diff --git a/.gitignore b/.gitignore index d452886..6f7e8475 100644 --- a/.gitignore +++ b/.gitignore
@@ -354,6 +354,7 @@ /third_party/libc++-static/libc++.a /third_party/libaddressinput/src /third_party/libexif/sources +/third_party/libFuzzer/src /third_party/libjingle/source /third_party/libjpeg_turbo /third_party/liblouis/src
diff --git a/AUTHORS b/AUTHORS index 9604859..89caae9 100644 --- a/AUTHORS +++ b/AUTHORS
@@ -395,6 +395,7 @@ Mathieu Meisser <mmeisser@logitech.com> Matt Arpidone <mma.public@gmail.com> Matt Strum <mstrum@amazon.com> +Matt Zeunert <matt@mostlystatic.com> Matthew Bauer <mjbauer95@gmail.com> Matthew Demarest <demarem@amazon.com> Matthew Robertson <matthewrobertson03@gmail.com> @@ -438,6 +439,8 @@ Nedeljko Babic <nedeljko.babic@imgtec.com> Nikhil Bansal <n.bansal@samsung.com> Nikita Ofitserov <himikof@gmail.com> +Nils Schneider <nils@nilsschneider.net> +Nils Schneider <nils.schneider@gmail.com> Ningxin Hu <ningxin.hu@intel.com> Nitish Mehrotra <nitish.m@samsung.com> Noj Vek <nojvek@gmail.com>
diff --git a/DEPS b/DEPS index f40cd90..ab371efd 100644 --- a/DEPS +++ b/DEPS
@@ -39,11 +39,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': 'dda239e25b54f4265734c62e2fdc76c872406f28', + 'skia_revision': '6db0a7bdceb6be85721bfb0db8dea7fd27db5970', # 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': 'a1504a2304851fd867427fcdb033c42623b33bdc', + 'v8_revision': '4159958b1cb02c5c608e72445f5a5cebed7c945b', # 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. @@ -51,7 +51,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': '00f394ec669faa3a778180991204caa474eb1dd2', + 'angle_revision': '0c0d8006a9dd31552079b521a16db072526901db', # 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. @@ -59,7 +59,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': 'ac88953dfa7c1a68c69989d61d7bc03c0595064b', + 'pdfium_revision': 'b33dfdf68bafa30e90a65fb71ff6b343202e0561', # 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. @@ -87,7 +87,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling NaCl # and whatever else without interference from each other. - 'nacl_revision': 'dabc9f016f3cb4cb262f7c9b43c60800906f3432', + 'nacl_revision': 'ac9486116283416ea38bc0a8b6a8df6bddc6d520', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling dEQP # and whatever else without interference from each other. @@ -100,7 +100,11 @@ # 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': 'f98a1ff33ee6d3575cdbb338b2a2f9fde11e7ee3', + 'catapult_revision': 'c4312a02dfdb80caf063200eb52996df4928bdc3', + # Three lines of non-changing comments so that + # the commit queue can handle CLs rolling libFuzzer + # and whatever else without interference from each other. + 'libfuzzer_revision': '1d3e15006639ad8c1aadd2d7bac4dab9a6be7da6', # from svn revision 265174 } # Only these hosts are allowed for dependencies in this DEPS file. @@ -150,7 +154,7 @@ Var('chromium_git') + '/external/snappy.git' + '@' + '762bb32f0c9d2f31ba4958c7c0933d22e80c20bf', 'src/tools/gyp': - Var('chromium_git') + '/external/gyp.git' + '@' + '28340b46df65f2c84f7793470189a0b395e1c9a4', + Var('chromium_git') + '/external/gyp.git' + '@' + '697933c2e3b3ffdd6949df3c2fa3613489e01175', 'src/tools/swarming_client': Var('chromium_git') + '/external/swarming.client.git' + '@' + Var('swarming_revision'), @@ -186,13 +190,13 @@ Var('chromium_git') + '/external/selenium/py.git' + '@' + '5fd78261a75fe08d27ca4835fb6c5ce4b42275bd', 'src/third_party/libvpx/source/libvpx': - Var('chromium_git') + '/webm/libvpx.git' + '@' + 'a6246927767f9ed8e10393876aa1f489e84ca0d3', + Var('chromium_git') + '/webm/libvpx.git' + '@' + '904cb53302dfebee4a0d795ad6ccebdd5da5f542', 'src/third_party/ffmpeg': Var('chromium_git') + '/chromium/third_party/ffmpeg.git' + '@' + 'beef68513861e11156899b1f763097c31808c418', 'src/third_party/libjingle/source/talk': - Var('chromium_git') + '/external/webrtc/trunk/talk.git' + '@' + '2688852545209f68491336f0e5fe3ba674b6ca6c', # commit position 12115 + Var('chromium_git') + '/external/webrtc/trunk/talk.git' + '@' + 'c5d109dab6c4e7097ef6d37f9e24c2e8906fa7ce', # commit position 12188 'src/third_party/usrsctp/usrsctplib': Var('chromium_git') + '/external/github.com/sctplab/usrsctp' + '@' + 'c60ec8b35c3fe6027d7a3faae89d1c8d7dd3ce98', @@ -216,7 +220,7 @@ Var('chromium_git') + '/native_client/src/third_party/scons-2.0.1.git' + '@' + '1c1550e17fc26355d08627fbdec13d8291227067', 'src/third_party/webrtc': - Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + '83147bf44f1d99df82eb2bde54cef6ec38b46509', # commit position 12179 + Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + 'f97e5d7a8e61dcd4d419403f8339595b8770ac70', # commit position 12196 'src/third_party/openmax_dl': Var('chromium_git') + '/external/webrtc/deps/third_party/openmax.git' + '@' + Var('openmax_dl_revision'), @@ -430,6 +434,10 @@ # Wireless Display Software. Used on Chrome OS. 'src/third_party/wds/src': Var('chromium_git') + '/external/github.com/01org/wds' + '@' + 'f187dda5fccaad08e168dc6657109325f42c648e', + + # Used for building libFuzzers (only supports Linux). + 'src/third_party/libFuzzer/src': + Var('chromium_git') + '/chromium/llvm-project/llvm/lib/Fuzzer.git' + '@' + Var('libfuzzer_revision'), }, 'android': { 'src/third_party/android_protobuf/src':
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 5621f9fd..33e704e5 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -270,6 +270,14 @@ r'^base[\\\/]message_loop[\\\/].*', ), ), + ( + '#pragma comment(lib,', + ( + 'Specify libraries to link with in build files and not in the source.', + ), + True, + (), + ), ) _IPC_ENUM_TRAITS_DEPRECATED = ( @@ -298,17 +306,6 @@ ) -_ANDROID_SPECIFIC_PYDEPS_FILES = [ - 'build/android/test_runner.pydeps', -] - -_GENERIC_PYDEPS_FILES = [ - 'build/secondary/tools/swarming_client/isolate.pydeps', -] - -_ALL_PYDEPS_FILES = _ANDROID_SPECIFIC_PYDEPS_FILES + _GENERIC_PYDEPS_FILES - - def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api): """Attempts to prevent use of functions intended only for testing in non-testing code. For now this is just a best-effort implementation @@ -685,7 +682,10 @@ """Check that all files have their permissions properly set.""" if input_api.platform == 'win32': return [] - args = [input_api.python_executable, 'tools/checkperms/checkperms.py', + checkperms_tool = input_api.os_path.join( + input_api.PresubmitLocalPath(), + 'tools', 'checkperms', 'checkperms.py') + args = [input_api.python_executable, checkperms_tool, '--root', input_api.change.RepositoryRoot()] for f in input_api.AffectedFiles(): args += ['--file', f.LocalPath()] @@ -1509,108 +1509,6 @@ return results -class PydepsChecker(object): - def __init__(self, input_api, pydeps_files): - self._file_cache = {} - self._input_api = input_api - self._pydeps_files = pydeps_files - - def _LoadFile(self, path): - """Returns the list of paths within a .pydeps file relative to //.""" - if path not in self._file_cache: - with open(path) as f: - self._file_cache[path] = f.read() - return self._file_cache[path] - - def _ComputeNormalizedPydepsEntries(self, pydeps_path): - """Returns an interable of paths within the .pydep, relativized to //.""" - os_path = self._input_api.os_path - pydeps_dir = os_path.dirname(pydeps_path) - entries = (l.rstrip() for l in self._LoadFile(pydeps_path).splitlines() - if not l.startswith('*')) - return (os_path.normpath(os_path.join(pydeps_dir, e)) for e in entries) - - def _CreateFilesToPydepsMap(self): - """Returns a map of local_path -> list_of_pydeps.""" - ret = {} - for pydep_local_path in self._pydeps_files: - for path in self._ComputeNormalizedPydepsEntries(pydep_local_path): - ret.setdefault(path, []).append(pydep_local_path) - return ret - - def ComputeAffectedPydeps(self): - """Returns an iterable of .pydeps files that might need regenerating.""" - affected_pydeps = set() - file_to_pydeps_map = None - for f in self._input_api.AffectedFiles(include_deletes=True): - local_path = f.LocalPath() - if local_path == 'DEPS': - return self._pydeps_files - elif local_path.endswith('.pydeps'): - if local_path in self._pydeps_files: - affected_pydeps.add(local_path) - elif local_path.endswith('.py'): - if file_to_pydeps_map is None: - file_to_pydeps_map = self._CreateFilesToPydepsMap() - affected_pydeps.update(file_to_pydeps_map.get(local_path, ())) - return affected_pydeps - - def DetermineIfStale(self, pydeps_path): - """Runs print_python_deps.py to see if the files is stale.""" - old_pydeps_data = self._LoadFile(pydeps_path) - - m = self._input_api.re.search(r'# target: //(.*)', old_pydeps_data) - if not m: - return ['COULD NOT FIND .pydeps TARGET'] - target = m.group(1) - m = self._input_api.re.search(r'# root: //(.*)', old_pydeps_data) - if not m: - return ['COULD NOT FIND .pydeps ROOT'] - root = m.group(1) or '.' - - cmd = ['build/print_python_deps.py', '--root', root, target] - new_pydeps_data = self._input_api.subprocess.check_output(cmd) - if old_pydeps_data != new_pydeps_data: - return cmd[:-1] + ['--output', pydeps_path] + cmd[-1:] - - -def _CheckPydepsNeedsUpdating(input_api, output_api, checker_for_tests=None): - """Checks if a .pydeps file needs to be regenerated.""" - # TODO(agrieve): Update when there's a better way to detect this: crbug/570091 - is_android = input_api.os_path.exists('third_party/android_tools') - pydeps_files = _ALL_PYDEPS_FILES if is_android else _GENERIC_PYDEPS_FILES - results = [] - # First, check for new / deleted .pydeps. - for f in input_api.AffectedFiles(include_deletes=True): - if f.LocalPath().endswith('.pydeps'): - if f.Action() == 'D' and f.LocalPath() in _ALL_PYDEPS_FILES: - results.append(output_api.PresubmitError( - 'Please update _ALL_PYDEPS_FILES within //PRESUBMIT.py to ' - 'remove %s' % f.LocalPath())) - elif f.Action() != 'D' and f.LocalPath() not in _ALL_PYDEPS_FILES: - results.append(output_api.PresubmitError( - 'Please update _ALL_PYDEPS_FILES within //PRESUBMIT.py to ' - 'include %s' % f.LocalPath())) - - if results: - return results - - checker = checker_for_tests or PydepsChecker(input_api, pydeps_files) - - for pydep_path in checker.ComputeAffectedPydeps(): - try: - cmd = checker.DetermineIfStale(pydep_path) - if cmd: - results.append(output_api.PresubmitError( - 'File is stale: %s\nTo regenerate, run:\n%s' % (pydep_path, - ' '.join(cmd)))) - except input_api.subprocess.CalledProcessError as error: - return [output_api.PresubmitError('Error running ' + ' '.join(error.cmd), - long_text=error.output)] - - return results - - def _CheckForCopyrightedCode(input_api, output_api): """Verifies that newly added code doesn't contain copyrighted material and is properly licensed under the standard Chromium license. @@ -1814,7 +1712,6 @@ results.extend(_CheckForWindowsLineEndings(input_api, output_api)) results.extend(_CheckSingletonInHeaders(input_api, output_api)) results.extend(_CheckNoDeprecatedCompiledResourcesGYP(input_api, output_api)) - results.extend(_CheckPydepsNeedsUpdating(input_api, output_api)) if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): results.extend(input_api.canned_checks.RunUnitTestsInDirectory(
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py index cbcf81b..7c528c57 100755 --- a/PRESUBMIT_test.py +++ b/PRESUBMIT_test.py
@@ -3,8 +3,12 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import glob +import json +import os import re import subprocess +import sys import unittest import PRESUBMIT @@ -831,103 +835,6 @@ output[0].message) -class PydepsNeedsUpdatingTest(unittest.TestCase): - - class MockSubprocess(object): - CalledProcessError = subprocess.CalledProcessError - - def setUp(self): - mock_all_pydeps = ['A.pydeps', 'B.pydeps'] - self.old_ALL_PYDEPS_FILES = PRESUBMIT._ALL_PYDEPS_FILES - PRESUBMIT._ALL_PYDEPS_FILES = mock_all_pydeps - self.mock_input_api = MockInputApi() - self.mock_output_api = MockOutputApi() - self.mock_input_api.subprocess = PydepsNeedsUpdatingTest.MockSubprocess() - self.checker = PRESUBMIT.PydepsChecker(self.mock_input_api, mock_all_pydeps) - self.checker._file_cache = { - 'A.pydeps': '# target: //A.py\n# root: //\nA.py\nC.py\n', - 'B.pydeps': '# target: //B.py\n# root: //\nB.py\nC.py\n', - } - - def tearDown(self): - PRESUBMIT._ALL_PYDEPS_FILES = self.old_ALL_PYDEPS_FILES - - def _RunCheck(self): - return PRESUBMIT._CheckPydepsNeedsUpdating(self.mock_input_api, - self.mock_output_api, - checker_for_tests=self.checker) - - def testAddedPydep(self): - self.mock_input_api.files = [ - MockAffectedFile('new.pydeps', [], action='A'), - ] - - results = self._RunCheck() - self.assertEqual(1, len(results)) - self.assertTrue('PYDEPS_FILES' in str(results[0])) - - def testRemovedPydep(self): - self.mock_input_api.files = [ - MockAffectedFile(PRESUBMIT._ALL_PYDEPS_FILES[0], [], action='D'), - ] - - results = self._RunCheck() - self.assertEqual(1, len(results)) - self.assertTrue('PYDEPS_FILES' in str(results[0])) - - def testRandomPyIgnored(self): - self.mock_input_api.files = [ - MockAffectedFile('random.py', []), - ] - - results = self._RunCheck() - self.assertEqual(0, len(results), 'Unexpected results: %r' % results) - - def testRelevantPyNoChange(self): - self.mock_input_api.files = [ - MockAffectedFile('A.py', []), - ] - - def mock_check_output(cmd): - self.assertEqual('A.py', cmd[3]) - return self.checker._file_cache['A.pydeps'] - - self.mock_input_api.subprocess.check_output = mock_check_output - - results = self._RunCheck() - self.assertEqual(0, len(results), 'Unexpected results: %r' % results) - - def testRelevantPyOneChange(self): - self.mock_input_api.files = [ - MockAffectedFile('A.py', []), - ] - - def mock_check_output(cmd): - self.assertEqual('A.py', cmd[3]) - return 'changed data' - - self.mock_input_api.subprocess.check_output = mock_check_output - - results = self._RunCheck() - self.assertEqual(1, len(results)) - self.assertTrue('File is stale' in str(results[0])) - - def testRelevantPyTwoChanges(self): - self.mock_input_api.files = [ - MockAffectedFile('C.py', []), - ] - - def mock_check_output(cmd): - return 'changed data' - - self.mock_input_api.subprocess.check_output = mock_check_output - - results = self._RunCheck() - self.assertEqual(2, len(results)) - self.assertTrue('File is stale' in str(results[0])) - self.assertTrue('File is stale' in str(results[1])) - - class LogUsageTest(unittest.TestCase): def testCheckAndroidCrLogUsage(self):
diff --git a/PRESUBMIT_test_mocks.py b/PRESUBMIT_test_mocks.py index 373b52c6..5230c87 100644 --- a/PRESUBMIT_test_mocks.py +++ b/PRESUBMIT_test_mocks.py
@@ -26,7 +26,7 @@ self.is_committing = False self.change = MockChange([]) - def AffectedFiles(self, file_filter=None, include_deletes=False): + def AffectedFiles(self, file_filter=None): return self.files def AffectedSourceFiles(self, file_filter=None): @@ -92,14 +92,13 @@ MockInputApi for presubmit unittests. """ - def __init__(self, local_path, new_contents, action='A'): + def __init__(self, local_path, new_contents): self._local_path = local_path self._new_contents = new_contents self._changed_contents = [(i + 1, l) for i, l in enumerate(new_contents)] - self._action = action def Action(self): - return self._action + return 'A' # TODO(dbeam): feel free to change if your test actually uses. def ChangedContents(self): return self._changed_contents
diff --git a/android_webview/browser/browser_view_renderer.cc b/android_webview/browser/browser_view_renderer.cc index cf62092..85cb2940 100644 --- a/android_webview/browser/browser_view_renderer.cc +++ b/android_webview/browser/browser_view_renderer.cc
@@ -412,6 +412,12 @@ UpdateCompositorIsActive(); } +void BrowserViewRenderer::SynchronizeRendererScroll() { + if (!compositor_) + return; + compositor_->SynchronizeWithRenderer(); +} + void BrowserViewRenderer::OnComputeScroll(base::TimeTicks animation_time) { if (!compositor_) return;
diff --git a/android_webview/browser/browser_view_renderer.h b/android_webview/browser/browser_view_renderer.h index 60fc097..b060a06 100644 --- a/android_webview/browser/browser_view_renderer.h +++ b/android_webview/browser/browser_view_renderer.h
@@ -82,6 +82,7 @@ void OnSizeChanged(int width, int height); void OnAttachedToWindow(int width, int height); void OnDetachedFromWindow(); + void SynchronizeRendererScroll(); void OnComputeScroll(base::TimeTicks animation_time); // Sets the scale for logical<->physical pixel conversions.
diff --git a/android_webview/browser/icon_helper.cc b/android_webview/browser/icon_helper.cc index 7ef757f..06ac0d6 100644 --- a/android_webview/browser/icon_helper.cc +++ b/android_webview/browser/icon_helper.cc
@@ -99,7 +99,7 @@ void IconHelper::DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) { - if (reload_type == content::NavigationController::RELOAD_IGNORING_CACHE) + if (reload_type == content::NavigationController::RELOAD_BYPASSING_CACHE) ClearUnableToDownloadFavicons(); }
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 06ead1d..657f1f81 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -2105,6 +2105,7 @@ throw new IllegalStateException("zoom delta value outside [0.01, 100] range."); } mContentViewCore.pinchByDelta(delta); + nativeSynchronizeRendererScroll(mNativeAwContents); } /** @@ -3238,6 +3239,7 @@ long nativeAwContents, String path, ValueCallback<String> callback); private native void nativeAddVisitedLinks(long nativeAwContents, String[] visitedLinks); + private native void nativeSynchronizeRendererScroll(long nativeAwContents); private native void nativeOnComputeScroll( long nativeAwContents, long currentAnimationTimeMillis); private native boolean nativeOnDraw(long nativeAwContents, Canvas canvas,
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java index f22317a7..f65028827 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java
@@ -15,7 +15,6 @@ import org.chromium.android_webview.test.util.JavascriptEventObserver; import org.chromium.base.ThreadUtils; import org.chromium.base.annotations.SuppressFBWarnings; -import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.content.browser.test.util.CallbackHelper; import org.chromium.content_public.browser.GestureStateListener; @@ -771,13 +770,8 @@ onScrollUpdateGestureConsumedHelper.waitForCallback(callCount); } - /* @SmallTest @Feature({"AndroidWebView"}) - Disabled because zoomIn is no longer synchronous. Fix if it's a compatibility problem. - See crbug.com/545628. - */ - @DisabledTest public void testPinchZoomUpdatesScrollRangeSynchronously() throws Throwable { final TestAwContentsClient contentsClient = new TestAwContentsClient(); final ScrollTestContainerView testContainerView = @@ -833,7 +827,13 @@ "Scroll range should increase after zoom (%d) > (%d)", atomicNewScrollRange.get(), atomicOldScrollRange.get()), atomicNewScrollRange.get() > atomicOldScrollRange.get()); - assertEquals(atomicContentHeight.get(), atomicOldContentHeightApproximation.get()); - assertEquals(atomicContentHeight.get(), atomicNewContentHeightApproximation.get()); + assertTrue(String.format(Locale.ENGLISH, "Old content height should be close (%d) ~= (%d)", + atomicContentHeight.get(), atomicOldContentHeightApproximation.get()), + Math.abs(atomicContentHeight.get() - atomicOldContentHeightApproximation.get()) + <= 1); + assertTrue(String.format(Locale.ENGLISH, "New content height should be close (%d) ~= (%d)", + atomicContentHeight.get(), atomicNewContentHeightApproximation.get()), + Math.abs(atomicContentHeight.get() - atomicNewContentHeightApproximation.get()) + <= 1); } }
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc index ce87204..aeb63a4 100644 --- a/android_webview/native/aw_contents.cc +++ b/android_webview/native/aw_contents.cc
@@ -1016,6 +1016,13 @@ render_view_host_ext_->SetBackgroundColor(color); } +void AwContents::SynchronizeRendererScroll( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + browser_view_renderer_.SynchronizeRendererScroll(); +} + void AwContents::OnComputeScroll(JNIEnv* env, const JavaParamRef<jobject>& obj, jlong animation_time_millis) {
diff --git a/android_webview/native/aw_contents.h b/android_webview/native/aw_contents.h index 352a888..044eca6 100644 --- a/android_webview/native/aw_contents.h +++ b/android_webview/native/aw_contents.h
@@ -164,6 +164,9 @@ void SetBackgroundColor(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, jint color); + void SynchronizeRendererScroll( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); void OnComputeScroll(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, jlong animation_time_millis);
diff --git a/android_webview/tools/system_webview_shell/apk/AndroidManifest.xml b/android_webview/tools/system_webview_shell/apk/AndroidManifest.xml index 3309a31..2224f83 100644 --- a/android_webview/tools/system_webview_shell/apk/AndroidManifest.xml +++ b/android_webview/tools/system_webview_shell/apk/AndroidManifest.xml
@@ -31,7 +31,8 @@ <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" - android:theme="@android:style/Theme.Light" > + android:theme="@android:style/Theme.Light" + android:debuggable="true" > <activity android:name="org.chromium.webview_shell.TelemetryActivity" android:launchMode="singleTask"
diff --git a/ash/metrics/task_switch_metrics_recorder.h b/ash/metrics/task_switch_metrics_recorder.h index 686c5a3..f01e846 100644 --- a/ash/metrics/task_switch_metrics_recorder.h +++ b/ash/metrics/task_switch_metrics_recorder.h
@@ -10,6 +10,7 @@ #include "ash/ash_export.h" #include "base/containers/scoped_ptr_hash_map.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" namespace aura { class Window;
diff --git a/ash/wm/drag_window_controller.cc b/ash/wm/drag_window_controller.cc index 405b869..ee62ab4 100644 --- a/ash/wm/drag_window_controller.cc +++ b/ash/wm/drag_window_controller.cc
@@ -4,11 +4,19 @@ #include "ash/wm/drag_window_controller.h" +#include <algorithm> + +#include "ash/display/window_tree_host_manager.h" +#include "ash/screen_util.h" +#include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/wm/window_util.h" +#include "ui/aura/client/aura_constants.h" #include "ui/aura/client/screen_position_client.h" #include "ui/aura/window.h" +#include "ui/aura/window_delegate.h" #include "ui/aura/window_event_dispatcher.h" +#include "ui/base/hit_test.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_tree_owner.h" #include "ui/compositor/scoped_layer_animation_settings.h" @@ -19,102 +27,210 @@ namespace ash { -DragWindowController::DragWindowController(aura::Window* window) - : window_(window), - drag_widget_(NULL) { -} +// This keeps tack of the drag window's state. It creates/destory/updates bounds +// and opacity based on the current bounds. +class DragWindowController::DragWindowDetails : public aura::WindowDelegate { + public: + DragWindowDetails(const gfx::Display& display, aura::Window* original_window) + : root_window_(Shell::GetInstance() + ->window_tree_host_manager() + ->GetRootWindowForDisplayId(display.id())) {} -DragWindowController::~DragWindowController() { - Hide(); -} - -void DragWindowController::SetDestinationDisplay( - const gfx::Display& dst_display) { - dst_display_ = dst_display; -} - -void DragWindowController::Show() { - if (!drag_widget_) - CreateDragWidget(window_->GetBoundsInScreen()); - drag_widget_->Show(); -} - -void DragWindowController::SetBounds(const gfx::Rect& bounds) { - DCHECK(drag_widget_); - bounds_ = bounds; - SetBoundsInternal(bounds); -} - -void DragWindowController::Hide() { - if (drag_widget_) { - drag_widget_->Close(); - drag_widget_ = NULL; + ~DragWindowDetails() override { + delete drag_window_; + DCHECK(!drag_window_); } - layer_owner_.reset(); + + void Update(aura::Window* original_window, + const gfx::Rect& bounds_in_screen, + const gfx::Point& drag_location_in_screen) { + gfx::Rect root_bounds_in_screen = root_window_->GetBoundsInScreen(); + if (!root_bounds_in_screen.Intersects(bounds_in_screen)) { + delete drag_window_; + // Make sure drag_window_ is reset so that new drag window will be created + // when it becomes necessary again. + DCHECK(!drag_window_); + layer_owner_.reset(); + return; + } + if (!drag_window_) + CreateDragWindow(original_window, bounds_in_screen); + + gfx::Rect bounds_in_root = ScreenUtil::ConvertRectFromScreen( + drag_window_->parent(), bounds_in_screen); + drag_window_->SetBounds(bounds_in_root); + if (root_bounds_in_screen.Contains(drag_location_in_screen)) { + SetOpacity(original_window, 1.f); + } else { + drag_window_->SetBounds(bounds_in_root); + gfx::Rect visible_bounds = root_bounds_in_screen; + visible_bounds.Intersect(bounds_in_screen); + SetOpacity(original_window, + GetDragWindowOpacity(bounds_in_screen, visible_bounds)); + } + } + + private: + friend class DragWindowController; + + void CreateDragWindow(aura::Window* original_window, + const gfx::Rect& bounds_in_screen) { + DCHECK(!drag_window_); + drag_window_ = new aura::Window(this); + int parent_id = original_window->parent()->id(); + aura::Window* container = root_window_->GetChildById(parent_id); + + drag_window_->SetType(ui::wm::WINDOW_TYPE_POPUP); + drag_window_->SetTransparent(true); + drag_window_->Init(ui::LAYER_TEXTURED); + drag_window_->SetName("DragWindow"); + drag_window_->set_id(kShellWindowId_PhantomWindow); + drag_window_->SetProperty(aura::client::kAnimationsDisabledKey, true); + container->AddChild(drag_window_); + drag_window_->SetBounds(bounds_in_screen); + SetShadowType(drag_window_, ::wm::SHADOW_TYPE_RECTANGULAR); + + RecreateWindowLayers(original_window); + layer_owner_->root()->SetVisible(true); + drag_window_->layer()->Add(layer_owner_->root()); + drag_window_->layer()->StackAtTop(layer_owner_->root()); + + // Show the widget after all the setups. + drag_window_->Show(); + + // Fade the window in. + ui::Layer* drag_layer = drag_window_->layer(); + drag_layer->SetOpacity(0); + ui::ScopedLayerAnimationSettings scoped_setter(drag_layer->GetAnimator()); + drag_layer->SetOpacity(1); + } + + void RecreateWindowLayers(aura::Window* original_window) { + DCHECK(!layer_owner_.get()); + layer_owner_ = ::wm::RecreateLayers(original_window); + // TODO(oshima): Recreated child layers may not have been painted + // yet, and may not be able to paint to because it does not have + // its original delegate. + layer_owner_->root()->set_delegate(original_window->layer()->delegate()); + // Place the layer at (0, 0) of the DragWindowController's window. + gfx::Rect layer_bounds = layer_owner_->root()->bounds(); + layer_bounds.set_origin(gfx::Point(0, 0)); + layer_owner_->root()->SetBounds(layer_bounds); + layer_owner_->root()->SetVisible(false); + // Detach it from the current container. + layer_owner_->root()->parent()->Remove(layer_owner_->root()); + } + + void SetOpacity(const aura::Window* original_window, float opacity) { + ui::Layer* layer = drag_window_->layer(); + ui::ScopedLayerAnimationSettings scoped_setter(layer->GetAnimator()); + layer->SetOpacity(opacity); + layer_owner_->root()->SetOpacity(1.0f); + } + + // aura::WindowDelegate: + gfx::Size GetMinimumSize() const override { return gfx::Size(); } + gfx::Size GetMaximumSize() const override { return gfx::Size(); } + void OnBoundsChanged(const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override {} + gfx::NativeCursor GetCursor(const gfx::Point& point) override { + return gfx::kNullCursor; + } + int GetNonClientComponent(const gfx::Point& point) const override { + return HTNOWHERE; + } + bool ShouldDescendIntoChildForEventHandling( + aura::Window* child, + const gfx::Point& location) override { + return false; + } + bool CanFocus() override { return false; } + void OnCaptureLost() override {} + void OnPaint(const ui::PaintContext& context) override {} + void OnDeviceScaleFactorChanged(float device_scale_factor) override {} + void OnWindowDestroyed(aura::Window* window) override {} + void OnWindowTargetVisibilityChanged(bool visible) override {} + bool HasHitTestMask() const override { return false; } + void GetHitTestMask(gfx::Path* mask) const override {} + void OnWindowDestroying(aura::Window* window) override { + DCHECK_EQ(drag_window_, window); + drag_window_ = nullptr; + } + + aura::Window* root_window_; + + aura::Window* drag_window_ = nullptr; // Owned by the container. + + // The copy of window_->layer() and its descendants. + scoped_ptr<ui::LayerTreeOwner> layer_owner_; + + DISALLOW_COPY_AND_ASSIGN(DragWindowDetails); +}; + +// static +float DragWindowController::GetDragWindowOpacity( + const gfx::Rect& window_bounds, + const gfx::Rect& visible_bounds) { + // The maximum opacity of the drag phantom window. + static const float kMaxOpacity = 0.8f; + + return kMaxOpacity * visible_bounds.size().GetArea() / + window_bounds.size().GetArea(); } -void DragWindowController::SetOpacity(float opacity) { - DCHECK(drag_widget_); - ui::Layer* layer = drag_widget_->GetNativeWindow()->layer(); - ui::ScopedLayerAnimationSettings scoped_setter(layer->GetAnimator()); - layer->SetOpacity(opacity); +DragWindowController::DragWindowController(aura::Window* window) + : window_(window) { + DCHECK(drag_windows_.empty()); + gfx::Screen* screen = gfx::Screen::GetScreen(); + gfx::Display current = screen->GetDisplayNearestWindow(window_); + + for (const gfx::Display& display : screen->GetAllDisplays()) { + if (current.id() == display.id()) + continue; + drag_windows_.push_back( + make_scoped_ptr(new DragWindowDetails(display, window_))); + } } -void DragWindowController::CreateDragWidget(const gfx::Rect& bounds) { - DCHECK(!drag_widget_); - drag_widget_ = new views::Widget; - views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); - params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; - params.parent = window_->parent(); - params.keep_on_top = true; - drag_widget_->set_focus_on_creation(false); - drag_widget_->Init(params); - drag_widget_->SetVisibilityChangedAnimationsEnabled(false); - drag_widget_->GetNativeWindow()->SetName("DragWindow"); - drag_widget_->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow); - // Show shadow for the dragging window. - SetShadowType(drag_widget_->GetNativeWindow(), - ::wm::SHADOW_TYPE_RECTANGULAR); - SetBoundsInternal(bounds); - drag_widget_->StackAbove(window_); +DragWindowController::~DragWindowController() {} - RecreateWindowLayers(); - aura::Window* window = drag_widget_->GetNativeWindow(); - layer_owner_->root()->SetVisible(true); - window->layer()->Add(layer_owner_->root()); - window->layer()->StackAtTop(layer_owner_->root()); - - // Show the widget after all the setups. - drag_widget_->Show(); - - // Fade the window in. - ui::Layer* widget_layer = drag_widget_->GetNativeWindow()->layer(); - widget_layer->SetOpacity(0); - ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator()); - widget_layer->SetOpacity(1); +void DragWindowController::Update(const gfx::Rect& bounds_in_screen, + const gfx::Point& drag_location_in_screen) { + for (scoped_ptr<DragWindowDetails>& details : drag_windows_) + details->Update(window_, bounds_in_screen, drag_location_in_screen); } -void DragWindowController::SetBoundsInternal(const gfx::Rect& bounds) { - aura::Window* window = drag_widget_->GetNativeWindow(); - aura::client::ScreenPositionClient* screen_position_client = - aura::client::GetScreenPositionClient(window->GetRootWindow()); - if (screen_position_client && dst_display_.is_valid()) - screen_position_client->SetBounds(window, bounds, dst_display_); - else - drag_widget_->SetBounds(bounds); +int DragWindowController::GetDragWindowsCountForTest() const { + int count = 0; + for (const scoped_ptr<DragWindowDetails>& details : drag_windows_) { + if (details->drag_window_) + count++; + } + return count; } -void DragWindowController::RecreateWindowLayers() { - DCHECK(!layer_owner_.get()); - layer_owner_ = ::wm::RecreateLayers(window_); - layer_owner_->root()->set_delegate(window_->layer()->delegate()); - // Place the layer at (0, 0) of the DragWindowController's window. - gfx::Rect layer_bounds = layer_owner_->root()->bounds(); - layer_bounds.set_origin(gfx::Point(0, 0)); - layer_owner_->root()->SetBounds(layer_bounds); - layer_owner_->root()->SetVisible(false); - // Detach it from the current container. - layer_owner_->root()->parent()->Remove(layer_owner_->root()); +const aura::Window* DragWindowController::GetDragWindowForTest( + size_t index) const { + for (const scoped_ptr<DragWindowDetails>& details : drag_windows_) { + if (details->drag_window_) { + if (index == 0) + return details->drag_window_; + index--; + } + } + return nullptr; +} + +const ui::LayerTreeOwner* DragWindowController::GetDragLayerOwnerForTest( + size_t index) const { + for (const scoped_ptr<DragWindowDetails>& details : drag_windows_) { + if (details->layer_owner_) { + if (index == 0) + return details->layer_owner_.get(); + index--; + } + } + return nullptr; } } // namespace ash
diff --git a/ash/wm/drag_window_controller.h b/ash/wm/drag_window_controller.h index a78733b..9bcf3ff4 100644 --- a/ash/wm/drag_window_controller.h +++ b/ash/wm/drag_window_controller.h
@@ -5,6 +5,8 @@ #ifndef ASH_WM_DRAG_WINDOW_CONTROLLER_H_ #define ASH_WM_DRAG_WINDOW_CONTROLLER_H_ +#include <vector> + #include "ash/ash_export.h" #include "base/gtest_prod_util.h" #include "base/macros.h" @@ -17,75 +19,44 @@ } namespace ui { -class Layer; class LayerTreeOwner; } -namespace views { -class Widget; -} - namespace ash { // DragWindowController is responsible for showing a semi-transparent window // while dragging a window across displays. class ASH_EXPORT DragWindowController { public: + // Computes the opacity for drag window based on how much of the area + // of the window is visible. + static float GetDragWindowOpacity(const gfx::Rect& window_bounds, + const gfx::Rect& visible_bounds); + explicit DragWindowController(aura::Window* window); virtual ~DragWindowController(); - // Sets the display where the window is placed after the window is dropped. - void SetDestinationDisplay(const gfx::Display& dst_display); + // This is used to update the bounds and opacity for the drag window + // immediately. + // This also creates/destorys the drag window when necessary. + void Update(const gfx::Rect& bounds_in_screen, + const gfx::Point& drag_location_in_screen); - // Shows the drag window at the specified location (coordinates of the - // parent). If |layer| is non-NULL, it is shown on top of the drag window. - // |layer| is owned by the caller. - // This does not immediately show the window. - void Show(); + // Returns the currently active drag windows. + int GetDragWindowsCountForTest() const; - // Hides the drag window. - void Hide(); - - // This is used to set bounds for the drag window immediately. This should - // be called only when the drag window is already visible. - void SetBounds(const gfx::Rect& bounds); - - // Sets the opacity of the drag window. - void SetOpacity(float opacity); + // Returns the drag window/layer owner for given index of the + // currently active drag windows list. + const aura::Window* GetDragWindowForTest(size_t index) const; + const ui::LayerTreeOwner* GetDragLayerOwnerForTest(size_t index) const; private: - FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, DragWindowController); - - // Creates and shows the |drag_widget_| at |bounds|. - // |layer| is shown on top of the drag window if it is non-NULL. - // |layer| is not owned by this object. - void CreateDragWidget(const gfx::Rect& bounds); - - // Sets bounds of the drag window. The window is shown on |dst_display_| - // if its id() is valid. Otherwise, a display nearest to |bounds| is chosen. - void SetBoundsInternal(const gfx::Rect& bounds); - - // Recreates a fresh layer for |window_| and all its child windows. - void RecreateWindowLayers(); + class DragWindowDetails; // Window the drag window is placed beneath. aura::Window* window_; - // The display where the drag is placed. When dst_display_.id() is - // kInvalidDisplayID (i.e. the default), a display nearest to the current - // |bounds_| is automatically used. - gfx::Display dst_display_; - - // Initially the bounds of |window_|. Each time Show() is invoked - // |start_bounds_| is then reset to the bounds of |drag_widget_| and - // |bounds_| is set to the value passed into Show(). The animation animates - // between these two values. - gfx::Rect bounds_; - - views::Widget* drag_widget_; - - // The copy of window_->layer() and its descendants. - scoped_ptr<ui::LayerTreeOwner> layer_owner_; + std::vector<scoped_ptr<DragWindowDetails>> drag_windows_; DISALLOW_COPY_AND_ASSIGN(DragWindowController); };
diff --git a/ash/wm/drag_window_resizer.cc b/ash/wm/drag_window_resizer.cc index 765dd17..0145fbb 100644 --- a/ash/wm/drag_window_resizer.cc +++ b/ash/wm/drag_window_resizer.cc
@@ -24,31 +24,6 @@ #include "ui/wm/core/window_util.h" namespace ash { -namespace { - -// The maximum opacity of the drag phantom window. -const float kMaxOpacity = 0.8f; - -// Returns true if Ash has more than one root window. -bool HasSecondaryRootWindows() { - return Shell::GetAllRootWindows().size() > 1; -} - -// When there are more than one root windows, returns all root windows which are -// not |root_window|. Returns an empty vector if only one root window exists. -aura::Window::Windows GetOtherRootWindows(aura::Window* root_window) { - aura::Window::Windows root_windows = Shell::GetAllRootWindows(); - aura::Window::Windows other_root_windows; - if (root_windows.size() < 2) - return other_root_windows; - for (size_t i = 0; i < root_windows.size(); ++i) { - if (root_windows[i] != root_window) - other_root_windows.push_back(root_windows[i]); - } - return other_root_windows; -} - -} // namespace // static DragWindowResizer* DragWindowResizer::instance_ = NULL; @@ -79,14 +54,12 @@ last_mouse_location_ = location; // Show a phantom window for dragging in another root window. - if (HasSecondaryRootWindows()) { + if (gfx::Screen::GetScreen()->GetNumDisplays() > 1) { gfx::Point location_in_screen = location; ::wm::ConvertPointToScreen(GetTarget()->parent(), &location_in_screen); - const bool in_original_root = - wm::GetRootWindowAt(location_in_screen) == GetTarget()->GetRootWindow(); - UpdateDragWindow(GetTarget()->bounds(), in_original_root); + UpdateDragWindow(GetTarget()->bounds(), location_in_screen); } else { - drag_window_controllers_.clear(); + drag_window_controller_.reset(); } } @@ -94,7 +67,7 @@ next_window_resizer_->CompleteDrag(); GetTarget()->layer()->SetOpacity(details().initial_opacity); - drag_window_controllers_.clear(); + drag_window_controller_.reset(); // Check if the destination is another display. gfx::Point last_mouse_location_in_screen = last_mouse_location_; @@ -139,7 +112,7 @@ void DragWindowResizer::RevertDrag() { next_window_resizer_->RevertDrag(); - drag_window_controllers_.clear(); + drag_window_controller_.reset(); GetTarget()->layer()->SetOpacity(details().initial_opacity); } @@ -161,58 +134,29 @@ instance_ = this; } -void DragWindowResizer::UpdateDragWindow(const gfx::Rect& bounds, - bool in_original_root) { +void DragWindowResizer::UpdateDragWindow( + const gfx::Rect& bounds_in_parent, + const gfx::Point& drag_location_in_screen) { if (details().window_component != HTCAPTION || !ShouldAllowMouseWarp()) return; - // It's available. Show a phantom window on the display if needed. - aura::Window::Windows other_roots = - GetOtherRootWindows(GetTarget()->GetRootWindow()); - size_t drag_window_controller_count = 0; - for (size_t i = 0; i < other_roots.size(); ++i) { - aura::Window* another_root = other_roots[i]; - const gfx::Rect root_bounds_in_screen(another_root->GetBoundsInScreen()); - const gfx::Rect bounds_in_screen = - ScreenUtil::ConvertRectToScreen(GetTarget()->parent(), bounds); - gfx::Rect bounds_in_another_root = - gfx::IntersectRects(root_bounds_in_screen, bounds_in_screen); - const float fraction_in_another_window = - (bounds_in_another_root.width() * bounds_in_another_root.height()) / - static_cast<float>(bounds.width() * bounds.height()); + if (!drag_window_controller_) + drag_window_controller_.reset(new DragWindowController(GetTarget())); - if (fraction_in_another_window > 0) { - if (drag_window_controllers_.size() < ++drag_window_controller_count) - drag_window_controllers_.resize(drag_window_controller_count); - ScopedVector<DragWindowController>::reference drag_window_controller = - drag_window_controllers_.back(); - if (!drag_window_controller) { - drag_window_controller = new DragWindowController(GetTarget()); - // Always show the drag phantom on the |another_root| window. - drag_window_controller->SetDestinationDisplay( - gfx::Screen::GetScreen()->GetDisplayNearestWindow(another_root)); - drag_window_controller->Show(); - } else { - // No animation. - drag_window_controller->SetBounds(bounds_in_screen); - } - const float phantom_opacity = - !in_original_root ? 1 : (kMaxOpacity * fraction_in_another_window); - const float window_opacity = - in_original_root ? 1 - : (kMaxOpacity * (1 - fraction_in_another_window)); - drag_window_controller->SetOpacity(phantom_opacity); - GetTarget()->layer()->SetOpacity(window_opacity); - } else { - GetTarget()->layer()->SetOpacity(1.0f); - } + const gfx::Rect bounds_in_screen = + ScreenUtil::ConvertRectToScreen(GetTarget()->parent(), bounds_in_parent); + + gfx::Rect root_bounds_in_screen = + GetTarget()->GetRootWindow()->GetBoundsInScreen(); + float opacity = 1.0f; + if (!root_bounds_in_screen.Contains(drag_location_in_screen)) { + gfx::Rect visible_bounds = root_bounds_in_screen; + visible_bounds.Intersect(bounds_in_screen); + opacity = DragWindowController::GetDragWindowOpacity(bounds_in_screen, + visible_bounds); } - - // If we have more drag window controllers allocated than needed, release the - // excess controllers by shrinking the vector |drag_window_controller_|. - DCHECK_GE(drag_window_controllers_.size(), drag_window_controller_count); - if (drag_window_controllers_.size() > drag_window_controller_count) - drag_window_controllers_.resize(drag_window_controller_count); + GetTarget()->layer()->SetOpacity(opacity); + drag_window_controller_->Update(bounds_in_screen, drag_location_in_screen); } bool DragWindowResizer::ShouldAllowMouseWarp() {
diff --git a/ash/wm/drag_window_resizer.h b/ash/wm/drag_window_resizer.h index 04bb62e..ae23dbe 100644 --- a/ash/wm/drag_window_resizer.h +++ b/ash/wm/drag_window_resizer.h
@@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" #include "base/macros.h" -#include "base/memory/scoped_vector.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "ui/gfx/geometry/point.h" @@ -36,16 +36,17 @@ private: FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, DragWindowController); - + FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, + DragWindowControllerAcrossThreeDisplays); // Creates DragWindowResizer that adds the ability of dragging windows across // displays to |next_window_resizer|. This object takes the ownership of // |next_window_resizer|. explicit DragWindowResizer(WindowResizer* next_window_resizer, wm::WindowState* window_state); - // Updates the bounds of the phantom window for window dragging. Set true on - // |in_original_root| if the pointer is still in |window()->GetRootWindow()|. - void UpdateDragWindow(const gfx::Rect& bounds, bool in_original_root); + // Updates the bounds of the drag window for window dragging. + void UpdateDragWindow(const gfx::Rect& bounds_in_parent, + const gfx::Point& drag_location_in_screen); // Returns true if we should allow the mouse pointer to warp. bool ShouldAllowMouseWarp(); @@ -53,7 +54,7 @@ scoped_ptr<WindowResizer> next_window_resizer_; // Shows a semi-transparent image of the window being dragged. - ScopedVector<DragWindowController> drag_window_controllers_; + scoped_ptr<DragWindowController> drag_window_controller_; gfx::Point last_mouse_location_;
diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc index 0fdd488a..9705c75d 100644 --- a/ash/wm/drag_window_resizer_unittest.cc +++ b/ash/wm/drag_window_resizer_unittest.cc
@@ -4,6 +4,8 @@ #include "ash/wm/drag_window_resizer.h" +#include "ash/display/display_layout_builder.h" +#include "ash/display/display_manager.h" #include "ash/display/mouse_cursor_event_filter.h" #include "ash/root_window_controller.h" #include "ash/shelf/shelf_layout_manager.h" @@ -346,45 +348,43 @@ EXPECT_EQ(root_windows[0], window_->GetRootWindow()); EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); { - scoped_ptr<WindowResizer> resizer(CreateDragWindowResizer( - window_.get(), gfx::Point(), HTCAPTION)); + // Hold the center of the window so that the window doesn't stick to the + // edge when dragging around the edge of the display. + scoped_ptr<WindowResizer> resizer( + CreateDragWindowResizer(window_.get(), gfx::Point(25, 30), HTCAPTION)); ASSERT_TRUE(resizer.get()); DragWindowResizer* drag_resizer = DragWindowResizer::instance_; ASSERT_TRUE(drag_resizer); - EXPECT_EQ(0u, drag_resizer->drag_window_controllers_.size()); + EXPECT_FALSE(drag_resizer->drag_window_controller_.get()); // The pointer is inside the primary root. The drag window controller // should be NULL. resizer->Drag(CalculateDragPoint(*resizer, 10, 10), 0); - EXPECT_EQ(0u, drag_resizer->drag_window_controllers_.size()); + DragWindowController* controller = + drag_resizer->drag_window_controller_.get(); + EXPECT_EQ(0, controller->GetDragWindowsCountForTest()); // The window spans both root windows. - resizer->Drag(CalculateDragPoint(*resizer, 798, 10), 0); - EXPECT_EQ(1u, drag_resizer->drag_window_controllers_.size()); - DragWindowController* controller = - drag_resizer->drag_window_controllers_[0]; - ASSERT_TRUE(controller); + resizer->Drag(CalculateDragPoint(*resizer, 773, 10), 0); + EXPECT_EQ(1, controller->GetDragWindowsCountForTest()); + const aura::Window* drag_window = controller->GetDragWindowForTest(0); + ASSERT_TRUE(drag_window); - ASSERT_TRUE(controller->drag_widget_); - ui::Layer* drag_layer = - controller->drag_widget_->GetNativeWindow()->layer(); + const ui::Layer* drag_layer = drag_window->layer(); ASSERT_TRUE(drag_layer); // Check if |resizer->layer_| is properly set to the drag widget. const std::vector<ui::Layer*>& layers = drag_layer->children(); EXPECT_FALSE(layers.empty()); - EXPECT_EQ(controller->layer_owner_->root(), layers.back()); + EXPECT_EQ(controller->GetDragLayerOwnerForTest(0)->root(), layers.back()); // |window_| should be opaque since the pointer is still on the primary // root window. The drag window should be semi-transparent. EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); - ASSERT_TRUE(controller->drag_widget_); EXPECT_GT(1.0f, drag_layer->opacity()); // Enter the pointer to the secondary display. - resizer->Drag(CalculateDragPoint(*resizer, 800, 10), 0); - EXPECT_EQ(1u, drag_resizer->drag_window_controllers_.size()); - controller = drag_resizer->drag_window_controllers_[0]; - ASSERT_TRUE(controller); + resizer->Drag(CalculateDragPoint(*resizer, 775, 10), 0); + EXPECT_EQ(1, controller->GetDragWindowsCountForTest()); // |window_| should be transparent, and the drag window should be opaque. EXPECT_GT(1.0f, window_->layer()->opacity()); EXPECT_FLOAT_EQ(1.0f, drag_layer->opacity()); @@ -404,8 +404,10 @@ window_.get(), gfx::Point(), HTCAPTION)); ASSERT_TRUE(resizer.get()); DragWindowResizer* drag_resizer = DragWindowResizer::instance_; + DragWindowController* controller = + drag_resizer->drag_window_controller_.get(); ASSERT_TRUE(drag_resizer); - EXPECT_EQ(0u, drag_resizer->drag_window_controllers_.size()); + EXPECT_FALSE(controller); resizer->Drag(CalculateDragPoint(*resizer, 0, 610), 0); resizer->RevertDrag(); @@ -414,6 +416,106 @@ } } +TEST_F(DragWindowResizerTest, DragWindowControllerAcrossThreeDisplays) { + if (!SupportsMultipleDisplays()) + return; + + UpdateDisplay("400x600,400x600,800x600"); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + + // Layout so that all three displays touch each other. + DisplayManager* display_manager = Shell::GetInstance()->display_manager(); + DisplayIdList list = display_manager->GetCurrentDisplayIdList(); + ASSERT_EQ(3u, list.size()); + ASSERT_EQ(gfx::Screen::GetScreen()->GetPrimaryDisplay().id(), list[0]); + DisplayLayoutBuilder builder(list[0]); + builder.AddDisplayPlacement(list[1], list[0], DisplayPlacement::RIGHT, 0); + builder.AddDisplayPlacement(list[2], list[0], DisplayPlacement::BOTTOM, 0); + display_manager->SetLayoutForCurrentDisplays(builder.Build()); + // Sanity check. + ASSERT_EQ(gfx::Rect(0, 000, 400, 600), + display_manager->GetDisplayForId(list[0]).bounds()); + ASSERT_EQ(gfx::Rect(400, 0, 400, 600), + display_manager->GetDisplayForId(list[1]).bounds()); + ASSERT_EQ(gfx::Rect(0, 600, 800, 600), + display_manager->GetDisplayForId(list[2]).bounds()); + + // Create a window on 2nd display. + window_->SetBoundsInScreen(gfx::Rect(400, 0, 100, 100), + display_manager->GetDisplayForId(list[1])); + ASSERT_EQ(root_windows[1], window_->GetRootWindow()); + + // Hold the center of the window so that the window doesn't stick to the edge + // when dragging around the edge of the display. + scoped_ptr<WindowResizer> resizer( + CreateDragWindowResizer(window_.get(), gfx::Point(50, 50), HTCAPTION)); + ASSERT_TRUE(resizer.get()); + DragWindowResizer* drag_resizer = DragWindowResizer::instance_; + ASSERT_TRUE(drag_resizer); + EXPECT_FALSE(drag_resizer->drag_window_controller_.get()); + resizer->Drag(CalculateDragPoint(*resizer, -50, 0), 0); + DragWindowController* controller = + drag_resizer->drag_window_controller_.get(); + ASSERT_TRUE(controller); + ASSERT_EQ(1, controller->GetDragWindowsCountForTest()); + const aura::Window* drag_window0 = controller->GetDragWindowForTest(0); + ASSERT_TRUE(drag_window0); + const ui::Layer* drag_layer0 = drag_window0->layer(); + EXPECT_EQ(root_windows[0], drag_window0->GetRootWindow()); + + // |window_| should be opaque since the pointer is still on the primary + // root window. The drag window should be semi-transparent. + EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); + EXPECT_GT(1.0f, drag_layer0->opacity()); + + // The window spans across 3 displays, dragging to 3rd display. + resizer->Drag(CalculateDragPoint(*resizer, -50, 549), 0); + ASSERT_EQ(2, controller->GetDragWindowsCountForTest()); + drag_window0 = controller->GetDragWindowForTest(0); + const aura::Window* drag_window1 = controller->GetDragWindowForTest(1); + drag_layer0 = drag_window0->layer(); + const ui::Layer* drag_layer1 = drag_window1->layer(); + EXPECT_EQ(root_windows[0], drag_window0->GetRootWindow()); + EXPECT_EQ(root_windows[2], drag_window1->GetRootWindow()); + + // |window_| should be opaque since the pointer is still on the 2nd + // root window. The drag window should be semi-transparent. + EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); + EXPECT_GT(1.0f, drag_layer0->opacity()); + EXPECT_GT(1.0f, drag_layer1->opacity()); + + resizer->Drag(CalculateDragPoint(*resizer, -51, 549), 0); + ASSERT_EQ(2, controller->GetDragWindowsCountForTest()); + drag_window0 = controller->GetDragWindowForTest(0); + drag_window1 = controller->GetDragWindowForTest(1); + drag_layer0 = drag_window0->layer(); + drag_layer1 = drag_window1->layer(); + EXPECT_EQ(root_windows[0], drag_window0->GetRootWindow()); + EXPECT_EQ(root_windows[2], drag_window1->GetRootWindow()); + + // |window_| should be transparent since the pointer is still on the primary + // root window. The drag window should be semi-transparent. + EXPECT_GT(1.0f, window_->layer()->opacity()); + EXPECT_FLOAT_EQ(1.0f, drag_layer0->opacity()); + EXPECT_GT(1.0f, drag_layer1->opacity()); + + // Enter the pointer to the 3rd. Since it's bottom, the window snaps and + // no drag windwos are created. + resizer->Drag(CalculateDragPoint(*resizer, -51, 551), 0); + ASSERT_EQ(1, controller->GetDragWindowsCountForTest()); + drag_window0 = controller->GetDragWindowForTest(0); + drag_layer0 = drag_window0->layer(); + EXPECT_EQ(root_windows[2], drag_window0->GetRootWindow()); + + // |window_| should be transparent, and the drag window should be opaque. + EXPECT_FLOAT_EQ(0.0f, window_->layer()->opacity()); + EXPECT_FLOAT_EQ(1.0f, drag_layer0->opacity()); + + resizer->CompleteDrag(); + EXPECT_EQ(root_windows[2], window_->GetRootWindow()); + EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); +} + // Verifies if the resizer sets and resets // MouseCursorEventFilter::mouse_warp_mode_ as expected. TEST_F(DragWindowResizerTest, WarpMousePointer) {
diff --git a/ash/wm/gestures/long_press_affordance_handler.h b/ash/wm/gestures/long_press_affordance_handler.h index 2ab4032..187e5c4 100644 --- a/ash/wm/gestures/long_press_affordance_handler.h +++ b/ash/wm/gestures/long_press_affordance_handler.h
@@ -6,6 +6,7 @@ #define ASH_WM_GESTURES_LONG_PRESS_AFFORDANCE_HANDLER_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/timer/timer.h" #include "ui/aura/window_observer.h" #include "ui/gfx/animation/linear_animation.h"
diff --git a/base/BUILD.gn b/base/BUILD.gn index 6ef6cd3..dcef582 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -2194,6 +2194,7 @@ "android/java/src/org/chromium/base/library_loader/Linker.java", "android/java/src/org/chromium/base/library_loader/LoaderErrors.java", "android/java/src/org/chromium/base/library_loader/ModernLinker.java", + "android/java/src/org/chromium/base/library_loader/NativeLibraryPreloader.java", "android/java/src/org/chromium/base/library_loader/ProcessInitException.java", "android/java/src/org/chromium/base/metrics/RecordHistogram.java", "android/java/src/org/chromium/base/metrics/RecordUserAction.java",
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn index 9fdb956..c1599bb6 100644 --- a/base/allocator/BUILD.gn +++ b/base/allocator/BUILD.gn
@@ -6,10 +6,6 @@ import("//build/config/allocator.gni") import("//build/config/compiler/compiler.gni") -if (is_win) { - import("//build/config/win/visual_studio_version.gni") -} - declare_args() { # Provide a way to force disable debugallocation in Debug builds, # e.g. for profiling (it's more rare to profile Debug builds, @@ -17,19 +13,21 @@ enable_debugallocation = is_debug } +# Allocator shim is only enabled for Release static builds. +win_use_allocator_shim = is_win && !is_component_build && !is_debug + # This "allocator" meta-target will forward to the default allocator according # to the build settings. group("allocator") { + public_deps = [] deps = [] if (use_allocator == "tcmalloc") { deps += [ ":tcmalloc" ] } - # This condition expresses the win_use_allocator_shim in the GYP build. - if (is_win && !is_component_build && visual_studio_version != "2015") { - deps += [ ":allocator_shim" ] - all_dependent_configs = [ ":nocmt" ] + if (win_use_allocator_shim) { + public_deps += [ ":allocator_shim" ] } } @@ -40,7 +38,7 @@ # assumes that the library using it will eventually be linked with # //base/allocator in the default way. Clean this up and delete this. config("allocator_shim_define") { - if (is_win && !is_component_build && visual_studio_version != "2015") { + if (win_use_allocator_shim) { defines = [ "ALLOCATOR_SHIM" ] } } @@ -76,46 +74,15 @@ } } -# This config and libc modification are only used on Windows. -if (is_win) { - config("nocmt") { - ldflags = [ - "/NODEFAULTLIB:libcmt", - "/NODEFAULTLIB:libcmtd", +# This config is only used on Windows static release builds for the +# allocator shim. +if (win_use_allocator_shim) { + source_set("allocator_shim") { + sources = [ + "allocator_shim_win.cc", + "allocator_shim_win.h", ] - libs = [ rebase_path("$target_gen_dir/allocator/libcmt.lib") ] - } - - if (!is_component_build && visual_studio_version != "2015") { - action("prep_libc") { - script = "prep_libc.py" - outputs = [ - "$target_gen_dir/allocator/libcmt.lib", - ] - args = [ - visual_studio_path + "/vc/lib", - rebase_path("$target_gen_dir/allocator"), - current_cpu, - - # The environment file in the build directory. This is required because - # the Windows toolchain setup saves the VC paths and such so that - # running "mc.exe" will work with the configured toolchain. This file - # is in the root build dir. - "environment.$current_cpu", - ] - } - - source_set("allocator_shim") { - sources = [ - "allocator_shim_win.cc", - ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - - deps = [ - ":prep_libc", - ] - } + configs += [ ":allocator_shim_define" ] } }
diff --git a/base/allocator/allocator.gyp b/base/allocator/allocator.gyp index d906eea..8d241d1 100644 --- a/base/allocator/allocator.gyp +++ b/base/allocator/allocator.gyp
@@ -49,25 +49,13 @@ 'AdditionalOptions': ['/ignore:4006'], }, }, - 'dependencies': [ - 'libcmt', - ], 'include_dirs': [ '../..', ], 'sources': [ 'allocator_shim_win.cc', + 'allocator_shim_win.h', ], - 'link_settings': { - 'msvs_settings': { - 'VCLinkerTool': { - 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'], - 'AdditionalDependencies': [ - '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib' - ], - }, - }, - }, 'configurations': { 'Debug_Base': { 'msvs_settings': { @@ -393,33 +381,6 @@ }, # 'allocator_features' target. ], # targets. 'conditions': [ - ['OS=="win" and win_use_allocator_shim==1', { - 'targets': [ - { - 'target_name': 'libcmt', - 'toolsets': ['host', 'target'], - 'type': 'none', - 'actions': [ - { - 'action_name': 'libcmt', - 'inputs': [ - 'prep_libc.py', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib', - ], - 'action': [ - 'python', - 'prep_libc.py', - '$(VCInstallDir)lib', - '<(SHARED_INTERMEDIATE_DIR)/allocator', - '<(target_arch)', - ], - }, - ], - }, - ], - }], ['use_experimental_allocator_shim==1', { 'targets': [ {
diff --git a/base/allocator/allocator_check.cc b/base/allocator/allocator_check.cc index cb5a987a..5a0564d 100644 --- a/base/allocator/allocator_check.cc +++ b/base/allocator/allocator_check.cc
@@ -6,6 +6,10 @@ #include "build/build_config.h" +#if defined(OS_WIN) +#include "base/allocator/allocator_shim_win.h" +#endif + #if defined(OS_LINUX) #include <malloc.h> #endif @@ -13,15 +17,9 @@ namespace base { namespace allocator { -// Defined in allocator_shim_win.cc . -// TODO(primiano): replace with an include once base can depend on allocator. -#if defined(OS_WIN) && defined(ALLOCATOR_SHIM) -extern bool g_is_win_shim_layer_initialized; -#endif - bool IsAllocatorInitialized() { #if defined(OS_WIN) && defined(ALLOCATOR_SHIM) - // Set by allocator_shim_win.cc when the shimmed _heap_init() is called. + // Set by allocator_shim_win.cc when the shimmed _set_new_mode() is called. return g_is_win_shim_layer_initialized; #elif defined(OS_LINUX) && defined(USE_TCMALLOC) && \ !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
diff --git a/base/allocator/allocator_shim_win.cc b/base/allocator/allocator_shim_win.cc index 2549c31..9b14ea0 100644 --- a/base/allocator/allocator_shim_win.cc +++ b/base/allocator/allocator_shim_win.cc
@@ -2,29 +2,29 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// The allocator shim is only enabled in Release Static builds. +// This #if is needed as gyp can't have different compile +// targets between Debug and Release. +// TODO(wfh): Remove this once gyp is dead. +#if defined(ALLOCATOR_SHIM) + #include <limits.h> #include <malloc.h> #include <new.h> #include <windows.h> #include <stddef.h> +#include "allocator_shim_win.h" + // This shim make it possible to perform additional checks on allocations // before passing them to the Heap functions. -// Heap functions are stripped from libcmt.lib using the prep_libc.py -// for each object file stripped, we re-implement them here to allow us to -// perform additional checks: +// Override heap functions to perform additional checks: // 1. Enforcing the maximum size that can be allocated to 2Gb. -// 2. Calling new_handler if malloc fails. +// 2. Calling new_handler if malloc fails -extern "C" { -// We set this to 1 because part of the CRT uses a check of _crtheap != 0 -// to test whether the CRT has been initialized. Once we've ripped out -// the allocators from libcmt, we need to provide this definition so that -// the rest of the CRT is still usable. -// heapinit.c -void* _crtheap = reinterpret_cast<void*>(1); -} +// See definitions of original functions in ucrt\corecrt_malloc.h in SDK +// include directory. namespace base { namespace allocator { @@ -38,23 +38,18 @@ const size_t kMaxWindowsAllocation = INT_MAX - kWindowsPageSize; int new_mode = 0; -// VS2013 crt uses the process heap as its heap, so we do the same here. -// See heapinit.c in VS CRT sources. -bool win_heap_init() { - // Set the _crtheap global here. THis allows us to offload most of the - // memory management to the CRT, except the functions we need to shim. - _crtheap = GetProcessHeap(); - return _crtheap != nullptr; +inline HANDLE get_heap_handle() { + return reinterpret_cast<HANDLE>(_get_heap_handle()); } void* win_heap_malloc(size_t size) { if (size < kMaxWindowsAllocation) - return HeapAlloc(_crtheap, 0, size); - return NULL; + return HeapAlloc(get_heap_handle(), 0, size); + return nullptr; } void win_heap_free(void* size) { - HeapFree(_crtheap, 0, size); + HeapFree(get_heap_handle(), 0, size); } void* win_heap_realloc(void* ptr, size_t size) { @@ -62,15 +57,11 @@ return win_heap_malloc(size); if (!size) { win_heap_free(ptr); - return NULL; + return nullptr; } if (size < kMaxWindowsAllocation) - return HeapReAlloc(_crtheap, 0, ptr, size); - return NULL; -} - -void win_heap_term() { - _crtheap = NULL; + return HeapReAlloc(get_heap_handle(), 0, ptr, size); + return nullptr; } // Call the new handler, if one has been set. @@ -83,79 +74,42 @@ return false; // Since exceptions are disabled, we don't really know if new_handler // failed. Assume it will abort if it fails. - return nh(size); + return nh(size) ? true : false; #else #error "Exceptions in allocator shim are not supported!" #endif // defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS - return false; -} - -// Implement a C++ style allocation, which always calls the new_handler -// on failure. -inline void* generic_cpp_alloc(size_t size, bool nothrow) { - void* ptr; - for (;;) { - ptr = malloc(size); - if (ptr) - return ptr; - if (!call_new_handler(nothrow, size)) - break; - } - return ptr; } } // namespace -// new.cpp -void* operator new(size_t size) { - return generic_cpp_alloc(size, false); -} +extern "C" { -// delete.cpp -void operator delete(void* p) throw() { - free(p); -} - -// new2.cpp -void* operator new[](size_t size) { - return generic_cpp_alloc(size, false); -} - -// delete2.cpp -void operator delete[](void* p) throw() { - free(p); -} - -// newopnt.cpp -void* operator new(size_t size, const std::nothrow_t& nt) { - return generic_cpp_alloc(size, true); -} - -// newaopnt.cpp -void* operator new[](size_t size, const std::nothrow_t& nt) { - return generic_cpp_alloc(size, true); -} +// Symbol to allow weak linkage to win_heap_malloc from memory_win.cc. +void* (*malloc_unchecked)(size_t) = &win_heap_malloc; // This function behaves similarly to MSVC's _set_new_mode. // If flag is 0 (default), calls to malloc will behave normally. // If flag is 1, calls to malloc will behave like calls to new, // and the std_new_handler will be invoked on failure. // Returns the previous mode. -// new_mode.cpp -int _set_new_mode(int flag) throw() { +// +// Replaces _set_new_mode in ucrt\heap\new_mode.cpp +int _set_new_mode(int flag) { + // The MS CRT calls this function early on in startup, so this serves as a low + // overhead proof that the allocator shim is in place for this process. + base::allocator::g_is_win_shim_layer_initialized = true; int old_mode = new_mode; new_mode = flag; return old_mode; } -// new_mode.cpp +// Replaces _query_new_mode in ucrt\heap\new_mode.cpp int _query_new_mode() { return new_mode; } -extern "C" { -// malloc.c -void* malloc(size_t size) { +// Replaces malloc in ucrt\heap\malloc.cpp +__declspec(restrict) void* malloc(size_t size) { void* ptr; for (;;) { ptr = win_heap_malloc(size); @@ -168,17 +122,14 @@ return ptr; } -// Symbol to allow weak linkage to win_heap_malloc from memory_win.cc. -void* (*malloc_unchecked)(size_t) = &win_heap_malloc; - -// free.c +// Replaces free in ucrt\heap\free.cpp void free(void* p) { win_heap_free(p); return; } -// realloc.c -void* realloc(void* ptr, size_t size) { +// Replaces realloc in ucrt\heap\realloc.cpp +__declspec(restrict) void* realloc(void* ptr, size_t size) { // Webkit is brittle for allocators that return NULL for malloc(0). The // realloc(0, 0) code path does not guarantee a non-NULL return, so be sure // to call malloc for this case. @@ -200,120 +151,20 @@ return new_ptr; } -// heapinit.c -intptr_t _get_heap_handle() { - return reinterpret_cast<intptr_t>(_crtheap); -} - -// heapinit.c -int _heap_init() { - base::allocator::g_is_win_shim_layer_initialized = true; - return win_heap_init() ? 1 : 0; -} - -// heapinit.c -void _heap_term() { - win_heap_term(); -} - -// calloc.c -void* calloc(size_t n, size_t elem_size) { +// Replaces calloc in ucrt\heap\calloc.cpp +__declspec(restrict) void* calloc(size_t n, size_t elem_size) { // Overflow check. const size_t size = n * elem_size; if (elem_size != 0 && size / elem_size != n) - return NULL; + return nullptr; void* result = malloc(size); - if (result != NULL) { + if (result) { memset(result, 0, size); } return result; } -// recalloc.c -void* _recalloc(void* p, size_t n, size_t elem_size) { - if (!p) - return calloc(n, elem_size); - - // This API is a bit odd. - // Note: recalloc only guarantees zeroed memory when p is NULL. - // Generally, calls to malloc() have padding. So a request - // to malloc N bytes actually malloc's N+x bytes. Later, if - // that buffer is passed to recalloc, we don't know what N - // was anymore. We only know what N+x is. As such, there is - // no way to know what to zero out. - const size_t size = n * elem_size; - if (elem_size != 0 && size / elem_size != n) - return NULL; - return realloc(p, size); -} - -// calloc_impl.c -void* _calloc_impl(size_t n, size_t size) { - return calloc(n, size); -} - -#ifndef NDEBUG -#undef malloc -#undef free -#undef calloc - -static int error_handler(int reportType) { - switch (reportType) { - case 0: // _CRT_WARN - __debugbreak(); - return 0; - - case 1: // _CRT_ERROR - __debugbreak(); - return 0; - - case 2: // _CRT_ASSERT - __debugbreak(); - return 0; - } - char* p = NULL; - *p = '\0'; - return 0; -} - -int _CrtDbgReport(int reportType, - const char*, - int, - const char*, - const char*, - ...) { - return error_handler(reportType); -} - -int _CrtDbgReportW(int reportType, - const wchar_t*, - int, - const wchar_t*, - const wchar_t*, - ...) { - return error_handler(reportType); -} - -int _CrtSetReportMode(int, int) { - return 0; -} - -void* _malloc_dbg(size_t size, int, const char*, int) { - return malloc(size); -} - -void* _realloc_dbg(void* ptr, size_t size, int, const char*, int) { - return realloc(ptr, size); -} - -void _free_dbg(void* ptr, int) { - free(ptr); -} - -void* _calloc_dbg(size_t n, size_t size, int, const char*, int) { - return calloc(n, size); -} -#endif // NDEBUG - } // extern C + +#endif // defined(ALLOCATOR_SHIM)
diff --git a/base/allocator/allocator_shim_win.h b/base/allocator/allocator_shim_win.h new file mode 100644 index 0000000..d19a989 --- /dev/null +++ b/base/allocator/allocator_shim_win.h
@@ -0,0 +1,17 @@ +// 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. + +#ifndef BASE_ALLOCATOR_ALLOCATOR_SHIM_WIN_H_ +#define BASE_ALLOCATOR_ALLOCATOR_SHIM_WIN_H_ + +#include <stddef.h> + +namespace base { +namespace allocator { +// Used to indicate that the shim is actually in place. +extern bool g_is_win_shim_layer_initialized; +} // namespace allocator +} // namespace base + +#endif // BASE_ALLOCATOR_ALLOCATOR_SHIM_WIN_H_
diff --git a/base/allocator/prep_libc.py b/base/allocator/prep_libc.py deleted file mode 100755 index a88d3bd0..0000000 --- a/base/allocator/prep_libc.py +++ /dev/null
@@ -1,84 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2012 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. -# -# This script takes libcmt.lib for VS2013 and removes the allocation related -# functions from it. -# -# Usage: prep_libc.py <VCLibDir> <OutputDir> <arch> [<environment_file>] -# -# VCLibDir is the path where VC is installed, something like: -# C:\Program Files\Microsoft Visual Studio 8\VC\lib -# -# OutputDir is the directory where the modified libcmt file should be stored. -# arch is one of: 'ia32', 'x86' or 'x64'. ia32 and x86 are synonyms. -# -# If the environment_file argument is set, the environment variables in the -# given file will be used to execute the VC tools. This file is in the same -# format as the environment block passed to CreateProcess. - -import os -import shutil -import subprocess -import sys - -def run(command, env_dict): - """Run |command|. If any lines that match an error condition then - terminate. - - The env_dict, will be used for the environment. None can be used to get the - default environment.""" - error = 'cannot find member object' - # Need shell=True to search the path in env_dict for the executable. - popen = subprocess.Popen( - command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, - env=env_dict) - out, _ = popen.communicate() - for line in out.splitlines(): - print line - if error and line.find(error) != -1: - print 'prep_libc.py: Error stripping object from C runtime.' - sys.exit(1) - -def main(): - bindir = 'SELF_X86' - objdir = 'INTEL' - vs_install_dir = sys.argv[1] - outdir = sys.argv[2] - if "x64" in sys.argv[3]: - bindir = 'SELF_64_amd64' - objdir = 'amd64' - vs_install_dir = os.path.join(vs_install_dir, 'amd64') - - if len(sys.argv) == 5: - env_pairs = open(sys.argv[4]).read()[:-2].split('\0') - env_dict = dict([item.split('=', 1) for item in env_pairs]) - else: - env_dict = None # Use the default environment. - - output_lib = os.path.join(outdir, 'libcmt.lib') - shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.lib'), output_lib) - shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.pdb'), - os.path.join(outdir, 'libcmt.pdb')) - cvspath = 'f:\\binaries\\Intermediate\\vctools\\crt_bld\\' + bindir + \ - '\\crt\\prebuild\\build\\' + objdir + '\\mt_obj\\nativec\\\\'; - cppvspath = 'f:\\binaries\\Intermediate\\vctools\\crt_bld\\' + bindir + \ - '\\crt\\prebuild\\build\\' + objdir + '\\mt_obj\\nativecpp\\\\'; - - cobjfiles = ['malloc', 'free', 'realloc', 'heapinit', 'calloc', 'recalloc', - 'calloc_impl'] - cppobjfiles = ['new', 'new2', 'delete', 'delete2', 'new_mode', 'newopnt', - 'newaopnt'] - for obj in cobjfiles: - cmd = ('lib /nologo /ignore:4006,4221 /remove:%s%s.obj %s' % - (cvspath, obj, output_lib)) - run(cmd, env_dict) - for obj in cppobjfiles: - cmd = ('lib /nologo /ignore:4006,4221 /remove:%s%s.obj %s' % - (cppvspath, obj, output_lib)) - run(cmd, env_dict) - -if __name__ == "__main__": - sys.exit(main())
diff --git a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java index a0897c06..6665ddfd 100644 --- a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java +++ b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
@@ -48,6 +48,9 @@ // Guards all access to the libraries private static final Object sLock = new Object(); + // The singleton instance of NativeLibraryPreloader. + private static NativeLibraryPreloader sLibraryPreloader; + // The singleton instance of LibraryLoader. private static volatile LibraryLoader sInstance; @@ -88,6 +91,20 @@ private long mLibraryLoadTimeMs; /** + * Set native library preloader, if set, the NativeLibraryPreloader.loadLibrary will be invoked + * before calling System.loadLibrary, this only applies when not using the chromium linker. + * + * @param loader the NativeLibraryPreloader, it shall only be set once and before the + * native library loaded. + */ + public static void setNativeLibraryPreloader(NativeLibraryPreloader loader) { + synchronized (sLock) { + assert sLibraryPreloader == null && (sInstance == null || !sInstance.mLoaded); + sLibraryPreloader = loader; + } + } + + /** * @param libraryProcessType the process the shared library is loaded in. refer to * LibraryProcessType for possible values. * @return LibraryLoader if existing, otherwise create a new one. @@ -266,6 +283,9 @@ linker.finishLibraryLoad(); } else { + if (sLibraryPreloader != null) { + sLibraryPreloader.loadLibrary(context); + } // Load libraries using the system linker. for (String library : NativeLibraries.LIBRARIES) { System.loadLibrary(library);
diff --git a/base/android/java/src/org/chromium/base/library_loader/NativeLibraryPreloader.java b/base/android/java/src/org/chromium/base/library_loader/NativeLibraryPreloader.java new file mode 100644 index 0000000..a3c4dd6 --- /dev/null +++ b/base/android/java/src/org/chromium/base/library_loader/NativeLibraryPreloader.java
@@ -0,0 +1,14 @@ +// 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. + +package org.chromium.base.library_loader; + +import android.content.Context; + +/** + * This is interface to preload the native library before calling System.loadLibrary. + */ +public abstract class NativeLibraryPreloader { + public abstract void loadLibrary(Context context); +}
diff --git a/base/debug/task_annotator.h b/base/debug/task_annotator.h index 2687c5c..443c71bf3 100644 --- a/base/debug/task_annotator.h +++ b/base/debug/task_annotator.h
@@ -39,6 +39,11 @@ DISALLOW_COPY_AND_ASSIGN(TaskAnnotator); }; +#define TRACE_TASK_EXECUTION(run_function, task) \ + TRACE_EVENT2("toplevel", (run_function), "src_file", \ + (task).posted_from.file_name(), "src_func", \ + (task).posted_from.function_name()); + } // namespace debug } // namespace base
diff --git a/base/message_loop/message_pump_win.cc b/base/message_loop/message_pump_win.cc index 803bb5d..fd4a2e8 100644 --- a/base/message_loop/message_pump_win.cc +++ b/base/message_loop/message_pump_win.cc
@@ -236,9 +236,10 @@ // The WaitMessage call below is a workaround to give the child window // some time to process its input messages. MSG msg = {0}; - DWORD queue_status = GetQueueStatus(QS_MOUSE); - if (HIWORD(queue_status) & QS_MOUSE && - !PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_NOREMOVE)) { + bool has_pending_sent_message = + (HIWORD(GetQueueStatus(QS_SENDMESSAGE)) & QS_SENDMESSAGE) != 0; + if (!has_pending_sent_message && + !PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { WaitMessage(); } return;
diff --git a/base/process/memory_unittest.cc b/base/process/memory_unittest.cc index 9e5de0c..7eab062 100644 --- a/base/process/memory_unittest.cc +++ b/base/process/memory_unittest.cc
@@ -10,8 +10,10 @@ #include <limits> +#include "base/allocator/allocator_check.h" #include "base/compiler_specific.h" #include "base/debug/alias.h" +#include "base/memory/aligned_memory.h" #include "base/strings/stringprintf.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" @@ -96,6 +98,10 @@ #endif // defined(OS_MACOSX) +TEST(MemoryTest, AllocatorShimWorking) { + ASSERT_TRUE(base::allocator::IsAllocatorInitialized()); +} + // Android doesn't implement set_new_handler, so we can't use the // OutOfMemoryTest cases. OpenBSD does not support these tests either. // Don't test these on ASan/TSan/MSan configurations: only test the real @@ -176,6 +182,23 @@ }, kOomRegex); } +TEST_F(OutOfMemoryDeathTest, AlignedAlloc) { + ASSERT_DEATH({ + SetUpInDeathAssert(); + value_ = base::AlignedAlloc(test_size_, 8); + }, kOomRegex); +} + +// POSIX does not define an aligned realloc function. +#if defined(OS_WIN) +TEST_F(OutOfMemoryDeathTest, AlignedRealloc) { + ASSERT_DEATH({ + SetUpInDeathAssert(); + value_ = _aligned_realloc(NULL, test_size_, 8); + }, kOomRegex); +} +#endif // defined(OS_WIN) + // OS X has no 2Gb allocation limit. // See https://crbug.com/169327. #if !defined(OS_MACOSX) @@ -213,6 +236,23 @@ value_ = calloc(1024, insecure_test_size_ / 1024L); }, kOomRegex); } + +TEST_F(OutOfMemoryDeathTest, SecurityAlignedAlloc) { + ASSERT_DEATH({ + SetUpInDeathAssert(); + value_ = base::AlignedAlloc(insecure_test_size_, 8); + }, kOomRegex); +} + +// POSIX does not define an aligned realloc function. +#if defined(OS_WIN) +TEST_F(OutOfMemoryDeathTest, SecurityAlignedRealloc) { + ASSERT_DEATH({ + SetUpInDeathAssert(); + value_ = _aligned_realloc(NULL, insecure_test_size_, 8); + }, kOomRegex); +} +#endif // defined(OS_WIN) #endif // !defined(OS_MACOSX) #if defined(OS_LINUX)
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc index 52663dc..086f54b 100644 --- a/base/threading/sequenced_worker_pool.cc +++ b/base/threading/sequenced_worker_pool.cc
@@ -809,7 +809,6 @@ TRACE_EVENT_FLAG_FLOW_IN, "src_file", task.posted_from.file_name(), "src_func", task.posted_from.function_name()); - TRACE_TASK_EXECUTION("SequencedWorkerPool::Inner::ThreadLoop", task); int new_thread_id = WillRunWorkerTask(task); { AutoUnlock unlock(lock_);
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc index dcebe0a..53ae4e6 100644 --- a/base/threading/worker_pool_posix.cc +++ b/base/threading/worker_pool_posix.cc
@@ -86,7 +86,9 @@ PendingTask pending_task = pool_->WaitForTask(); if (pending_task.task.is_null()) break; - TRACE_TASK_EXECUTION("WorkerThread::ThreadMain::Run", pending_task); + TRACE_EVENT2("toplevel", "WorkerThread::ThreadMain::Run", + "src_file", pending_task.posted_from.file_name(), + "src_func", pending_task.posted_from.function_name()); tracked_objects::TaskStopwatch stopwatch; stopwatch.Start();
diff --git a/base/threading/worker_pool_win.cc b/base/threading/worker_pool_win.cc index 575caaa6..1b0ade5 100644 --- a/base/threading/worker_pool_win.cc +++ b/base/threading/worker_pool_win.cc
@@ -21,7 +21,9 @@ DWORD CALLBACK WorkItemCallback(void* param) { PendingTask* pending_task = static_cast<PendingTask*>(param); - TRACE_TASK_EXECUTION("WorkerThread::ThreadMain::Run", *pending_task); + TRACE_EVENT2("toplevel", "WorkItemCallback::Run", + "src_file", pending_task->posted_from.file_name(), + "src_func", pending_task->posted_from.function_name()); g_worker_pool_running_on_this_thread.Get().Set(true);
diff --git a/base/trace_event/common/trace_event_common.h b/base/trace_event/common/trace_event_common.h index 0b549d4..f65b35b 100644 --- a/base/trace_event/common/trace_event_common.h +++ b/base/trace_event/common/trace_event_common.h
@@ -926,15 +926,6 @@ name, id, TRACE_EVENT_FLAG_COPY, arg1_name, \ arg1_val, arg2_name, arg2_val) -// Special trace event macro to trace task execution with the location where it -// was posted from. -#define TRACE_TASK_EXECUTION(run_function, task) \ - TRACE_EVENT2("toplevel", run_function, "src_file", \ - (task).posted_from.file_name(), "src_func", \ - (task).posted_from.function_name()); \ - TRACE_EVENT_API_SCOPED_TASK_EXECUTION_EVENT INTERNAL_TRACE_EVENT_UID( \ - task_event)((task).posted_from.file_name()); - // TRACE_EVENT_METADATA* events are information related to other // injected events, not events in their own right. #define TRACE_EVENT_METADATA1(category_group, name, arg1_name, arg1_val) \
diff --git a/base/trace_event/heap_profiler_allocation_context_tracker.cc b/base/trace_event/heap_profiler_allocation_context_tracker.cc index 1fc8bc0..2dfe79f 100644 --- a/base/trace_event/heap_profiler_allocation_context_tracker.cc +++ b/base/trace_event/heap_profiler_allocation_context_tracker.cc
@@ -19,7 +19,6 @@ namespace { const size_t kMaxStackDepth = 128u; -const size_t kMaxTaskDepth = 16u; AllocationContextTracker* const kInitializingSentinel = reinterpret_cast<AllocationContextTracker*>(-1); @@ -52,7 +51,6 @@ AllocationContextTracker::AllocationContextTracker() : thread_name_(nullptr) { pseudo_stack_.reserve(kMaxStackDepth); - task_contexts_.reserve(kMaxTaskDepth); } AllocationContextTracker::~AllocationContextTracker() {} @@ -101,20 +99,6 @@ pseudo_stack_.pop_back(); } -void AllocationContextTracker::PushCurrentTaskContext(const char* context) { - DCHECK(context); - if (task_contexts_.size() < kMaxTaskDepth) - task_contexts_.push_back(context); - else - NOTREACHED(); -} - -void AllocationContextTracker::PopCurrentTaskContext(const char* context) { - DCHECK_EQ(context, task_contexts_.back()) - << "Encountered an unmatched context end"; - task_contexts_.pop_back(); -} - // static AllocationContext AllocationContextTracker::GetContextSnapshot() { AllocationContext ctx; @@ -142,9 +126,7 @@ std::fill(dst, dst_end, nullptr); } - // TODO(ssid): Fix crbug.com/594803 to add file name as 3rd dimension - // (component name) in the heap profiler and not piggy back on the type name. - ctx.type_name = task_contexts_.empty() ? nullptr : task_contexts_.back(); + ctx.type_name = nullptr; return ctx; }
diff --git a/base/trace_event/heap_profiler_allocation_context_tracker.h b/base/trace_event/heap_profiler_allocation_context_tracker.h index d6133323..21c3c97 100644 --- a/base/trace_event/heap_profiler_allocation_context_tracker.h +++ b/base/trace_event/heap_profiler_allocation_context_tracker.h
@@ -58,11 +58,6 @@ // Pops a frame from the thread-local pseudo stack. void PopPseudoStackFrame(StackFrame frame); - // Push and pop current task's context. A stack is used to support nested - // tasks and the top of the stack will be used in allocation context. - void PushCurrentTaskContext(const char* context); - void PopCurrentTaskContext(const char* context); - // Returns a snapshot of the current thread-local context. AllocationContext GetContextSnapshot(); @@ -79,10 +74,6 @@ // The thread name is used as the first entry in the pseudo stack. const char* thread_name_; - // Stack of tasks' contexts. Context serves as a different dimension than - // pseudo stack to cluster allocations. - std::vector<const char*> task_contexts_; - DISALLOW_COPY_AND_ASSIGN(AllocationContextTracker); };
diff --git a/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc b/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc index 05c60c7..6349ec0 100644 --- a/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc +++ b/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc
@@ -7,7 +7,6 @@ #include <iterator> #include "base/memory/ref_counted.h" -#include "base/pending_task.h" #include "base/trace_event/heap_profiler_allocation_context.h" #include "base/trace_event/heap_profiler_allocation_context_tracker.h" #include "base/trace_event/trace_event.h" @@ -252,31 +251,5 @@ ASSERT_EQ(kCupcake, ctx2.backtrace.frames[1]); } -TEST_F(AllocationContextTrackerTest, TrackTaskContext) { - const char kContext1[] = "context1"; - const char kContext2[] = "context2"; - { - // The context from the scoped task event should be used as type name. - TRACE_EVENT_API_SCOPED_TASK_EXECUTION_EVENT event1(kContext1); - AllocationContext ctx1 = - AllocationContextTracker::GetInstanceForCurrentThread() - ->GetContextSnapshot(); - ASSERT_EQ(kContext1, ctx1.type_name); - - // In case of nested events, the last event's context should be used. - TRACE_EVENT_API_SCOPED_TASK_EXECUTION_EVENT event2(kContext2); - AllocationContext ctx2 = - AllocationContextTracker::GetInstanceForCurrentThread() - ->GetContextSnapshot(); - ASSERT_EQ(kContext2, ctx2.type_name); - } - - // Type should be nullptr without task event. - AllocationContext ctx = - AllocationContextTracker::GetInstanceForCurrentThread() - ->GetContextSnapshot(); - ASSERT_FALSE(ctx.type_name); -} - } // namespace trace_event } // namespace base
diff --git a/base/trace_event/heap_profiler_type_name_deduplicator.cc b/base/trace_event/heap_profiler_type_name_deduplicator.cc index 055f86ab..e7f57c8 100644 --- a/base/trace_event/heap_profiler_type_name_deduplicator.cc +++ b/base/trace_event/heap_profiler_type_name_deduplicator.cc
@@ -16,33 +16,6 @@ namespace base { namespace trace_event { -namespace { - -// Extract directory name if |type_name| was file name. Otherwise, return -// |type_name|. -StringPiece ExtractDirNameFromFileName(const char* type_name) { - StringPiece result(type_name); - size_t last_seperator = result.find_last_of("\\/"); - - // If |type_name| was a not a file path, the seperator will not be found, so - // the whole type name is returned. - if (last_seperator == StringPiece::npos) - return result; - - // Remove the file name from the path. - result.remove_suffix(result.length() - last_seperator); - - // Remove the parent directory references. - const char kParentDirectory[] = ".."; - const size_t kParentDirectoryLength = 3; // '../' or '..\'. - while (result.starts_with(kParentDirectory)) { - result.remove_prefix(kParentDirectoryLength); - } - return result; -} - -} // namespace - TypeNameDeduplicator::TypeNameDeduplicator() { // A null pointer has type ID 0 ("unknown type"); type_ids_.insert(std::make_pair(nullptr, 0)); @@ -80,13 +53,9 @@ // a dictionary. SStringPrintf(&buffer, ",\"%d\":", it->second); - // TODO(ssid): crbug.com/594803 the type name is misused for file name in - // some cases. - StringPiece type_info = ExtractDirNameFromFileName(it->first); - // |EscapeJSONString| appends, it does not overwrite |buffer|. bool put_in_quotes = true; - EscapeJSONString(type_info, put_in_quotes, &buffer); + EscapeJSONString(it->first, put_in_quotes, &buffer); out->append(buffer); }
diff --git a/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc b/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc index 8ab3f37..92ffcf8 100644 --- a/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc +++ b/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc
@@ -13,8 +13,6 @@ namespace base { namespace trace_event { -namespace { - // Define all strings once, because the deduplicator requires pointer equality, // and string interning is unreliable. const char kInt[] = "int"; @@ -22,43 +20,12 @@ const char kString[] = "string"; const char kNeedsEscape[] = "\"quotes\""; -#if defined(OS_POSIX) -const char kTaskFileName[] = "../../base/trace_event/trace_log.cc"; -const char kTaskPath[] = "base/trace_event"; -#else -const char kTaskFileName[] = "..\\..\\base\\memory\\memory_win.cc"; -const char kTaskPath[] = "base\\memory"; -#endif - scoped_ptr<Value> DumpAndReadBack(const TypeNameDeduplicator& deduplicator) { std::string json; deduplicator.AppendAsTraceFormat(&json); return JSONReader::Read(json); } -// Inserts a single type name into a new TypeNameDeduplicator instance and -// checks if the value gets inserted and the exported value for |type_name| is -// the same as |expected_value|. -void TestInsertTypeAndReadback(const char* type_name, - const char* expected_value) { - scoped_ptr<TypeNameDeduplicator> dedup(new TypeNameDeduplicator); - ASSERT_EQ(1, dedup->Insert(type_name)); - - scoped_ptr<Value> type_names = DumpAndReadBack(*dedup); - ASSERT_NE(nullptr, type_names); - - const DictionaryValue* dictionary; - ASSERT_TRUE(type_names->GetAsDictionary(&dictionary)); - - // When the type name was inserted, it got ID 1. The exported key "1" - // should be equal to |expected_value|. - std::string value; - ASSERT_TRUE(dictionary->GetString("1", &value)); - ASSERT_EQ(expected_value, value); -} - -} // namespace - TEST(TypeNameDeduplicatorTest, Deduplication) { // The type IDs should be like this: // 0: [unknown] @@ -81,14 +48,22 @@ } TEST(TypeNameDeduplicatorTest, EscapeTypeName) { - // Reading json should not fail, because the type name should have been - // escaped properly and exported value should contain quotes. - TestInsertTypeAndReadback(kNeedsEscape, kNeedsEscape); -} + scoped_ptr<TypeNameDeduplicator> dedup(new TypeNameDeduplicator); + ASSERT_EQ(1, dedup->Insert(kNeedsEscape)); -TEST(TypeNameDeduplicatorTest, TestExtractFileName) { - // The exported value for passed file name should be the folders in the path. - TestInsertTypeAndReadback(kTaskFileName, kTaskPath); + // Reading json should not fail, because the type name should have been + // escaped properly. + scoped_ptr<Value> type_names = DumpAndReadBack(*dedup); + ASSERT_NE(nullptr, type_names); + + const DictionaryValue* dictionary; + ASSERT_TRUE(type_names->GetAsDictionary(&dictionary)); + + // When the type name was inserted, it got ID 1. The exported key "1" + // should contain the name, with quotes. + std::string type_name; + ASSERT_TRUE(dictionary->GetString("1", &type_name)); + ASSERT_EQ("\"quotes\"", type_name); } } // namespace trace_event
diff --git a/base/trace_event/trace_event.h b/base/trace_event/trace_event.h index e7801e6..2321d7ad 100644 --- a/base/trace_event/trace_event.h +++ b/base/trace_event/trace_event.h
@@ -18,7 +18,6 @@ #include "base/macros.h" #include "base/time/time.h" #include "base/trace_event/common/trace_event_common.h" -#include "base/trace_event/heap_profiler_allocation_context_tracker.h" #include "base/trace_event/trace_event_system_stats_monitor.h" #include "base/trace_event/trace_log.h" #include "build/build_config.h" @@ -211,10 +210,6 @@ #define TRACE_EVENT_API_THREAD_BUCKET(thread_bucket) \ g_trace_state[thread_bucket] -// Scoped tracker for task execution context in the heap profiler. -#define TRACE_EVENT_API_SCOPED_TASK_EXECUTION_EVENT \ - trace_event_internal::ScopedTaskExecutionEvent - //////////////////////////////////////////////////////////////////////////////// // Implementation detail: trace event macros create temporary variables @@ -1050,31 +1045,6 @@ const char* previous_state_; }; -// ScopedTaskExecutionEvent records the current task's context in the heap -// profiler. -class ScopedTaskExecutionEvent { - public: - explicit ScopedTaskExecutionEvent(const char* task_context) - : context_(task_context) { - if (UNLIKELY( - base::trace_event::AllocationContextTracker::capture_enabled())) { - base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread() - ->PushCurrentTaskContext(context_); - } - } - - ~ScopedTaskExecutionEvent() { - if (UNLIKELY( - base::trace_event::AllocationContextTracker::capture_enabled())) { - base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread() - ->PopCurrentTaskContext(context_); - } - } - - private: - const char* context_; -}; - } // namespace trace_event_internal namespace base {
diff --git a/blimp/client/app/android/java/res/drawable-hdpi/btn_menu.png b/blimp/client/app/android/java/res/drawable-hdpi/btn_menu.png new file mode 100644 index 0000000..d752ea2 --- /dev/null +++ b/blimp/client/app/android/java/res/drawable-hdpi/btn_menu.png Binary files differ
diff --git a/blimp/client/app/android/java/res/drawable-mdpi/btn_menu.png b/blimp/client/app/android/java/res/drawable-mdpi/btn_menu.png new file mode 100644 index 0000000..bbb4a3d5 --- /dev/null +++ b/blimp/client/app/android/java/res/drawable-mdpi/btn_menu.png Binary files differ
diff --git a/blimp/client/app/android/java/res/drawable-xhdpi/btn_menu.png b/blimp/client/app/android/java/res/drawable-xhdpi/btn_menu.png new file mode 100644 index 0000000..3b23a150e --- /dev/null +++ b/blimp/client/app/android/java/res/drawable-xhdpi/btn_menu.png Binary files differ
diff --git a/blimp/client/app/android/java/res/drawable-xxhdpi/btn_menu.png b/blimp/client/app/android/java/res/drawable-xxhdpi/btn_menu.png new file mode 100644 index 0000000..8e8ed4c8 --- /dev/null +++ b/blimp/client/app/android/java/res/drawable-xxhdpi/btn_menu.png Binary files differ
diff --git a/blimp/client/app/android/java/res/drawable-xxxhdpi/btn_menu.png b/blimp/client/app/android/java/res/drawable-xxxhdpi/btn_menu.png new file mode 100644 index 0000000..ce4f84d --- /dev/null +++ b/blimp/client/app/android/java/res/drawable-xxxhdpi/btn_menu.png Binary files differ
diff --git a/blimp/client/app/android/java/res/layout/blimp_main.xml b/blimp/client/app/android/java/res/layout/blimp_main.xml index a0a2354..fca99bc 100644 --- a/blimp/client/app/android/java/res/layout/blimp_main.xml +++ b/blimp/client/app/android/java/res/layout/blimp_main.xml
@@ -45,6 +45,14 @@ android:background="?android:attr/selectableItemBackground" android:scaleType="center" android:src="@drawable/btn_reload" /> + <ImageButton + android:id="@+id/menu_button" + android:layout_width="wrap_content" + android:layout_height="48dp" + android:paddingEnd="4dp" + android:layout_gravity="center" + android:background="@null" + android:src="@drawable/btn_menu" /> </org.chromium.blimp.toolbar.Toolbar> <!-- Content Area -->
diff --git a/blimp/client/app/android/java/res/layout/toolbar_popup_item.xml b/blimp/client/app/android/java/res/layout/toolbar_popup_item.xml new file mode 100644 index 0000000..026be2f3 --- /dev/null +++ b/blimp/client/app/android/java/res/layout/toolbar_popup_item.xml
@@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- 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. --> + +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="?android:attr/listPreferredItemHeightSmall" + android:paddingStart="?android:attr/listPreferredItemPaddingLeft" + android:gravity="center_vertical" + android:background="@color/default_white_background" + android:textColor="@color/default_dark_text_color" + android:textSize="16sp" /> \ No newline at end of file
diff --git a/blimp/client/app/android/java/res/values/colors.xml b/blimp/client/app/android/java/res/values/colors.xml new file mode 100644 index 0000000..93528bf --- /dev/null +++ b/blimp/client/app/android/java/res/values/colors.xml
@@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- 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. --> + +<resources> + <!-- Common colors --> + <color name="default_dark_text_color">#333</color> + <color name="default_white_background">#FAFAFA</color> +</resources>
diff --git a/blimp/client/app/android/java/res/values/dimens.xml b/blimp/client/app/android/java/res/values/dimens.xml new file mode 100644 index 0000000..1d01465 --- /dev/null +++ b/blimp/client/app/android/java/res/values/dimens.xml
@@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- 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. --> + +<resources> + <dimen name="toolbar_popup_item_width">220dp</dimen> +</resources>
diff --git a/blimp/client/app/android/java/src/org/chromium/blimp/toolbar/Toolbar.java b/blimp/client/app/android/java/src/org/chromium/blimp/toolbar/Toolbar.java index 00678e7..bf5aa7a 100644 --- a/blimp/client/app/android/java/src/org/chromium/blimp/toolbar/Toolbar.java +++ b/blimp/client/app/android/java/src/org/chromium/blimp/toolbar/Toolbar.java
@@ -4,18 +4,24 @@ package org.chromium.blimp.toolbar; +import android.content.ActivityNotFoundException; import android.content.Context; +import android.content.Intent; import android.graphics.Bitmap; +import android.net.Uri; import android.text.TextUtils; import android.util.AttributeSet; import android.view.View; +import android.widget.AdapterView; +import android.widget.AdapterView.OnItemClickListener; +import android.widget.ArrayAdapter; import android.widget.ImageButton; import android.widget.LinearLayout; +import android.widget.ListPopupWindow; import android.widget.ProgressBar; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; - import org.chromium.blimp.R; import org.chromium.blimp.session.BlimpClientSession; @@ -26,10 +32,15 @@ @JNINamespace("blimp::client") public class Toolbar extends LinearLayout implements UrlBar.UrlBarObserver, View.OnClickListener { + private static final int ID_OPEN_IN_CHROME = 0; + private long mNativeToolbarPtr; + private Context mContext; private UrlBar mUrlBar; private ImageButton mReloadButton; + private ImageButton mMenuButton; + private ListPopupWindow mPopupMenu; private ProgressBar mProgressBar; /** @@ -45,6 +56,7 @@ */ public Toolbar(Context context, AttributeSet attrs) { super(context, attrs); + mContext = context; } /** @@ -109,6 +121,14 @@ mReloadButton = (ImageButton) findViewById(R.id.toolbar_reload_btn); mReloadButton.setOnClickListener(this); + mMenuButton = (ImageButton) findViewById(R.id.menu_button); + mMenuButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + showMenu(v); + } + }); + mProgressBar = (ProgressBar) findViewById(R.id.page_load_progress); mProgressBar.setVisibility(View.GONE); } @@ -151,6 +171,50 @@ } } + private void showMenu(View anchorView) { + if (mPopupMenu == null) { + initializeMenu(anchorView); + } + mPopupMenu.show(); + mPopupMenu.getListView().setDivider(null); + } + + /** + * Creates and initializes the app menu anchored to the specified view. + * @param anchorView The anchor of the {@link ListPopupWindow} + */ + private void initializeMenu(View anchorView) { + mPopupMenu = new ListPopupWindow(mContext); + mPopupMenu.setAdapter(new ArrayAdapter<String>(mContext, R.layout.toolbar_popup_item, + new String[] {mContext.getString(R.string.open_in_chrome)})); + mPopupMenu.setAnchorView(anchorView); + mPopupMenu.setWidth(getResources().getDimensionPixelSize(R.dimen.toolbar_popup_item_width)); + mPopupMenu.setVerticalOffset(-anchorView.getHeight()); + mPopupMenu.setModal(true); + mPopupMenu.setOnItemClickListener(new OnItemClickListener() { + @Override + public void onItemClick(AdapterView<?> parent, View view, int position, long id) { + if (position == ID_OPEN_IN_CHROME) { + openInChrome(); + } + mPopupMenu.dismiss(); + } + }); + } + + private void openInChrome() { + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(mUrlBar.getText().toString())); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setPackage("com.android.chrome"); + try { + mContext.startActivity(intent); + } catch (ActivityNotFoundException e) { + // Chrome is probably not installed, so try with the default browser + intent.setPackage(null); + mContext.startActivity(intent); + } + } + // Methods that are called by native via JNI. @CalledByNative private void onEngineSentUrl(String url) {
diff --git a/blimp/client/app/android/java/strings/android_blimp_strings.grd b/blimp/client/app/android/java/strings/android_blimp_strings.grd index 69b88965..aeebd7e 100644 --- a/blimp/client/app/android/java/strings/android_blimp_strings.grd +++ b/blimp/client/app/android/java/strings/android_blimp_strings.grd
@@ -142,6 +142,9 @@ <message name="IDS_NETWORK_DISCONNECTED" desc="Message for when a connection terminates."> Engine disconnected, reason: %1$s </message> + <message name="IDS_OPEN_IN_CHROME" desc="Opens the URL in Chrome."> + Open in Chrome + </message> </messages> </release> </grit>
diff --git a/blimp/client/app/blimp_discardable_memory_allocator.h b/blimp/client/app/blimp_discardable_memory_allocator.h index 382b09b..52b8c7e 100644 --- a/blimp/client/app/blimp_discardable_memory_allocator.h +++ b/blimp/client/app/blimp_discardable_memory_allocator.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/memory/discardable_memory_allocator.h" +#include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" namespace blimp {
diff --git a/blimp/docs/build.md b/blimp/docs/build.md index e5e20d7..9a470dd 100644 --- a/blimp/docs/build.md +++ b/blimp/docs/build.md
@@ -56,7 +56,7 @@ To add your own build preferences ```bash -gn args out-android/Debug +gn args out-linux/Debug ``` ## Adding new build arguments
diff --git a/blimp/net/blimp_message_multiplexer.h b/blimp/net/blimp_message_multiplexer.h index af4c4bb..046f796b 100644 --- a/blimp/net/blimp_message_multiplexer.h +++ b/blimp/net/blimp_message_multiplexer.h
@@ -6,6 +6,7 @@ #define BLIMP_NET_BLIMP_MESSAGE_MULTIPLEXER_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "blimp/common/proto/blimp_message.pb.h" #include "blimp/net/blimp_net_export.h"
diff --git a/blimp/net/connection_handler.h b/blimp/net/connection_handler.h index b9d37f61..5e54740 100644 --- a/blimp/net/connection_handler.h +++ b/blimp/net/connection_handler.h
@@ -5,6 +5,8 @@ #ifndef BLIMP_NET_CONNECTION_HANDLER_H_ #define BLIMP_NET_CONNECTION_HANDLER_H_ +#include "base/memory/scoped_ptr.h" + namespace blimp { class BlimpConnection;
diff --git a/build/all.gyp b/build/all.gyp index 79a67d1..19d08d0 100644 --- a/build/all.gyp +++ b/build/all.gyp
@@ -388,7 +388,6 @@ # ../chrome/test/mini_installer requires mini_installer. '../chrome/installer/mini_installer.gyp:mini_installer', '../chrome_elf/chrome_elf.gyp:chrome_elf_unittests', - '../content/content_shell_and_tests.gyp:copy_test_netscape_plugin', '../courgette/courgette.gyp:courgette_unittests', '../sandbox/sandbox.gyp:sbox_integration_tests', '../sandbox/sandbox.gyp:sbox_unittests', @@ -1040,7 +1039,6 @@ '../components/components_tests.gyp:components_unittests', '../content/content_shell_and_tests.gyp:content_browsertests', '../content/content_shell_and_tests.gyp:content_unittests', - '../content/content_shell_and_tests.gyp:copy_test_netscape_plugin', # ../chrome/test/mini_installer requires mini_installer. '../chrome/installer/mini_installer.gyp:mini_installer', '../courgette/courgette.gyp:courgette_unittests',
diff --git a/build/android/BUILD.gn b/build/android/BUILD.gn index af819ed..73b25cd 100644 --- a/build/android/BUILD.gn +++ b/build/android/BUILD.gn
@@ -84,25 +84,30 @@ ] } +group("devil_py") { + data = [ + "devil_chromium.json", + "devil_chromium.py", + "//third_party/android_tools/sdk/build-tools/23.0.1/aapt", + "//third_party/android_tools/sdk/build-tools/23.0.1/dexdump", + "//third_party/android_tools/sdk/build-tools/23.0.1/lib/libc++.so", + "//third_party/android_tools/sdk/build-tools/23.0.1/split-select", + "//third_party/android_tools/sdk/platform-tools/adb", + "//third_party/catapult/catapult_base/catapult_base/", + "//third_party/catapult/dependency_manager/dependency_manager/", + "//third_party/catapult/third_party/gsutil/", + "//third_party/catapult/devil/devil/", + ] +} + group("test_runner_py") { - _py_files = read_file("test_runner.pydeps", "list lines") - - # Filter out comments. - set_sources_assignment_filter([ "#*" ]) - sources = _py_files - - data = sources + [ - "devil_chromium.json", - "//third_party/android_tools/sdk/build-tools/23.0.1/aapt", - "//third_party/android_tools/sdk/build-tools/23.0.1/dexdump", - "//third_party/android_tools/sdk/build-tools/23.0.1/lib/libc++.so", - "//third_party/android_tools/sdk/build-tools/23.0.1/split-select", - "//third_party/android_tools/sdk/platform-tools/adb", - "//third_party/catapult/third_party/gsutil/", - "//third_party/catapult/devil/devil/devil_dependencies.json", - ] + data = [ + "test_runner.py", + "pylib/", + "//build/util/lib/common/", + ] data_deps = [ - "//tools/swarming_client:isolate_py", + ":devil_py", ] }
diff --git a/build/android/test_runner.pydeps b/build/android/test_runner.pydeps deleted file mode 100644 index 1f4a559b..0000000 --- a/build/android/test_runner.pydeps +++ /dev/null
@@ -1,153 +0,0 @@ -# Generated by //build/print_python_deps.py -# root: //build/android -# target: //build/android/test_runner.py -../../third_party/appurify-python/src/appurify/__init__.py -../../third_party/appurify-python/src/appurify/api.py -../../third_party/appurify-python/src/appurify/constants.py -../../third_party/appurify-python/src/appurify/utils.py -../../third_party/catapult/catapult_base/catapult_base/__init__.py -../../third_party/catapult/catapult_base/catapult_base/cloud_storage.py -../../third_party/catapult/catapult_base/catapult_base/util.py -../../third_party/catapult/dependency_manager/dependency_manager/__init__.py -../../third_party/catapult/dependency_manager/dependency_manager/archive_info.py -../../third_party/catapult/dependency_manager/dependency_manager/base_config.py -../../third_party/catapult/dependency_manager/dependency_manager/cloud_storage_info.py -../../third_party/catapult/dependency_manager/dependency_manager/dependency_info.py -../../third_party/catapult/dependency_manager/dependency_manager/dependency_manager_util.py -../../third_party/catapult/dependency_manager/dependency_manager/exceptions.py -../../third_party/catapult/dependency_manager/dependency_manager/local_path_info.py -../../third_party/catapult/dependency_manager/dependency_manager/manager.py -../../third_party/catapult/dependency_manager/dependency_manager/uploader.py -../../third_party/catapult/devil/devil/__init__.py -../../third_party/catapult/devil/devil/android/__init__.py -../../third_party/catapult/devil/devil/android/apk_helper.py -../../third_party/catapult/devil/devil/android/battery_utils.py -../../third_party/catapult/devil/devil/android/constants/__init__.py -../../third_party/catapult/devil/devil/android/constants/file_system.py -../../third_party/catapult/devil/devil/android/decorators.py -../../third_party/catapult/devil/devil/android/device_blacklist.py -../../third_party/catapult/devil/devil/android/device_errors.py -../../third_party/catapult/devil/devil/android/device_list.py -../../third_party/catapult/devil/devil/android/device_signal.py -../../third_party/catapult/devil/devil/android/device_temp_file.py -../../third_party/catapult/devil/devil/android/device_utils.py -../../third_party/catapult/devil/devil/android/flag_changer.py -../../third_party/catapult/devil/devil/android/forwarder.py -../../third_party/catapult/devil/devil/android/install_commands.py -../../third_party/catapult/devil/devil/android/logcat_monitor.py -../../third_party/catapult/devil/devil/android/md5sum.py -../../third_party/catapult/devil/devil/android/ports.py -../../third_party/catapult/devil/devil/android/sdk/__init__.py -../../third_party/catapult/devil/devil/android/sdk/aapt.py -../../third_party/catapult/devil/devil/android/sdk/adb_wrapper.py -../../third_party/catapult/devil/devil/android/sdk/build_tools.py -../../third_party/catapult/devil/devil/android/sdk/gce_adb_wrapper.py -../../third_party/catapult/devil/devil/android/sdk/intent.py -../../third_party/catapult/devil/devil/android/sdk/keyevent.py -../../third_party/catapult/devil/devil/android/sdk/split_select.py -../../third_party/catapult/devil/devil/android/sdk/version_codes.py -../../third_party/catapult/devil/devil/android/valgrind_tools/__init__.py -../../third_party/catapult/devil/devil/android/valgrind_tools/base_tool.py -../../third_party/catapult/devil/devil/base_error.py -../../third_party/catapult/devil/devil/constants/__init__.py -../../third_party/catapult/devil/devil/constants/exit_codes.py -../../third_party/catapult/devil/devil/devil_env.py -../../third_party/catapult/devil/devil/utils/__init__.py -../../third_party/catapult/devil/devil/utils/cmd_helper.py -../../third_party/catapult/devil/devil/utils/file_utils.py -../../third_party/catapult/devil/devil/utils/host_utils.py -../../third_party/catapult/devil/devil/utils/lazy/__init__.py -../../third_party/catapult/devil/devil/utils/lazy/weak_constant.py -../../third_party/catapult/devil/devil/utils/parallelizer.py -../../third_party/catapult/devil/devil/utils/reraiser_thread.py -../../third_party/catapult/devil/devil/utils/run_tests_helper.py -../../third_party/catapult/devil/devil/utils/timeout_retry.py -../../third_party/catapult/devil/devil/utils/watchdog_timer.py -../../third_party/catapult/devil/devil/utils/zip_utils.py -../util/lib/common/perf_result_data_type.py -../util/lib/common/perf_tests_results_helper.py -../util/lib/common/unittest_util.py -devil_chromium.py -pylib/__init__.py -pylib/base/__init__.py -pylib/base/base_setup.py -pylib/base/base_test_result.py -pylib/base/base_test_runner.py -pylib/base/environment.py -pylib/base/environment_factory.py -pylib/base/test_collection.py -pylib/base/test_dispatcher.py -pylib/base/test_instance.py -pylib/base/test_instance_factory.py -pylib/base/test_run.py -pylib/base/test_run_factory.py -pylib/base/test_server.py -pylib/chrome_test_server_spawner.py -pylib/constants/__init__.py -pylib/constants/host_paths.py -pylib/gtest/__init__.py -pylib/gtest/gtest_test_instance.py -pylib/host_driven/__init__.py -pylib/host_driven/setup.py -pylib/host_driven/test_case.py -pylib/host_driven/test_info_collection.py -pylib/host_driven/test_runner.py -pylib/host_driven/tests_annotations.py -pylib/instrumentation/__init__.py -pylib/instrumentation/instrumentation_parser.py -pylib/instrumentation/instrumentation_test_instance.py -pylib/instrumentation/json_perf_parser.py -pylib/instrumentation/setup.py -pylib/instrumentation/test_jar.py -pylib/instrumentation/test_options.py -pylib/instrumentation/test_package.py -pylib/instrumentation/test_result.py -pylib/instrumentation/test_runner.py -pylib/junit/__init__.py -pylib/junit/setup.py -pylib/junit/test_dispatcher.py -pylib/junit/test_runner.py -pylib/linker/__init__.py -pylib/linker/setup.py -pylib/linker/test_case.py -pylib/linker/test_runner.py -pylib/local/__init__.py -pylib/local/device/__init__.py -pylib/local/device/local_device_environment.py -pylib/local/device/local_device_gtest_run.py -pylib/local/device/local_device_instrumentation_test_run.py -pylib/local/device/local_device_test_run.py -pylib/local/local_test_server_spawner.py -pylib/monkey/__init__.py -pylib/monkey/setup.py -pylib/monkey/test_options.py -pylib/monkey/test_runner.py -pylib/perf/__init__.py -pylib/perf/setup.py -pylib/perf/test_options.py -pylib/perf/test_runner.py -pylib/remote/__init__.py -pylib/remote/device/__init__.py -pylib/remote/device/appurify_constants.py -pylib/remote/device/appurify_sanitized.py -pylib/remote/device/remote_device_environment.py -pylib/remote/device/remote_device_gtest_run.py -pylib/remote/device/remote_device_helper.py -pylib/remote/device/remote_device_instrumentation_test_run.py -pylib/remote/device/remote_device_test_run.py -pylib/remote/device/remote_device_uirobot_test_run.py -pylib/results/__init__.py -pylib/results/flakiness_dashboard/__init__.py -pylib/results/flakiness_dashboard/json_results_generator.py -pylib/results/flakiness_dashboard/results_uploader.py -pylib/results/json_results.py -pylib/results/report_results.py -pylib/uirobot/__init__.py -pylib/uirobot/uirobot_test_instance.py -pylib/utils/__init__.py -pylib/utils/isolator.py -pylib/utils/proguard.py -pylib/utils/repo_utils.py -pylib/utils/test_environment.py -pylib/valgrind_tools.py -test_runner.py
diff --git a/build/args/headless.gn b/build/args/headless.gn new file mode 100644 index 0000000..29260e3 --- /dev/null +++ b/build/args/headless.gn
@@ -0,0 +1,23 @@ +# GN args template for the Headless Chrome library +# +# Add import to arg.gn in out directory and run gn gen on the directory to use. +# E.g. for out directory out/foo: +# echo 'import("//build/args/headless.gn")' > out/foo/args.gn +# gn gen out/foo +# +# Use gn args to add your own build preference args. + +use_ozone = true + +enable_basic_printing = false +enable_print_preview = false +enable_remoting = false +use_alsa = false +use_ash = false +use_cups = false +use_dbus = false +use_gconf = false +use_gio = false +use_kerberos = false +use_pulseaudio = false +use_udev = false
diff --git a/build/common.gypi b/build/common.gypi index ecf711f3..75cf5484 100644 --- a/build/common.gypi +++ b/build/common.gypi
@@ -1353,12 +1353,12 @@ 'android_lint%': 1, # Although base/allocator lets you select a heap library via an - # environment variable, the libcmt shim it uses sometimes gets in - # the way. To disable it entirely, and switch to normal msvcrt, do e.g. + # environment variable, the shim it uses sometimes gets in the way. + # To disable it entirely, and switch to normal msvcrt, do e.g. # 'win_use_allocator_shim': 0, # 'win_release_RuntimeLibrary': 2 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build. - 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt + 'win_use_allocator_shim%': 1, # 1 = shim allocator; 0 = msvcrt # Enables the unified allocator shim (experimental) which routes all the # alloc calls to base/. Right now is supported on Linux Desktop only. @@ -2016,11 +2016,7 @@ },{ 'winsdk_arch%': '<(target_arch)', }], - ['component=="shared_library" or MSVS_VERSION == "2015"', { - # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT - # and we are hoping to be able to remove it if an additional feature - # lands in the 2015 CRT API. For now, don't shim and revisit once - # VS2015 is RTM: http://crbug.com/481611. + ['component=="shared_library"', { 'win_use_allocator_shim%': 0, }], ['component=="static_library"', { @@ -2857,11 +2853,6 @@ }], # fieldtrial_testing_like_official_build==0 and branding!="Chrome" ['OS=="win"', { 'defines': ['NO_TCMALLOC'], - 'conditions': [ - ['win_use_allocator_shim==1', { - 'defines': ['ALLOCATOR_SHIM'], - }], - ], }], ['asan==1', { 'defines': [ @@ -3529,8 +3520,10 @@ 'WTF_USE_DYNAMIC_ANNOTATIONS=1', ], }], - ['OS=="win"', { - 'defines': ['NO_TCMALLOC'], + ['OS=="win" and win_use_allocator_shim==1', { + 'defines': [ + 'ALLOCATOR_SHIM' + ], }], # _FORTIFY_SOURCE isn't really supported by Clang now, see # http://llvm.org/bugs/show_bug.cgi?id=16821. @@ -5911,14 +5904,10 @@ '/ignore:4199', '/ignore:4221', '/nxcompat', + '/largeaddressaware', ], }, 'conditions': [ - ['syzyasan==0', { - 'VCLinkerTool': { - 'AdditionalOptions': ['/largeaddressaware'], - }, - }], ['asan==1', { # TODO(asan/win): Move this down into the general # win-target_defaults section once the 64-bit asan runtime
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni index 9a24f4a..a3d338f1 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni
@@ -906,7 +906,7 @@ # enable_errorprone: If true, enables the errorprone compiler. # enable_incremental_javac: Overrides the global enable_incremental_javac. # main_class: When specified, a wrapper script is created within -# $target_out_dir/bin to launch the binary with the given class as the +# $root_build_dir/bin to launch the binary with the given class as the # entrypoint. # wrapper_script_args: List of additional arguments for the wrapper script. #
diff --git a/build/config/arm.gni b/build/config/arm.gni index 996694a..c83cf48 100644 --- a/build/config/arm.gni +++ b/build/config/arm.gni
@@ -2,7 +2,12 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -if (target_cpu == "arm") { +# These are primarily relevant in current_cpu == "arm" contexts, where +# ARM code is being compiled. But they can also be relevant in the +# host toolchain context when target_cpu == "arm", where a host-side +# build tool being built will change its behavior depending on the +# details of the target configuration. +if (target_cpu == "arm" || current_cpu == "arm") { declare_args() { # Version of the ARM processor when compiling on ARM. Ignored on non-ARM # platforms.
diff --git a/build/config/features.gni b/build/config/features.gni index d17e34c..72a5b5e 100644 --- a/build/config/features.gni +++ b/build/config/features.gni
@@ -16,7 +16,6 @@ import("//build/config/chrome_build.gni") import("//build/config/chromecast_build.gni") -import("//build/config/headless_build.gni") if (is_android) { import("//build/config/android/config.gni") } @@ -64,7 +63,7 @@ enable_autofill_dialog = !is_ios - enable_remoting = !is_ios && !is_chromecast && !is_headless + enable_remoting = !is_ios && !is_chromecast # Enable hole punching for the protected video. enable_video_hole = is_android @@ -94,11 +93,29 @@ # Note: this setting is ignored if is_chrome_branded. fieldtrial_testing_like_official_build = is_chrome_branded - use_cups = (is_desktop_linux || is_mac) && !is_chromecast && !is_headless + use_cups = (is_desktop_linux || is_mac) && !is_chromecast # Enables Wi-Fi Display functionality # WARNING: This enables MPEG Transport Stream (MPEG-TS) encoding! enable_wifi_display = false + + # libudev usage. This currently only affects the content layer. + use_udev = is_linux && !is_chromecast + + use_dbus = is_linux && !is_chromecast + + # Option controlling the use of GConf (the classic GNOME configuration + # system). + use_gconf = is_linux && !is_chromeos && !is_chromecast + + use_gio = is_linux && !is_chromeos && !is_chromecast + + # Enable basic printing support and UI. + enable_basic_printing = !is_chromeos && !is_chromecast && !is_ios + + # Enable printing with print preview. It does not imply + # enable_basic_printing. It's possible to build Chrome with preview only. + enable_print_preview = !is_android && !is_chromecast && !is_ios } # Additional dependent variables ----------------------------------------------- @@ -108,23 +125,12 @@ # 2: Use only CLD2. cld_version = 2 -# libudev usage. This currently only affects the content layer. -use_udev = is_linux && !is_chromecast && !is_headless - # Enable the spell checker. enable_spellcheck = !is_ios # Use the operating system's spellchecker rather than hunspell. use_browser_spellchecker = is_android || is_mac -# Enable basic printing support and UI. -enable_basic_printing = - !is_chromeos && !is_chromecast && !is_ios && !is_headless - -# Enable printing with print preview. It does not imply -# enable_basic_printing. It's possible to build Chrome with preview only. -enable_print_preview = !is_android && !is_chromecast && !is_ios && !is_headless - # Enables the use of CDMs in pepper plugins. enable_pepper_cdms = enable_plugins && (is_linux || is_mac || is_win) && !is_chromecast @@ -143,8 +149,6 @@ enable_web_speech = !is_android && !is_ios -use_dbus = is_linux && !is_chromecast && !is_headless - enable_task_manager = !is_ios && !is_android enable_themes = !is_android && !is_ios @@ -168,14 +172,8 @@ # Use brlapi from brltty for braille display support. use_brlapi = is_chromeos -# Option controlling the use of GConf (the classic GNOME configuration -# system). -use_gconf = is_linux && !is_chromeos && !is_chromecast && !is_headless - # Enable WebVR support by default on Android # Still requires command line flag to access API enable_webvr = is_android -use_gio = is_linux && !is_chromeos && !is_chromecast && !is_headless - enable_configuration_policy = !is_ios
diff --git a/build/config/headless_build.gni b/build/config/headless_build.gni deleted file mode 100644 index 1788b25a..0000000 --- a/build/config/headless_build.gni +++ /dev/null
@@ -1,8 +0,0 @@ -# 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. - -declare_args() { - # Configure the build for headless mode. See crbug.com/546953. - is_headless = false -}
diff --git a/build/config/ui.gni b/build/config/ui.gni index 1df101f1..43d53a25 100644 --- a/build/config/ui.gni +++ b/build/config/ui.gni
@@ -15,17 +15,16 @@ # to set up feature flags. import("//build/config/chromecast_build.gni") -import("//build/config/headless_build.gni") declare_args() { # Indicates if Ash is enabled. Ash is the Aura Shell which provides a # desktop-like environment for Aura. Requires use_aura = true - use_ash = is_chromeos && !is_chromecast && !is_headless + use_ash = is_chromeos && !is_chromecast # Indicates if Ozone is enabled. Ozone is a low-level library layer for Linux # that does not require X11. Enabling this feature disables use of glib, x11, # Pango, and Cairo. Default to false on non-Chromecast builds. - use_ozone = (is_chromecast || is_headless) && !is_android + use_ozone = is_chromecast && !is_android # Indicates if Aura is enabled. Aura is a low-level windowing library, sort # of a replacement for GDI or GTK.
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn index 9318b700..db3cdca 100644 --- a/build/config/win/BUILD.gn +++ b/build/config/win/BUILD.gn
@@ -224,15 +224,13 @@ ldflags = [ "/MACHINE:X86", "/SAFESEH", # Not compatible with x64 so use only for x86. + "/largeaddressaware", ] lib_dirs = [ "$windows_sdk_path\Lib\winv6.3\um\x86", "$visual_studio_path\VC\lib", "$visual_studio_path\VC\atlmfc\lib", ] - if (!is_syzyasan) { - ldflags += [ "/largeaddressaware" ] - } } }
diff --git a/build/gn_helpers.py b/build/gn_helpers.py index dc0820a..f1037720 100644 --- a/build/gn_helpers.py +++ b/build/gn_helpers.py
@@ -280,7 +280,7 @@ returns true. Otherwise, returns false and the current position is unchanged.""" end = self.cur + len(constant) - if end >= len(self.input): + if end > len(self.input): return False # Not enough room. if self.input[self.cur:end] == constant: self.cur = end
diff --git a/build/gn_helpers_unittest.py b/build/gn_helpers_unittest.py index a493f67..72123f9 100644 --- a/build/gn_helpers_unittest.py +++ b/build/gn_helpers_unittest.py
@@ -27,6 +27,13 @@ parser = gn_helpers.GNValueParser('123 456') parser.Parse() + def test_ParseBool(self): + parser = gn_helpers.GNValueParser('true') + self.assertEqual(parser.Parse(), True) + + parser = gn_helpers.GNValueParser('false') + self.assertEqual(parser.Parse(), False) + def test_ParseNumber(self): parser = gn_helpers.GNValueParser('123') self.assertEqual(parser.ParseNumber(), 123)
diff --git a/build/print_python_deps.py b/build/print_python_deps.py deleted file mode 100755 index da83684..0000000 --- a/build/print_python_deps.py +++ /dev/null
@@ -1,70 +0,0 @@ -#!/usr/bin/env python -# 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. - -"""Prints all non-system dependencies for the given module. - -The primary use-case for this script is to genererate the list of python modules -required for .isolate files. -""" - -import argparse -import imp -import os -import pipes -import sys - -# Don't use any helper modules, or else they will end up in the results. - - -_SRC_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) - - -def ComputePythonDependencies(root): - """Gets the paths of imported non-system python modules. - - A path is assumed to be a "system" import if it is outside of chromium's - src/. The paths will be relative to the current directory. - """ - module_paths = (m.__file__ for m in sys.modules.values() - if m and hasattr(m, '__file__')) - - src_paths = set() - for path in module_paths: - if path == __file__: - continue - path = os.path.abspath(path) - if not path.startswith(_SRC_ROOT): - continue - - if path.endswith('.pyc'): - path = path[:-1] - src_paths.add(os.path.relpath(path, root)) - - return sorted(src_paths) - - -def main(): - parser = argparse.ArgumentParser( - description='Prints all non-system dependencies for the given module.') - parser.add_argument('module', - help='The python module to analyze.') - parser.add_argument('--root', default='.', - help='Directory to make paths relative to.') - parser.add_argument('--output', - help='Write output to a file rather than stdout.') - options = parser.parse_args() - sys.path.append(os.path.dirname(options.module)) - imp.load_source('NAME', options.module) - out = open(options.output, 'w') if options.output else sys.stdout - with out: - out.write('# Generated by //build/print_python_deps.py\n') - out.write('# root: //%s\n' % os.path.relpath(options.root, _SRC_ROOT)) - out.write('# target: //%s\n' % os.path.relpath(options.module, _SRC_ROOT)) - for path in ComputePythonDependencies(options.root): - out.write(path + '\n') - - -if __name__ == '__main__': - sys.exit(main())
diff --git a/build/secondary/tools/swarming_client/BUILD.gn b/build/secondary/tools/swarming_client/BUILD.gn deleted file mode 100644 index f486052..0000000 --- a/build/secondary/tools/swarming_client/BUILD.gn +++ /dev/null
@@ -1,14 +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. - -group("isolate_py") { - _py_files = - read_file("//build/secondary/tools/swarming_client/isolate.pydeps", - "list lines") - - # Filter out comments. - set_sources_assignment_filter([ "#*" ]) - sources = _py_files - data = sources -}
diff --git a/build/secondary/tools/swarming_client/isolate.pydeps b/build/secondary/tools/swarming_client/isolate.pydeps deleted file mode 100644 index 22af37b..0000000 --- a/build/secondary/tools/swarming_client/isolate.pydeps +++ /dev/null
@@ -1,118 +0,0 @@ -# Generated by //build/print_python_deps.py -# root: //tools/swarming_client -# target: //tools/swarming_client/isolate.py -auth.py -isolate.py -isolate_format.py -isolated_format.py -isolateserver.py -run_isolated.py -third_party/__init__.py -third_party/colorama/__init__.py -third_party/colorama/ansi.py -third_party/colorama/ansitowin32.py -third_party/colorama/initialise.py -third_party/colorama/win32.py -third_party/colorama/winterm.py -third_party/depot_tools/__init__.py -third_party/depot_tools/fix_encoding.py -third_party/depot_tools/subcommand.py -third_party/httplib2/__init__.py -third_party/httplib2/iri2uri.py -third_party/httplib2/socks.py -third_party/oauth2client/__init__.py -third_party/oauth2client/_helpers.py -third_party/oauth2client/_openssl_crypt.py -third_party/oauth2client/_pycrypto_crypt.py -third_party/oauth2client/client.py -third_party/oauth2client/clientsecrets.py -third_party/oauth2client/crypt.py -third_party/oauth2client/locked_file.py -third_party/oauth2client/multistore_file.py -third_party/oauth2client/util.py -third_party/pyasn1/pyasn1/__init__.py -third_party/pyasn1/pyasn1/codec/__init__.py -third_party/pyasn1/pyasn1/codec/ber/__init__.py -third_party/pyasn1/pyasn1/codec/ber/decoder.py -third_party/pyasn1/pyasn1/codec/ber/eoo.py -third_party/pyasn1/pyasn1/codec/cer/__init__.py -third_party/pyasn1/pyasn1/codec/cer/decoder.py -third_party/pyasn1/pyasn1/codec/der/__init__.py -third_party/pyasn1/pyasn1/codec/der/decoder.py -third_party/pyasn1/pyasn1/compat/__init__.py -third_party/pyasn1/pyasn1/compat/octets.py -third_party/pyasn1/pyasn1/debug.py -third_party/pyasn1/pyasn1/error.py -third_party/pyasn1/pyasn1/type/__init__.py -third_party/pyasn1/pyasn1/type/base.py -third_party/pyasn1/pyasn1/type/char.py -third_party/pyasn1/pyasn1/type/constraint.py -third_party/pyasn1/pyasn1/type/error.py -third_party/pyasn1/pyasn1/type/namedtype.py -third_party/pyasn1/pyasn1/type/namedval.py -third_party/pyasn1/pyasn1/type/tag.py -third_party/pyasn1/pyasn1/type/tagmap.py -third_party/pyasn1/pyasn1/type/univ.py -third_party/pyasn1/pyasn1/type/useful.py -third_party/requests/__init__.py -third_party/requests/adapters.py -third_party/requests/api.py -third_party/requests/auth.py -third_party/requests/certs.py -third_party/requests/compat.py -third_party/requests/cookies.py -third_party/requests/exceptions.py -third_party/requests/hooks.py -third_party/requests/models.py -third_party/requests/packages/__init__.py -third_party/requests/packages/urllib3/__init__.py -third_party/requests/packages/urllib3/_collections.py -third_party/requests/packages/urllib3/connection.py -third_party/requests/packages/urllib3/connectionpool.py -third_party/requests/packages/urllib3/contrib/__init__.py -third_party/requests/packages/urllib3/exceptions.py -third_party/requests/packages/urllib3/fields.py -third_party/requests/packages/urllib3/filepost.py -third_party/requests/packages/urllib3/packages/__init__.py -third_party/requests/packages/urllib3/packages/ordered_dict.py -third_party/requests/packages/urllib3/packages/six.py -third_party/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py -third_party/requests/packages/urllib3/poolmanager.py -third_party/requests/packages/urllib3/request.py -third_party/requests/packages/urllib3/response.py -third_party/requests/packages/urllib3/util/__init__.py -third_party/requests/packages/urllib3/util/connection.py -third_party/requests/packages/urllib3/util/request.py -third_party/requests/packages/urllib3/util/response.py -third_party/requests/packages/urllib3/util/retry.py -third_party/requests/packages/urllib3/util/ssl_.py -third_party/requests/packages/urllib3/util/timeout.py -third_party/requests/packages/urllib3/util/url.py -third_party/requests/sessions.py -third_party/requests/status_codes.py -third_party/requests/structures.py -third_party/requests/utils.py -third_party/rsa/rsa/__init__.py -third_party/rsa/rsa/_compat.py -third_party/rsa/rsa/common.py -third_party/rsa/rsa/core.py -third_party/rsa/rsa/key.py -third_party/rsa/rsa/pem.py -third_party/rsa/rsa/pkcs1.py -third_party/rsa/rsa/prime.py -third_party/rsa/rsa/randnum.py -third_party/rsa/rsa/transform.py -third_party/rsa/rsa/varblock.py -third_party/six/__init__.py -utils/__init__.py -utils/file_path.py -utils/fs.py -utils/logging_utils.py -utils/lru.py -utils/net.py -utils/oauth.py -utils/on_error.py -utils/subprocess42.py -utils/threading_utils.py -utils/tools.py -utils/zip_package.py
diff --git a/build/util/version.py b/build/util/version.py index 767412e9..4d3691a 100755 --- a/build/util/version.py +++ b/build/util/version.py
@@ -27,7 +27,7 @@ values_dict[key] = val -def fetch_values(file_list, is_official_build=None): +def fetch_values(file_list): """ Returns a dictionary of values to be used for substitution, populating the dictionary with KEYWORD=VALUE settings from the files in 'file_list'. @@ -37,7 +37,7 @@ OFFICIAL_BUILD """ CHROME_BUILD_TYPE = os.environ.get('CHROME_BUILD_TYPE') - if CHROME_BUILD_TYPE == '_official' or is_official_build: + if CHROME_BUILD_TYPE == '_official': official_build = '1' else: official_build = '0' @@ -113,10 +113,6 @@ help='Evaluate VAL after reading variables. Can be used ' 'to synthesize variables. e.g. -e \'PATCH_HI=int(' 'PATCH)/256.') - parser.add_argument('--official', action='store_true', - help='Whether the current build should be an official ' - 'build, used in addition to the environment ' - 'variable.') parser.add_argument('args', nargs=argparse.REMAINDER, help='For compatibility: INPUT and OUTPUT can be ' 'passed as positional arguments.') @@ -140,7 +136,7 @@ if options.args: parser.error('Unexpected arguments: %r' % options.args) - values = fetch_values(options.file, options.official) + values = fetch_values(options.file) for key, val in evals.iteritems(): values[key] = str(eval(val, globals(), values))
diff --git a/cc/debug/debug_rect_history.cc b/cc/debug/debug_rect_history.cc index cc8d12363..1659316 100644 --- a/cc/debug/debug_rect_history.cc +++ b/cc/debug/debug_rect_history.cc
@@ -39,16 +39,16 @@ debug_rects_.clear(); if (debug_state.show_touch_event_handler_rects) - SaveTouchEventHandlerRects(root_layer); + SaveTouchEventHandlerRects(root_layer->layer_tree_impl()); if (debug_state.show_wheel_event_handler_rects) SaveWheelEventHandlerRects(root_layer); if (debug_state.show_scroll_event_handler_rects) - SaveScrollEventHandlerRects(root_layer); + SaveScrollEventHandlerRects(root_layer->layer_tree_impl()); if (debug_state.show_non_fast_scrollable_rects) - SaveNonFastScrollableRects(root_layer); + SaveNonFastScrollableRects(root_layer->layer_tree_impl()); if (debug_state.show_paint_rects) SavePaintRects(root_layer); @@ -157,10 +157,10 @@ } } -void DebugRectHistory::SaveTouchEventHandlerRects(LayerImpl* layer) { - LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { - SaveTouchEventHandlerRectsCallback(layer); - }); +void DebugRectHistory::SaveTouchEventHandlerRects(LayerTreeImpl* tree_impl) { + LayerTreeHostCommon::CallFunctionForEveryLayer( + tree_impl, + [this](LayerImpl* layer) { SaveTouchEventHandlerRectsCallback(layer); }); } void DebugRectHistory::SaveTouchEventHandlerRectsCallback(LayerImpl* layer) { @@ -196,10 +196,10 @@ gfx::Rect(inner_viewport->bounds())))); } -void DebugRectHistory::SaveScrollEventHandlerRects(LayerImpl* layer) { - LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { - SaveScrollEventHandlerRectsCallback(layer); - }); +void DebugRectHistory::SaveScrollEventHandlerRects(LayerTreeImpl* tree_impl) { + LayerTreeHostCommon::CallFunctionForEveryLayer( + tree_impl, + [this](LayerImpl* layer) { SaveScrollEventHandlerRectsCallback(layer); }); } void DebugRectHistory::SaveScrollEventHandlerRectsCallback(LayerImpl* layer) { @@ -212,10 +212,10 @@ gfx::Rect(layer->bounds())))); } -void DebugRectHistory::SaveNonFastScrollableRects(LayerImpl* layer) { - LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) { - SaveNonFastScrollableRectsCallback(layer); - }); +void DebugRectHistory::SaveNonFastScrollableRects(LayerTreeImpl* tree_impl) { + LayerTreeHostCommon::CallFunctionForEveryLayer( + tree_impl, + [this](LayerImpl* layer) { SaveNonFastScrollableRectsCallback(layer); }); } void DebugRectHistory::SaveNonFastScrollableRectsCallback(LayerImpl* layer) {
diff --git a/cc/debug/debug_rect_history.h b/cc/debug/debug_rect_history.h index 62cf032..b06dc58 100644 --- a/cc/debug/debug_rect_history.h +++ b/cc/debug/debug_rect_history.h
@@ -15,6 +15,7 @@ class LayerImpl; class LayerTreeDebugState; +class LayerTreeImpl; // There are currently six types of debug rects: // @@ -84,12 +85,12 @@ const LayerImplList& render_surface_layer_list); void SaveScreenSpaceRects( const LayerImplList& render_surface_layer_list); - void SaveTouchEventHandlerRects(LayerImpl* layer); + void SaveTouchEventHandlerRects(LayerTreeImpl* layer); void SaveTouchEventHandlerRectsCallback(LayerImpl* layer); void SaveWheelEventHandlerRects(LayerImpl* layer); - void SaveScrollEventHandlerRects(LayerImpl* layer); + void SaveScrollEventHandlerRects(LayerTreeImpl* layer); void SaveScrollEventHandlerRectsCallback(LayerImpl* layer); - void SaveNonFastScrollableRects(LayerImpl* layer); + void SaveNonFastScrollableRects(LayerTreeImpl* layer); void SaveNonFastScrollableRectsCallback(LayerImpl* layer); void SaveLayerAnimationBoundsRects( const LayerImplList& render_surface_layer_list);
diff --git a/cc/debug/devtools_instrumentation.h b/cc/debug/devtools_instrumentation.h index 4fc601e..5794b899 100644 --- a/cc/debug/devtools_instrumentation.h +++ b/cc/debug/devtools_instrumentation.h
@@ -8,6 +8,7 @@ #include <stdint.h> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_argument.h"
diff --git a/cc/debug/invalidation_benchmark.cc b/cc/debug/invalidation_benchmark.cc index 0cd68cb..3114cd2 100644 --- a/cc/debug/invalidation_benchmark.cc +++ b/cc/debug/invalidation_benchmark.cc
@@ -63,16 +63,15 @@ } void InvalidationBenchmark::DidUpdateLayers(LayerTreeHost* host) { - LayerTreeHostCommon::CallFunctionForSubtree( - host->root_layer(), - [this](Layer* layer) { layer->RunMicroBenchmark(this); }); + LayerTreeHostCommon::CallFunctionForEveryLayer( + host, [this](Layer* layer) { layer->RunMicroBenchmark(this); }); } void InvalidationBenchmark::RunOnLayer(PictureLayer* layer) { switch (mode_) { case FIXED_SIZE: { // Invalidation with a random position and fixed size. - gfx::Rect visible_layer_rect = layer->visible_layer_rect(); + gfx::Rect visible_layer_rect = layer->visible_layer_rect_for_testing(); int x = LCGRandom() * (visible_layer_rect.width() - width_); int y = LCGRandom() * (visible_layer_rect.height() - height_); gfx::Rect invalidation_rect(x, y, width_, height_); @@ -86,7 +85,7 @@ } case RANDOM: { // Random invalidation inside the viewport. - gfx::Rect visible_layer_rect = layer->visible_layer_rect(); + gfx::Rect visible_layer_rect = layer->visible_layer_rect_for_testing(); int x_min = LCGRandom() * visible_layer_rect.width(); int x_max = LCGRandom() * visible_layer_rect.width(); int y_min = LCGRandom() * visible_layer_rect.height(); @@ -101,7 +100,7 @@ } case VIEWPORT: { // Invalidate entire viewport. - layer->SetNeedsDisplayRect(layer->visible_layer_rect()); + layer->SetNeedsDisplayRect(layer->visible_layer_rect_for_testing()); break; } }
diff --git a/cc/debug/rasterize_and_record_benchmark.cc b/cc/debug/rasterize_and_record_benchmark.cc index 74220e7..12c3bf96 100644 --- a/cc/debug/rasterize_and_record_benchmark.cc +++ b/cc/debug/rasterize_and_record_benchmark.cc
@@ -70,9 +70,8 @@ void RasterizeAndRecordBenchmark::DidUpdateLayers(LayerTreeHost* host) { host_ = host; - LayerTreeHostCommon::CallFunctionForSubtree( - host->root_layer(), - [this](Layer* layer) { layer->RunMicroBenchmark(this); }); + LayerTreeHostCommon::CallFunctionForEveryLayer( + host, [this](Layer* layer) { layer->RunMicroBenchmark(this); }); DCHECK(!results_.get()); results_ = make_scoped_ptr(new base::DictionaryValue); @@ -115,7 +114,7 @@ if (!layer->DrawsContent()) return; - gfx::Rect visible_layer_rect = layer->visible_layer_rect(); + gfx::Rect visible_layer_rect = layer->visible_layer_rect_for_testing(); if (visible_layer_rect.IsEmpty()) return;
diff --git a/cc/debug/rasterize_and_record_benchmark_impl.cc b/cc/debug/rasterize_and_record_benchmark_impl.cc index 438acd83..f44ba080 100644 --- a/cc/debug/rasterize_and_record_benchmark_impl.cc +++ b/cc/debug/rasterize_and_record_benchmark_impl.cc
@@ -53,9 +53,9 @@ content_rect.height())); SkCanvas canvas(bitmap); - const bool include_images = true; raster_source->PlaybackToCanvas(&canvas, content_rect, content_rect, - contents_scale, include_images); + contents_scale, + RasterSource::PlaybackSettings()); timer.NextLap(); } while (!timer.HasTimeLimitExpired()); @@ -125,8 +125,8 @@ void RasterizeAndRecordBenchmarkImpl::DidCompleteCommit( LayerTreeHostImpl* host) { - LayerTreeHostCommon::CallFunctionForSubtree( - host->RootLayer(), [this](LayerImpl* layer) { + LayerTreeHostCommon::CallFunctionForEveryLayer( + host->active_tree(), [this](LayerImpl* layer) { rasterize_results_.total_layers++; layer->RunMicroBenchmark(this); });
diff --git a/cc/debug/rendering_stats.h b/cc/debug/rendering_stats.h index 9846915..a99d28d 100644 --- a/cc/debug/rendering_stats.h +++ b/cc/debug/rendering_stats.h
@@ -9,6 +9,7 @@ #include <vector> +#include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/trace_event/trace_event_argument.h" #include "base/values.h"
diff --git a/cc/debug/traced_display_item_list.h b/cc/debug/traced_display_item_list.h index b06500da..71cf664 100644 --- a/cc/debug/traced_display_item_list.h +++ b/cc/debug/traced_display_item_list.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/trace_event/trace_event.h" #include "cc/debug/traced_value.h"
diff --git a/cc/layers/layer.h b/cc/layers/layer.h index a4745f6..d217ab9d 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h
@@ -469,7 +469,9 @@ return should_flatten_transform_from_property_tree_; } - const gfx::Rect& visible_layer_rect() const { return visible_layer_rect_; } + const gfx::Rect& visible_layer_rect_for_testing() const { + return visible_layer_rect_; + } void set_visible_layer_rect(const gfx::Rect& rect) { visible_layer_rect_ = rect; }
diff --git a/cc/layers/layer_proto_converter.cc b/cc/layers/layer_proto_converter.cc index f4c097f68..b7602a2 100644 --- a/cc/layers/layer_proto_converter.cc +++ b/cc/layers/layer_proto_converter.cc
@@ -80,8 +80,8 @@ // static void LayerProtoConverter::RecursivelyFindAllLayers(Layer* root_layer, LayerIdMap* layer_id_map) { - LayerTreeHostCommon::CallFunctionForSubtree( - root_layer, + LayerTreeHostCommon::CallFunctionForEveryLayer( + root_layer->layer_tree_host(), [layer_id_map](Layer* layer) { (*layer_id_map)[layer->id()] = layer; }); }
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc index 4304928..9daded8 100644 --- a/cc/layers/picture_layer.cc +++ b/cc/layers/picture_layer.cc
@@ -91,7 +91,6 @@ update_source_frame_number_ = layer_tree_host()->source_frame_number(); bool updated = Layer::Update(); - gfx::Rect update_rect = visible_layer_rect(); gfx::Size layer_size = paint_properties().bounds; recording_source_->SetBackgroundColor(SafeOpaqueBackgroundColor()); @@ -110,9 +109,8 @@ // for them. DCHECK(client_); updated |= recording_source_->UpdateAndExpandInvalidation( - client_, &last_updated_invalidation_, layer_size, update_rect, + client_, &last_updated_invalidation_, layer_size, update_source_frame_number_, RecordingSource::RECORD_NORMALLY); - last_updated_visible_layer_rect_ = visible_layer_rect(); if (updated) { SetNeedsPushProperties(); @@ -140,8 +138,8 @@ scoped_ptr<RecordingSource> recording_source(new RecordingSource); Region recording_invalidation; recording_source->UpdateAndExpandInvalidation( - client_, &recording_invalidation, layer_size, gfx::Rect(layer_size), - update_source_frame_number_, RecordingSource::RECORD_NORMALLY); + client_, &recording_invalidation, layer_size, update_source_frame_number_, + RecordingSource::RECORD_NORMALLY); scoped_refptr<RasterSource> raster_source = recording_source->CreateRasterSource(false); @@ -184,8 +182,6 @@ picture->mutable_recording_source(), layer_tree_host()->image_serialization_processor()); RegionToProto(last_updated_invalidation_, picture->mutable_invalidation()); - RectToProto(last_updated_visible_layer_rect_, - picture->mutable_last_updated_visible_layer_rect()); picture->set_is_mask(is_mask_); picture->set_nearest_neighbor(nearest_neighbor_); @@ -210,8 +206,6 @@ Region new_invalidation = RegionFromProto(picture.invalidation()); last_updated_invalidation_.Swap(&new_invalidation); - last_updated_visible_layer_rect_ = - ProtoToRect(picture.last_updated_visible_layer_rect()); is_mask_ = picture.is_mask(); nearest_neighbor_ = picture.nearest_neighbor();
diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h index ed777b0..a750c95 100644 --- a/cc/layers/picture_layer.h +++ b/cc/layers/picture_layer.h
@@ -67,9 +67,6 @@ devtools_instrumentation:: ScopedLayerObjectTracker instrumentation_object_tracker_; - // These store the last visible layer and invalidation computed via a call - // to Update(). - gfx::Rect last_updated_visible_layer_rect_; Region last_updated_invalidation_; int update_source_frame_number_;
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index 10903f0..94f51aa 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -457,12 +457,14 @@ FakeRasterSource::CreateFromRecordingSource(active_recording_source.get(), false); + RasterSource::PlaybackSettings playback_settings; + playback_settings.playback_to_shared_canvas = true; std::vector<SkRect>::const_iterator rect_iter = rects.begin(); for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) { MockCanvas mock_canvas(1000, 1000); - const bool include_images = true; - updated_active_raster_source->PlaybackToSharedCanvas( - &mock_canvas, (*tile_iter)->content_rect(), 1.0f, include_images); + const gfx::Rect& content_rect = (*tile_iter)->content_rect(); + updated_active_raster_source->PlaybackToCanvas( + &mock_canvas, content_rect, content_rect, 1.0f, playback_settings); // This test verifies that when drawing the contents of a specific tile // at content scale 1.0, the playback canvas never receives content from @@ -4390,7 +4392,7 @@ Region invalidation(layer_rect); recording_source->UpdateAndExpandInvalidation( - &client, &invalidation, layer_bounds, layer_rect, frame_number++, + &client, &invalidation, layer_bounds, frame_number++, RecordingSource::RECORD_NORMALLY); scoped_refptr<RasterSource> pending_raster_source = @@ -4454,7 +4456,7 @@ recording_source->SetNeedsDisplayRect(layer_rect); Region invalidation1; recording_source->UpdateAndExpandInvalidation( - &client, &invalidation1, layer_bounds, layer_rect, frame_number++, + &client, &invalidation1, layer_bounds, frame_number++, RecordingSource::RECORD_NORMALLY); scoped_refptr<RasterSource> raster_source1 = @@ -4474,7 +4476,7 @@ recording_source->SetNeedsDisplayRect(layer_rect); Region invalidation2; recording_source->UpdateAndExpandInvalidation( - &client, &invalidation2, layer_bounds, layer_rect, frame_number++, + &client, &invalidation2, layer_bounds, frame_number++, RecordingSource::RECORD_NORMALLY); scoped_refptr<RasterSource> raster_source2 =
diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc index 9c2275c..c57bb61e 100644 --- a/cc/layers/picture_layer_unittest.cc +++ b/cc/layers/picture_layer_unittest.cc
@@ -47,10 +47,6 @@ last_updated_invalidation_ = invalidation; } - void set_last_updated_visible_layer_rect(const gfx::Rect& rect) { - last_updated_visible_layer_rect_ = rect; - } - void set_update_source_frame_number(int number) { update_source_frame_number_ = number; } @@ -82,8 +78,6 @@ // Validate that the PictureLayer specific fields are properly set. EXPECT_TRUE(recording_source()->EqualsTo(*layer->recording_source())); - EXPECT_EQ(last_updated_visible_layer_rect_, - layer->last_updated_visible_layer_rect_); EXPECT_EQ(update_source_frame_number_, layer->update_source_frame_number_); EXPECT_EQ(is_mask_, layer->is_mask_); EXPECT_EQ(nearest_neighbor_, layer->nearest_neighbor_); @@ -123,7 +117,6 @@ Region region(gfx::Rect(14, 15, 16, 17)); layer->set_invalidation(region); - layer->set_last_updated_visible_layer_rect(gfx::Rect(5, 6, 7, 8)); layer->set_is_mask(true); layer->set_nearest_neighbor(true); @@ -402,8 +395,7 @@ gfx::Rect layer_rect(layer_bounds); Region invalidation(layer_rect); recording_source->UpdateAndExpandInvalidation( - client, &invalidation, layer_bounds, layer_rect, 1, - RecordingSource::RECORD_NORMALLY); + client, &invalidation, layer_bounds, 1, RecordingSource::RECORD_NORMALLY); // Layer is suitable for gpu rasterization by default. EXPECT_TRUE(recording_source->IsSuitableForGpuRasterization());
diff --git a/cc/layers/solid_color_layer_impl_unittest.cc b/cc/layers/solid_color_layer_impl_unittest.cc index 94c17df..5a9b11d 100644 --- a/cc/layers/solid_color_layer_impl_unittest.cc +++ b/cc/layers/solid_color_layer_impl_unittest.cc
@@ -15,6 +15,7 @@ #include "cc/test/fake_layer_tree_host.h" #include "cc/test/layer_test_common.h" #include "cc/test/test_task_graph_runner.h" +#include "cc/trees/layer_tree_host_common.h" #include "cc/trees/single_thread_proxy.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/cc/output/begin_frame_args.h b/cc/output/begin_frame_args.h index 6d85b40b..27496310 100644 --- a/cc/output/begin_frame_args.h +++ b/cc/output/begin_frame_args.h
@@ -7,6 +7,7 @@ #include "base/location.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/values.h" #include "cc/base/cc_export.h"
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 47b851fe..feef7e2 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc
@@ -649,11 +649,9 @@ SkMatrix local_matrix; local_matrix.setScale(scale.x(), scale.y()); - skia::RefPtr<SkImageFilter> filter_with_local_scale = - skia::AdoptRef(filter->newWithLocalMatrix(local_matrix)); SkPaint paint; - paint.setImageFilter(filter_with_local_scale.get()); + paint.setImageFilter(filter->makeWithLocalMatrix(local_matrix)); surface->getCanvas()->translate(-dst_rect.x(), -dst_rect.y()); surface->getCanvas()->drawImage(srcImage.get(), src_rect.x(), src_rect.y(), &paint); @@ -999,13 +997,9 @@ skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter( quad->filters, gfx::SizeF(contents_texture->size())); if (filter) { - skia::RefPtr<SkColorFilter> cf; - - { - SkColorFilter* colorfilter_rawptr = NULL; - filter->asColorFilter(&colorfilter_rawptr); - cf = skia::AdoptRef(colorfilter_rawptr); - } + SkColorFilter* colorfilter_rawptr = NULL; + filter->asColorFilter(&colorfilter_rawptr); + sk_sp<SkColorFilter> cf(colorfilter_rawptr); if (cf && cf->asColorMatrix(color_matrix) && !filter->getInput(0)) { // We have a single color matrix as a filter; apply it locally
diff --git a/cc/output/renderer.h b/cc/output/renderer.h index d22d509..880a139 100644 --- a/cc/output/renderer.h +++ b/cc/output/renderer.h
@@ -6,6 +6,7 @@ #define CC_OUTPUT_RENDERER_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "cc/base/cc_export.h" #include "cc/output/renderer_capabilities.h" #include "cc/output/renderer_settings.h"
diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc index 3769646..a975c797 100644 --- a/cc/output/software_renderer.cc +++ b/cc/output/software_renderer.cc
@@ -366,7 +366,8 @@ TRACE_EVENT0("cc", "SoftwareRenderer::DrawPictureQuad"); - const bool include_images = true; + RasterSource::PlaybackSettings playback_settings; + playback_settings.playback_to_shared_canvas = true; if (needs_transparency || disable_image_filtering) { // TODO(aelias): This isn't correct in all cases. We should detect these // cases and fall back to a persistent bitmap backing @@ -377,13 +378,13 @@ skia::OpacityFilterCanvas filtered_canvas(current_canvas_, quad->shared_quad_state->opacity, disable_image_filtering); - quad->raster_source->PlaybackToSharedCanvas( - &filtered_canvas, quad->content_rect, quad->contents_scale, - include_images); + quad->raster_source->PlaybackToCanvas( + &filtered_canvas, quad->content_rect, quad->content_rect, + quad->contents_scale, playback_settings); } else { - quad->raster_source->PlaybackToSharedCanvas( - current_canvas_, quad->content_rect, quad->contents_scale, - include_images); + quad->raster_source->PlaybackToCanvas( + current_canvas_, quad->content_rect, quad->content_rect, + quad->contents_scale, playback_settings); } } @@ -642,11 +643,9 @@ localM.setTranslate(SkIntToScalar(-quad->rect.origin().x()), SkIntToScalar(-quad->rect.origin().y())); localM.preScale(quad->filters_scale.x(), quad->filters_scale.y()); - skia::RefPtr<SkImageFilter> localIMF = - skia::AdoptRef(filter->newWithLocalMatrix(localM)); SkPaint paint; - paint.setImageFilter(localIMF.get()); + paint.setImageFilter(filter->makeWithLocalMatrix(localM)); surface->getCanvas()->drawBitmap(*to_filter, 0, 0, &paint); return skia::AdoptRef(surface->newImageSnapshot());
diff --git a/cc/output/texture_mailbox_deleter.h b/cc/output/texture_mailbox_deleter.h index f25661db..3ff91d4 100644 --- a/cc/output/texture_mailbox_deleter.h +++ b/cc/output/texture_mailbox_deleter.h
@@ -7,6 +7,7 @@ #include <vector> +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "cc/base/cc_export.h"
diff --git a/cc/playback/discardable_image_map_unittest.cc b/cc/playback/discardable_image_map_unittest.cc index 021987d..95c23a3b 100644 --- a/cc/playback/discardable_image_map_unittest.cc +++ b/cc/playback/discardable_image_map_unittest.cc
@@ -88,8 +88,8 @@ Region invalidation(visible_rect); recording_source.SetGenerateDiscardableImagesMetadata(true); recording_source.UpdateAndExpandInvalidation( - &content_layer_client, &invalidation, visible_rect.size(), visible_rect, - 1, RecordingSource::RECORD_NORMALLY); + &content_layer_client, &invalidation, visible_rect.size(), 1, + RecordingSource::RECORD_NORMALLY); DisplayItemList* display_list = recording_source.display_list(); DiscardableImageMap image_map; @@ -165,7 +165,7 @@ Region invalidation(visible_rect); recording_source.SetGenerateDiscardableImagesMetadata(true); recording_source.UpdateAndExpandInvalidation( - &content_layer_client, &invalidation, layer_size, visible_rect, 1, + &content_layer_client, &invalidation, layer_size, 1, RecordingSource::RECORD_NORMALLY); DisplayItemList* display_list = recording_source.display_list(); @@ -265,8 +265,8 @@ Region invalidation(visible_rect); recording_source.SetGenerateDiscardableImagesMetadata(true); recording_source.UpdateAndExpandInvalidation( - &content_layer_client, &invalidation, visible_rect.size(), visible_rect, - 1, RecordingSource::RECORD_NORMALLY); + &content_layer_client, &invalidation, visible_rect.size(), 1, + RecordingSource::RECORD_NORMALLY); DisplayItemList* display_list = recording_source.display_list(); DiscardableImageMap image_map; @@ -308,8 +308,8 @@ Region invalidation(visible_rect); recording_source.SetGenerateDiscardableImagesMetadata(true); recording_source.UpdateAndExpandInvalidation( - &content_layer_client, &invalidation, visible_rect.size(), visible_rect, - 1, RecordingSource::RECORD_NORMALLY); + &content_layer_client, &invalidation, visible_rect.size(), 1, + RecordingSource::RECORD_NORMALLY); DisplayItemList* display_list = recording_source.display_list(); DiscardableImageMap image_map;
diff --git a/cc/playback/raster_source.cc b/cc/playback/raster_source.cc index 93e987b9..ab0fd5a 100644 --- a/cc/playback/raster_source.cc +++ b/cc/playback/raster_source.cc
@@ -86,52 +86,27 @@ this); } -void RasterSource::PlaybackToSharedCanvas(SkCanvas* raster_canvas, - const gfx::Rect& canvas_rect, - float contents_scale, - bool include_images) const { - // TODO(vmpstr): This can be improved by plumbing whether the tile itself has - // discardable images. This way we would only pay for the hijack canvas if the - // tile actually needed it. - if (!include_images) { - SkipImageCanvas canvas(raster_canvas); - RasterCommon(&canvas, nullptr, canvas_rect, canvas_rect, contents_scale); - } else if (display_list_->MayHaveDiscardableImages()) { - const SkImageInfo& info = raster_canvas->imageInfo(); - ImageHijackCanvas canvas(info.width(), info.height(), - image_decode_controller_); - canvas.addCanvas(raster_canvas); - - RasterCommon(&canvas, nullptr, canvas_rect, canvas_rect, contents_scale); - } else { - RasterCommon(raster_canvas, nullptr, canvas_rect, canvas_rect, - contents_scale); - } -} - -void RasterSource::RasterForAnalysis(skia::AnalysisCanvas* canvas, - const gfx::Rect& canvas_rect, - float contents_scale) const { - RasterCommon(canvas, canvas, canvas_rect, canvas_rect, contents_scale); -} - void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas, const gfx::Rect& canvas_bitmap_rect, const gfx::Rect& canvas_playback_rect, float contents_scale, - bool include_images) const { - PrepareForPlaybackToCanvas(raster_canvas, canvas_bitmap_rect, - canvas_playback_rect, contents_scale); + const PlaybackSettings& settings) const { + if (!settings.playback_to_shared_canvas) { + PrepareForPlaybackToCanvas(raster_canvas, canvas_bitmap_rect, + canvas_playback_rect, contents_scale); + } - if (!include_images) { + if (settings.skip_images) { SkipImageCanvas canvas(raster_canvas); RasterCommon(&canvas, nullptr, canvas_bitmap_rect, canvas_playback_rect, contents_scale); - } else if (display_list_->MayHaveDiscardableImages()) { + } else if (settings.use_image_hijack_canvas && + display_list_->MayHaveDiscardableImages()) { const SkImageInfo& info = raster_canvas->imageInfo(); ImageHijackCanvas canvas(info.width(), info.height(), image_decode_controller_); canvas.addCanvas(raster_canvas); + RasterCommon(&canvas, nullptr, canvas_bitmap_rect, canvas_playback_rect, contents_scale); } else { @@ -282,7 +257,7 @@ layer_rect.Intersect(gfx::Rect(size_)); skia::AnalysisCanvas canvas(layer_rect.width(), layer_rect.height()); - RasterForAnalysis(&canvas, layer_rect, 1.0f); + RasterCommon(&canvas, &canvas, layer_rect, layer_rect, 1.0f); return canvas.GetColorIfSolid(color); } @@ -373,4 +348,9 @@ return true; } +RasterSource::PlaybackSettings::PlaybackSettings() + : playback_to_shared_canvas(false), + skip_images(false), + use_image_hijack_canvas(true) {} + } // namespace cc
diff --git a/cc/playback/raster_source.h b/cc/playback/raster_source.h index 8cfb43c..4931ee5 100644 --- a/cc/playback/raster_source.h +++ b/cc/playback/raster_source.h
@@ -28,6 +28,21 @@ class CC_EXPORT RasterSource : public base::trace_event::MemoryDumpProvider, public base::RefCountedThreadSafe<RasterSource> { public: + struct CC_EXPORT PlaybackSettings { + PlaybackSettings(); + + // If set to true, this indicates that the canvas has already been + // rasterized into. This means that the canvas cannot be cleared safely. + bool playback_to_shared_canvas; + + // If set to true, none of the images will be rasterized. + bool skip_images; + + // If set to true, we will use an image hijack canvas, which enables + // compositor image caching. + bool use_image_hijack_canvas; + }; + static scoped_refptr<RasterSource> CreateFromRecordingSource( const RecordingSource* other, bool can_use_lcd_text); @@ -47,15 +62,7 @@ const gfx::Rect& canvas_bitmap_rect, const gfx::Rect& canvas_playback_rect, float contents_scale, - bool include_images) const; - - // Similar to above, except that the canvas passed here can (or was already) - // rasterized into by another raster source. That is, it is not safe to clear - // the canvas or discard its underlying memory. - void PlaybackToSharedCanvas(SkCanvas* canvas, - const gfx::Rect& canvas_rect, - float contents_scale, - bool include_images) const; + const PlaybackSettings& settings) const; // Returns whether the given rect at given scale is of solid color in // this raster source, as well as the solid color value. @@ -146,12 +153,6 @@ ImageDecodeController* image_decode_controller_; private: - // Called when analyzing a tile. We can use AnalysisCanvas as - // SkPicture::AbortCallback, which allows us to early out from analysis. - void RasterForAnalysis(skia::AnalysisCanvas* canvas, - const gfx::Rect& canvas_rect, - float contents_scale) const; - void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback, const gfx::Rect& canvas_bitmap_rect,
diff --git a/cc/playback/raster_source_unittest.cc b/cc/playback/raster_source_unittest.cc index d88d49d6..7efbaf9 100644 --- a/cc/playback/raster_source_unittest.cc +++ b/cc/playback/raster_source_unittest.cc
@@ -285,9 +285,9 @@ SkCanvas canvas(bitmap); canvas.clear(SK_ColorTRANSPARENT); - const bool include_images = true; raster->PlaybackToCanvas(&canvas, canvas_rect, canvas_rect, - contents_scale, include_images); + contents_scale, + RasterSource::PlaybackSettings()); SkColor* pixels = reinterpret_cast<SkColor*>(bitmap.getPixels()); int num_pixels = bitmap.width() * bitmap.height(); @@ -337,9 +337,8 @@ // Playback the full rect which should make everything white. gfx::Rect raster_full_rect(content_bounds); gfx::Rect playback_rect(content_bounds); - const bool include_images = true; raster->PlaybackToCanvas(&canvas, raster_full_rect, playback_rect, - contents_scale, include_images); + contents_scale, RasterSource::PlaybackSettings()); { SkColor* pixels = reinterpret_cast<SkColor*>(bitmap.getPixels()); @@ -370,7 +369,7 @@ // that touches the edge pixels of the recording. playback_rect.Inset(1, 2, 0, 1); raster->PlaybackToCanvas(&canvas, raster_full_rect, playback_rect, - contents_scale, include_images); + contents_scale, RasterSource::PlaybackSettings()); SkColor* pixels = reinterpret_cast<SkColor*>(bitmap.getPixels()); int num_black = 0; @@ -433,9 +432,8 @@ // Playback the full rect which should make everything light gray (alpha=10). gfx::Rect raster_full_rect(content_bounds); gfx::Rect playback_rect(content_bounds); - const bool include_images = true; raster->PlaybackToCanvas(&canvas, raster_full_rect, playback_rect, - contents_scale, include_images); + contents_scale, RasterSource::PlaybackSettings()); { SkColor* pixels = reinterpret_cast<SkColor*>(bitmap.getPixels()); @@ -474,7 +472,7 @@ playback_rect = gfx::Rect(gfx::ScaleToCeiledSize(partial_bounds, contents_scale)); raster->PlaybackToCanvas(&canvas, raster_full_rect, playback_rect, - contents_scale, include_images); + contents_scale, RasterSource::PlaybackSettings()); // Test that the whole playback_rect was cleared and repainted with new alpha. SkColor* pixels = reinterpret_cast<SkColor*>(bitmap.getPixels()); @@ -513,9 +511,8 @@ bitmap.allocN32Pixels(canvas_rect.width(), canvas_rect.height()); SkCanvas canvas(bitmap); - const bool include_images = true; raster->PlaybackToCanvas(&canvas, canvas_rect, canvas_rect, contents_scale, - include_images); + RasterSource::PlaybackSettings()); SkColor* pixels = reinterpret_cast<SkColor*>(bitmap.getPixels()); int num_pixels = bitmap.width() * bitmap.height();
diff --git a/cc/playback/recording_source.cc b/cc/playback/recording_source.cc index cb3b737e..4cd414c0 100644 --- a/cc/playback/recording_source.cc +++ b/cc/playback/recording_source.cc
@@ -131,7 +131,6 @@ ContentLayerClient* painter, Region* invalidation, const gfx::Size& layer_size, - const gfx::Rect& visible_layer_rect, int frame_number, RecordingMode recording_mode) { ScopedRecordingSourceUpdateTimer timer;
diff --git a/cc/playback/recording_source.h b/cc/playback/recording_source.h index 8d4826df..7da3e64 100644 --- a/cc/playback/recording_source.h +++ b/cc/playback/recording_source.h
@@ -54,7 +54,6 @@ bool UpdateAndExpandInvalidation(ContentLayerClient* painter, Region* invalidation, const gfx::Size& layer_size, - const gfx::Rect& visible_layer_rect, int frame_number, RecordingMode recording_mode); gfx::Size GetSize() const;
diff --git a/cc/proto/property_tree.proto b/cc/proto/property_tree.proto index 014d252..f9a65dc 100644 --- a/cc/proto/property_tree.proto +++ b/cc/proto/property_tree.proto
@@ -83,13 +83,17 @@ } // Proto for struct EffectNodeData. -// NEXT ID: 13 +// NEXT ID: 17 message EffectNodeData { optional float opacity = 1; optional float screen_space_opacity = 2; optional bool has_render_surface = 3; optional bool has_copy_request = 4; optional bool has_background_filters = 5; + optional bool node_or_ancestor_has_background_filters = 13; + optional bool to_screen_opacity_is_animated = 14; + optional bool hidden_by_backface_visibility = 15; + optional bool double_sided = 16; optional bool is_drawn = 6; optional bool has_animated_opacity = 7; optional bool effect_changed = 11;
diff --git a/cc/raster/bitmap_tile_task_worker_pool.cc b/cc/raster/bitmap_tile_task_worker_pool.cc index e8d2bfa..783ec484 100644 --- a/cc/raster/bitmap_tile_task_worker_pool.cc +++ b/cc/raster/bitmap_tile_task_worker_pool.cc
@@ -35,12 +35,13 @@ } // Overridden from RasterBuffer: - void Playback(const RasterSource* raster_source, - const gfx::Rect& raster_full_rect, - const gfx::Rect& raster_dirty_rect, - uint64_t new_content_id, - float scale, - bool include_images) override { + void Playback( + const RasterSource* raster_source, + const gfx::Rect& raster_full_rect, + const gfx::Rect& raster_dirty_rect, + uint64_t new_content_id, + float scale, + const RasterSource::PlaybackSettings& playback_settings) override { gfx::Rect playback_rect = raster_full_rect; if (resource_has_previous_content_) { playback_rect.Intersect(raster_dirty_rect); @@ -52,7 +53,7 @@ TileTaskWorkerPool::PlaybackToMemory( lock_.sk_bitmap().getPixels(), resource_->format(), resource_->size(), stride, raster_source, raster_full_rect, playback_rect, scale, - include_images); + playback_settings); } private:
diff --git a/cc/raster/gpu_rasterizer.cc b/cc/raster/gpu_rasterizer.cc index 498030d..f6e0288 100644 --- a/cc/raster/gpu_rasterizer.cc +++ b/cc/raster/gpu_rasterizer.cc
@@ -43,7 +43,8 @@ const RasterSource* raster_source, const gfx::Rect& raster_full_rect, const gfx::Rect& playback_rect, - float scale) { + float scale, + const RasterSource::PlaybackSettings& playback_settings) { // Play back raster_source into temp SkPicture. SkPictureRecorder recorder; const gfx::Size size = write_lock->GetResourceSize(); @@ -51,9 +52,8 @@ skia::RefPtr<SkCanvas> canvas = skia::SharePtr( recorder.beginRecording(size.width(), size.height(), NULL, flags)); canvas->save(); - const bool include_images = true; raster_source->PlaybackToCanvas(canvas.get(), raster_full_rect, playback_rect, - scale, include_images); + scale, playback_settings); canvas->restore(); sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
diff --git a/cc/raster/gpu_rasterizer.h b/cc/raster/gpu_rasterizer.h index 51cf89f..d195143 100644 --- a/cc/raster/gpu_rasterizer.h +++ b/cc/raster/gpu_rasterizer.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "cc/base/cc_export.h" +#include "cc/playback/raster_source.h" #include "cc/resources/resource_pool.h" #include "cc/tiles/tile.h" #include "third_party/skia/include/core/SkMultiPictureDraw.h" @@ -27,7 +28,8 @@ const RasterSource* raster_source, const gfx::Rect& raster_full_rect, const gfx::Rect& playback_rect, - float scale); + float scale, + const RasterSource::PlaybackSettings& playback_settings); ResourceProvider* resource_provider() { return resource_provider_; }
diff --git a/cc/raster/gpu_tile_task_worker_pool.cc b/cc/raster/gpu_tile_task_worker_pool.cc index 75c9646a8..27d0a4651 100644 --- a/cc/raster/gpu_tile_task_worker_pool.cc +++ b/cc/raster/gpu_tile_task_worker_pool.cc
@@ -37,15 +37,16 @@ } // Overridden from RasterBuffer: - void Playback(const RasterSource* raster_source, - const gfx::Rect& raster_full_rect, - const gfx::Rect& raster_dirty_rect, - uint64_t new_content_id, - float scale, - bool include_images) override { + void Playback( + const RasterSource* raster_source, + const gfx::Rect& raster_full_rect, + const gfx::Rect& raster_dirty_rect, + uint64_t new_content_id, + float scale, + const RasterSource::PlaybackSettings& playback_settings) override { TRACE_EVENT0("cc", "RasterBufferImpl::Playback"); // GPU raster doesn't do low res tiles, so should always include images. - DCHECK(include_images); + DCHECK(!playback_settings.skip_images); ContextProvider* context_provider = rasterizer_->resource_provider() ->output_surface() ->worker_context_provider(); @@ -63,7 +64,7 @@ // TODO(danakj): Implement partial raster with raster_dirty_rect. // Rasterize source into resource. rasterizer_->RasterizeSource(&lock_, raster_source, raster_full_rect, - playback_rect, scale); + playback_rect, scale, playback_settings); gpu::gles2::GLES2Interface* gl = scoped_context.ContextGL(); const uint64_t fence_sync = gl->InsertFenceSyncCHROMIUM();
diff --git a/cc/raster/one_copy_tile_task_worker_pool.cc b/cc/raster/one_copy_tile_task_worker_pool.cc index fc69466a..79429ad 100644 --- a/cc/raster/one_copy_tile_task_worker_pool.cc +++ b/cc/raster/one_copy_tile_task_worker_pool.cc
@@ -47,15 +47,16 @@ ~RasterBufferImpl() override {} // Overridden from RasterBuffer: - void Playback(const RasterSource* raster_source, - const gfx::Rect& raster_full_rect, - const gfx::Rect& raster_dirty_rect, - uint64_t new_content_id, - float scale, - bool include_images) override { + void Playback( + const RasterSource* raster_source, + const gfx::Rect& raster_full_rect, + const gfx::Rect& raster_dirty_rect, + uint64_t new_content_id, + float scale, + const RasterSource::PlaybackSettings& playback_settings) override { worker_pool_->PlaybackAndCopyOnWorkerThread( resource_, &lock_, raster_source, raster_full_rect, raster_dirty_rect, - scale, include_images, previous_content_id_, new_content_id); + scale, playback_settings, previous_content_id_, new_content_id); } private: @@ -322,7 +323,7 @@ const gfx::Rect& raster_full_rect, const gfx::Rect& raster_dirty_rect, float scale, - bool include_images, + const RasterSource::PlaybackSettings& playback_settings, uint64_t previous_content_id, uint64_t new_content_id) { base::AutoLock lock(lock_); @@ -368,7 +369,7 @@ TileTaskWorkerPool::PlaybackToMemory( buffer->memory(0), resource->format(), staging_buffer->size, buffer->stride(0), raster_source, raster_full_rect, playback_rect, - scale, include_images); + scale, playback_settings); buffer->Unmap(); staging_buffer->content_id = new_content_id; }
diff --git a/cc/raster/one_copy_tile_task_worker_pool.h b/cc/raster/one_copy_tile_task_worker_pool.h index 1b0007b0..f691232 100644 --- a/cc/raster/one_copy_tile_task_worker_pool.h +++ b/cc/raster/one_copy_tile_task_worker_pool.h
@@ -84,7 +84,7 @@ const gfx::Rect& raster_full_rect, const gfx::Rect& raster_dirty_rect, float scale, - bool include_images, + const RasterSource::PlaybackSettings& playback_settings, uint64_t resource_content_id, uint64_t previous_content_id);
diff --git a/cc/raster/raster_buffer.h b/cc/raster/raster_buffer.h index 29b6e3a..04972f9d 100644 --- a/cc/raster/raster_buffer.h +++ b/cc/raster/raster_buffer.h
@@ -8,22 +8,23 @@ #include <stdint.h> #include "cc/base/cc_export.h" +#include "cc/playback/raster_source.h" #include "ui/gfx/geometry/rect.h" namespace cc { -class RasterSource; class CC_EXPORT RasterBuffer { public: RasterBuffer(); virtual ~RasterBuffer(); - virtual void Playback(const RasterSource* raster_source, - const gfx::Rect& raster_full_rect, - const gfx::Rect& raster_dirty_rect, - uint64_t new_content_id, - float scale, - bool include_images) = 0; + virtual void Playback( + const RasterSource* raster_source, + const gfx::Rect& raster_full_rect, + const gfx::Rect& raster_dirty_rect, + uint64_t new_content_id, + float scale, + const RasterSource::PlaybackSettings& playback_settings) = 0; }; } // namespace cc
diff --git a/cc/raster/tile_task_worker_pool.cc b/cc/raster/tile_task_worker_pool.cc index 2b69278b..510862a 100644 --- a/cc/raster/tile_task_worker_pool.cc +++ b/cc/raster/tile_task_worker_pool.cc
@@ -60,15 +60,16 @@ } // anonymous namespace // static -void TileTaskWorkerPool::PlaybackToMemory(void* memory, - ResourceFormat format, - const gfx::Size& size, - size_t stride, - const RasterSource* raster_source, - const gfx::Rect& canvas_bitmap_rect, - const gfx::Rect& canvas_playback_rect, - float scale, - bool include_images) { +void TileTaskWorkerPool::PlaybackToMemory( + void* memory, + ResourceFormat format, + const gfx::Size& size, + size_t stride, + const RasterSource* raster_source, + const gfx::Rect& canvas_bitmap_rect, + const gfx::Rect& canvas_playback_rect, + float scale, + const RasterSource::PlaybackSettings& playback_settings) { TRACE_EVENT0("cc", "TileTaskWorkerPool::PlaybackToMemory"); DCHECK(IsSupportedPlaybackToMemoryFormat(format)) << format; @@ -95,7 +96,7 @@ SkSurface::NewRasterDirect(info, memory, stride, &surface_props)); raster_source->PlaybackToCanvas(surface->getCanvas(), canvas_bitmap_rect, canvas_playback_rect, scale, - include_images); + playback_settings); return; } case RGBA_4444: @@ -106,7 +107,7 @@ // playback rect passed to PlaybackToCanvas. crbug.com/519070 raster_source->PlaybackToCanvas(surface->getCanvas(), canvas_bitmap_rect, canvas_bitmap_rect, scale, - include_images); + playback_settings); if (format == ETC1) { TRACE_EVENT0("cc",
diff --git a/cc/raster/tile_task_worker_pool.h b/cc/raster/tile_task_worker_pool.h index db78391..e56807f 100644 --- a/cc/raster/tile_task_worker_pool.h +++ b/cc/raster/tile_task_worker_pool.h
@@ -7,6 +7,7 @@ #include <stddef.h> +#include "cc/playback/raster_source.h" #include "cc/raster/tile_task_runner.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" @@ -16,7 +17,6 @@ } namespace cc { -class RasterSource; class RenderingStatsInstrumentation; class CC_EXPORT TileTaskWorkerPool { @@ -35,15 +35,16 @@ // that will cover the resulting |memory|. The |canvas_playback_rect| can be a // smaller contained rect inside the |canvas_bitmap_rect| if the |memory| is // already partially complete, and only the subrect needs to be played back. - static void PlaybackToMemory(void* memory, - ResourceFormat format, - const gfx::Size& size, - size_t stride, - const RasterSource* raster_source, - const gfx::Rect& canvas_bitmap_rect, - const gfx::Rect& canvas_playback_rect, - float scale, - bool include_images); + static void PlaybackToMemory( + void* memory, + ResourceFormat format, + const gfx::Size& size, + size_t stride, + const RasterSource* raster_source, + const gfx::Rect& canvas_bitmap_rect, + const gfx::Rect& canvas_playback_rect, + float scale, + const RasterSource::PlaybackSettings& playback_settings); // Type-checking downcast routine. virtual TileTaskRunner* AsTileTaskRunner() = 0;
diff --git a/cc/raster/tile_task_worker_pool_unittest.cc b/cc/raster/tile_task_worker_pool_unittest.cc index 4f0bae45..f761385 100644 --- a/cc/raster/tile_task_worker_pool_unittest.cc +++ b/cc/raster/tile_task_worker_pool_unittest.cc
@@ -67,7 +67,8 @@ void RunOnWorkerThread() override { uint64_t new_content_id = 0; raster_buffer_->Playback(raster_source_.get(), gfx::Rect(1, 1), - gfx::Rect(1, 1), new_content_id, 1.f, true); + gfx::Rect(1, 1), new_content_id, 1.f, + RasterSource::PlaybackSettings()); } // Overridden from TileTask:
diff --git a/cc/raster/zero_copy_tile_task_worker_pool.cc b/cc/raster/zero_copy_tile_task_worker_pool.cc index 7180633..da96233 100644 --- a/cc/raster/zero_copy_tile_task_worker_pool.cc +++ b/cc/raster/zero_copy_tile_task_worker_pool.cc
@@ -29,12 +29,13 @@ : lock_(resource_provider, resource->id()), resource_(resource) {} // Overridden from RasterBuffer: - void Playback(const RasterSource* raster_source, - const gfx::Rect& raster_full_rect, - const gfx::Rect& raster_dirty_rect, - uint64_t new_content_id, - float scale, - bool include_images) override { + void Playback( + const RasterSource* raster_source, + const gfx::Rect& raster_full_rect, + const gfx::Rect& raster_dirty_rect, + uint64_t new_content_id, + float scale, + const RasterSource::PlaybackSettings& playback_settings) override { gfx::GpuMemoryBuffer* buffer = lock_.GetGpuMemoryBuffer(); if (!buffer) return; @@ -50,7 +51,7 @@ TileTaskWorkerPool::PlaybackToMemory( buffer->memory(0), resource_->format(), resource_->size(), buffer->stride(0), raster_source, raster_full_rect, raster_full_rect, - scale, include_images); + scale, playback_settings); buffer->Unmap(); }
diff --git a/cc/resources/video_resource_updater.h b/cc/resources/video_resource_updater.h index 24dd24d4..9af50b2 100644 --- a/cc/resources/video_resource_updater.h +++ b/cc/resources/video_resource_updater.h
@@ -13,6 +13,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "cc/base/cc_export.h"
diff --git a/cc/scheduler/delay_based_time_source.h b/cc/scheduler/delay_based_time_source.h index 1300661..1be9d9b 100644 --- a/cc/scheduler/delay_based_time_source.h +++ b/cc/scheduler/delay_based_time_source.h
@@ -9,6 +9,7 @@ #include "base/cancelable_callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/values.h" #include "cc/base/cc_export.h"
diff --git a/cc/scheduler/scheduler_settings.h b/cc/scheduler/scheduler_settings.h index 432c15f3..2f07b30 100644 --- a/cc/scheduler/scheduler_settings.h +++ b/cc/scheduler/scheduler_settings.h
@@ -6,6 +6,7 @@ #define CC_SCHEDULER_SCHEDULER_SETTINGS_H_ #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/values.h" #include "cc/base/cc_export.h"
diff --git a/cc/surfaces/surface_manager.h b/cc/surfaces/surface_manager.h index 55e44f8f..8bf3df89 100644 --- a/cc/surfaces/surface_manager.h +++ b/cc/surfaces/surface_manager.h
@@ -13,6 +13,7 @@ #include <vector> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/threading/thread_checker.h" #include "cc/surfaces/surface_damage_observer.h"
diff --git a/cc/test/fake_raster_source.cc b/cc/test/fake_raster_source.cc index f6e2901..00af0f7 100644 --- a/cc/test/fake_raster_source.cc +++ b/cc/test/fake_raster_source.cc
@@ -138,16 +138,17 @@ FakeRasterSource::~FakeRasterSource() {} -void FakeRasterSource::PlaybackToCanvas(SkCanvas* canvas, - const gfx::Rect& canvas_bitmap_rect, - const gfx::Rect& canvas_playback_rect, - float contents_scale, - bool include_images) const { +void FakeRasterSource::PlaybackToCanvas( + SkCanvas* canvas, + const gfx::Rect& canvas_bitmap_rect, + const gfx::Rect& canvas_playback_rect, + float contents_scale, + const PlaybackSettings& settings) const { if (playback_allowed_event_) playback_allowed_event_->Wait(); RasterSource::PlaybackToCanvas(canvas, canvas_bitmap_rect, canvas_playback_rect, contents_scale, - include_images); + settings); } } // namespace cc
diff --git a/cc/test/fake_raster_source.h b/cc/test/fake_raster_source.h index 7b6b3ec..e347e5c 100644 --- a/cc/test/fake_raster_source.h +++ b/cc/test/fake_raster_source.h
@@ -38,7 +38,7 @@ const gfx::Rect& canvas_bitmap_rect, const gfx::Rect& canvas_playback_rect, float contents_scale, - bool include_images) const override; + const PlaybackSettings& settings) const override; protected: FakeRasterSource(const RecordingSource* recording_source, bool can_use_lcd);
diff --git a/cc/test/fake_recording_source.h b/cc/test/fake_recording_source.h index 9dd9054..69216c70 100644 --- a/cc/test/fake_recording_source.h +++ b/cc/test/fake_recording_source.h
@@ -68,8 +68,8 @@ void Rerecord() { SetNeedsDisplayRect(recorded_viewport_); Region invalidation; - UpdateAndExpandInvalidation(&client_, &invalidation, size_, - recorded_viewport_, 0, RECORD_NORMALLY); + UpdateAndExpandInvalidation(&client_, &invalidation, size_, 0, + RECORD_NORMALLY); } void add_draw_rect(const gfx::Rect& rect) {
diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc index 0e3020ec..0ef1f02a 100644 --- a/cc/test/layer_test_common.cc +++ b/cc/test/layer_test_common.cc
@@ -125,10 +125,10 @@ host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_, settings)), render_pass_(RenderPass::Create()), layer_impl_id_(2) { - scoped_ptr<LayerImpl> root_layer_impl = + scoped_ptr<LayerImpl> root = LayerImpl::Create(host_->host_impl()->active_tree(), 1); - root_layer_impl->SetHasRenderSurface(true); - host_->host_impl()->active_tree()->SetRootLayer(std::move(root_layer_impl)); + host_->host_impl()->active_tree()->SetRootLayer(std::move(root)); + root_layer()->SetHasRenderSurface(true); host_->host_impl()->SetVisible(true); host_->host_impl()->InitializeRenderer(output_surface_.get()); @@ -152,8 +152,7 @@ LayerImplList layer_list; host_->host_impl()->active_tree()->IncrementRenderSurfaceListIdForTesting(); LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - host_->host_impl()->active_tree()->root_layer(), viewport_size, - &layer_list, + root_layer(), viewport_size, &layer_list, host_->host_impl()->active_tree()->current_render_surface_list_id()); LayerTreeHostCommon::CalculateDrawProperties(&inputs); } @@ -214,8 +213,7 @@ std::vector<scoped_ptr<CopyOutputRequest>> copy_requests; copy_requests.push_back( CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); - host_->host_impl()->active_tree()->root_layer()->PassCopyRequests( - ©_requests); + root_layer()->PassCopyRequests(©_requests); } } // namespace cc
diff --git a/cc/test/layer_test_common.h b/cc/test/layer_test_common.h index a1904b9..573ba64 100644 --- a/cc/test/layer_test_common.h +++ b/cc/test/layer_test_common.h
@@ -61,8 +61,7 @@ scoped_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), layer_impl_id_++); T* ptr = layer.get(); - LayerImpl* root_layer_impl = host_->active_tree()->root_layer(); - root_layer_impl->AddChild(std::move(layer)); + root_layer()->AddChild(std::move(layer)); return ptr; } @@ -89,8 +88,7 @@ scoped_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), layer_impl_id_++, a); T* ptr = layer.get(); - LayerImpl* root_layer_impl = host_->active_tree()->root_layer(); - root_layer_impl->AddChild(std::move(layer)); + root_layer()->AddChild(std::move(layer)); return ptr; } @@ -99,8 +97,7 @@ scoped_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), layer_impl_id_++, a, b); T* ptr = layer.get(); - LayerImpl* root_layer_impl = host_->active_tree()->root_layer(); - root_layer_impl->AddChild(std::move(layer)); + root_layer()->AddChild(std::move(layer)); return ptr; } @@ -109,8 +106,7 @@ scoped_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), layer_impl_id_++, a, b, c, d); T* ptr = layer.get(); - LayerImpl* root_layer_impl = host_->active_tree()->root_layer(); - root_layer_impl->AddChild(std::move(layer)); + root_layer()->AddChild(std::move(layer)); return ptr; } @@ -128,8 +124,7 @@ scoped_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), layer_impl_id_++, a, b, c, d, e); T* ptr = layer.get(); - LayerImpl* root_layer_impl = host_->active_tree()->root_layer(); - root_layer_impl->AddChild(std::move(layer)); + root_layer()->AddChild(std::move(layer)); return ptr; } @@ -155,7 +150,7 @@ return host_->host_impl()->resource_provider(); } LayerImpl* root_layer() const { - return host_->host_impl()->active_tree()->root_layer(); + return host_impl()->active_tree()->root_layer(); } FakeLayerTreeHost* host() { return host_.get(); } FakeLayerTreeHostImpl* host_impl() const { return host_->host_impl(); }
diff --git a/cc/test/ordered_simple_task_runner.h b/cc/test/ordered_simple_task_runner.h index 0ebd25c..e312d36d 100644 --- a/cc/test/ordered_simple_task_runner.h +++ b/cc/test/ordered_simple_task_runner.h
@@ -14,6 +14,7 @@ #include "base/compiler_specific.h" #include "base/logging.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/test/simple_test_tick_clock.h" #include "base/test/test_simple_task_runner.h" #include "base/trace_event/trace_event.h"
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc index 6df710b..68408e4d 100644 --- a/cc/tiles/tile_manager.cc +++ b/cc/tiles/tile_manager.cc
@@ -48,7 +48,7 @@ const gfx::Rect& content_rect, const gfx::Rect& invalid_content_rect, float contents_scale, - bool include_images, + const RasterSource::PlaybackSettings& playback_settings, TileResolution tile_resolution, int layer_id, uint64_t source_prepare_tiles_id, @@ -65,7 +65,7 @@ content_rect_(content_rect), invalid_content_rect_(invalid_content_rect), contents_scale_(contents_scale), - include_images_(include_images), + playback_settings_(playback_settings), tile_resolution_(tile_resolution), layer_id_(layer_id), source_prepare_tiles_id_(source_prepare_tiles_id), @@ -93,7 +93,7 @@ raster_buffer_->Playback(raster_source_.get(), content_rect_, invalid_content_rect_, new_content_id_, - contents_scale_, include_images_); + contents_scale_, playback_settings_); } // Overridden from TileTask: @@ -116,7 +116,7 @@ gfx::Rect content_rect_; gfx::Rect invalid_content_rect_; float contents_scale_; - bool include_images_; + RasterSource::PlaybackSettings playback_settings_; TileResolution tile_resolution_; int layer_id_; uint64_t source_prepare_tiles_id_; @@ -848,18 +848,22 @@ } // For LOW_RESOLUTION tiles, we don't draw or predecode images. - const bool include_images = - prioritized_tile.priority().resolution != LOW_RESOLUTION; + RasterSource::PlaybackSettings playback_settings; + playback_settings.skip_images = + prioritized_tile.priority().resolution == LOW_RESOLUTION; // Create and queue all image decode tasks that this tile depends on. ImageDecodeTask::Vector decode_tasks; std::vector<DrawImage>& images = scheduled_draw_images_[tile->id()]; images.clear(); - if (include_images) { + if (!playback_settings.skip_images) { prioritized_tile.raster_source()->GetDiscardableImagesInRect( tile->enclosing_layer_rect(), tile->contents_scale(), &images); } + // TODO(vmpstr): We should disable image hijack canvas in + // |playback_settings| here if |images| is empty. + for (auto it = images.begin(); it != images.end();) { scoped_refptr<ImageDecodeTask> task; bool need_to_unref_when_finished = @@ -876,10 +880,11 @@ return make_scoped_refptr(new RasterTaskImpl( resource, prioritized_tile.raster_source(), tile->content_rect(), - tile->invalidated_content_rect(), tile->contents_scale(), include_images, - prioritized_tile.priority().resolution, tile->layer_id(), - prepare_tiles_count_, static_cast<const void*>(tile), tile->id(), - tile->invalidated_id(), resource_content_id, tile->source_frame_number(), + tile->invalidated_content_rect(), tile->contents_scale(), + playback_settings, prioritized_tile.priority().resolution, + tile->layer_id(), prepare_tiles_count_, static_cast<const void*>(tile), + tile->id(), tile->invalidated_id(), resource_content_id, + tile->source_frame_number(), base::Bind(&TileManager::OnRasterTaskCompleted, base::Unretained(this), tile->id(), resource), &decode_tasks));
diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc index 6e7422b..f6e4b14 100644 --- a/cc/trees/draw_property_utils.cc +++ b/cc/trees/draw_property_utils.cc
@@ -313,54 +313,52 @@ layer->HasPotentiallyRunningTransformAnimation(); } -static inline bool SubtreeShouldBeSkipped(LayerImpl* layer, - bool layer_is_drawn, - const TransformTree& tree) { +static inline bool LayerShouldBeSkipped(LayerImpl* layer, + bool layer_is_drawn, + const TransformTree& transform_tree) { + const TransformNode* transform_node = + transform_tree.Node(layer->transform_tree_index()); + const EffectTree& effect_tree = transform_tree.property_trees()->effect_tree; + const EffectNode* effect_node = effect_tree.Node(layer->effect_tree_index()); // If the layer transform is not invertible, it should not be drawn. // TODO(ajuma): Correctly process subtrees with singular transform for the // case where we may animate to a non-singular transform and wish to // pre-raster. - if (!HasInvertibleOrAnimatedTransform(layer)) + bool has_inherited_invertible_or_animated_transform = + (transform_node->data.is_invertible && + transform_node->data.ancestors_are_invertible) || + transform_node->data.to_screen_is_animated; + if (!has_inherited_invertible_or_animated_transform) return true; // When we need to do a readback/copy of a layer's output, we can not skip // it or any of its ancestors. - if (layer->num_copy_requests_in_target_subtree() > 0) - return false; - - // We cannot skip the the subtree if a descendant has a touch handler - // or the hit testing code will break (it requires fresh transforms, etc). - // Though we don't need visible rect for hit testing, we need render surface's - // drawable content rect which depends on layer's drawable content rect which - // in turn depends on layer's clip rect that is computed while computing - // visible rects. - if (layer->layer_or_descendant_has_touch_handler()) + if (effect_node->data.num_copy_requests_in_subtree > 0) return false; // If the layer is not drawn, then skip it and its subtree. - if (!layer_is_drawn) + if (!effect_node->data.is_drawn) return true; - if (layer->render_surface() && !layer->double_sided() && - IsSurfaceBackFaceVisible(layer, tree)) + if (effect_node->data.hidden_by_backface_visibility) return true; // If layer is on the pending tree and opacity is being animated then // this subtree can't be skipped as we need to create, prioritize and // include tiles for this layer when deciding if tree can be activated. - if (layer->layer_tree_impl()->IsPendingTree() && - layer->HasPotentiallyRunningOpacityAnimation()) + if (!transform_tree.property_trees()->is_active && + effect_node->data.to_screen_opacity_is_animated) return false; // If layer has a background filter, don't skip the layer, even it the // opacity is 0. - if (!layer->background_filters().IsEmpty()) + if (effect_node->data.node_or_ancestor_has_background_filters) return false; // The opacity of a layer always applies to its children (either implicitly // via a render surface or explicitly if the parent preserves 3D), so the // entire subtree can be skipped if this layer is fully transparent. - return !layer->EffectiveOpacity(); + return !effect_node->data.screen_space_opacity; } static inline bool SubtreeShouldBeSkipped(Layer* layer, @@ -402,9 +400,9 @@ } template <typename LayerType> -static bool LayerShouldBeSkipped(LayerType* layer, - bool layer_is_drawn, - const TransformTree& tree) { +static bool LayerNeedsUpdate(LayerType* layer, + bool layer_is_drawn, + const TransformTree& tree) { // Layers can be skipped if any of these conditions are met. // - is not drawn due to it or one of its ancestors being hidden (or having // no copy requests). @@ -422,10 +420,10 @@ // transparent, we would have skipped the entire subtree and never made it // into this function, so it is safe to omit this check here. if (!layer_is_drawn) - return true; + return false; if (!layer->DrawsContent() || layer->bounds().IsEmpty()) - return true; + return false; // The layer should not be drawn if (1) it is not double-sided and (2) the // back of the layer is known to be facing the screen. @@ -437,19 +435,17 @@ if (TransformToScreenIsKnown(layer, backface_transform_id, tree) && !HasSingularTransform(backface_transform_id, tree) && IsLayerBackFaceVisible(layer, backface_transform_id, tree)) - return true; + return false; } - return false; + return true; } -template <typename LayerType> -void FindLayersThatNeedUpdates( - LayerType* layer, - const TransformTree& transform_tree, - const EffectTree& effect_tree, - typename LayerType::LayerListType* update_layer_list, - std::vector<LayerType*>* visible_layer_list) { +void FindLayersThatNeedUpdates(Layer* layer, + const TransformTree& transform_tree, + const EffectTree& effect_tree, + LayerList* update_layer_list, + std::vector<Layer*>* visible_layer_list) { DCHECK_GE(layer->effect_tree_index(), 0); bool layer_is_drawn = effect_tree.Node(layer->effect_tree_index())->data.is_drawn; @@ -458,7 +454,7 @@ SubtreeShouldBeSkipped(layer, layer_is_drawn, transform_tree)) return; - if (!LayerShouldBeSkipped(layer, layer_is_drawn, transform_tree)) { + if (LayerNeedsUpdate(layer, layer_is_drawn, transform_tree)) { visible_layer_list->push_back(layer); update_layer_list->push_back(layer); } @@ -466,10 +462,10 @@ // Append mask layers to the update layer list. They don't have valid visible // rects, so need to get added after the above calculation. Replica layers // don't need to be updated. - if (LayerType* mask_layer = layer->mask_layer()) + if (Layer* mask_layer = layer->mask_layer()) update_layer_list->push_back(mask_layer); - if (LayerType* replica_layer = layer->replica_layer()) { - if (LayerType* mask_layer = replica_layer->mask_layer()) + if (Layer* replica_layer = layer->replica_layer()) { + if (Layer* mask_layer = replica_layer->mask_layer()) update_layer_list->push_back(mask_layer); } @@ -479,6 +475,34 @@ } } +void FindLayersThatNeedUpdates(LayerImpl* layer, + const TransformTree& transform_tree, + const EffectTree& effect_tree, + LayerImplList* update_layer_list, + std::vector<LayerImpl*>* visible_layer_list) { + DCHECK_GE(layer->effect_tree_index(), 0); + for (auto* layer_impl : *layer->layer_tree_impl()) { + bool layer_is_drawn = + effect_tree.Node(layer->effect_tree_index())->data.is_drawn; + + if (layer_impl->parent() && + LayerShouldBeSkipped(layer_impl, layer_is_drawn, transform_tree)) + continue; + + if (LayerNeedsUpdate(layer_impl, layer_is_drawn, transform_tree)) { + visible_layer_list->push_back(layer_impl); + update_layer_list->push_back(layer_impl); + } + + if (LayerImpl* mask_layer = layer->mask_layer()) + update_layer_list->push_back(mask_layer); + if (LayerImpl* replica_layer = layer->replica_layer()) { + if (LayerImpl* mask_layer = replica_layer->mask_layer()) + update_layer_list->push_back(mask_layer); + } + } +} + template <typename LayerType> void UpdateRenderSurfaceForLayer(EffectTree* effect_tree, bool non_root_surfaces_enabled,
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 5437ba5..f80f921d 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc
@@ -358,8 +358,8 @@ if (is_new_trace && frame_viewer_instrumentation::IsTracingLayerTreeSnapshots() && root_layer()) { - LayerTreeHostCommon::CallFunctionForSubtree( - root_layer(), [](Layer* layer) { layer->DidBeginTracing(); }); + LayerTreeHostCommon::CallFunctionForEveryLayer( + this, [](Layer* layer) { layer->DidBeginTracing(); }); } LayerTreeImpl* sync_tree = host_impl->sync_tree(); @@ -1567,10 +1567,9 @@ // updated for other reasons. All layers that at this point are part of the // layer tree are valid, so it is OK that they have a valid sequence number. int seq_num = property_trees_.sequence_number; - LayerTreeHostCommon::CallFunctionForSubtree( - root_layer(), [seq_num](Layer* layer) { - layer->set_property_tree_sequence_number(seq_num); - }); + LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { + layer->set_property_tree_sequence_number(seq_num); + }); surface_id_namespace_ = proto.surface_id_namespace(); next_surface_sequence_ = proto.next_surface_sequence();
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index 8af3dcb..e8bbf5b 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h
@@ -39,7 +39,6 @@ #include "cc/surfaces/surface_sequence.h" #include "cc/trees/compositor_mode.h" #include "cc/trees/layer_tree_host_client.h" -#include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_settings.h" #include "cc/trees/mutator_host_client.h" #include "cc/trees/proxy.h"
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc index 399fe5c..2b5c66bc 100644 --- a/cc/trees/layer_tree_host_common.cc +++ b/cc/trees/layer_tree_host_common.cc
@@ -258,13 +258,6 @@ (layer->parent()->sorting_context_id() == layer->sorting_context_id()); } -static bool IsRootLayerOfNewRenderingContext(LayerImpl* layer) { - if (layer->parent()) - return !layer->parent()->Is3dSorted() && layer->Is3dSorted(); - - return layer->Is3dSorted(); -} - static bool IsLayerBackFaceVisible(LayerImpl* layer, const TransformTree& transform_tree) { // The current W3C spec on CSS transforms says that backface visibility should @@ -284,16 +277,10 @@ static bool IsSurfaceBackFaceVisible(LayerImpl* layer, const gfx::Transform& draw_transform) { - if (LayerIsInExisting3DRenderingContext(layer)) - return draw_transform.IsBackFaceVisible(); - - if (IsRootLayerOfNewRenderingContext(layer)) - return layer->transform().IsBackFaceVisible(); - - // If the render_surface is not part of a new or existing rendering context, - // then the layers that contribute to this surface will decide back-face - // visibility for themselves. - return false; + return layer->layer_tree_impl() + ->property_trees() + ->effect_tree.Node(layer->effect_tree_index()) + ->data.hidden_by_backface_visibility; } static bool LayerShouldBeSkipped(LayerImpl* layer, @@ -350,7 +337,13 @@ // TODO(ajuma): Correctly process subtrees with singular transform for the // case where we may animate to a non-singular transform and wish to // pre-raster. - if (!HasInvertibleOrAnimatedTransform(layer)) + TransformNode* node = + layer->layer_tree_impl()->property_trees()->transform_tree.Node( + layer->transform_tree_index()); + bool has_invertible_transform = + node->data.is_invertible && node->data.ancestors_are_invertible; + if (!(has_invertible_transform || + layer->HasPotentiallyRunningTransformAnimation())) return true; // When we need to do a readback/copy of a layer's output, we can not skip
diff --git a/cc/trees/layer_tree_host_common.h b/cc/trees/layer_tree_host_common.h index 00e751b..892521cd 100644 --- a/cc/trees/layer_tree_host_common.h +++ b/cc/trees/layer_tree_host_common.h
@@ -14,7 +14,11 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" #include "cc/base/cc_export.h" +#include "cc/layers/layer.h" #include "cc/layers/layer_collections.h" +#include "cc/layers/layer_impl.h" +#include "cc/trees/layer_tree_host.h" +#include "cc/trees/layer_tree_impl.h" #include "cc/trees/property_tree.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/vector2d.h" @@ -133,9 +137,13 @@ static bool RenderSurfaceContributesToTarget(LayerType*, int target_surface_layer_id); - template <typename LayerType, typename Function> - static void CallFunctionForSubtree(LayerType* layer, - const Function& function); + template <typename Function> + static void CallFunctionForEveryLayer(LayerTreeHost* layer, + const Function& function); + + template <typename Function> + static void CallFunctionForEveryLayer(LayerTreeImpl* layer, + const Function& function); static Layer* get_layer_as_raw_ptr(const LayerList& layers, size_t index) { return layers[index].get(); @@ -195,8 +203,7 @@ } template <typename LayerType, typename Function> -void LayerTreeHostCommon::CallFunctionForSubtree(LayerType* layer, - const Function& function) { +static void CallFunctionForLayer(LayerType* layer, const Function& function) { function(layer); if (LayerType* mask_layer = layer->mask_layer()) @@ -206,13 +213,31 @@ if (LayerType* mask_layer = replica_layer->mask_layer()) function(mask_layer); } +} + +template <typename Function> +static void CallFunctionForEveryLayerInternal(Layer* layer, + const Function& function) { + CallFunctionForLayer(layer, function); for (size_t i = 0; i < layer->children().size(); ++i) { - CallFunctionForSubtree(get_layer_as_raw_ptr(layer->children(), i), - function); + CallFunctionForEveryLayerInternal(layer->children()[i].get(), function); } } +template <typename Function> +void LayerTreeHostCommon::CallFunctionForEveryLayer(LayerTreeHost* host, + const Function& function) { + CallFunctionForEveryLayerInternal(host->root_layer(), function); +} + +template <typename Function> +void LayerTreeHostCommon::CallFunctionForEveryLayer(LayerTreeImpl* host_impl, + const Function& function) { + for (auto* layer : *host_impl) + CallFunctionForLayer(layer, function); +} + CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer); CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer);
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index ba2144b..406ae20 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -12,6 +12,7 @@ #include "cc/animation/animation_host.h" #include "cc/animation/animation_id_provider.h" +#include "cc/animation/animation_player.h" #include "cc/animation/keyframed_animation_curve.h" #include "cc/animation/layer_animation_controller.h" #include "cc/animation/transform_operations.h" @@ -1065,7 +1066,7 @@ // that is fully contained within the target's bounds, so grand_child should // be considered fully visible. EXPECT_EQ(gfx::Rect(grand_child->bounds()), - grand_child->visible_layer_rect()); + grand_child->visible_layer_rect_for_testing()); } TEST_F(LayerTreeHostCommonTest, TransformsForDegenerateIntermediateLayer) { @@ -3156,7 +3157,7 @@ // The visible rect is expanded to integer coordinates in target space before // being projected back to layer space, where it is once again expanded to // integer coordinates. - EXPECT_EQ(gfx::Rect(49, 49), grand_child->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(49, 49), grand_child->visible_layer_rect_for_testing()); } TEST_F(LayerTreeHostCommonTest, @@ -3541,16 +3542,14 @@ // Though all layers have invertible transforms, matrix multiplication using // floating-point math makes the draw transform uninvertible. - EXPECT_FALSE(grand_child->DrawTransform().IsInvertible()); + EXPECT_FALSE(root->layer_tree_impl() + ->property_trees() + ->transform_tree.Node(grand_child->transform_tree_index()) + ->data.ancestors_are_invertible); - // CalcDrawProps only skips a subtree when a layer's own transform is - // uninvertible, not when its draw transform is invertible, since CDP makes - // skipping decisions before computing a layer's draw transform. Property - // trees make skipping decisions after computing draw transforms, so could be - // made to skip layers with an uninvertible draw transform (once CDP is - // deleted). - EXPECT_EQ(gfx::Rect(grand_child->bounds()), - grand_child->visible_layer_rect()); + // CalcDrawProps skips a subtree when a layer's screen space transform is + // uninvertible + EXPECT_EQ(gfx::Rect(), grand_child->visible_layer_rect()); } TEST_F(LayerTreeHostCommonTest, @@ -3609,12 +3608,16 @@ // Though all layers have invertible transforms, matrix multiplication using // floating-point math makes the draw transform uninvertible. - EXPECT_FALSE(grand_child_ptr->DrawTransform().IsInvertible()); + EXPECT_FALSE( + host_impl.active_tree() + ->property_trees() + ->transform_tree.Node(grand_child_ptr->transform_tree_index()) + ->data.ancestors_are_invertible); - // Since |grand_child| has an uninvertible draw transform, it is treated as - // unoccluded (even though |occluding_child| comes later in draw order, and - // hence potentially occludes it). - gfx::Rect layer_bounds = gfx::Rect(grand_child_ptr->bounds()); + // Since |grand_child| has an uninvertible screen space transform, it is + // skipped so + // that we are not computing its occlusion_in_content_space. + gfx::Rect layer_bounds = gfx::Rect(); EXPECT_EQ( layer_bounds, grand_child_ptr->draw_properties() @@ -4565,17 +4568,17 @@ EXPECT_TRUE(UpdateLayerListContains(child2->id())); EXPECT_TRUE(UpdateLayerListContains(child_of_animating_surface->id())); - EXPECT_FALSE(child2->visible_layer_rect().IsEmpty()); + EXPECT_FALSE(child2->visible_layer_rect_for_testing().IsEmpty()); // The animating layers should have a visible content rect that represents the // area of the front face that is within the viewport. - EXPECT_EQ(animating_child->visible_layer_rect(), + EXPECT_EQ(animating_child->visible_layer_rect_for_testing(), gfx::Rect(animating_child->bounds())); - EXPECT_EQ(animating_surface->visible_layer_rect(), + EXPECT_EQ(animating_surface->visible_layer_rect_for_testing(), gfx::Rect(animating_surface->bounds())); // And layers in the subtree of the animating layer should have valid visible // content rects also. - EXPECT_EQ(child_of_animating_surface->visible_layer_rect(), + EXPECT_EQ(child_of_animating_surface->visible_layer_rect_for_testing(), gfx::Rect(child_of_animating_surface->bounds())); } @@ -5782,26 +5785,26 @@ copy_layer->AddChild(std::move(copy_child)); copy_parent->AddChild(std::move(copy_layer)); root->AddChild(std::move(copy_parent)); - host_impl.pending_tree()->SetRootLayer(std::move(root)); - LayerImpl* root_ptr = host_impl.pending_tree()->root_layer(); LayerImplList render_surface_layer_list; - root_ptr->layer_tree_impl()->IncrementRenderSurfaceListIdForTesting(); + root->layer_tree_impl()->IncrementRenderSurfaceListIdForTesting(); + LayerImpl* root_layer = root.get(); + root_layer->layer_tree_impl()->SetRootLayer(std::move(root)); LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root_ptr, root_ptr->bounds(), &render_surface_layer_list, - root_ptr->layer_tree_impl()->current_render_surface_list_id()); + root_layer, root_layer->bounds(), &render_surface_layer_list, + root_layer->layer_tree_impl()->current_render_surface_list_id()); inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); // We should have two render surface, as the others are clipped out. ASSERT_EQ(2u, render_surface_layer_list.size()); - EXPECT_EQ(root_ptr->id(), render_surface_layer_list.at(0)->id()); + EXPECT_EQ(root_layer->id(), render_surface_layer_list.at(0)->id()); // The root render surface should only have 2 contributing layer, since the // other layers are empty/clipped away. - ASSERT_EQ(2u, root_ptr->render_surface()->layer_list().size()); - EXPECT_EQ(root_ptr->id(), - root_ptr->render_surface()->layer_list().at(0)->id()); + ASSERT_EQ(2u, root_layer->render_surface()->layer_list().size()); + EXPECT_EQ(root_layer->id(), + root_layer->render_surface()->layer_list().at(0)->id()); } TEST_F(LayerTreeHostCommonTest, VisibleContentRectInsideSurface) { @@ -5856,7 +5859,7 @@ // The visible_layer_rect for the |surface_child| should not be clipped by // the viewport. EXPECT_EQ(gfx::Rect(50, 50).ToString(), - surface_child->visible_layer_rect().ToString()); + surface_child->visible_layer_rect_for_testing().ToString()); } TEST_F(LayerTreeHostCommonTest, TransformedClipParent) { @@ -6348,16 +6351,16 @@ child2->AddChild(std::move(child3)); child1->AddChild(std::move(child2)); root->AddChild(std::move(child1)); - host_impl.active_tree()->SetRootLayer(std::move(root)); - LayerImpl* root_ptr = host_impl.active_tree()->root_layer(); + LayerImpl* root_layer = root.get(); + root_layer->layer_tree_impl()->SetRootLayer(std::move(root)); { LayerImplList render_surface_layer_list; - FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(root_ptr); - root_ptr->layer_tree_impl()->IncrementRenderSurfaceListIdForTesting(); + FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(root_layer); + root_layer->layer_tree_impl()->IncrementRenderSurfaceListIdForTesting(); LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root_ptr, root_ptr->bounds(), &render_surface_layer_list, - root_ptr->layer_tree_impl()->current_render_surface_list_id()); + root_layer, root_layer->bounds(), &render_surface_layer_list, + root_layer->layer_tree_impl()->current_render_surface_list_id()); inputs.can_render_to_separate_surface = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -6387,10 +6390,10 @@ { LayerImplList render_surface_layer_list; - root_ptr->layer_tree_impl()->IncrementRenderSurfaceListIdForTesting(); + root_layer->layer_tree_impl()->IncrementRenderSurfaceListIdForTesting(); LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( - root_ptr, root_ptr->bounds(), &render_surface_layer_list, - root_ptr->layer_tree_impl()->current_render_surface_list_id()); + root_layer, root_layer->bounds(), &render_surface_layer_list, + root_layer->layer_tree_impl()->current_render_surface_list_id()); inputs.can_render_to_separate_surface = false; LayerTreeHostCommon::CalculateDrawProperties(&inputs); @@ -6720,6 +6723,7 @@ child->SetTransform(singular_transform); + root->layer_tree_impl()->property_trees()->needs_rebuild = true; ExecuteCalculateDrawProperties(root); EXPECT_EQ(2u, render_surface_layer_list_impl()->size()); @@ -6729,6 +6733,7 @@ parent->SetTransform(singular_transform); child->SetTransform(identity_transform); + root->layer_tree_impl()->property_trees()->needs_rebuild = true; ExecuteCalculateDrawProperties(root); EXPECT_EQ(1u, render_surface_layer_list_impl()->size()); @@ -7284,7 +7289,6 @@ child->AddChild(std::move(grand_child)); parent->AddChild(std::move(child)); grand_parent->AddChild(std::move(parent)); - host_impl.active_tree()->SetRootLayer(std::move(grand_parent)); SetLayerPropertiesForTesting(grand_parent_raw, identity_matrix, gfx::Point3F(), gfx::PointF(), gfx::Size(1, 2), @@ -7300,6 +7304,8 @@ gfx::PointF(), gfx::Size(1, 2), true, false, false); + host_impl.active_tree()->SetRootLayer(std::move(grand_parent)); + ExecuteCalculateDrawProperties(grand_parent_raw); // No layers have animations. @@ -8074,11 +8080,13 @@ // Layers in the root render surface have their visible content rect clipped // by the viewport. - EXPECT_EQ(gfx::Rect(768 / 2, 582 / 2), root->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(768 / 2, 582 / 2), + root->visible_layer_rect_for_testing()); // Layers drawing to a child render surface should still have their visible // content rect clipped by the viewport. - EXPECT_EQ(gfx::Rect(768 / 2, 582 / 2), content->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(768 / 2, 582 / 2), + content->visible_layer_rect_for_testing()); } TEST_F(LayerTreeHostCommonTest, BoundsDeltaAffectVisibleContentRect) { @@ -8226,7 +8234,7 @@ 1.f, false); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_FALSE(animated->visible_layer_rect().IsEmpty()); + EXPECT_FALSE(animated->visible_layer_rect_for_testing().IsEmpty()); } TEST_F(LayerTreeHostCommonTest, @@ -8278,12 +8286,13 @@ // The animated layer has a singular transform and maps to a non-empty rect in // clipped target space, so is treated as fully visible. - EXPECT_EQ(gfx::Rect(120, 120), animated->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(120, 120), animated->visible_layer_rect_for_testing()); // The singular transform on |animated| is flattened when inherited by // |surface|, and this happens to make it invertible. - EXPECT_EQ(gfx::Rect(2, 2), surface->visible_layer_rect()); - EXPECT_EQ(gfx::Rect(2, 2), descendant_of_animation->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(2, 2), surface->visible_layer_rect_for_testing()); + EXPECT_EQ(gfx::Rect(2, 2), + descendant_of_animation->visible_layer_rect_for_testing()); gfx::Transform zero_matrix; zero_matrix.Scale3d(0.f, 0.f, 0.f); @@ -8294,13 +8303,14 @@ // The animated layer maps to the empty rect in clipped target space, so is // treated as having an empty visible rect. - EXPECT_EQ(gfx::Rect(), animated->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(), animated->visible_layer_rect_for_testing()); // This time, flattening does not make |animated|'s transform invertible. This // means the clip cannot be projected into |surface|'s space, so we treat // |surface| and layers that draw into it as having empty visible rect. - EXPECT_EQ(gfx::Rect(), surface->visible_layer_rect()); - EXPECT_EQ(gfx::Rect(), descendant_of_animation->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(), surface->visible_layer_rect_for_testing()); + EXPECT_EQ(gfx::Rect(), + descendant_of_animation->visible_layer_rect_for_testing()); } // Verify that having an animated filter (but no current filter, as these @@ -8424,7 +8434,8 @@ ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(0, 0, 50, 50), grandchild->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), + grandchild->visible_layer_rect_for_testing()); } // Ensures that the property tree code accounts for offsets between fixed @@ -8463,7 +8474,8 @@ ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(0, 0, 50, 50), grandchild->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), + grandchild->visible_layer_rect_for_testing()); } TEST_F(LayerTreeHostCommonTest, CombineClipsUsingContentTarget) { @@ -8553,7 +8565,7 @@ ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); gfx::Rect expected(0, 0, 100, 100); - EXPECT_EQ(expected, fixed->visible_layer_rect()); + EXPECT_EQ(expected, fixed->visible_layer_rect_for_testing()); } TEST_F(LayerTreeHostCommonTest, FixedClipsShouldBeAssociatedWithTheRightNode) { @@ -8600,7 +8612,7 @@ ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); gfx::Rect expected(0, 0, 50, 50); - EXPECT_EQ(expected, fixed->visible_layer_rect()); + EXPECT_EQ(expected, fixed->visible_layer_rect_for_testing()); } TEST_F(LayerTreeHostCommonTest, ChangingAxisAlignmentTriggersRebuild) { @@ -8645,12 +8657,12 @@ gfx::PointF(), gfx::Size(10, 10), true, false); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(10, 10), child->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(10, 10), child->visible_layer_rect_for_testing()); child->SetTransformOrigin(gfx::Point3F(10.f, 10.f, 10.f)); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(5, 5, 5, 5), child->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(5, 5, 5, 5), child->visible_layer_rect_for_testing()); } TEST_F(LayerTreeHostCommonTest, UpdateScrollChildPosition) { @@ -8679,12 +8691,13 @@ true, false); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(25, 25), scroll_child->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(25, 25), scroll_child->visible_layer_rect_for_testing()); scroll_child->SetPosition(gfx::PointF(0, -10.f)); scroll_parent->SetScrollOffset(gfx::ScrollOffset(0.f, 10.f)); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(0, 5, 25, 25), scroll_child->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(0, 5, 25, 25), + scroll_child->visible_layer_rect_for_testing()); } static void CopyOutputCallback(scoped_ptr<CopyOutputResult> result) { @@ -8752,7 +8765,7 @@ // Check the non-skipped case. ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_layer_rect_for_testing()); // Now we will reset the visible rect from property trees for the grandchild, // and we will configure |child| in several ways that should force the subtree @@ -8764,12 +8777,12 @@ child->SetTransform(singular); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(0, 0), grandchild->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(0, 0), grandchild->visible_layer_rect_for_testing()); child->SetTransform(identity); child->SetHideLayerAndSubtree(true); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(0, 0), grandchild->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(0, 0), grandchild->visible_layer_rect_for_testing()); child->SetHideLayerAndSubtree(false); gfx::Transform zero_z_scale; @@ -8786,7 +8799,7 @@ animation->set_time_offset(base::TimeDelta::FromMilliseconds(-1000)); AddAnimationToLayerWithPlayer(child->id(), timeline(), std::move(animation)); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_layer_rect_for_testing()); grandchild->set_visible_layer_rect(gfx::Rect()); RemoveAnimationFromLayerWithExistingPlayer(child->id(), timeline(), @@ -8794,7 +8807,7 @@ child->SetTransform(identity); child->SetOpacity(0.f); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(0, 0), grandchild->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(0, 0), grandchild->visible_layer_rect_for_testing()); // Now, even though child has zero opacity, we will configure |grandchild| and // |greatgrandchild| in several ways that should force the subtree to be @@ -8802,7 +8815,7 @@ grandchild->RequestCopyOfOutput( CopyOutputRequest::CreateBitmapRequest(base::Bind(&CopyOutputCallback))); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_layer_rect_for_testing()); greatgrandchild->set_visible_layer_rect(gfx::Rect()); // Add an opacity animation with a start delay. @@ -8815,10 +8828,10 @@ AddAnimationToLayerWithExistingPlayer(child->id(), timeline(), std::move(animation)); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_layer_rect_for_testing()); } -TEST_F(LayerTreeHostCommonTest, SkippingSubtreeImpl) { +TEST_F(LayerTreeHostCommonTest, SkippingLayerImpl) { FakeImplTaskRunnerProvider task_runner_provider; TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; @@ -8857,18 +8870,30 @@ host_impl.active_tree()->SetRootLayer(std::move(root)); // Check the non-skipped case. - ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); - EXPECT_EQ(gfx::Rect(10, 10), grandchild_ptr->visible_layer_rect()); + // ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); + // EXPECT_EQ(gfx::Rect(10, 10), grandchild_ptr->visible_layer_rect()); // Now we will reset the visible rect from property trees for the grandchild, // and we will configure |child| in several ways that should force the subtree // to be skipped. The visible content rect for |grandchild| should, therefore, // remain empty. grandchild_ptr->set_visible_layer_rect(gfx::Rect()); + gfx::Transform singular; singular.matrix().set(0, 0, 0); + // This line is used to make the results of skipping and not skipping layers + // different. + singular.matrix().set(0, 1, 1); + + gfx::Transform rotate; + rotate.Rotate(90); + + gfx::Transform rotate_back_and_translate; + rotate_back_and_translate.RotateAboutYAxis(180); + rotate_back_and_translate.Translate(-10, 0); child_ptr->SetTransform(singular); + host_impl.active_tree()->property_trees()->needs_rebuild = true; ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); EXPECT_EQ(gfx::Rect(0, 0), grandchild_ptr->visible_layer_rect()); child_ptr->SetTransform(identity); @@ -8881,7 +8906,26 @@ child_ptr->SetOpacity(0.f); ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); EXPECT_EQ(gfx::Rect(0, 0), grandchild_ptr->visible_layer_rect()); + child_ptr->SetOpacity(1.f); + root_ptr->SetTransform(singular); + // Force transform tree to have a node for child, so that ancestor's + // invertible transform can be tested. + child_ptr->SetTransform(rotate); + host_impl.active_tree()->property_trees()->needs_rebuild = true; + ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); + EXPECT_EQ(gfx::Rect(0, 0), grandchild_ptr->visible_layer_rect()); + root_ptr->SetTransform(identity); + child_ptr->SetTransform(identity); + + root_ptr->SetOpacity(0.f); + child_ptr->SetOpacity(0.7f); + host_impl.active_tree()->property_trees()->needs_rebuild = true; + ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); + EXPECT_EQ(gfx::Rect(0, 0), grandchild_ptr->visible_layer_rect()); + root_ptr->SetOpacity(1.f); + + child_ptr->SetOpacity(0.f); // Now, even though child has zero opacity, we will configure |grandchild| and // |greatgrandchild| in several ways that should force the subtree to be // processed anyhow. @@ -8892,6 +8936,120 @@ root_ptr->layer_tree_impl()->property_trees()->needs_rebuild = true; ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); EXPECT_EQ(gfx::Rect(10, 10), grandchild_ptr->visible_layer_rect()); + requests.clear(); + grandchild_ptr->PassCopyRequests(&requests); + child_ptr->SetOpacity(1.f); + + // A double sided render surface with backface visible should not be skipped + grandchild_ptr->set_visible_layer_rect(gfx::Rect()); + child_ptr->SetHasRenderSurface(true); + child_ptr->SetDoubleSided(true); + child_ptr->SetTransform(rotate_back_and_translate); + root_ptr->layer_tree_impl()->property_trees()->needs_rebuild = true; + ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); + EXPECT_EQ(gfx::Rect(10, 10), grandchild_ptr->visible_layer_rect()); + child_ptr->SetTransform(identity); + + scoped_ptr<KeyframedTransformAnimationCurve> curve( + KeyframedTransformAnimationCurve::Create()); + TransformOperations start; + start.AppendTranslate(1.f, 2.f, 3.f); + gfx::Transform transform; + transform.Scale3d(1.0, 2.0, 3.0); + TransformOperations operation; + operation.AppendMatrix(transform); + curve->AddKeyframe( + TransformKeyframe::Create(base::TimeDelta(), start, nullptr)); + curve->AddKeyframe(TransformKeyframe::Create( + base::TimeDelta::FromSecondsD(1.0), operation, nullptr)); + scoped_ptr<Animation> transform_animation( + Animation::Create(std::move(curve), 3, 3, TargetProperty::TRANSFORM)); + scoped_refptr<AnimationPlayer> player(AnimationPlayer::Create(1)); + host_impl.active_tree()->animation_host()->RegisterPlayerForLayer( + root_ptr->id(), player.get()); + host_impl.active_tree() + ->animation_host() + ->GetControllerForLayerId(root_ptr->id()) + ->AddAnimation(std::move(transform_animation)); + grandchild_ptr->set_visible_layer_rect(gfx::Rect()); + child_ptr->SetScrollClipLayer(root_ptr->id()); + root_ptr->SetTransform(singular); + child_ptr->SetTransform(singular); + root_ptr->layer_tree_impl()->property_trees()->needs_rebuild = true; + ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); + EXPECT_EQ(gfx::Rect(10, 10), grandchild_ptr->visible_layer_rect()); + + host_impl.active_tree()->animation_host()->UnregisterPlayerForLayer( + root_ptr->id(), player.get()); +} + +TEST_F(LayerTreeHostCommonTest, SkippingPendingLayerImpl) { + FakeImplTaskRunnerProvider task_runner_provider; + TestSharedBitmapManager shared_bitmap_manager; + TestTaskGraphRunner task_graph_runner; + FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, + &task_graph_runner); + + gfx::Transform identity; + host_impl.CreatePendingTree(); + scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.pending_tree(), 1); + scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.pending_tree(), 2); + scoped_ptr<LayerImpl> grandchild = + LayerImpl::Create(host_impl.pending_tree(), 3); + + scoped_ptr<FakePictureLayerImpl> greatgrandchild( + FakePictureLayerImpl::Create(host_impl.pending_tree(), 4)); + + child->SetDrawsContent(true); + grandchild->SetDrawsContent(true); + greatgrandchild->SetDrawsContent(true); + + SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(), + gfx::PointF(), gfx::Size(100, 100), true, false, + true); + SetLayerPropertiesForTesting(child.get(), identity, gfx::Point3F(), + gfx::PointF(), gfx::Size(10, 10), true, false, + false); + SetLayerPropertiesForTesting(grandchild.get(), identity, gfx::Point3F(), + gfx::PointF(), gfx::Size(10, 10), true, false, + false); + + LayerImpl* root_ptr = root.get(); + LayerImpl* grandchild_ptr = grandchild.get(); + + child->AddChild(std::move(grandchild)); + root->AddChild(std::move(child)); + + host_impl.pending_tree()->SetRootLayer(std::move(root)); + + // Check the non-skipped case. + ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); + EXPECT_EQ(gfx::Rect(10, 10), grandchild_ptr->visible_layer_rect()); + + scoped_ptr<KeyframedFloatAnimationCurve> curve( + KeyframedFloatAnimationCurve::Create()); + scoped_ptr<TimingFunction> func = EaseTimingFunction::Create(); + curve->AddKeyframe( + FloatKeyframe::Create(base::TimeDelta(), 0.9f, std::move(func))); + curve->AddKeyframe( + FloatKeyframe::Create(base::TimeDelta::FromSecondsD(1.0), 0.3f, nullptr)); + scoped_ptr<Animation> animation( + Animation::Create(std::move(curve), 3, 3, TargetProperty::OPACITY)); + scoped_refptr<AnimationPlayer> player(AnimationPlayer::Create(1)); + host_impl.active_tree()->animation_host()->RegisterPlayerForLayer( + root_ptr->id(), player.get()); + host_impl.active_tree() + ->animation_host() + ->GetControllerForLayerId(root_ptr->id()) + ->AddAnimation(std::move(animation)); + root_ptr->SetOpacity(0); + grandchild_ptr->set_visible_layer_rect(gfx::Rect()); + root_ptr->layer_tree_impl()->property_trees()->needs_rebuild = true; + ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); + EXPECT_EQ(gfx::Rect(10, 10), grandchild_ptr->visible_layer_rect()); + + host_impl.active_tree()->animation_host()->UnregisterPlayerForLayer( + root_ptr->id(), player.get()); } TEST_F(LayerTreeHostCommonTest, SkippingLayer) { @@ -8910,17 +9068,17 @@ host()->SetRootLayer(root); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(10, 10), child->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(10, 10), child->visible_layer_rect_for_testing()); child->set_visible_layer_rect(gfx::Rect()); child->SetHideLayerAndSubtree(true); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(0, 0), child->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(0, 0), child->visible_layer_rect_for_testing()); child->SetHideLayerAndSubtree(false); child->SetBounds(gfx::Size()); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(0, 0), child->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(0, 0), child->visible_layer_rect_for_testing()); child->SetBounds(gfx::Size(10, 10)); gfx::Transform rotate; @@ -8928,13 +9086,13 @@ rotate.RotateAboutXAxis(180.f); child->SetTransform(rotate); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(0, 0), child->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(0, 0), child->visible_layer_rect_for_testing()); child->SetDoubleSided(true); child->SetTransform(identity); child->SetOpacity(0.f); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); - EXPECT_EQ(gfx::Rect(0, 0), child->visible_layer_rect()); + EXPECT_EQ(gfx::Rect(0, 0), child->visible_layer_rect_for_testing()); } TEST_F(LayerTreeHostCommonTest, LayerTreeRebuildTest) { @@ -9616,12 +9774,11 @@ TEST_F(LayerTreeHostCommonTest, LargeTransformTest) { LayerImpl* root = root_layer(); LayerImpl* render_surface1 = AddChild<LayerImpl>(root); - LayerImpl* render_surface2 = AddChild<LayerImpl>(render_surface1); + LayerImpl* child = AddChild<LayerImpl>(render_surface1); const gfx::Transform identity_matrix; - render_surface1->SetDrawsContent(true); - render_surface2->SetDrawsContent(true); - render_surface2->SetMasksToBounds(true); + child->SetDrawsContent(true); + child->SetMasksToBounds(true); gfx::Transform large_transform; large_transform.Scale(99999999999999999999.f, 99999999999999999999.f); @@ -9632,41 +9789,35 @@ SetLayerPropertiesForTesting(root, identity_matrix, gfx::Point3F(), gfx::PointF(), gfx::Size(30, 30), true, false, true); - SetLayerPropertiesForTesting(render_surface1, large_transform, gfx::Point3F(), + SetLayerPropertiesForTesting(render_surface1, identity_matrix, gfx::Point3F(), gfx::PointF(), gfx::Size(30, 30), true, false, true); - SetLayerPropertiesForTesting(render_surface2, identity_matrix, gfx::Point3F(), + // TODO(sunxd): we make child have no render surface, because if the + // child has one, the large transform applied to child will result in NaNs in + // the draw_transform of the render_surface, thus make draw property updates + // skip the child layer. We need further investigation into this to know + // what exactly happens here. + SetLayerPropertiesForTesting(child, large_transform, gfx::Point3F(), gfx::PointF(), gfx::Size(30, 30), true, false, - true); + false); ExecuteCalculateDrawProperties(root); - bool is_inf_or_nan = - std::isinf( - render_surface2->render_surface()->draw_transform().matrix().get( - 0, 0)) || - std::isnan( - render_surface2->render_surface()->draw_transform().matrix().get(0, - 0)); - EXPECT_TRUE(is_inf_or_nan); - is_inf_or_nan = - std::isinf( - render_surface2->render_surface()->draw_transform().matrix().get( - 1, 1)) || - std::isnan( - render_surface2->render_surface()->draw_transform().matrix().get(1, - 1)); - EXPECT_TRUE(is_inf_or_nan); EXPECT_EQ(gfx::RectF(), - render_surface2->render_surface()->DrawableContentRect()); + render_surface1->render_surface()->DrawableContentRect()); + + bool is_inf_or_nan = std::isinf(child->DrawTransform().matrix().get(0, 0)) || + std::isnan(child->DrawTransform().matrix().get(0, 0)); + EXPECT_TRUE(is_inf_or_nan); + + is_inf_or_nan = std::isinf(child->DrawTransform().matrix().get(1, 1)) || + std::isnan(child->DrawTransform().matrix().get(1, 1)); + EXPECT_TRUE(is_inf_or_nan); std::vector<LayerImpl*>* rsll = render_surface_layer_list_impl(); bool root_in_rsll = std::find(rsll->begin(), rsll->end(), root) != rsll->end(); EXPECT_TRUE(root_in_rsll); - bool render_surface2_in_rsll = - std::find(rsll->begin(), rsll->end(), render_surface2) != rsll->end(); - EXPECT_FALSE(render_surface2_in_rsll); } TEST_F(LayerTreeHostCommonTest, SerializeScrollUpdateInfo) {
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 9281916..f0ce937 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -1625,13 +1625,11 @@ TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); if (is_new_trace) { if (pending_tree_) { - LayerTreeHostCommon::CallFunctionForSubtree( - pending_tree_->root_layer(), - [](LayerImpl* layer) { layer->DidBeginTracing(); }); + LayerTreeHostCommon::CallFunctionForEveryLayer( + pending_tree(), [](LayerImpl* layer) { layer->DidBeginTracing(); }); } - LayerTreeHostCommon::CallFunctionForSubtree( - active_tree_->root_layer(), - [](LayerImpl* layer) { layer->DidBeginTracing(); }); + LayerTreeHostCommon::CallFunctionForEveryLayer( + active_tree(), [](LayerImpl* layer) { layer->DidBeginTracing(); }); } {
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 0b15ed3b..36e8d599 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc
@@ -999,7 +999,8 @@ // As there's no pending tree in single-threaded case, this test should run // only for multi-threaded case. -MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterDeviceSizeChanged); +// Disabled because its timing out flakily. crbug.com/598491 +// MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterDeviceSizeChanged); class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest { public: @@ -6476,8 +6477,8 @@ void BeginTest() override { PostSetNeedsCommitToMainThread(); } void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { - LayerTreeHostCommon::CallFunctionForSubtree( - host_impl->sync_tree()->root_layer(), [this](LayerImpl* layer) { + LayerTreeHostCommon::CallFunctionForEveryLayer( + host_impl->sync_tree(), [this](LayerImpl* layer) { const std::vector<int>& list = layer->IsAffectedByPageScale() ? this->affected_by_page_scale_
diff --git a/cc/trees/layer_tree_host_unittest_serialization.cc b/cc/trees/layer_tree_host_unittest_serialization.cc index cae21caa..b67b2fe 100644 --- a/cc/trees/layer_tree_host_unittest_serialization.cc +++ b/cc/trees/layer_tree_host_unittest_serialization.cc
@@ -46,8 +46,8 @@ } void VerifyHostHasAllExpectedLayersInTree(Layer* root_layer) { - LayerTreeHostCommon::CallFunctionForSubtree( - root_layer, [root_layer](Layer* layer) { + LayerTreeHostCommon::CallFunctionForEveryLayer( + root_layer->layer_tree_host(), [root_layer](Layer* layer) { DCHECK(layer->layer_tree_host()); EXPECT_EQ(layer, layer->layer_tree_host()->LayerById(layer->id())); }); @@ -171,8 +171,8 @@ // All layers must have a property tree index that matches PropertyTrees. if (layer_tree_host_dst_->property_trees_.sequence_number) { int seq_num = layer_tree_host_dst_->property_trees_.sequence_number; - LayerTreeHostCommon::CallFunctionForSubtree( - layer_tree_host_dst_->root_layer_.get(), [seq_num](Layer* layer) { + LayerTreeHostCommon::CallFunctionForEveryLayer( + layer_tree_host_dst_.get(), [seq_num](Layer* layer) { EXPECT_EQ(seq_num, layer->property_tree_sequence_number()); }); }
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 21e71ae..7f56ae4a 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc
@@ -105,15 +105,15 @@ void LayerTreeImpl::ReleaseResources() { if (root_layer_) { - LayerTreeHostCommon::CallFunctionForSubtree( - root_layer_, [](LayerImpl* layer) { layer->ReleaseResources(); }); + LayerTreeHostCommon::CallFunctionForEveryLayer( + this, [](LayerImpl* layer) { layer->ReleaseResources(); }); } } void LayerTreeImpl::RecreateResources() { if (root_layer_) { - LayerTreeHostCommon::CallFunctionForSubtree( - root_layer_, [](LayerImpl* layer) { layer->RecreateResources(); }); + LayerTreeHostCommon::CallFunctionForEveryLayer( + this, [](LayerImpl* layer) { layer->RecreateResources(); }); } } @@ -125,8 +125,8 @@ // TODO(vmpstr): Early out if there are no requests on any of the layers. For // that, we need to inform LayerTreeImpl whenever there are requests when we // get them. - LayerTreeHostCommon::CallFunctionForSubtree( - root_layer_, [request_ids](LayerImpl* layer) { + LayerTreeHostCommon::CallFunctionForEveryLayer( + this, [request_ids](LayerImpl* layer) { layer->GatherFrameTimingRequestIds(request_ids); }); } @@ -564,10 +564,9 @@ // frame to a newly-committed property tree. if (!root_layer()) return; - LayerTreeHostCommon::CallFunctionForSubtree( - root_layer(), [](LayerImpl* layer) { - layer->UpdatePropertyTreeForScrollingAndAnimationIfNeeded(); - }); + LayerTreeHostCommon::CallFunctionForEveryLayer(this, [](LayerImpl* layer) { + layer->UpdatePropertyTreeForScrollingAndAnimationIfNeeded(); + }); } void LayerTreeImpl::SetPageScaleOnActiveTree(float active_page_scale) { @@ -853,7 +852,7 @@ occlusion_tracker.set_minimum_tracking_size( settings().minimum_occlusion_tracking_size); - // LayerIterator is used here instead of CallFunctionForSubtree to only + // LayerIterator is used here instead of CallFunctionForEveryLayer to only // UpdateTilePriorities on layers that will be visible (and thus have valid // draw properties) and not because any ordering is required. LayerIterator end = LayerIterator::End(&render_surface_layer_list_); @@ -1077,8 +1076,8 @@ layer_tree_host_impl_->ResetRequiresHighResToDraw(); if (root_layer()) { - LayerTreeHostCommon::CallFunctionForSubtree( - root_layer(), [](LayerImpl* layer) { layer->DidBecomeActive(); }); + LayerTreeHostCommon::CallFunctionForEveryLayer( + this, [](LayerImpl* layer) { layer->DidBecomeActive(); }); } for (const auto& swap_promise : swap_promise_list_)
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc index 281c72f..bc019dc 100644 --- a/cc/trees/property_tree.cc +++ b/cc/trees/property_tree.cc
@@ -438,6 +438,10 @@ has_render_surface(false), has_copy_request(false), has_background_filters(false), + node_or_ancestor_has_background_filters(false), + to_screen_opacity_is_animated(false), + hidden_by_backface_visibility(false), + double_sided(false), is_drawn(true), has_animated_opacity(false), effect_changed(false), @@ -454,7 +458,11 @@ has_render_surface == other.has_render_surface && has_copy_request == other.has_copy_request && has_background_filters == other.has_background_filters && - is_drawn == other.is_drawn && + node_or_ancestor_has_background_filters == + other.node_or_ancestor_has_background_filters && + to_screen_opacity_is_animated == other.to_screen_opacity_is_animated && + hidden_by_backface_visibility == other.hidden_by_backface_visibility && + double_sided == other.double_sided && is_drawn == other.is_drawn && has_animated_opacity == other.has_animated_opacity && effect_changed == other.effect_changed && num_copy_requests_in_subtree == other.num_copy_requests_in_subtree && @@ -470,6 +478,11 @@ data->set_has_render_surface(has_render_surface); data->set_has_copy_request(has_copy_request); data->set_has_background_filters(has_background_filters); + data->set_node_or_ancestor_has_background_filters( + node_or_ancestor_has_background_filters); + data->set_to_screen_opacity_is_animated(to_screen_opacity_is_animated); + data->set_hidden_by_backface_visibility(hidden_by_backface_visibility); + data->set_double_sided(double_sided); data->set_is_drawn(is_drawn); data->set_has_animated_opacity(has_animated_opacity); data->set_effect_changed(effect_changed); @@ -488,6 +501,11 @@ has_render_surface = data.has_render_surface(); has_copy_request = data.has_copy_request(); has_background_filters = data.has_background_filters(); + node_or_ancestor_has_background_filters = + data.node_or_ancestor_has_background_filters(); + to_screen_opacity_is_animated = data.to_screen_opacity_is_animated(); + hidden_by_backface_visibility = data.hidden_by_backface_visibility(); + double_sided = data.double_sided(); is_drawn = data.is_drawn(); has_animated_opacity = data.has_animated_opacity(); effect_changed = data.effect_changed(); @@ -1209,6 +1227,46 @@ } } +void EffectTree::UpdateBackfaceVisibility(EffectNode* node, + EffectNode* parent_node) { + if (!parent_node) { + node->data.hidden_by_backface_visibility = false; + return; + } + if (parent_node->data.hidden_by_backface_visibility) { + node->data.hidden_by_backface_visibility = true; + return; + } + + TransformTree& transform_tree = property_trees()->transform_tree; + if (node->data.has_render_surface && !node->data.double_sided) { + TransformNode* transform_node = + transform_tree.Node(node->data.transform_id); + if (transform_node->data.is_invertible && + transform_node->data.ancestors_are_invertible) { + if (transform_node->data.sorting_context_id) { + const TransformNode* parent_transform_node = + transform_tree.parent(transform_node); + if (parent_transform_node && + parent_transform_node->data.sorting_context_id == + transform_node->data.sorting_context_id) { + gfx::Transform surface_draw_transform; + transform_tree.ComputeTransform(transform_node->id, + transform_node->data.target_id, + &surface_draw_transform); + node->data.hidden_by_backface_visibility = + surface_draw_transform.IsBackFaceVisible(); + } else { + node->data.hidden_by_backface_visibility = + transform_node->data.local.IsBackFaceVisible(); + } + return; + } + } + } + node->data.hidden_by_backface_visibility = false; +} + void EffectTree::UpdateEffects(int id) { EffectNode* node = Node(id); EffectNode* parent_node = parent(node); @@ -1216,6 +1274,7 @@ UpdateOpacities(node, parent_node); UpdateIsDrawn(node, parent_node); UpdateEffectChanged(node, parent_node); + UpdateBackfaceVisibility(node, parent_node); } void EffectTree::ClearCopyRequests() {
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h index 1993976..e441ed8 100644 --- a/cc/trees/property_tree.h +++ b/cc/trees/property_tree.h
@@ -263,6 +263,10 @@ bool has_render_surface; bool has_copy_request; bool has_background_filters; + bool node_or_ancestor_has_background_filters; + bool to_screen_opacity_is_animated; + bool hidden_by_backface_visibility; + bool double_sided; bool is_drawn; bool has_animated_opacity; // We need to track changes to effects on the compositor to compute damage @@ -553,6 +557,7 @@ private: void UpdateOpacities(EffectNode* node, EffectNode* parent_node); void UpdateIsDrawn(EffectNode* node, EffectNode* parent_node); + void UpdateBackfaceVisibility(EffectNode* node, EffectNode* parent_node); }; class CC_EXPORT ScrollTree final : public PropertyTree<ScrollNode> {
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc index befc6a5..7b4300b 100644 --- a/cc/trees/property_tree_builder.cc +++ b/cc/trees/property_tree_builder.cc
@@ -612,6 +612,7 @@ node.data.has_copy_request = layer->HasCopyRequest(); node.data.has_background_filters = !layer->background_filters().IsEmpty(); node.data.has_animated_opacity = has_animated_opacity; + node.data.double_sided = layer->double_sided(); if (!is_root) { // The effect node's transform id is used only when we create a render @@ -625,6 +626,12 @@ data_from_ancestor.transform_tree->next_available_id(); } node.data.clip_id = data_from_ancestor.clip_tree_parent; + EffectNode* parent_node = data_for_children->effect_tree->Node(parent_id); + node.data.node_or_ancestor_has_background_filters = + parent_node->data.node_or_ancestor_has_background_filters || + node.data.has_background_filters; + node.data.to_screen_opacity_is_animated = + parent_node->data.to_screen_opacity_is_animated || has_animated_opacity; } else { // Root render surface acts the unbounded and untransformed to draw content // into. Transform node created from root layer (includes device scale @@ -632,6 +639,9 @@ // to root render surface's content, but not root render surface itself. node.data.transform_id = kRootPropertyTreeNodeId; node.data.clip_id = kRootPropertyTreeNodeId; + node.data.node_or_ancestor_has_background_filters = + node.data.has_background_filters; + node.data.to_screen_opacity_is_animated = has_animated_opacity; } node.data.target_id = should_create_render_surface
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index 5fcb39b..32fc307 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc
@@ -17,6 +17,7 @@ #include "cc/scheduler/compositor_timing_history.h" #include "cc/scheduler/scheduler.h" #include "cc/trees/layer_tree_host.h" +#include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_host_single_thread_client.h" #include "cc/trees/layer_tree_impl.h" #include "cc/trees/scoped_abort_remaining_swap_promises.h"
diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc index 4b958de..f625cca 100644 --- a/cc/trees/tree_synchronizer_unittest.cc +++ b/cc/trees/tree_synchronizer_unittest.cc
@@ -21,6 +21,7 @@ #include "cc/test/fake_rendering_stats_instrumentation.h" #include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" +#include "cc/trees/layer_tree_host_common.h" #include "cc/trees/single_thread_proxy.h" #include "cc/trees/task_runner_provider.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/android/chrome_public_test_apk.isolate b/chrome/android/chrome_public_test_apk.isolate index fcec9e0..c2c623a6 100644 --- a/chrome/android/chrome_public_test_apk.isolate +++ b/chrome/android/chrome_public_test_apk.isolate
@@ -18,6 +18,8 @@ '../chrome_public_test_apk.isolate', '<(PRODUCT_DIR)/apks/ChromePublic.apk', '<(PRODUCT_DIR)/apks/ChromePublicTest.apk', + '<(PRODUCT_DIR)/apks/ChromePublicTestSupport.apk', + '<(PRODUCT_DIR)/apks/ChromiumNetTestSupport.apk', '<(PRODUCT_DIR)/bin/run_chrome_public_test_apk', '<(PRODUCT_DIR)/test.lib.java/ChromePublicTest.jar', ]
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml index 6c77785..60d562c7 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml
@@ -647,6 +647,9 @@ <service android:name="org.chromium.chrome.browser.omaha.OmahaClient" android:exported="false"/> + <service android:name="org.chromium.chrome.browser.incognito.IncognitoNotificationService" + android:exported="false"/> + <!-- The following service entries exist in order to allow us to start more than one sandboxed process. -->
diff --git a/chrome/android/java/res/layout/new_tab_page_recycler_view.xml b/chrome/android/java/res/layout/new_tab_page_recycler_view.xml index 1411662f..a4ecf54 100644 --- a/chrome/android/java/res/layout/new_tab_page_recycler_view.xml +++ b/chrome/android/java/res/layout/new_tab_page_recycler_view.xml
@@ -3,7 +3,7 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> -<org.chromium.chrome.browser.ntp.v2.NewTabPageRecyclerView +<org.chromium.chrome.browser.ntp.cards.NewTabPageRecyclerView xmlns:android="http://schemas.android.com/apk/res/android" android:background="@color/ntp_with_cards_bg" android:fillViewport="true"
diff --git a/chrome/android/java/res/xml/data_reduction_preferences_off.xml b/chrome/android/java/res/xml/data_reduction_preferences_off.xml index 6e8402e..f6154aaf 100644 --- a/chrome/android/java/res/xml/data_reduction_preferences_off.xml +++ b/chrome/android/java/res/xml/data_reduction_preferences_off.xml
@@ -12,14 +12,6 @@ android:title="@string/safe_browsing_description" /> <org.chromium.chrome.browser.preferences.TextMessagePreference android:title="@string/data_reduction_caveats_description" /> - <org.chromium.chrome.browser.preferences.TextMessagePreference - android:key="data_reduction_experiment_text" - android:title="@string/data_reduction_experiment_description" /> - <org.chromium.chrome.browser.preferences.HyperlinkPreference - android:key="data_reduction_experiment_link" - android:title="@string/learn_more" - chrome:url="@string/data_reduction_experiment_link_url" - chrome:imitateWebLink="true" /> <org.chromium.chrome.browser.preferences.LearnMorePreference android:key="data_reduction_learn_more" chrome:helpContext="@string/help_context_data_reduction" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java index 6b5b6fb..de14a7e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -73,7 +73,6 @@ import org.chromium.chrome.browser.preferences.ChromePreferenceManager; import org.chromium.chrome.browser.preferences.ConnectionChangeReceiver; import org.chromium.chrome.browser.preferences.PrefServiceBridge; -import org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferences; import org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoScreen; import org.chromium.chrome.browser.signin.SigninPromoScreen; import org.chromium.chrome.browser.snackbar.undo.UndoBarController; @@ -315,11 +314,6 @@ Window.PROGRESS_VISIBILITY_OFF); super.finishNativeInitialization(); - - if (getActivityTab() != null) { - DataReductionPreferences.launchDataReductionSSLInfoBar( - this, getActivityTab().getWebContents()); - } } finally { TraceEvent.end("ChromeTabbedActivity.finishNativeInitialization"); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java index c4e7109..c283f5ae 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java
@@ -97,12 +97,6 @@ public static final String EXTRA_IS_ALLOWED_TO_RETURN_TO_PARENT = "org.chromium.chrome.browser.document.IS_ALLOWED_TO_RETURN_TO_PARENT"; - /** - * Action fired when the user selects the "Close all incognito tabs" notification. - */ - static final String ACTION_CLOSE_ALL_INCOGNITO = - "com.google.android.apps.chrome.document.CLOSE_ALL_INCOGNITO"; - private static final String TAG = "document_CLActivity"; /** New instance should be launched in the foreground. */ @@ -238,13 +232,6 @@ ApiCompatibilityUtils.finishAndRemoveTask(this); return; } else { - // Check if we're just closing all of the Incognito tabs. - if (TextUtils.equals(intent.getAction(), ACTION_CLOSE_ALL_INCOGNITO)) { - ChromeApplication.getDocumentTabModelSelector().getModel(true).closeAllTabs(); - ApiCompatibilityUtils.finishAndRemoveTask(this); - return; - } - // Launch a DocumentActivity to handle the Intent. handleDocumentActivityIntent(); } @@ -768,18 +755,6 @@ return true; } - /** - * Get an intent that will close all incognito tabs through {@link ChromeLauncherActivity}. - * @param context The context to use for creating the {@link PendingIntent}. - * @return {@link PendingIntent} to use for closing all incognito tabs. - */ - @TargetApi(Build.VERSION_CODES.LOLLIPOP) - public static PendingIntent getRemoveAllIncognitoTabsIntent(Context context) { - Intent intent = new Intent( - ACTION_CLOSE_ALL_INCOGNITO, null, context, ChromeLauncherActivity.class); - return PendingIntent.getActivity(context, 0, intent, 0); - } - static String getDocumentClassName(boolean isIncognito) { return isIncognito ? IncognitoDocumentActivity.class.getName() : DocumentActivity.class.getName();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentActivity.java index 2bb7930..dad262aa 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentActivity.java
@@ -45,7 +45,6 @@ import org.chromium.chrome.browser.ntp.NewTabPage; import org.chromium.chrome.browser.preferences.ChromePreferenceManager; import org.chromium.chrome.browser.preferences.PrefServiceBridge; -import org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferences; import org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoScreen; import org.chromium.chrome.browser.signin.SigninPromoScreen; import org.chromium.chrome.browser.tab.EmptyTabObserver; @@ -736,11 +735,6 @@ mTab.addObserver(new DocumentTabObserver()); removeWindowBackground(); - - if (mTab != null) { - DataReductionPreferences.launchDataReductionSSLInfoBar( - DocumentActivity.this, mTab.getWebContents()); - } } private void resetIcon() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/IncognitoDocumentActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/document/IncognitoDocumentActivity.java index e1e46c94..12b68b0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/document/IncognitoDocumentActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/document/IncognitoDocumentActivity.java
@@ -10,6 +10,7 @@ import android.os.Bundle; import org.chromium.chrome.browser.cookies.CookiesFetcher; +import org.chromium.chrome.browser.incognito.IncognitoNotificationManager; import org.chromium.content.browser.crypto.CipherFactory; import org.chromium.content.browser.crypto.CipherFactory.CipherDataObserver; @@ -61,8 +62,7 @@ @Override public void onResume() { super.onResume(); - IncognitoNotificationManager.updateIncognitoNotification( - ChromeLauncherActivity.getRemoveAllIncognitoTabsIntent(this)); + IncognitoNotificationManager.showIncognitoNotification(); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/IncognitoNotificationManager.java b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationManager.java similarity index 86% rename from chrome/android/java/src/org/chromium/chrome/browser/document/IncognitoNotificationManager.java rename to chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationManager.java index cb22ffec..3daaa25 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/document/IncognitoNotificationManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationManager.java
@@ -2,11 +2,10 @@ // 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.document; +package org.chromium.chrome.browser.incognito; import android.app.Notification; import android.app.NotificationManager; -import android.app.PendingIntent; import android.content.Context; import android.support.v4.app.NotificationCompat; @@ -21,10 +20,9 @@ private static final int INCOGNITO_TABS_OPEN_ID = 100; /** - * Updates the notification being displayed. - * @param intent Intent to fire if the notification is selected. + * Shows the close all incognito notification. */ - public static void updateIncognitoNotification(PendingIntent intent) { + public static void showIncognitoNotification() { Context context = ApplicationStatus.getApplicationContext(); String actionMessage = context.getResources().getString(R.string.close_all_incognito_notification); @@ -32,7 +30,8 @@ NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setContentTitle(title) - .setContentIntent(intent) + .setContentIntent( + IncognitoNotificationService.getRemoveAllIncognitoTabsIntent(context)) .setContentText(actionMessage) .setOngoing(true) .setVisibility(Notification.VISIBILITY_SECRET)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java new file mode 100644 index 0000000..31c394a --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java
@@ -0,0 +1,149 @@ +// 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. + +package org.chromium.chrome.browser.incognito; + +import android.app.Activity; +import android.app.IntentService; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.util.Pair; + +import org.chromium.base.ApplicationStatus; +import org.chromium.base.ThreadUtils; +import org.chromium.base.VisibleForTesting; +import org.chromium.chrome.browser.ChromeApplication; +import org.chromium.chrome.browser.ChromeTabbedActivity; +import org.chromium.chrome.browser.TabState; +import org.chromium.chrome.browser.tabmodel.TabPersistentStore; +import org.chromium.chrome.browser.tabmodel.TabWindowManager; +import org.chromium.chrome.browser.util.FeatureUtilities; + +import java.io.File; +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Callable; + +/** + * Service that handles the action of clicking on the incognito notification. + */ +public class IncognitoNotificationService extends IntentService { + + private static final String TAG = "incognito_notification"; + + private static final String ACTION_CLOSE_ALL_INCOGNITO = + "com.google.android.apps.chrome.incognito.CLOSE_ALL_INCOGNITO"; + + @VisibleForTesting + public static PendingIntent getRemoveAllIncognitoTabsIntent(Context context) { + Intent intent = new Intent(context, IncognitoNotificationService.class); + intent.setAction(ACTION_CLOSE_ALL_INCOGNITO); + return PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_ONE_SHOT); + } + + /** Empty public constructor needed by Android. */ + public IncognitoNotificationService() { + super(TAG); + } + + @Override + protected void onHandleIntent(Intent intent) { + boolean isDocumentMode = ThreadUtils.runOnUiThreadBlockingNoException( + new Callable<Boolean>() { + @Override + public Boolean call() throws Exception { + return FeatureUtilities.isDocumentMode(IncognitoNotificationService.this); + } + }); + + boolean clearedIncognito = true; + if (isDocumentMode) { + // TODO(dfalcantara): Delete this when document mode goes away. + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + ChromeApplication.getDocumentTabModelSelector().getModel(true).closeAllTabs(); + } + }); + } else { + List<Integer> processedSelectors = closeIncognitoTabsInRunningTabbedActivities(); + + for (int i = 0; i < TabWindowManager.MAX_SIMULTANEOUS_SELECTORS; i++) { + if (processedSelectors.contains(i)) continue; + clearedIncognito &= deleteIncognitoStateFilesInDirectory( + TabPersistentStore.getStateDirectory(this, i)); + } + } + + // If we failed clearing all of the incognito tabs, then do not dismiss the notification. + if (!clearedIncognito) return; + + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + int incognitoCount = TabWindowManager.getInstance().getIncognitoTabCount(); + assert incognitoCount == 0; + + if (incognitoCount == 0) { + IncognitoNotificationManager.dismissIncognitoNotification(); + } + } + }); + } + + /** + * Iterate across the running activities and for any running tabbed mode activities close their + * incognito tabs. + * + * @return The list of window indexes that were processed. + * + * @see TabWindowManager#getIndexForWindow(Activity) + */ + private List<Integer> closeIncognitoTabsInRunningTabbedActivities() { + return ThreadUtils.runOnUiThreadBlockingNoException( + new Callable<List<Integer>>() { + @Override + public List<Integer> call() { + List<Integer> selectorIndexes = new ArrayList<>(); + + List<WeakReference<Activity>> runningActivities = + ApplicationStatus.getRunningActivities(); + for (int i = 0; i < runningActivities.size(); i++) { + Activity activity = runningActivities.get(i).get(); + if (activity == null) continue; + if (!(activity instanceof ChromeTabbedActivity)) continue; + + ChromeTabbedActivity tabbedActivity = (ChromeTabbedActivity) activity; + if (tabbedActivity.isActivityDestroyed()) continue; + + tabbedActivity.getTabModelSelector().getModel(true).closeAllTabs(); + selectorIndexes.add(TabWindowManager.getInstance().getIndexForWindow( + tabbedActivity)); + } + + return selectorIndexes; + } + }); + } + + /** + * @return Whether deleting all the incognito files was successful. + */ + private boolean deleteIncognitoStateFilesInDirectory(File directory) { + File[] allTabStates = directory.listFiles(); + if (allTabStates == null) return true; + + boolean deletionSuccessful = true; + for (int i = 0; i < allTabStates.length; i++) { + String fileName = allTabStates[i].getName(); + Pair<Integer, Boolean> tabInfo = TabState.parseInfoFromFilename(fileName); + if (tabInfo == null || !tabInfo.second) continue; + deletionSuccessful &= allTabStates[i].delete(); + } + return deletionSuccessful; + } + +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java index f99676b..0b0dbe9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java
@@ -58,9 +58,12 @@ private boolean mDestroyed; private NativeInitializationController mNativeInitializationController; private MemoryUma mMemoryUma; - private boolean mIsTablet; private long mLastUserInteractionTime; + private boolean mIsTablet; + private boolean mIsSmallestScreenWidthDpOverriden; + private int mSmallestScreenWidthDpOverride; + public AsyncInitializationActivity() { mHandler = new Handler(); } @@ -83,6 +86,8 @@ int smallestDeviceWidthDp = DeviceFormFactor.getSmallestDeviceWidthDp(this); if (smallestDeviceWidthDp >= DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) { + mIsSmallestScreenWidthDpOverriden = true; + mSmallestScreenWidthDpOverride = smallestDeviceWidthDp; Configuration overrideConfiguration = new Configuration(); overrideConfiguration.smallestScreenWidthDp = smallestDeviceWidthDp; applyOverrideConfiguration(overrideConfiguration); @@ -364,6 +369,20 @@ mLastUserInteractionTime = SystemClock.elapsedRealtime(); } + @Override + public void onConfigurationChanged(Configuration newConfig) { + // AppCompatActivity#onConfigurationChanged() updates the activity resources with the + // newConfig without taking into account the configuration override we apply in + // #onAttachBaseContext(). For now, we can work around that by setting the + // smallestScreenWidthDp on the newConfig before calling super.onConfigurationChanged(). + // See crbug.com/594540. + // TODO(twellington): Remove this once AppCompatActivity bug is fixed. + if (mIsSmallestScreenWidthDpOverriden) { + newConfig.smallestScreenWidthDp = mSmallestScreenWidthDpOverride; + } + super.onConfigurationChanged(newConfig); + } + /** * @return timestamp when the last user interaction was made. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/invalidation/ChromiumSyncAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/invalidation/ChromiumSyncAdapter.java index 2b50a3f..cc61266 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/invalidation/ChromiumSyncAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/invalidation/ChromiumSyncAdapter.java
@@ -21,6 +21,7 @@ import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.library_loader.ProcessInitException; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.components.invalidation.PendingInvalidation; import org.chromium.content.app.ContentApplication; @@ -127,8 +128,7 @@ private void startBrowserProcessesSync( final BrowserStartupController.StartupCallback callback) { try { - BrowserStartupController.get(mApplication, LibraryProcessType.PROCESS_BROWSER) - .startBrowserProcessesSync(false); + ChromeBrowserInitializer.getInstance(getContext()).handleSynchronousStartup(); } catch (ProcessInitException e) { Log.e(TAG, "Unable to load native library.", e); System.exit(-1);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java index 5ffe3fd9..c7563b0c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java
@@ -135,11 +135,6 @@ return nativeIsDataReductionProxyPromoAllowed(mNativeDataReductionProxySettings); } - /** Returns true if proxy alternative field trial is running. */ - public boolean isIncludedInAltFieldTrial() { - return nativeIsIncludedInAltFieldTrial(mNativeDataReductionProxySettings); - } - /** * Sets the preference on whether to enable/disable the SPDY proxy. This will zero out the * data reduction statistics if this is the first time the SPDY proxy has been enabled. @@ -314,8 +309,6 @@ long nativeDataReductionProxySettingsAndroid); private native boolean nativeIsDataReductionProxyPromoAllowed( long nativeDataReductionProxySettingsAndroid); - private native boolean nativeIsIncludedInAltFieldTrial( - long nativeDataReductionProxySettingsAndroid); private native boolean nativeIsDataReductionProxyEnabled( long nativeDataReductionProxySettingsAndroid); private native boolean nativeCanUseDataReductionProxy(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPreferences.java index c4a7b603..bf39562 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPreferences.java
@@ -6,13 +6,11 @@ import static org.chromium.third_party.android.datausagechart.ChartDataUsageView.DAYS_IN_CHART; -import android.content.Context; import android.content.res.Resources; import android.os.Bundle; import android.preference.Preference; import android.preference.Preference.OnPreferenceChangeListener; import android.preference.PreferenceFragment; -import android.preference.PreferenceManager; import android.text.format.DateUtils; import android.view.Menu; import android.view.MenuInflater; @@ -20,14 +18,11 @@ import org.chromium.base.CommandLine; import org.chromium.chrome.R; -import org.chromium.chrome.browser.firstrun.FirstRunStatus; import org.chromium.chrome.browser.help.HelpAndFeedback; -import org.chromium.chrome.browser.infobar.DataReductionProxyInfoBar; import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; import org.chromium.chrome.browser.preferences.ChromeSwitchPreference; import org.chromium.chrome.browser.preferences.ManagedPreferenceDelegate; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.content_public.browser.WebContents; import org.chromium.third_party.android.datausagechart.NetworkStats; import org.chromium.third_party.android.datausagechart.NetworkStatsHistory; @@ -39,30 +34,12 @@ public static final String PREF_DATA_REDUCTION_SWITCH = "data_reduction_switch"; private static final String PREF_DATA_REDUCTION_STATS = "data_reduction_stats"; - private static final String SHARED_PREF_DISPLAYED_INFOBAR = "displayed_data_reduction_infobar"; - // This is the same as Chromium data_reduction_proxy::switches::kEnableDataReductionProxy. private static final String ENABLE_DATA_REDUCTION_PROXY = "enable-spdy-proxy-auth"; private boolean mIsEnabled; private boolean mWasEnabledAtCreation; - public static void launchDataReductionSSLInfoBar(Context context, WebContents webContents) { - // The infobar is displayed if the Chrome instance is part of the SSL experiment field - // trial, the FRE has completed, the proxy is enabled, and the infobar has not been - // displayed before. - if (!DataReductionProxySettings.getInstance().isIncludedInAltFieldTrial()) return; - if (!DataReductionProxySettings.getInstance().isDataReductionProxyEnabled()) return; - if (DataReductionProxySettings.getInstance().isDataReductionProxyManaged()) return; - if (!FirstRunStatus.getFirstRunFlowComplete(context)) return; - if (getDisplayedDataReductionInfoBar(context)) return; - DataReductionProxyInfoBar.launch(webContents, - context.getString(R.string.data_reduction_infobar_text), - context.getString(R.string.learn_more), - context.getString(R.string.data_reduction_experiment_link_url)); - setDisplayedDataReductionInfoBar(context, true); - } - @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -127,12 +104,6 @@ updateReductionStatistics(); } else { addPreferencesFromResource(R.xml.data_reduction_preferences_off); - if (!DataReductionProxySettings.getInstance().isIncludedInAltFieldTrial()) { - getPreferenceScreen().removePreference( - findPreference("data_reduction_experiment_text")); - getPreferenceScreen().removePreference( - findPreference("data_reduction_experiment_link")); - } } mIsEnabled = isEnabled; } @@ -218,15 +189,4 @@ // .setChecked() should be called after .addPreference() dataReductionSwitch.setChecked(isEnabled); } - - private static boolean getDisplayedDataReductionInfoBar(Context context) { - return PreferenceManager.getDefaultSharedPreferences(context).getBoolean( - SHARED_PREF_DISPLAYED_INFOBAR, false); - } - - private static void setDisplayedDataReductionInfoBar(Context context, boolean displayed) { - PreferenceManager.getDefaultSharedPreferences(context).edit() - .putBoolean(SHARED_PREF_DISPLAYED_INFOBAR, displayed) - .apply(); - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProvider.java index 150ba3b..5d46b9a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProvider.java
@@ -16,10 +16,9 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.VisibleForTesting; import org.chromium.base.annotations.CalledByNative; -import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.library_loader.ProcessInitException; +import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.components.webrestrictions.WebRestrictionsContentProvider; -import org.chromium.content.browser.BrowserStartupController; import java.util.concurrent.CountDownLatch; @@ -41,8 +40,7 @@ return mNativeSupervisedUserContentProvider; } - BrowserStartupController.get(getContext(), LibraryProcessType.PROCESS_BROWSER) - .startBrowserProcessesSync(false); + ChromeBrowserInitializer.getInstance(getContext()).handleSynchronousStartup(); mNativeSupervisedUserContentProvider = nativeCreateSupervisedUserContentProvider(); return mNativeSupervisedUserContentProvider;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java index d6ada57..14136d35 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -461,7 +461,7 @@ @Override public int getSystemWindowInsetBottom() { ChromeActivity activity = getActivity(); - if (activity != null) { + if (activity != null && activity.getInsetObserverView() != null) { return activity.getInsetObserverView().getSystemWindowInsetsBottom(); } return 0; @@ -965,7 +965,7 @@ */ public void reloadIgnoringCache() { if (getWebContents() != null) { - getWebContents().getNavigationController().reloadIgnoringCache(true); + getWebContents().getNavigationController().reloadBypassingCache(true); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/DocumentModeAssassin.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/DocumentModeAssassin.java index a8fceb5..d1cabe2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/DocumentModeAssassin.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/DocumentModeAssassin.java
@@ -26,7 +26,7 @@ import org.chromium.chrome.browser.document.DocumentActivity; import org.chromium.chrome.browser.document.DocumentUtils; import org.chromium.chrome.browser.document.IncognitoDocumentActivity; -import org.chromium.chrome.browser.document.IncognitoNotificationManager; +import org.chromium.chrome.browser.incognito.IncognitoNotificationManager; import org.chromium.chrome.browser.preferences.DocumentModeManager; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabPersistentStore.TabModelMetadata;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModel.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModel.java index a461cb2..989c138 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModel.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModel.java
@@ -6,6 +6,7 @@ import org.chromium.base.ObserverList; import org.chromium.base.ThreadUtils; +import org.chromium.chrome.browser.incognito.IncognitoNotificationManager; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.Tab; @@ -50,6 +51,8 @@ protected void ensureTabModelImpl() { ThreadUtils.assertOnUiThread(); if (!(mDelegateModel instanceof EmptyTabModel)) return; + + IncognitoNotificationManager.showIncognitoNotification(); mDelegateModel = mDelegate.createTabModel(); for (TabModelObserver observer : mObservers) { mDelegateModel.addObserver(observer); @@ -79,6 +82,8 @@ // Only delete the incognito profile if there are no incognito tabs open in any tab // model selector as the profile is shared between them. if (profile != null && !mDelegate.doOffTheRecordTabsExist()) { + IncognitoNotificationManager.dismissIncognitoNotification(); + profile.destroyWhenAppropriate(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelImpl.java index 75dde7d..2b3be69 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelImpl.java
@@ -26,7 +26,7 @@ import org.chromium.chrome.browser.document.DocumentActivity; import org.chromium.chrome.browser.document.DocumentMetricIds; import org.chromium.chrome.browser.document.DocumentUtils; -import org.chromium.chrome.browser.document.IncognitoNotificationManager; +import org.chromium.chrome.browser.incognito.IncognitoNotificationManager; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabCreatorManager; import org.chromium.chrome.browser.tabmodel.TabList;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/OffTheRecordDocumentTabModel.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/OffTheRecordDocumentTabModel.java index 66de0b7..95b3d539 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/OffTheRecordDocumentTabModel.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/OffTheRecordDocumentTabModel.java
@@ -8,7 +8,7 @@ import org.chromium.base.VisibleForTesting; import org.chromium.chrome.browser.TabState; -import org.chromium.chrome.browser.document.IncognitoNotificationManager; +import org.chromium.chrome.browser.incognito.IncognitoNotificationManager; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.EmptyTabModel; import org.chromium.chrome.browser.tabmodel.OffTheRecordTabModel;
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index bfdd808..d0b8f17 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -780,15 +780,6 @@ <message name="IDS_DATA_REDUCTION_CAVEATS_DESCRIPTION" desc="Description text for usage caveats"> This feature may interfere with access to premium data services provided by your carrier. </message> - <message name="IDS_DATA_REDUCTION_EXPERIMENT_DESCRIPTION" desc="Text to be displayed in settings when an experiment is running"> - If you enable this feature, you will be part of an experiment that proxies HTTPS pages through Google servers. - </message> - <message name="IDS_DATA_REDUCTION_EXPERIMENT_LINK_URL" desc="A link provided in settings when an experiment is running" translateable="false"> - <!-- Intentionally empty. This is overridden downstream. --> - </message> - <message name="IDS_DATA_REDUCTION_INFOBAR_TEXT" desc="Text to be displayed in the data reduction proxy infobar"> - We are testing the proxying of HTTPS pages through Google servers as part of an experiment. - </message> <!-- Data Saver Promo and FRE card --> <message name="IDS_DATA_REDUCTION_PROMO_TITLE" desc="The title for the promo inviting users to enable Data Saver" > @@ -2366,10 +2357,10 @@ Physical Web pages nearby </message> <message name="IDS_PHYSICAL_WEB_OPTIN_NOTIFICATION_TITLE" desc="The first line in a notification message informing the user there are nearby devices broadcasting URLs and Chrome can be used to browse the list of URLs."> - Physical Web pages are nearby + Web pages are nearby </message> <message name="IDS_PHYSICAL_WEB_OPTIN_NOTIFICATION_TEXT" desc="The second line in a notification message informing the user there are nearby devices broadcasting URLs and Chrome can be used to browse the list of URLs."> - Use Chrome to browse them + View them in Chrome </message> <message name="IDS_PHYSICAL_WEB_EMPTY_LIST" desc="The message displayed in place of a list of nearby URLs when there are no URLs to display."> No nearby Physical Web pages found
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 2eb05518..d5127d3 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -274,7 +274,6 @@ "java/src/org/chromium/chrome/browser/document/DocumentUtils.java", "java/src/org/chromium/chrome/browser/document/DocumentWebContentsDelegate.java", "java/src/org/chromium/chrome/browser/document/IncognitoDocumentActivity.java", - "java/src/org/chromium/chrome/browser/document/IncognitoNotificationManager.java", "java/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsView.java", "java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerServiceFactory.java", "java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerTabUtils.java", @@ -353,6 +352,8 @@ "java/src/org/chromium/chrome/browser/identity/UniqueIdentificationGenerator.java", "java/src/org/chromium/chrome/browser/identity/UniqueIdentificationGeneratorFactory.java", "java/src/org/chromium/chrome/browser/identity/UuidBasedUniqueIdentificationGenerator.java", + "java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationManager.java", + "java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java", "java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java", "java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarDelegateAndroid.java", "java/src/org/chromium/chrome/browser/infobar/AutofillSaveCardInfoBar.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/NavigationPopupTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/NavigationPopupTest.java index 6de4035..7676b4a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/NavigationPopupTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/NavigationPopupTest.java
@@ -126,7 +126,7 @@ } @Override - public void reloadIgnoringCache(boolean checkForRepost) { + public void reloadBypassingCache(boolean checkForRepost) { } @Override
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerTest.java index 405063d..3f65fd19 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerTest.java
@@ -16,9 +16,7 @@ import android.view.MotionEvent.PointerProperties; import android.widget.FrameLayout; -import org.chromium.base.PathUtils; import org.chromium.base.ThreadUtils; -import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.library_loader.ProcessInitException; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Restriction; @@ -29,6 +27,7 @@ import org.chromium.chrome.browser.compositor.layouts.phone.StackLayout; import org.chromium.chrome.browser.compositor.layouts.phone.stack.Stack; import org.chromium.chrome.browser.compositor.layouts.phone.stack.StackTab; +import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelSelector; @@ -37,7 +36,6 @@ import org.chromium.chrome.test.util.ChromeRestriction; import org.chromium.chrome.test.util.browser.tabmodel.MockTabModel.MockTabModelDelegate; import org.chromium.chrome.test.util.browser.tabmodel.MockTabModelSelector; -import org.chromium.content.browser.BrowserStartupController; /** * Unit tests for {@link org.chromium.chrome.browser.compositor.layouts.LayoutManagerChrome} @@ -46,8 +44,6 @@ implements MockTabModelDelegate { private static final String TAG = "LayoutManagerTest"; - private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "content"; - private long mLastDownTime = 0; private TabModelSelector mTabModelSelector; @@ -468,18 +464,13 @@ protected void setUp() throws Exception { super.setUp(); - PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX, - getInstrumentation().getTargetContext()); - // Load the browser process. ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { try { - BrowserStartupController.get( - getInstrumentation().getTargetContext(), - LibraryProcessType.PROCESS_BROWSER) - .startBrowserProcessesSync(false); + ChromeBrowserInitializer.getInstance( + getInstrumentation().getTargetContext()).handleSynchronousStartup(); } catch (ProcessInitException e) { fail("Failed to load browser"); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/document/DocumentModeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/document/DocumentModeTest.java index 4ad202f..34ef7392 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/document/DocumentModeTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/document/DocumentModeTest.java
@@ -26,6 +26,7 @@ import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.ShortcutHelper; +import org.chromium.chrome.browser.incognito.IncognitoNotificationService; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelSelector; @@ -463,7 +464,7 @@ assertEquals(1, selector.getCurrentModel().getCount()); PendingIntent closeAllIntent = - ChromeLauncherActivity.getRemoveAllIncognitoTabsIntent(mContext); + IncognitoNotificationService.getRemoveAllIncognitoTabsIntent(mContext); closeAllIntent.send(); CriteriaHelper.pollUiThread(new Criteria() {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java index b38b4eb93..272278efc 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java
@@ -13,13 +13,11 @@ import android.test.UiThreadTest; import android.test.suitebuilder.annotation.SmallTest; -import org.chromium.base.PathUtils; -import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.library_loader.ProcessInitException; import org.chromium.base.test.util.Feature; +import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.preferences.website.ContentSetting; import org.chromium.chrome.browser.preferences.website.GeolocationInfo; -import org.chromium.content.browser.BrowserStartupController; /** * Tests for GeolocationHeader and GeolocationTracker. @@ -29,18 +27,12 @@ private static final String SEARCH_URL_1 = "https://www.google.com/search?q=potatoes"; private static final String SEARCH_URL_2 = "https://www.google.co.jp/webhp?#q=dinosaurs"; - private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "content"; - @SmallTest @Feature({"Location"}) @UiThreadTest public void testGeolocationHeader() throws ProcessInitException { - PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX, - getInstrumentation().getTargetContext()); - Context targetContext = getInstrumentation().getTargetContext(); - BrowserStartupController.get(targetContext, LibraryProcessType.PROCESS_BROWSER) - .startBrowserProcessesSync(false); + ChromeBrowserInitializer.getInstance(targetContext).handleSynchronousStartup(); setMockLocation(20.3, 155.8, System.currentTimeMillis());
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h index 49d3eb32..59f94f9c 100644 --- a/chrome/app/chrome_command_ids.h +++ b/chrome/app/chrome_command_ids.h
@@ -30,7 +30,7 @@ #define IDC_HOME 33003 #define IDC_OPEN_CURRENT_URL 33004 #define IDC_STOP 33006 -#define IDC_RELOAD_IGNORING_CACHE 33007 +#define IDC_RELOAD_BYPASSING_CACHE 33007 #define IDC_LOAD_NEW_TAB_PAGE 33008 #define IDC_RELOAD_CLEARING_CACHE 33009
diff --git a/chrome/app/chrome_dll.rc b/chrome/app/chrome_dll.rc index 4dc8a15..fa079d0 100644 --- a/chrome/app/chrome_dll.rc +++ b/chrome/app/chrome_dll.rc
@@ -74,10 +74,10 @@ "O", IDC_OPEN_FILE, VIRTKEY, CONTROL "P", IDC_PRINT, VIRTKEY, CONTROL "R", IDC_RELOAD, VIRTKEY, CONTROL - "R", IDC_RELOAD_IGNORING_CACHE, VIRTKEY, CONTROL, SHIFT + "R", IDC_RELOAD_BYPASSING_CACHE, VIRTKEY, CONTROL, SHIFT VK_F5, IDC_RELOAD, VIRTKEY - VK_F5, IDC_RELOAD_IGNORING_CACHE, VIRTKEY, CONTROL - VK_F5, IDC_RELOAD_IGNORING_CACHE, VIRTKEY, SHIFT + VK_F5, IDC_RELOAD_BYPASSING_CACHE, VIRTKEY, CONTROL + VK_F5, IDC_RELOAD_BYPASSING_CACHE, VIRTKEY, SHIFT VK_HOME, IDC_HOME, VIRTKEY, ALT "T", IDC_RESTORE_TAB, VIRTKEY, CONTROL, SHIFT "S", IDC_SAVE_PAGE, VIRTKEY, CONTROL
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index a1764677..7a13162 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp
@@ -4727,8 +4727,8 @@ <message name="IDS_KEYBOARD_OVERLAY_RELOAD_CURRENT_PAGE" desc="The text in the keyboard overlay to explain the shortcut."> Reload </message> - <message name="IDS_KEYBOARD_OVERLAY_RELOAD_IGNORING_CACHE" desc="The text in the keyboard overlay to explain the shortcut."> - Reload ignoring cache + <message name="IDS_KEYBOARD_OVERLAY_RELOAD_BYPASSING_CACHE" desc="The text in the keyboard overlay to explain the shortcut."> + Reload bypassing cache </message> <message name="IDS_KEYBOARD_OVERLAY_REOPEN_LAST_CLOSED_TAB" desc="The text in the keyboard overlay to explain the shortcut."> Reopen last-closed tab
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 35f74e1..6321734 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -5890,12 +5890,6 @@ <message name="IDS_FLAGS_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION" desc="Description of the flag to automatically save password."> Skip the passwords prompt and save passwords automatically. </message> - <message name="IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME" desc="Name of the flag for the password manager reauthentication option."> - Password Manager Reauthentication - </message> - <message name="IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION" desc="Description of the flag for the password manager reauthentication option."> - Disable prompting the user for their OS password before revealing passwords on the passwords page. - </message> <message name="IDS_FLAGS_PASSWORD_CHANGE_SUPPORT_NAME" desc="Name of the flag for the password manager's password change support option."> Change password support </message> @@ -6008,17 +6002,17 @@ This is to be used in conjunction with the enable-navigation-tracing flag. Please select the label that best describes the recorded traces. This will choose the destination the traces are uploaded to. If you are not sure, select other. If left empty, no traces will be uploaded. </message> - <message name="IDS_FLAG_ENABLE_AUDIO_FOR_DESKTOP_SHARE" desc="Title for the flag to enable Audio Sharing."> - Enable Audio For Desktop Share + <message name="IDS_FLAG_DISABLE_AUDIO_FOR_DESKTOP_SHARE" desc="Title for the flag to disable Audio Sharing."> + Disable Audio For Desktop Share </message> - <message name="IDS_FLAG_ENABLE_AUDIO_FOR_DESKTOP_SHARE_DESCRIPTION" desc="Description for the flag to enable Audio Sharing."> - With this flag on, desktop share picker window will let the user to choose whether to share audio. + <message name="IDS_FLAG_DISABLE_AUDIO_FOR_DESKTOP_SHARE_DESCRIPTION" desc="Description for the flag to disable Audio Sharing."> + With this flag on, desktop share picker window will not let the user choose whether to share audio. </message> - <message name="IDS_FLAG_ENABLE_TAB_FOR_DESKTOP_SHARE" desc="Title for the flag to enable tab for desktop share."> - Enable tab For Desktop Share. + <message name="IDS_FLAG_DISABLE_TAB_FOR_DESKTOP_SHARE" desc="Title for the flag to disable tab for desktop share."> + Desktop Share with tab source </message> - <message name="IDS_FLAG_ENABLE_TAB_FOR_DESKTOP_SHARE_DESCRIPTION" desc="Description for the flag to enable tab for desktop share."> - Enables user to chose a tab for desktop share. + <message name="IDS_FLAG_DISABLE_TAB_FOR_DESKTOP_SHARE_DESCRIPTION" desc="Description for the flag to disable tab for desktop share."> + This flag controls whether users can choose a tab for desktop share. </message> <message name="IDS_TRACE_UPLOAD_URL_CHOICE_OTHER"> Other @@ -8020,6 +8014,16 @@ Manage... </message> + <message name="IDS_BACKGROUND_SYNC_HEADER" desc="Header for background sync on the Content Settings dialog. Background sync allows websites to queue an operation for the next time the device is online."> + Background sync + </message> + <message name="IDS_BACKGROUND_SYNC_ALLOW_RADIO" desc="A radio button on the Content Settings dialog to allow all sites to use background sync."> + Allow recently closed sites to finish sending and receiving data (recommended) + </message> + <message name="IDS_BACKGROUND_SYNC_BLOCK_RADIO" desc="A radio button on the Content Settings dialog to block all sites from using background sync."> + Do not allow recently closed sites to finish sending and receiving data + </message> + <message name="IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL" desc="Label for Zoom Level tab and a header the on Content Settings dialog (zoom levels indicate that a page should be shown for example at 110% magnification)."> Zoom Levels </message> @@ -11780,7 +11784,7 @@ <message name="IDS_RELOAD_MENU_MAC" desc="The Mac menu item to reload the current page in the view menu."> Reload This Page </message> - <message name="IDS_RELOAD_IGNORING_CACHE_MENU_MAC" desc="The Mac menu item to force reload the current page (ignoring cache) in the view menu."> + <message name="IDS_RELOAD_BYPASSING_CACHE_MENU_MAC" desc="The Mac menu item to force reload the current page (ignoring cache) in the view menu."> Force Reload This Page </message> <message name="IDS_ENTER_FULLSCREEN_MAC" desc="The Mac menu item to go into fullscreen mode in the view menu and also in the app menu."> @@ -14627,6 +14631,15 @@ </message> </if> + <if expr="not is_android and not is_ios and _google_chrome"> + <message name="IDS_FLAGS_GOOGLE_BRANDED_CONTEXT_MENU_NAME" desc="Name for the flag to enable Google branding in the context menu."> + Google branding in the context menu + </message> + <message name="IDS_FLAGS_GOOGLE_BRANDED_CONTEXT_MENU_DESCRIPTION" desc="Description for the flag to enable Google branding in the context menu."> + Shows a Google icon next to context menu items powered by Google services. + </message> + </if> + <message name="IDS_FLAGS_ENABLE_WEB_USB_NAME" desc="Title for the flag to enable WebUSB."> WebUSB </message>
diff --git a/chrome/app/nibs/MainMenu.xib b/chrome/app/nibs/MainMenu.xib index d32632d..f8c67c2 100644 --- a/chrome/app/nibs/MainMenu.xib +++ b/chrome/app/nibs/MainMenu.xib
@@ -335,7 +335,7 @@ <action selector="commandDispatch:" target="-1" id="543"/> </connections> </menuItem> - <menuItem title="^IDS_RELOAD_IGNORING_CACHE_MENU_MAC" tag="33007" alternate="YES" keyEquivalent="R" id="676"> + <menuItem title="^IDS_RELOAD_BYPASSING_CACHE_MENU_MAC" tag="33007" alternate="YES" keyEquivalent="R" id="676"> <connections> <action selector="commandDispatch:" target="-1" id="677"/> </connections>
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd index dcc61d2..d43de81e 100644 --- a/chrome/app/theme/theme_resources.grd +++ b/chrome/app/theme/theme_resources.grd
@@ -299,6 +299,9 @@ <if expr="is_macosx"> <structure type="chrome_scaled_image" name="IDR_GENERATE_PASSWORD_KEY" file="legacy/password_generation_key.png" /> </if> + <if expr="_google_chrome"> + <structure type="chrome_scaled_image" name="IDR_GOOGLE_ICON" file="google_chrome/google_icon.png" /> + </if> <structure type="chrome_scaled_image" name="IDR_HELP_MENU" file="common/help_16.png" /> <if expr="toolkit_views or is_macosx or is_ios"> <structure type="chrome_scaled_image" name="IDR_HOME" file="common/browser_home_normal.png" />
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 0bc2ce4b..5da4cfe 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -42,8 +42,11 @@ config("browser_win_linker_flags") { libs = [ "credui.lib", + "cryptui.lib", + "dwmapi.lib", "netapi32.lib", "ndfapi.lib", # Used by browser/net/net_error_diagnostics_dialog_win.h + "pdh.lib", ] ldflags = [ "/DELAYLOAD:ndfapi.dll" ] }
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index b853309c..0bb490f 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -923,11 +923,6 @@ IDS_FLAGS_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION, kOsDesktop, FEATURE_VALUE_TYPE( password_manager::features::kEnableAutomaticPasswordSaving)}, - {"password-manager-reauthentication", - IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME, - IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION, kOsMac | kOsWin, - SINGLE_DISABLE_VALUE_TYPE( - switches::kDisablePasswordManagerReauthentication)}, {"enable-password-change-support", IDS_FLAGS_PASSWORD_CHANGE_SUPPORT_NAME, IDS_FLAGS_PASSWORD_CHANGE_SUPPORT_DESCRIPTION, kOsAndroid, FEATURE_VALUE_TYPE( @@ -1780,14 +1775,16 @@ {"enable-scroll-anchoring", IDS_FLAGS_ENABLE_SCROLL_ANCHORING_NAME, IDS_FLAGS_ENABLE_SCROLL_ANCHORING_DESCRIPTION, kOsAll, FEATURE_VALUE_TYPE(features::kScrollAnchoring)}, - {"enable-audio-support-for-desktop-share", - IDS_FLAG_ENABLE_AUDIO_FOR_DESKTOP_SHARE, - IDS_FLAG_ENABLE_AUDIO_FOR_DESKTOP_SHARE_DESCRIPTION, kOsAll, - SINGLE_VALUE_TYPE(switches::kEnableAudioSupportForDesktopShare)}, + {"disable-audio-support-for-desktop-share", + IDS_FLAG_DISABLE_AUDIO_FOR_DESKTOP_SHARE, + IDS_FLAG_DISABLE_AUDIO_FOR_DESKTOP_SHARE_DESCRIPTION, kOsAll, + SINGLE_VALUE_TYPE(switches::kDisableAudioSupportForDesktopShare)}, #if defined(ENABLE_EXTENSIONS) - {"enable-tab-for-desktop-share", IDS_FLAG_ENABLE_TAB_FOR_DESKTOP_SHARE, - IDS_FLAG_ENABLE_TAB_FOR_DESKTOP_SHARE_DESCRIPTION, kOsAll, - SINGLE_VALUE_TYPE(extensions::switches::kEnableTabForDesktopShare)}, + {"tab-for-desktop-share", IDS_FLAG_DISABLE_TAB_FOR_DESKTOP_SHARE, + IDS_FLAG_DISABLE_TAB_FOR_DESKTOP_SHARE_DESCRIPTION, kOsAll, + ENABLE_DISABLE_VALUE_TYPE( + extensions::switches::kEnableTabForDesktopShare, + extensions::switches::kDisableTabForDesktopShare)}, #endif #if defined(OS_ANDROID) {"enable-ntp-snippets", IDS_FLAGS_ENABLE_NTP_SNIPPETS_NAME, @@ -1830,6 +1827,12 @@ IDS_FLAGS_ENABLE_IME_MENU_DESCRIPTION, kOsCrOS, FEATURE_VALUE_TYPE(features::kOptInImeMenu)}, #endif +#if !defined(OS_ANDROID) && !defined(OS_IOS) && defined(GOOGLE_CHROME_BUILD) + {"enable-google-branded-context-menu", + IDS_FLAGS_GOOGLE_BRANDED_CONTEXT_MENU_NAME, + IDS_FLAGS_GOOGLE_BRANDED_CONTEXT_MENU_DESCRIPTION, kOsDesktop, + SINGLE_VALUE_TYPE(switches::kEnableGoogleBrandedContextMenu)}, +#endif // NOTE: Adding new command-line switches requires adding corresponding // entries to enum "LoginCustomFlags" in histograms.xml. See note in // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
diff --git a/chrome/browser/android/ntp/most_visited_sites.cc b/chrome/browser/android/ntp/most_visited_sites.cc index 27debe9..1d5d4cbf 100644 --- a/chrome/browser/android/ntp/most_visited_sites.cc +++ b/chrome/browser/android/ntp/most_visited_sites.cc
@@ -195,12 +195,6 @@ new suggestions::SuggestionsSource(profile_)); content::URLDataSource::Add(profile_, new ThumbnailListSource(profile_)); - SuggestionsService* suggestions_service = - SuggestionsServiceFactory::GetForProfile(profile_); - suggestions_subscription_ = suggestions_service->AddCallback( - base::Bind(&MostVisitedSites::OnSuggestionsProfileAvailable, - base::Unretained(this))); - SupervisedUserService* supervised_user_service = SupervisedUserServiceFactory::GetForProfile(profile_); supervised_user_service->AddObserver(this); @@ -237,15 +231,6 @@ received_popular_sites_ = true; } - SuggestionsService* suggestions_service = - SuggestionsServiceFactory::GetForProfile(profile_); - // Immediately get the current suggestions from the cache. If the cache is - // empty, this will fall back to TopSites. - OnSuggestionsProfileAvailable( - suggestions_service->GetSuggestionsDataFromCache()); - // Also start a request for fresh suggestions. - suggestions_service->FetchSuggestionsData(); - scoped_refptr<TopSites> top_sites = TopSitesFactory::GetForProfile(profile_); if (top_sites) { // TopSites updates itself after a delay. To ensure up-to-date results, @@ -256,6 +241,19 @@ // TopSites changes. scoped_observer_.Add(top_sites.get()); } + + SuggestionsService* suggestions_service = + SuggestionsServiceFactory::GetForProfile(profile_); + suggestions_subscription_ = suggestions_service->AddCallback( + base::Bind(&MostVisitedSites::OnSuggestionsProfileAvailable, + base::Unretained(this))); + + // Immediately get the current suggestions from the cache. If the cache is + // empty, this will fall back to TopSites. + OnSuggestionsProfileAvailable( + suggestions_service->GetSuggestionsDataFromCache()); + // Also start a request for fresh suggestions. + suggestions_service->FetchSuggestionsData(); } void MostVisitedSites::GetURLThumbnail(
diff --git a/chrome/browser/android/password_ui_view_android.cc b/chrome/browser/android/password_ui_view_android.cc index 84dec75..27d6f7f 100644 --- a/chrome/browser/android/password_ui_view_android.cc +++ b/chrome/browser/android/password_ui_view_android.cc
@@ -45,9 +45,7 @@ } void PasswordUIViewAndroid::SetPasswordList( - const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list, - bool show_passwords) { - // Android just ignores the |show_passwords| argument. + const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list) { JNIEnv* env = base::android::AttachCurrentThread(); ScopedJavaLocalRef<jobject> ui_controller = weak_java_ui_controller_.get(env); if (!ui_controller.is_null()) {
diff --git a/chrome/browser/android/password_ui_view_android.h b/chrome/browser/android/password_ui_view_android.h index 370dee1..d7160fe 100644 --- a/chrome/browser/android/password_ui_view_android.h +++ b/chrome/browser/android/password_ui_view_android.h
@@ -34,8 +34,8 @@ const std::string& username, const base::string16& password_value) override; void SetPasswordList( - const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list, - bool show_passwords) override; + const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list) + override; void SetPasswordExceptionList( const std::vector<scoped_ptr<autofill::PasswordForm>>& password_exception_list) override;
diff --git a/chrome/browser/app_mode/app_mode_utils.cc b/chrome/browser/app_mode/app_mode_utils.cc index 787ac4a..0e706d9 100644 --- a/chrome/browser/app_mode/app_mode_utils.cc +++ b/chrome/browser/app_mode/app_mode_utils.cc
@@ -18,18 +18,18 @@ DCHECK(IsRunningInForcedAppMode()); const int kAllowed[] = { - IDC_BACK, - IDC_FORWARD, - IDC_RELOAD, - IDC_STOP, - IDC_RELOAD_IGNORING_CACHE, - IDC_RELOAD_CLEARING_CACHE, - IDC_CUT, - IDC_COPY, - IDC_PASTE, - IDC_ZOOM_PLUS, - IDC_ZOOM_NORMAL, - IDC_ZOOM_MINUS, + IDC_BACK, + IDC_FORWARD, + IDC_RELOAD, + IDC_STOP, + IDC_RELOAD_BYPASSING_CACHE, + IDC_RELOAD_CLEARING_CACHE, + IDC_CUT, + IDC_COPY, + IDC_PASTE, + IDC_ZOOM_PLUS, + IDC_ZOOM_NORMAL, + IDC_ZOOM_MINUS, }; for (size_t i = 0; i < arraysize(kAllowed); ++i) {
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc index 2a23257..3def5c5 100644 --- a/chrome/browser/apps/guest_view/web_view_browsertest.cc +++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -744,9 +744,7 @@ testing::Values(false)); class WebViewNewWindowTest : public WebViewTest {}; -INSTANTIATE_TEST_CASE_P(WebViewTests, - WebViewNewWindowTest, - testing::Values(false)); +INSTANTIATE_TEST_CASE_P(WebViewTests, WebViewNewWindowTest, testing::Bool()); class WebViewSizeTest : public WebViewTest {}; INSTANTIATE_TEST_CASE_P(WebViewTests, WebViewSizeTest, testing::Values(false)); @@ -1748,6 +1746,11 @@ } IN_PROC_BROWSER_TEST_P(WebViewNewWindowTest, OpenURLFromTab_NewWindow_Abort) { + // This test is disabled because it attaches before the element is appended + // to the document. crbug.com/589896. + if (content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) + return; + LoadAppWithGuest("web_view/simple"); // Verify that OpenURLFromTab with a window disposition of NEW_BACKGROUND_TAB
diff --git a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc index a7842da..53bfdc5 100644 --- a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc +++ b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
@@ -32,6 +32,7 @@ #include "content/public/browser/render_widget_host_iterator.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" +#include "content/public/common/browser_plugin_guest_mode.h" #include "content/public/common/content_switches.h" #include "content/public/test/browser_test_utils.h" #include "extensions/browser/api/extensions_api_client.h" @@ -502,10 +503,11 @@ } }; +class WebViewNewWindowInteractiveTest : public WebViewInteractiveTest {}; + // The following class of tests do not work for OOPIF <webview>. // TODO(ekaramad): Make this tests work with OOPIF and replace the test classes // with WebViewInteractiveTest (see crbug.com/582562). -class WebViewNewWindowInteractiveTest : public WebViewInteractiveTestBase {}; class WebViewFocusInteractiveTest : public WebViewInteractiveTestBase {}; class WebViewPopupInteractiveTest : public WebViewInteractiveTestBase {}; class WebViewContextMenuInteractiveTest : public WebViewInteractiveTestBase {}; @@ -516,6 +518,10 @@ WebViewInteractiveTest, testing::Bool()); +INSTANTIATE_TEST_CASE_P(WebViewInteractiveTests, + WebViewNewWindowInteractiveTest, + testing::Bool()); + // ui_test_utils::SendMouseMoveSync doesn't seem to work on OS_MACOSX, and // likely won't work on many other platforms as well, so for now this test // is for Windows and Linux only. As of Sept 17th, 2013 this test is disabled @@ -743,27 +749,32 @@ ASSERT_TRUE(start_of_line_listener.WaitUntilSatisfied()); } -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, NewWindow_AttachAfterOpenerDestroyed) { + // This test is disabled because it attaches before the element is appended + // to the document. crbug.com/589896. + if (content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) + return; + TestHelper("testNewWindowAttachAfterOpenerDestroyed", "web_view/newwindow", NEEDS_TEST_SERVER); } -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, NewWindow_NewWindowNameTakesPrecedence) { TestHelper("testNewWindowNameTakesPrecedence", "web_view/newwindow", NEEDS_TEST_SERVER); } -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, NewWindow_WebViewNameTakesPrecedence) { TestHelper("testNewWindowWebViewNameTakesPrecedence", "web_view/newwindow", NEEDS_TEST_SERVER); } -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, NewWindow_NoName) { +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, NewWindow_NoName) { TestHelper("testNewWindowNoName", "web_view/newwindow", NEEDS_TEST_SERVER); @@ -775,41 +786,46 @@ #else #define MAYBE_NewWindow_Redirect NewWindow_Redirect #endif -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, MAYBE_NewWindow_Redirect) { TestHelper("testNewWindowRedirect", "web_view/newwindow", NEEDS_TEST_SERVER); } -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, NewWindow_Close) { +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, NewWindow_Close) { TestHelper("testNewWindowClose", "web_view/newwindow", NEEDS_TEST_SERVER); } -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, NewWindow_DeferredAttachment) { + // This test is disabled because it attaches before the element is appended + // to the document. crbug.com/589896. + if (content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) + return; + TestHelper("testNewWindowDeferredAttachment", "web_view/newwindow", NEEDS_TEST_SERVER); } -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, NewWindow_ExecuteScript) { TestHelper("testNewWindowExecuteScript", "web_view/newwindow", NEEDS_TEST_SERVER); } -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, NewWindow_DeclarativeWebRequest) { TestHelper("testNewWindowDeclarativeWebRequest", "web_view/newwindow", NEEDS_TEST_SERVER); } -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, NewWindow_DiscardAfterOpenerDestroyed) { TestHelper("testNewWindowDiscardAfterOpenerDestroyed", "web_view/newwindow", @@ -822,7 +838,7 @@ #else #define MAYBE_NewWindow_WebRequest NewWindow_WebRequest #endif -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, MAYBE_NewWindow_WebRequest) { TestHelper("testNewWindowWebRequest", "web_view/newwindow", @@ -838,7 +854,7 @@ NEEDS_TEST_SERVER); } -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, NewWindow_WebRequestRemoveElement) { TestHelper("testNewWindowWebRequestRemoveElement", "web_view/newwindow", @@ -877,7 +893,7 @@ } #endif -IN_PROC_BROWSER_TEST_F(WebViewNewWindowInteractiveTest, +IN_PROC_BROWSER_TEST_P(WebViewNewWindowInteractiveTest, NewWindow_OpenerDestroyedWhileUnattached) { TestHelper("testNewWindowOpenerDestroyedWhileUnattached", "web_view/newwindow",
diff --git a/chrome/browser/banners/app_banner_data_fetcher.cc b/chrome/browser/banners/app_banner_data_fetcher.cc index a8c8c32..5282804f 100644 --- a/chrome/browser/banners/app_banner_data_fetcher.cc +++ b/chrome/browser/banners/app_banner_data_fetcher.cc
@@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/command_line.h" +#include "base/lazy_instance.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -31,7 +32,8 @@ namespace { -base::TimeDelta gTimeDeltaForTesting; +base::LazyInstance<base::TimeDelta> gTimeDeltaForTesting = + LAZY_INSTANCE_INITIALIZER; int gCurrentRequestID = -1; const char kPngExtension[] = ".png"; @@ -64,12 +66,12 @@ // static base::Time AppBannerDataFetcher::GetCurrentTime() { - return base::Time::Now() + gTimeDeltaForTesting; + return base::Time::Now() + gTimeDeltaForTesting.Get(); } // static void AppBannerDataFetcher::SetTimeDeltaForTesting(int days) { - gTimeDeltaForTesting = base::TimeDelta::FromDays(days); + gTimeDeltaForTesting.Get() = base::TimeDelta::FromDays(days); } AppBannerDataFetcher::AppBannerDataFetcher(content::WebContents* web_contents,
diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h index cd22bf6e6..540ba2a 100644 --- a/chrome/browser/browser_process.h +++ b/chrome/browser/browser_process.h
@@ -181,6 +181,9 @@ virtual GpuModeManager* gpu_mode_manager() = 0; + // Create and bind remote debugging server to a given |ip| and |port|. + // Passing empty |ip| results in binding to localhost: + // 127.0.0.1 or ::1 depending on the environment. virtual void CreateDevToolsHttpProtocolHandler(const std::string& ip, uint16_t port) = 0; virtual void CreateDevToolsAutoOpener() = 0;
diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc index 132db68e..6f45a76 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
@@ -195,9 +195,6 @@ content::GeofencingManager* GetGeofencingManager() override { return nullptr; } - content::NavigatorConnectContext* GetNavigatorConnectContext() override { - return nullptr; - } content::PlatformNotificationContext* GetPlatformNotificationContext() override { return nullptr;
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 61723fab..f48e2ea 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc
@@ -174,7 +174,6 @@ #if defined(OS_LINUX) && !defined(OS_CHROMEOS) #include "chrome/browser/first_run/upgrade_util_linux.h" -#include "chrome/browser/sxs_linux.h" #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) #if defined(OS_CHROMEOS) @@ -546,7 +545,7 @@ int port; if (base::StringToInt(port_str, &port) && port >= 0 && port < 65535) { g_browser_process->CreateDevToolsHttpProtocolHandler( - "127.0.0.1", static_cast<uint16_t>(port)); + "", static_cast<uint16_t>(port)); } else { DLOG(WARNING) << "Invalid http debugger port number " << port; } @@ -1485,11 +1484,6 @@ return chrome::RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS; #endif // defined(OS_WIN) -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) - if (sxs_linux::ShouldMigrateUserDataDir()) - return sxs_linux::MigrateUserDataDir(); -#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) - // Desktop construction occurs here, (required before profile creation). PreProfileInit();
diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc index 466971e4..37bcc4c 100644 --- a/chrome/browser/chrome_browser_main_linux.cc +++ b/chrome/browser/chrome_browser_main_linux.cc
@@ -18,7 +18,6 @@ #if !defined(OS_CHROMEOS) #include "base/linux_util.h" -#include "chrome/browser/sxs_linux.h" #include "content/public/browser/browser_thread.h" #endif @@ -47,10 +46,6 @@ content::BrowserThread::PostBlockingPoolTask( FROM_HERE, base::Bind(base::IgnoreResult(&base::GetLinuxDistro))); - - content::BrowserThread::PostBlockingPoolTask( - FROM_HERE, - base::Bind(&sxs_linux::AddChannelMarkToUserDataDir)); #endif media::AudioManager::SetGlobalAppName(
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index 3273de1e..3a996d66 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc
@@ -56,7 +56,6 @@ #include "content/public/browser/utility_process_host.h" #include "content/public/browser/utility_process_host_client.h" #include "content/public/common/content_switches.h" -#include "content/public/common/dwrite_font_platform_win.h" #include "content/public/common/main_function_params.h" #include "ui/base/cursor/cursor_loader_win.h" #include "ui/base/l10n/l10n_util.h" @@ -65,7 +64,6 @@ #include "ui/base/win/message_box_win.h" #include "ui/gfx/platform_font_win.h" #include "ui/gfx/switches.h" -#include "ui/gfx/win/direct_write.h" #include "ui/strings/grit/app_locale_settings.h" #if defined(GOOGLE_CHROME_BUILD) @@ -110,16 +108,6 @@ base::string16 GetLocalizedString(int installer_string_id) override; }; -void ExecuteFontCacheBuildTask(const base::FilePath& path) { - base::WeakPtr<content::UtilityProcessHost> utility_process_host( - content::UtilityProcessHost::Create(NULL, NULL)->AsWeakPtr()); - utility_process_host->SetName( - l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_FONT_CACHE_BUILDER_NAME)); - utility_process_host->DisableSandbox(); - utility_process_host->Send( - new ChromeUtilityHostMsg_BuildDirectWriteFontCache(path)); -} - #if BUILDFLAG(ENABLE_KASKO) void ObserveFailedCrashReportDirectory(const base::FilePath& path, bool error) { DCHECK(!error); @@ -324,37 +312,6 @@ void ChromeBrowserMainPartsWin::PostProfileInit() { ChromeBrowserMainParts::PostProfileInit(); - - // DirectWrite support is mainly available Windows 7 and up. - // Skip loading the font cache if we are using the font proxy field trial. - if (gfx::win::ShouldUseDirectWrite() && - !content::ShouldUseDirectWriteFontProxyFieldTrial()) { - base::FilePath path( - profile()->GetPath().AppendASCII(content::kFontCacheSharedSectionName)); - // This function will create a read only section if cache file exists - // otherwise it will spawn utility process to build cache file, which will - // be used during next browser start/postprofileinit. - if (!content::LoadFontCache(path)) { - // We delay building of font cache until first startup page loads. - // During first renderer start there are lot of things happening - // simultaneously some of them are: - // - Renderer is going through all font files on the system to create a - // font collection. - // - Renderer loading up startup URL, accessing HTML/JS File cache, net - // activity etc. - // - Extension initialization. - // We delay building of cache mainly to avoid parallel font file loading - // along with Renderer. Some systems have significant number of font files - // which takes long time to process. - // Related information is at http://crbug.com/436195. - const int kBuildFontCacheDelaySec = 30; - content::BrowserThread::PostDelayedTask( - content::BrowserThread::IO, - FROM_HERE, - base::Bind(ExecuteFontCacheBuildTask, path), - base::TimeDelta::FromSeconds(kBuildFontCacheDelaySec)); - } - } } void ChromeBrowserMainPartsWin::PostBrowserStart() {
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index a9e88d1..31c8f70a 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1345,6 +1345,9 @@ // Keys: lowPriorityIframes "LowPriorityIFrames", + + // Keys: disallowFetchForDocWrittenScriptsInMainFrame + "DisallowFetchForDocWrittenScriptsInMainFrame" }; std::vector<std::string> blink_settings;
diff --git a/chrome/browser/chromeos/login/ui/simple_web_view_dialog.cc b/chrome/browser/chromeos/login/ui/simple_web_view_dialog.cc index 5fa079792e..d073a91 100644 --- a/chrome/browser/chromeos/login/ui/simple_web_view_dialog.cc +++ b/chrome/browser/chromeos/login/ui/simple_web_view_dialog.cc
@@ -137,7 +137,7 @@ command_updater_->UpdateCommandEnabled(IDC_FORWARD, true); command_updater_->UpdateCommandEnabled(IDC_STOP, true); command_updater_->UpdateCommandEnabled(IDC_RELOAD, true); - command_updater_->UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE, true); + command_updater_->UpdateCommandEnabled(IDC_RELOAD_BYPASSING_CACHE, true); command_updater_->UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, true); } @@ -349,11 +349,11 @@ web_contents->Stop(); break; case IDC_RELOAD: - // Always reload ignoring cache. - case IDC_RELOAD_IGNORING_CACHE: + // Always reload bypassing cache. + case IDC_RELOAD_BYPASSING_CACHE: case IDC_RELOAD_CLEARING_CACHE: location_bar_->Revert(); - web_contents->GetController().ReloadIgnoringCache(true); + web_contents->GetController().ReloadBypassingCache(true); break; default: NOTREACHED();
diff --git a/chrome/browser/devtools/devtools_file_helper.h b/chrome/browser/devtools/devtools_file_helper.h index dbe61704..c63ffa5 100644 --- a/chrome/browser/devtools/devtools_file_helper.h +++ b/chrome/browser/devtools/devtools_file_helper.h
@@ -13,6 +13,7 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/strings/string16.h" #include "components/prefs/pref_change_registrar.h"
diff --git a/chrome/browser/devtools/devtools_file_system_indexer.h b/chrome/browser/devtools/devtools_file_system_indexer.h index 7e5cd34..7682c49 100644 --- a/chrome/browser/devtools/devtools_file_system_indexer.h +++ b/chrome/browser/devtools/devtools_file_system_indexer.h
@@ -15,6 +15,7 @@ #include "base/files/file_proxy.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" class Profile;
diff --git a/chrome/browser/devtools/devtools_file_watcher.cc b/chrome/browser/devtools/devtools_file_watcher.cc index d966de5..6cfafcd 100644 --- a/chrome/browser/devtools/devtools_file_watcher.cc +++ b/chrome/browser/devtools/devtools_file_watcher.cc
@@ -13,6 +13,7 @@ #include "base/files/file_path.h" #include "base/files/file_path_watcher.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread;
diff --git a/chrome/browser/devtools/devtools_protocol.h b/chrome/browser/devtools/devtools_protocol.h index 73ac261..41c7e9f 100644 --- a/chrome/browser/devtools/devtools_protocol.h +++ b/chrome/browser/devtools/devtools_protocol.h
@@ -8,6 +8,7 @@ #include <string> #include "base/compiler_specific.h" +#include "base/memory/scoped_ptr.h" #include "base/values.h" // Utility class for processing DevTools remote debugging messages.
diff --git a/chrome/browser/devtools/remote_debugging_server.cc b/chrome/browser/devtools/remote_debugging_server.cc index c355ce5..2576410 100644 --- a/chrome/browser/devtools/remote_debugging_server.cc +++ b/chrome/browser/devtools/remote_debugging_server.cc
@@ -45,14 +45,26 @@ last_tethering_port_(kMinTetheringPort) {} private: + scoped_ptr<net::ServerSocket> CreateLocalHostServerSocket(int port) { + scoped_ptr<net::ServerSocket> socket( + new net::TCPServerSocket(nullptr, net::NetLog::Source())); + if (socket->ListenWithAddressAndPort( + "127.0.0.1", port, kBackLog) == net::OK) + return socket; + if (socket->ListenWithAddressAndPort("::1", port, kBackLog) == net::OK) + return socket; + return scoped_ptr<net::ServerSocket>(); + } + // devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory. scoped_ptr<net::ServerSocket> CreateForHttpServer() override { scoped_ptr<net::ServerSocket> socket( new net::TCPServerSocket(nullptr, net::NetLog::Source())); - if (socket->ListenWithAddressAndPort(address_, port_, kBackLog) != net::OK) - return scoped_ptr<net::ServerSocket>(); - - return socket; + if (address_.empty()) + return CreateLocalHostServerSocket(port_); + if (socket->ListenWithAddressAndPort(address_, port_, kBackLog) == net::OK) + return socket; + return scoped_ptr<net::ServerSocket>(); } scoped_ptr<net::ServerSocket> CreateForTethering(std::string* name) override { @@ -63,13 +75,7 @@ last_tethering_port_ = kMinTetheringPort; uint16_t port = ++last_tethering_port_; *name = base::UintToString(port); - scoped_ptr<net::TCPServerSocket> socket( - new net::TCPServerSocket(nullptr, net::NetLog::Source())); - if (socket->ListenWithAddressAndPort("127.0.0.1", port, kBackLog) != - net::OK) { - return scoped_ptr<net::ServerSocket>(); - } - return std::move(socket); + return CreateLocalHostServerSocket(port); } std::string address_;
diff --git a/chrome/browser/devtools/remote_debugging_server.h b/chrome/browser/devtools/remote_debugging_server.h index e27cc16..6394582 100644 --- a/chrome/browser/devtools/remote_debugging_server.h +++ b/chrome/browser/devtools/remote_debugging_server.h
@@ -20,6 +20,8 @@ public: static void EnableTetheringForDebug(); + // Bind remote debugging service to the given |ip| and |port|. + // Empty |ip| stands for 127.0.0.1 or ::1. RemoteDebuggingServer(const std::string& ip, uint16_t port); virtual ~RemoteDebuggingServer();
diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc index 6b9b354..366d9c5 100644 --- a/chrome/browser/diagnostics/recon_diagnostics.cc +++ b/chrome/browser/diagnostics/recon_diagnostics.cc
@@ -13,6 +13,7 @@ #include "base/json/json_reader.h" #include "base/json/json_string_value_serializer.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h"
diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc index 7315d2f..39b63128 100644 --- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc +++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
@@ -161,12 +161,9 @@ #define MAYBE_ChooseDesktopMedia ChooseDesktopMedia #endif IN_PROC_BROWSER_TEST_F(DesktopCaptureApiTest, MAYBE_ChooseDesktopMedia) { - // For tab and audio share, we need to turn on the flag, because the - // functionality is currently behind the flags. + // For tabshare, we need to turn on the flag. base::CommandLine::ForCurrentProcess()->AppendSwitch( extensions::switches::kEnableTabForDesktopShare); - base::CommandLine::ForCurrentProcess()->AppendSwitch( - extensions::switches::kEnableDesktopCaptureAudio); // Each element in the following array corresponds to one test in // chrome/test/data/extensions/api_test/desktop_capture/test.js .
diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc index d30e240..617e6f0d 100644 --- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc +++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc
@@ -18,6 +18,8 @@ #include "chrome/browser/media/native_desktop_media_list.h" #include "chrome/browser/media/tab_desktop_media_list.h" #include "chrome/browser/ui/ash/ash_util.h" +#include "chrome/common/channel_info.h" +#include "components/version_info/version_info.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" @@ -100,13 +102,19 @@ if (base::CommandLine::ForCurrentProcess()->HasSwitch( extensions::switches::kEnableTabForDesktopShare)) { show_tabs = true; + } else if (base::CommandLine::ForCurrentProcess()->HasSwitch( + extensions::switches::kDisableTabForDesktopShare)) { + show_tabs = false; + } else { + const version_info::Channel channel = chrome::GetChannel(); + show_tabs = (channel != version_info::Channel::STABLE); } break; case api::desktop_capture::DESKTOP_CAPTURE_SOURCE_TYPE_AUDIO: bool has_flag = base::CommandLine::ForCurrentProcess()->HasSwitch( - extensions::switches::kEnableDesktopCaptureAudio); - request_audio = has_flag; + extensions::switches::kDisableDesktopCaptureAudio); + request_audio = !has_flag; break; } }
diff --git a/chrome/browser/extensions/api/gcd_private/privet_v3_context_getter.h b/chrome/browser/extensions/api/gcd_private/privet_v3_context_getter.h index 0dc5d71..f64cad4 100644 --- a/chrome/browser/extensions/api/gcd_private/privet_v3_context_getter.h +++ b/chrome/browser/extensions/api/gcd_private/privet_v3_context_getter.h
@@ -7,6 +7,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/single_thread_task_runner.h" #include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/extensions/api/history/history_api.cc b/chrome/browser/extensions/api/history/history_api.cc index 47d0a11..5de2840 100644 --- a/chrome/browser/extensions/api/history/history_api.cc +++ b/chrome/browser/extensions/api/history/history_api.cc
@@ -39,10 +39,8 @@ using api::history::HistoryItem; using api::history::VisitItem; -typedef std::vector<linked_ptr<api::history::HistoryItem> > - HistoryItemList; -typedef std::vector<linked_ptr<api::history::VisitItem> > - VisitItemList; +typedef std::vector<api::history::HistoryItem> HistoryItemList; +typedef std::vector<api::history::VisitItem> VisitItemList; namespace AddUrl = api::history::AddUrl; namespace DeleteUrl = api::history::DeleteUrl; @@ -62,28 +60,27 @@ return 1000 * time.ToDoubleT(); } -scoped_ptr<HistoryItem> GetHistoryItem(const history::URLRow& row) { - scoped_ptr<HistoryItem> history_item(new HistoryItem()); +HistoryItem GetHistoryItem(const history::URLRow& row) { + HistoryItem history_item; - history_item->id = base::Int64ToString(row.id()); - history_item->url.reset(new std::string(row.url().spec())); - history_item->title.reset(new std::string(base::UTF16ToUTF8(row.title()))); - history_item->last_visit_time.reset( + history_item.id = base::Int64ToString(row.id()); + history_item.url.reset(new std::string(row.url().spec())); + history_item.title.reset(new std::string(base::UTF16ToUTF8(row.title()))); + history_item.last_visit_time.reset( new double(MilliSecondsFromTime(row.last_visit()))); - history_item->typed_count.reset(new int(row.typed_count())); - history_item->visit_count.reset(new int(row.visit_count())); + history_item.typed_count.reset(new int(row.typed_count())); + history_item.visit_count.reset(new int(row.visit_count())); return history_item; } -scoped_ptr<VisitItem> GetVisitItem(const history::VisitRow& row) { - scoped_ptr<VisitItem> visit_item(new VisitItem()); +VisitItem GetVisitItem(const history::VisitRow& row) { + VisitItem visit_item; - visit_item->id = base::Int64ToString(row.url_id); - visit_item->visit_id = base::Int64ToString(row.visit_id); - visit_item->visit_time.reset( - new double(MilliSecondsFromTime(row.visit_time))); - visit_item->referring_visit_id = base::Int64ToString(row.referring_visit); + visit_item.id = base::Int64ToString(row.url_id); + visit_item.visit_id = base::Int64ToString(row.visit_id); + visit_item.visit_time.reset(new double(MilliSecondsFromTime(row.visit_time))); + visit_item.referring_visit_id = base::Int64ToString(row.referring_visit); api::history::TransitionType transition = api::history::TRANSITION_TYPE_LINK; switch (row.transition & ui::PAGE_TRANSITION_CORE_MASK) { @@ -124,7 +121,7 @@ DCHECK(false); } - visit_item->transition = transition; + visit_item.transition = transition; return visit_item; } @@ -146,8 +143,7 @@ const history::URLRow& row, const history::RedirectList& redirects, base::Time visit_time) { - scoped_ptr<HistoryItem> history_item = GetHistoryItem(row); - scoped_ptr<base::ListValue> args = OnVisited::Create(*history_item); + scoped_ptr<base::ListValue> args = OnVisited::Create(GetHistoryItem(row)); DispatchEvent(profile_, events::HISTORY_ON_VISITED, api::history::OnVisited::kEventName, std::move(args)); } @@ -299,12 +295,8 @@ const history::VisitVector& visits) { VisitItemList visit_item_vec; if (success && !visits.empty()) { - for (history::VisitVector::const_iterator iterator = visits.begin(); - iterator != visits.end(); - ++iterator) { - visit_item_vec.push_back(make_linked_ptr( - GetVisitItem(*iterator).release())); - } + for (const history::VisitRow& visit : visits) + visit_item_vec.push_back(GetVisitItem(visit)); } results_ = GetVisits::Results::Create(visit_item_vec); @@ -342,13 +334,8 @@ void HistorySearchFunction::SearchComplete(history::QueryResults* results) { HistoryItemList history_item_vec; if (results && !results->empty()) { - for (history::QueryResults::URLResultVector::const_iterator iterator = - results->begin(); - iterator != results->end(); - ++iterator) { - history_item_vec.push_back(make_linked_ptr( - GetHistoryItem(**iterator).release())); - } + for (const history::URLResult* item : *results) + history_item_vec.push_back(GetHistoryItem(*item)); } results_ = Search::Results::Create(history_item_vec); SendAsyncResponse();
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.cc b/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.cc index f60069b..ac018a3c 100644 --- a/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.cc +++ b/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.cc
@@ -46,6 +46,10 @@ // A preference determining whether to hide the warning bubble next time. const char kPrefWarningBubbleNeverShow[] = "skip_ime_warning_bubble"; +// A preference to see whether it is the first time to call input.ime.activate +// since the extension is loaded. +const char kPrefImeActivatedCalledBefore[] = "ime_activate_called_before"; + bool IsInputImeEnabled() { return !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableInputImeAPI); @@ -123,6 +127,10 @@ const Extension* extension) { // No-op if called multiple times. ui::IMEBridge::Initialize(); + Profile* profile = Profile::FromBrowserContext(browser_context); + ExtensionPrefs::Get(profile)->UpdateExtensionPref( + extension->id(), kPrefImeActivatedCalledBefore, + new base::FundamentalValue(false)); } void InputImeAPI::OnExtensionUnloaded(content::BrowserContext* browser_context, @@ -194,7 +202,31 @@ if (!event_router) return RespondNow(Error(kErrorNoActiveEngine)); - // This API is only allowed to be called from a user action. + ExtensionPrefs* prefs = ExtensionPrefs::Get(profile); + bool warning_bubble_never_show = false; + bool ime_activated_called = false; + + if (prefs->ReadPrefAsBoolean(extension_id(), kPrefImeActivatedCalledBefore, + &ime_activated_called) && + prefs->ReadPrefAsBoolean(extension_id(), kPrefWarningBubbleNeverShow, + &warning_bubble_never_show) && + !ime_activated_called && + warning_bubble_never_show) { + // If it the first time that the extension call input.ime.activate() since + // loaded, we allow it to be automatically activated from a non user action. + event_router->SetActiveEngine(extension_id()); + ExtensionPrefs::Get(profile)->UpdateExtensionPref( + extension_id(), kPrefImeActivatedCalledBefore, + new base::FundamentalValue(true)); + return RespondNow(NoArguments()); + } + + ExtensionPrefs::Get(profile)->UpdateExtensionPref( + extension_id(), kPrefImeActivatedCalledBefore, + new base::FundamentalValue(true)); + + // If not the first time, this API is only allowed to be called from a user + // action. if (!user_gesture()) return RespondNow(Error(kErrorNotCalledFromUserAction)); @@ -204,11 +236,7 @@ return RespondNow(NoArguments()); } - ExtensionPrefs* prefs = ExtensionPrefs::Get(profile); - bool allowed_to_activate = false; - if (prefs->ReadPrefAsBoolean(extension_id(), kPrefWarningBubbleNeverShow, - &allowed_to_activate) && - allowed_to_activate) { + if (warning_bubble_never_show) { // If user allows to activate the extension without showing the warning // bubble, sets the active engine directly. // Otherwise, the extension will be activated when the user presses the 'OK'
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc index 6bf71e6..d762a4d1 100644 --- a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
@@ -146,8 +146,7 @@ } void PasswordsPrivateDelegateImpl::SetPasswordList( - const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list, - bool show_passwords) { + const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list) { // Rebuild |login_pair_to_index_map_| so that it reflects the contents of the // new list. login_pair_to_index_map_.clear();
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.h b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.h index dae28d6b..b2cf817 100644 --- a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.h +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.h
@@ -55,9 +55,8 @@ const std::string& origin_url, const std::string& username, const base::string16& plaintext_password) override; - void SetPasswordList( - const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list, - bool show_passwords) override; + void SetPasswordList(const std::vector<scoped_ptr<autofill::PasswordForm>>& + password_list) override; void SetPasswordExceptionList( const std::vector<scoped_ptr<autofill::PasswordForm>>& password_exception_list) override;
diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc index 32a766a..0f69e53b 100644 --- a/chrome/browser/extensions/api/settings_private/prefs_util.cc +++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -105,8 +105,6 @@ settings_private::PrefType::PREF_TYPE_STRING; (*s_whitelist)["net.network_prediction_options"] = settings_private::PrefType::PREF_TYPE_NUMBER; - (*s_whitelist)["profile.password_manager_allow_show_passwords"] = - settings_private::PrefType::PREF_TYPE_BOOLEAN; (*s_whitelist)["profile.password_manager_enabled"] = settings_private::PrefType::PREF_TYPE_BOOLEAN; (*s_whitelist)["safebrowsing.enabled"] =
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index b88feedd5..ad9a1e539 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -42,7 +42,7 @@ #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_navigator.h" -#include "chrome/browser/ui/browser_tabstrip.h" +#include "chrome/browser/ui/browser_navigator_params.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/panels/panel_manager.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -641,11 +641,16 @@ Browser* new_window = new Browser(create_params); - for (std::vector<GURL>::iterator i = urls.begin(); i != urls.end(); ++i) { - WebContents* tab = chrome::AddSelectedTabWithURL( - new_window, *i, ui::PAGE_TRANSITION_LINK); + for (const GURL& url : urls) { + chrome::NavigateParams navigate_params(new_window, url, + ui::PAGE_TRANSITION_LINK); + navigate_params.disposition = NEW_FOREGROUND_TAB; + navigate_params.source_site_instance = + render_frame_host()->GetSiteInstance(); + chrome::Navigate(&navigate_params); if (create_panel) { - TabHelper::FromWebContents(tab)->SetExtensionAppIconById(extension_id); + TabHelper::FromWebContents(navigate_params.target_contents) + ->SetExtensionAppIconById(extension_id); } } @@ -1592,7 +1597,7 @@ ui::PAGE_TRANSITION_RELOAD, false); GetCurrentBrowser()->OpenURL(params); } else if (bypass_cache) { - web_contents->GetController().ReloadIgnoringCache(true); + web_contents->GetController().ReloadBypassingCache(true); } else { web_contents->GetController().Reload(true); }
diff --git a/chrome/browser/extensions/api/tabs/tabs_test.cc b/chrome/browser/extensions/api/tabs/tabs_test.cc index aa258bc..f75baee9 100644 --- a/chrome/browser/extensions/api/tabs/tabs_test.cc +++ b/chrome/browser/extensions/api/tabs/tabs_test.cc
@@ -431,6 +431,8 @@ IncognitoModePrefs::FORCED); // Run without an explicit "incognito" param. scoped_refptr<WindowsCreateFunction> function(new WindowsCreateFunction()); + function->SetRenderFrameHost( + browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame()); scoped_refptr<Extension> extension(test_util::CreateEmptyExtension()); function->set_extension(extension.get()); scoped_ptr<base::DictionaryValue> result(utils::ToDictionary( @@ -450,6 +452,8 @@ Browser* incognito_browser = CreateIncognitoBrowser(); // Run without an explicit "incognito" param. function = new WindowsCreateFunction(); + function->SetRenderFrameHost( + browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame()); function->set_extension(extension.get()); result.reset(utils::ToDictionary( utils::RunFunctionAndReturnSingleResult(
diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc index 233e213..7eb080c 100644 --- a/chrome/browser/extensions/extension_apitest.cc +++ b/chrome/browser/extensions/extension_apitest.cc
@@ -175,6 +175,13 @@ extension_name, std::string(), NULL, kFlagEnableFileAccess); } +bool ExtensionApiTest::RunExtensionTestWithArg( + const std::string& extension_name, + const char* custom_arg) { + return RunExtensionTestImpl(extension_name, std::string(), custom_arg, + kFlagEnableFileAccess); +} + bool ExtensionApiTest::RunExtensionTestIncognito( const std::string& extension_name) { return RunExtensionTestImpl(extension_name,
diff --git a/chrome/browser/extensions/extension_apitest.h b/chrome/browser/extensions/extension_apitest.h index 7b1a193..5415365 100644 --- a/chrome/browser/extensions/extension_apitest.h +++ b/chrome/browser/extensions/extension_apitest.h
@@ -72,6 +72,11 @@ // |extension_name| is a directory in "test/data/extensions/api_test". bool RunExtensionTest(const std::string& extension_name); + // Similar to RunExtensionTest, except sets an additional string argument + // |customArg| to the test config object. + bool RunExtensionTestWithArg(const std::string& extension_name, + const char* custom_arg); + // Same as RunExtensionTest, but enables the extension for incognito mode. bool RunExtensionTestIncognito(const std::string& extension_name);
diff --git a/chrome/browser/extensions/window_open_apitest.cc b/chrome/browser/extensions/window_open_apitest.cc index 61f954b..ec50d3ea 100644 --- a/chrome/browser/extensions/window_open_apitest.cc +++ b/chrome/browser/extensions/window_open_apitest.cc
@@ -231,13 +231,11 @@ class WindowOpenPanelDisabledTest : public ExtensionApiTest { void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionApiTest::SetUpCommandLine(command_line); - // TODO(jennb): Re-enable when panels are enabled by default. - // command_line->AppendSwitch(switches::kDisablePanels); + command_line->AppendSwitch(switches::kDisablePanels); } }; -IN_PROC_BROWSER_TEST_F(WindowOpenPanelDisabledTest, - DISABLED_WindowOpenPanelNotEnabled) { +IN_PROC_BROWSER_TEST_F(WindowOpenPanelDisabledTest, WindowOpenPanelNotEnabled) { ASSERT_TRUE(RunExtensionTest("window_open/panel_not_enabled")) << message_; } @@ -281,7 +279,18 @@ host_resolver()->AddRule("*", "127.0.0.1"); ASSERT_TRUE(StartEmbeddedTestServer()); - ASSERT_TRUE(RunExtensionTest("window_open/panel_browsing_instance")) + ASSERT_TRUE( + RunExtensionTestWithArg("window_open/panel_browsing_instance", "panel")) + << message_; +} + +// Similar to the previous test, but for when panels are disabled. +IN_PROC_BROWSER_TEST_F(WindowOpenPanelDisabledTest, BrowsingInstanceTest) { + host_resolver()->AddRule("*", "127.0.0.1"); + ASSERT_TRUE(StartEmbeddedTestServer()); + + ASSERT_TRUE( + RunExtensionTestWithArg("window_open/panel_browsing_instance", "popup")) << message_; }
diff --git a/chrome/browser/favicon/content_favicon_driver_browsertest.cc b/chrome/browser/favicon/content_favicon_driver_browsertest.cc index bd4ac11..12101ba 100644 --- a/chrome/browser/favicon/content_favicon_driver_browsertest.cc +++ b/chrome/browser/favicon/content_favicon_driver_browsertest.cc
@@ -205,7 +205,7 @@ // Test that when a user reloads a page ignoring the cache that the favicon is // is redownloaded and (not returned from either the favicon cache or the HTTP // cache). -IN_PROC_BROWSER_TEST_F(ContentFaviconDriverTest, ReloadIgnoringCache) { +IN_PROC_BROWSER_TEST_F(ContentFaviconDriverTest, ReloadBypassingCache) { ASSERT_TRUE(embedded_test_server()->Start()); GURL url = embedded_test_server()->GetURL("/favicon/page_with_favicon.html"); GURL icon_url = embedded_test_server()->GetURL("/favicon/icon.png"); @@ -241,7 +241,7 @@ // A reload ignoring the cache should refetch the favicon from the website. { PendingTaskWaiter waiter(web_contents(), this); - chrome::ExecuteCommand(browser(), IDC_RELOAD_IGNORING_CACHE); + chrome::ExecuteCommand(browser(), IDC_RELOAD_BYPASSING_CACHE); waiter.Wait(); } ASSERT_TRUE(delegate->was_requested());
diff --git a/chrome/browser/feedback/system_logs/system_logs_fetcher_base.h b/chrome/browser/feedback/system_logs/system_logs_fetcher_base.h index 29a20ab..349c448 100644 --- a/chrome/browser/feedback/system_logs/system_logs_fetcher_base.h +++ b/chrome/browser/feedback/system_logs/system_logs_fetcher_base.h
@@ -12,6 +12,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h"
diff --git a/chrome/browser/image_decoder.h b/chrome/browser/image_decoder.h index 5f3dbaa..f320426 100644 --- a/chrome/browser/image_decoder.h +++ b/chrome/browser/image_decoder.h
@@ -12,6 +12,7 @@ #include "base/lazy_instance.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/sequence_checker.h" #include "base/sequenced_task_runner.h" #include "base/synchronization/lock.h"
diff --git a/chrome/browser/importer/firefox_profile_lock_unittest.cc b/chrome/browser/importer/firefox_profile_lock_unittest.cc index c7cb642..4b1df9a 100644 --- a/chrome/browser/importer/firefox_profile_lock_unittest.cc +++ b/chrome/browser/importer/firefox_profile_lock_unittest.cc
@@ -4,6 +4,7 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/string_util.h" #include "build/build_config.h" #include "chrome/browser/importer/firefox_profile_lock.h"
diff --git a/chrome/browser/media/desktop_capture_access_handler.cc b/chrome/browser/media/desktop_capture_access_handler.cc index a9aa1bfb..62d5cc1 100644 --- a/chrome/browser/media/desktop_capture_access_handler.cc +++ b/chrome/browser/media/desktop_capture_access_handler.cc
@@ -366,10 +366,12 @@ loopback_audio_supported) || media_id.type == content::DesktopMediaID::TYPE_WEB_CONTENTS; - const bool has_flag = base::CommandLine::ForCurrentProcess()->HasSwitch( - extensions::switches::kEnableDesktopCaptureAudio); + const bool check_audio_permission = + !base::CommandLine::ForCurrentProcess()->HasSwitch( + extensions::switches::kDisableDesktopCaptureAudio); const bool capture_audio = - (has_flag ? audio_permitted : true) && audio_requested && audio_supported; + (check_audio_permission ? audio_permitted : true) && audio_requested && + audio_supported; ui = GetDevicesForDesktopCapture(&devices, media_id, capture_audio, true, GetApplicationTitle(web_contents, extension),
diff --git a/chrome/browser/media/webrtc_rtp_dump_handler.h b/chrome/browser/media/webrtc_rtp_dump_handler.h index a9fefad..1bb1b037b 100644 --- a/chrome/browser/media/webrtc_rtp_dump_handler.h +++ b/chrome/browser/media/webrtc_rtp_dump_handler.h
@@ -11,6 +11,7 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/media/rtp_dump_type.h"
diff --git a/chrome/browser/media/webrtc_rtp_dump_writer.h b/chrome/browser/media/webrtc_rtp_dump_writer.h index a53955e..6ac6800 100644 --- a/chrome/browser/media/webrtc_rtp_dump_writer.h +++ b/chrome/browser/media/webrtc_rtp_dump_writer.h
@@ -11,6 +11,7 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" #include "base/time/time.h"
diff --git a/chrome/browser/memory/tab_manager.cc b/chrome/browser/memory/tab_manager.cc index 8bd8dca..d65bc47 100644 --- a/chrome/browser/memory/tab_manager.cc +++ b/chrome/browser/memory/tab_manager.cc
@@ -10,9 +10,6 @@ #include <set> #include <vector> -#include "ash/multi_profile_uma.h" -#include "ash/session/session_state_delegate.h" -#include "ash/shell.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" @@ -54,7 +51,11 @@ #include "content/public/common/page_importance_signals.h" #if defined(OS_CHROMEOS) +#include "ash/multi_profile_uma.h" +#include "ash/session/session_state_delegate.h" +#include "ash/shell.h" #include "chrome/browser/memory/tab_manager_delegate_chromeos.h" +#include "chromeos/chromeos_switches.h" #endif using base::TimeDelta; @@ -221,32 +222,13 @@ memory_pressure_listener_.reset(); } -// Things to collect on the browser thread (because TabStripModel isn't thread -// safe): -// 1) whether or not a tab is pinned -// 2) last time a tab was selected -// 3) is the tab currently selected TabStatsList TabManager::GetTabStats() { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - TabStatsList stats_list; - stats_list.reserve(32); // 99% of users have < 30 tabs open. - - // TODO(chrisha): Move this code to a TabStripModel enumeration delegate! - if (!test_tab_strip_models_.empty()) { - for (size_t i = 0; i < test_tab_strip_models_.size(); ++i) { - AddTabStats(test_tab_strip_models_[i].first, // tab_strip_model - test_tab_strip_models_[i].second, // is_app - i == 0, // is_active - &stats_list); - } - } else { - // The code here can only be tested under a full browser test. - AddTabStats(&stats_list); - } + TabStatsList stats_list(GetUnsortedTabStats()); // Sort the collected data so that least desirable to be killed is first, most // desirable is last. std::sort(stats_list.begin(), stats_list.end(), CompareTabStats); + return stats_list; } @@ -290,23 +272,18 @@ return GetWebContentsData(contents)->IsDiscarded(); } -// TODO(jamescook): This should consider tabs with references to other tabs, -// such as tabs created with JavaScript window.open(). Potentially consider -// discarding the entire set together, or use that in the priority computation. -bool TabManager::DiscardTab() { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - TabStatsList stats = GetTabStats(); - if (stats.empty()) - return false; - // Loop until a non-discarded tab to kill is found. - for (TabStatsList::const_reverse_iterator stats_rit = stats.rbegin(); - stats_rit != stats.rend(); ++stats_rit) { - int64_t least_important_tab_id = stats_rit->tab_contents_id; - if (CanDiscardTab(least_important_tab_id) && - DiscardTabById(least_important_tab_id)) - return true; +void TabManager::DiscardTab() { +#if defined(OS_CHROMEOS) + // If --enable-arc-memory-management is on, call Chrome OS specific low memory + // handling process. + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + chromeos::switches::kEnableArcMemoryManagement)) { + delegate_->LowMemoryKill(weak_ptr_factory_.GetWeakPtr(), + GetUnsortedTabStats()); + return; } - return false; +#endif + DiscardTabImpl(); } WebContents* TabManager::DiscardTabById(int64_t target_web_contents_id) { @@ -819,4 +796,50 @@ base::TimeDelta::FromSeconds(kRendererNotificationDelayInSeconds)); } +// TODO(jamescook): This should consider tabs with references to other tabs, +// such as tabs created with JavaScript window.open(). Potentially consider +// discarding the entire set together, or use that in the priority computation. +bool TabManager::DiscardTabImpl() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + TabStatsList stats = GetTabStats(); + + if (stats.empty()) + return false; + // Loop until a non-discarded tab to kill is found. + for (TabStatsList::const_reverse_iterator stats_rit = stats.rbegin(); + stats_rit != stats.rend(); ++stats_rit) { + int64_t least_important_tab_id = stats_rit->tab_contents_id; + if (CanDiscardTab(least_important_tab_id) && + DiscardTabById(least_important_tab_id)) + return true; + } + return false; +} + +// Things to collect on the browser thread (because TabStripModel isn't thread +// safe): +// 1) whether or not a tab is pinned +// 2) last time a tab was selected +// 3) is the tab currently selected +TabStatsList TabManager::GetUnsortedTabStats() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + TabStatsList stats_list; + stats_list.reserve(32); // 99% of users have < 30 tabs open. + + // TODO(chrisha): Move this code to a TabStripModel enumeration delegate! + if (!test_tab_strip_models_.empty()) { + for (size_t i = 0; i < test_tab_strip_models_.size(); ++i) { + AddTabStats(test_tab_strip_models_[i].first, // tab_strip_model + test_tab_strip_models_[i].second, // is_app + i == 0, // is_active + &stats_list); + } + } else { + // The code here can only be tested under a full browser test. + AddTabStats(&stats_list); + } + + return stats_list; +} + } // namespace memory
diff --git a/chrome/browser/memory/tab_manager.h b/chrome/browser/memory/tab_manager.h index d3aaac2..b856c9fd 100644 --- a/chrome/browser/memory/tab_manager.h +++ b/chrome/browser/memory/tab_manager.h
@@ -8,6 +8,7 @@ #include <stdint.h> #include <set> +#include <string> #include <utility> #include <vector> @@ -81,7 +82,7 @@ void Stop(); // Returns the list of the stats for all renderers. Must be called on the UI - // thread. + // thread. The returned list is sorted by reversed importance. TabStatsList GetTabStats(); // Returns a sorted list of renderers, from most important to least important. @@ -90,10 +91,14 @@ // Returns true if |contents| is currently discarded. bool IsTabDiscarded(content::WebContents* contents) const; + // Goes through a list of checks to see if a tab is allowed to be discarded by + // the automatic tab discarding mechanism. Note that this is not used when + // discarding a particular tab from about:discards. + bool CanDiscardTab(int64_t target_web_contents_id) const; + // Discards a tab to free the memory occupied by its renderer. The tab still - // exists in the tab-strip; clicking on it will reload it. Returns true if it - // successfully found a tab and discarded it. - bool DiscardTab(); + // exists in the tab-strip; clicking on it will reload it. + void DiscardTab(); // Discards a tab with the given unique ID. The tab still exists in the // tab-strip; clicking on it will reload it. Returns true if it successfully @@ -120,6 +125,7 @@ FRIEND_TEST_ALL_PREFIXES(TabManagerTest, InvalidOrEmptyURL); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, IsInternalPage); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, OomPressureListener); + FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectPDFPages); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectRecentlyUsedTabs); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectVideoTabs); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ReloadDiscardedTabContextMenu); @@ -185,11 +191,6 @@ // that need to be run periodically (see comment in implementation). void UpdateTimerCallback(); - // Goes through a list of checks to see if a tab is allowed to be discarded by - // the automatic tab discarding mechanism. Note that this is not used when - // discarding a particular tab from about:discards. - bool CanDiscardTab(int64_t target_web_contents_id) const; - // Does the actual discard by destroying the WebContents in |model| at |index| // and replacing it by an empty one. Returns the new WebContents or NULL if // the operation fails (return value used only in testing). @@ -232,6 +233,13 @@ // schedules another call to itself as long as memory pressure continues. void DoChildProcessDispatch(); + // Implementation of DiscardTab. + bool DiscardTabImpl(); + + // Returns the list of the stats for all renderers. Must be called on the UI + // thread. + TabStatsList GetUnsortedTabStats(); + // Timer to periodically update the stats of the renderers. base::RepeatingTimer update_timer_;
diff --git a/chrome/browser/memory/tab_manager_browsertest.cc b/chrome/browser/memory/tab_manager_browsertest.cc index e292fa3a..a6d63a07 100644 --- a/chrome/browser/memory/tab_manager_browsertest.cc +++ b/chrome/browser/memory/tab_manager_browsertest.cc
@@ -105,7 +105,7 @@ // Discard a tab. It should kill the first tab, since it was the oldest // and was not selected. - EXPECT_TRUE(tab_manager->DiscardTab()); + EXPECT_TRUE(tab_manager->DiscardTabImpl()); EXPECT_EQ(3, tsm->count()); EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(0))); EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(1))); @@ -113,7 +113,7 @@ EXPECT_TRUE(tab_manager->recent_tab_discard()); // Run discard again, make sure it kills the second tab. - EXPECT_TRUE(tab_manager->DiscardTab()); + EXPECT_TRUE(tab_manager->DiscardTabImpl()); EXPECT_EQ(3, tsm->count()); EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(0))); EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(1))); @@ -121,7 +121,7 @@ // Kill the third tab. It should not kill the last tab, since it is active // tab. - EXPECT_FALSE(tab_manager->DiscardTab()); + EXPECT_FALSE(tab_manager->DiscardTabImpl()); EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(0))); EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(1))); EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(2))); @@ -259,11 +259,11 @@ // This shouldn't be able to discard a tab as the background tab has not yet // started loading (its URL is not committed). - EXPECT_FALSE(tab_manager->DiscardTab()); + EXPECT_FALSE(tab_manager->DiscardTabImpl()); // Wait for the background tab to load which then allows it to be discarded. load2.Wait(); - EXPECT_TRUE(tab_manager->DiscardTab()); + EXPECT_TRUE(tab_manager->DiscardTabImpl()); } // Makes sure that PDF pages are protected. @@ -287,7 +287,7 @@ // No discarding should be possible as the only background tab is displaying a // PDF page, hence protected. - EXPECT_FALSE(tab_manager->DiscardTab()); + EXPECT_FALSE(tab_manager->DiscardTabImpl()); } // Makes sure that recently opened or used tabs are protected, depending on the @@ -320,13 +320,13 @@ test_clock_.Advance(base::TimeDelta::FromMinutes(kProtectionTime / 2)); // Should not be able to discard a tab. - ASSERT_FALSE(tab_manager->DiscardTab()); + ASSERT_FALSE(tab_manager->DiscardTabImpl()); // Advance the clock for more than the protection time. test_clock_.Advance(base::TimeDelta::FromMinutes(kProtectionTime / 2 + 2)); // Should be able to discard the background tab now. - EXPECT_TRUE(tab_manager->DiscardTab()); + EXPECT_TRUE(tab_manager->DiscardTabImpl()); // Activate the 2nd tab. tsm->ActivateTabAt(1, true); @@ -336,13 +336,13 @@ test_clock_.Advance(base::TimeDelta::FromMinutes(kProtectionTime / 2)); // Should not be able to discard a tab. - ASSERT_FALSE(tab_manager->DiscardTab()); + ASSERT_FALSE(tab_manager->DiscardTabImpl()); // Advance the clock for more than the protection time. test_clock_.Advance(base::TimeDelta::FromMinutes(kProtectionTime / 2 + 2)); // Should be able to discard the background tab now. - EXPECT_TRUE(tab_manager->DiscardTab()); + EXPECT_TRUE(tab_manager->DiscardTabImpl()); // This is necessary otherwise the test crashes in // WebContentsData::WebContentsDestroyed. @@ -379,13 +379,13 @@ video_stream_ui->OnStarted(base::Closure()); // Should not be able to discard a tab. - ASSERT_FALSE(tab_manager->DiscardTab()); + ASSERT_FALSE(tab_manager->DiscardTabImpl()); // Remove the video stream. video_stream_ui.reset(); // Should be able to discard the background tab now. - EXPECT_TRUE(tab_manager->DiscardTab()); + EXPECT_TRUE(tab_manager->DiscardTabImpl()); } } // namespace memory
diff --git a/chrome/browser/memory/tab_manager_delegate_chromeos.cc b/chrome/browser/memory/tab_manager_delegate_chromeos.cc index 4b0d96e8..25e2522 100644 --- a/chrome/browser/memory/tab_manager_delegate_chromeos.cc +++ b/chrome/browser/memory/tab_manager_delegate_chromeos.cc
@@ -4,15 +4,25 @@ #include "chrome/browser/memory/tab_manager_delegate_chromeos.h" +#include <algorithm> +#include <set> +#include <string> +#include <vector> + +#include "base/bind.h" #include "base/memory/memory_pressure_monitor_chromeos.h" #include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/lock.h" +#include "chrome/browser/chromeos/arc/arc_process.h" +#include "chrome/browser/chromeos/arc/arc_process_service.h" #include "chrome/browser/memory/tab_stats.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/common/chrome_constants.h" +#include "components/arc/arc_bridge_service.h" +#include "components/arc/common/process.mojom.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" @@ -32,6 +42,59 @@ // a little while before doing the adjustment. const int kFocusedTabScoreAdjustIntervalMs = 500; +// TODO(cylee): Check whether the app is in foreground or not. +int AppStateToPriority( + const arc::ProcessState& process_state) { + // Logic copied from Android: + // frameworks/base/core/java/android/app/ActivityManager.java + // Note that ProcessState enumerates from most important (lower value) to + // least important (higher value), while ProcessPriority enumerates the + // opposite. + if (process_state >= arc::ProcessState::HOME) { + return ProcessPriority::ANDROID_BACKGROUND; + } else if (process_state >= arc::ProcessState::SERVICE) { + return ProcessPriority::ANDROID_SERVICE; + } else if (process_state > arc::ProcessState::HEAVY_WEIGHT) { + return ProcessPriority::ANDROID_CANT_SAVE_STATE; + } else if (process_state >= arc::ProcessState::IMPORTANT_BACKGROUND) { + return ProcessPriority::ANDROID_PERCEPTIBLE; + } else if (process_state >= arc::ProcessState::IMPORTANT_FOREGROUND) { + return ProcessPriority::ANDROID_VISIBLE; + } else if (process_state >= arc::ProcessState::TOP_SLEEPING) { + return ProcessPriority::ANDROID_TOP_SLEEPING; + } else if (process_state >= arc::ProcessState::FOREGROUND_SERVICE) { + return ProcessPriority::ANDROID_FOREGROUND_SERVICE; + } else if (process_state >= arc::ProcessState::TOP) { + return ProcessPriority::ANDROID_TOP; + } else if (process_state >= arc::ProcessState::PERSISTENT) { + return ProcessPriority::ANDROID_PERSISTENT; + } + return ProcessPriority::ANDROID_NON_EXISTS; +} + +// TODO(cylee): Check whether the tab is in foreground or not. +int TabStatsToPriority(const TabStats& tab) { + int priority = 0; + if (tab.is_app) { + priority = ProcessPriority::CHROME_APP; + } else if (tab.is_internal_page) { + priority = ProcessPriority::CHROME_INTERNAL; + } else { + priority = ProcessPriority::CHROME_NORMAL; + } + + if (tab.is_selected) + priority |= ProcessPriority::CHROME_SELECTED; + if (tab.is_pinned) + priority |= ProcessPriority::CHROME_PINNED; + if (tab.is_media) + priority |= ProcessPriority::CHROME_MEDIA; + if (tab.has_form_entry) + priority |= ProcessPriority::CHROME_CANT_SAVE_STATE; + + return priority; +} + } // namespace TabManagerDelegate::TabManagerDelegate() @@ -46,6 +109,24 @@ TabManagerDelegate::~TabManagerDelegate() {} +// If able to get the list of ARC procsses, prioritize tabs and apps as a whole. +// Otherwise try to kill tabs only. +void TabManagerDelegate::LowMemoryKill( + const base::WeakPtr<TabManager>& tab_manager, + const TabStatsList& tab_list) { + arc::ArcProcessService* arc_process_service = arc::ArcProcessService::Get(); + if (arc_process_service && arc_process_service->RequestProcessList( + base::Bind(&TabManagerDelegate::LowMemoryKillImpl, + tab_manager, tab_list))) { + // LowMemoryKillImpl will be called asynchronously so nothing left to do. + return; + } + // If the list of ARC processes is not available, call LowMemoryKillImpl + // synchronously with an empty list of apps. + std::vector<arc::ArcProcess> dummy_apps; + LowMemoryKillImpl(tab_manager, tab_list, dummy_apps); +} + int TabManagerDelegate::GetOomScore(int child_process_host_id) { base::AutoLock oom_score_autolock(oom_score_lock_); int score = oom_score_map_[child_process_host_id]; @@ -170,6 +251,65 @@ return process_infos; } +// static +std::vector<TabManagerDelegate::KillCandidate> +TabManagerDelegate::GetSortedKillCandidates( + const TabStatsList& tab_list, + const std::vector<arc::ArcProcess>& arc_processes) { + + std::vector<KillCandidate> candidates; + candidates.reserve(tab_list.size() + arc_processes.size()); + + for (const auto& tab : tab_list) { + candidates.push_back(KillCandidate(&tab, TabStatsToPriority(tab))); + } + + for (const auto& app : arc_processes) { + candidates.push_back( + KillCandidate(&app, AppStateToPriority(app.process_state))); + } + + // Sort candidates according to priority. + // TODO(cylee): Missing LRU property. Fix it when apps has the information. + std::sort(candidates.begin(), candidates.end()); + + return candidates; +} + +// static +void TabManagerDelegate::LowMemoryKillImpl( + const base::WeakPtr<TabManager>& tab_manager, + const TabStatsList& tab_list, + const std::vector<arc::ArcProcess>& arc_processes) { + arc::ProcessInstance* arc_process_instance = + arc::ArcBridgeService::Get() ? + arc::ArcBridgeService::Get()->process_instance() : + nullptr; + + std::vector<TabManagerDelegate::KillCandidate> candidates = + GetSortedKillCandidates(tab_list, arc_processes); + for (const auto& entry : candidates) { + // Never kill persistent process. + if (entry.priority >= ProcessPriority::ANDROID_PERSISTENT) { + break; + } + if (entry.is_arc_app) { + if (arc_process_instance) { + arc_process_instance->KillProcess(entry.app->nspid, "LowMemoryKill"); + break; + } + } else { + int64_t tab_id = entry.tab->tab_contents_id; + // Check |tab_manager| is alive before taking tabs into consideration. + if (tab_manager && + tab_manager->CanDiscardTab(tab_id) && + tab_manager->DiscardTabById(tab_id)) { + break; + } + } + } +} + void TabManagerDelegate::AdjustOomPrioritiesOnFileThread( TabStatsList stats_list) { DCHECK_CURRENTLY_ON(BrowserThread::FILE);
diff --git a/chrome/browser/memory/tab_manager_delegate_chromeos.h b/chrome/browser/memory/tab_manager_delegate_chromeos.h index f23bcb1..2075a27 100644 --- a/chrome/browser/memory/tab_manager_delegate_chromeos.h +++ b/chrome/browser/memory/tab_manager_delegate_chromeos.h
@@ -11,8 +11,10 @@ #include "base/containers/hash_tables.h" #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "base/process/process.h" #include "base/timer/timer.h" +#include "chrome/browser/chromeos/arc/arc_process.h" #include "chrome/browser/memory/tab_manager.h" #include "chrome/browser/memory/tab_stats.h" #include "content/public/browser/notification_observer.h" @@ -20,6 +22,37 @@ namespace memory { +// The importance of tabs/apps. The lower the value, the more likely a process +// is to be selected on memory pressure. The values is additive, for example, +// one tab could be of value (CHROME_NORMAL | CHROME_PINNED). +// TODO(cylee): Refactor this CL so the prioritize logic is unified in +// TabManager. +enum ProcessPriority { + ANDROID_BACKGROUND = 1, + ANDROID_SERVICE = 1 << 1, + ANDROID_CANT_SAVE_STATE = 1 << 2, + ANDROID_PERCEPTIBLE = 1 << 3, + ANDROID_VISIBLE = 1 << 4, + ANDROID_TOP_SLEEPING = 1 << 5, + ANDROID_FOREGROUND_SERVICE = 1 << 6, + ANDROID_FOREGROUND = 1 << 7, + // A chrome window can be of one of the 3 exclusive types below: + // internal page, normal page, or chrome app. + CHROME_INTERNAL = 1 << 8, + CHROME_NORMAL = 1 << 9, + CHROME_APP = 1 << 10, + // A chrome window could have the following 4 additional attributes + // (not exclusive). + CHROME_PINNED = 1 << 11, + CHROME_MEDIA = 1 << 12, + CHROME_CANT_SAVE_STATE = 1 << 13, + CHROME_SELECTED = 1 << 14, + ANDROID_TOP = CHROME_SELECTED, + + ANDROID_PERSISTENT = 1 << 30, + ANDROID_NON_EXISTS = 0x7FFFFFFF +}; + // The Chrome OS TabManagerDelegate is responsible for keeping the // renderers' scores up to date in /proc/<pid>/oom_score_adj. // @@ -31,6 +64,9 @@ TabManagerDelegate(); ~TabManagerDelegate() override; + void LowMemoryKill(const base::WeakPtr<TabManager>& tab_manager, + const TabStatsList& tab_stats); + // Return the score of a process. int GetOomScore(int child_process_host_id); @@ -39,6 +75,28 @@ private: FRIEND_TEST_ALL_PREFIXES(TabManagerDelegateTest, GetProcessHandles); + FRIEND_TEST_ALL_PREFIXES(TabManagerDelegateTest, LowMemoryKill); + + // On ARC enabled machines, either a tab or an app could be a possible + // victim of low memory kill process. This is a helper struct which holds a + // pointer to an app or a tab (but not both) to facilitate prioritizing the + // victims. + struct KillCandidate { + KillCandidate(const TabStats* _tab, int _priority) + : tab(_tab), priority(_priority), is_arc_app(false) {} + KillCandidate(const arc::ArcProcess* _app, int _priority) + : app(_app), priority(_priority), is_arc_app(true) {} + union { + const TabStats* tab; + const arc::ArcProcess* app; + }; + int priority; + bool is_arc_app; + + bool operator<(const KillCandidate& rhs) const { + return priority < rhs.priority; + } + }; // content::NotificationObserver: void Observe(int type, @@ -55,6 +113,17 @@ static std::vector<ProcessInfo> GetChildProcessInfos( const TabStatsList& stats_list); + // Actual kills a process after getting all info of tabs and apps. + static void LowMemoryKillImpl( + const base::WeakPtr<TabManager>& tab_manager, + const TabStatsList& tab_list, + const std::vector<arc::ArcProcess>& arc_processes); + + // Get the list of candidates to kill, sorted by reversed importance. + static std::vector<KillCandidate> GetSortedKillCandidates( + const TabStatsList& tab_list, + const std::vector<arc::ArcProcess>& arc_processes); + // Called by AdjustOomPriorities. void AdjustOomPrioritiesOnFileThread(TabStatsList stats_list);
diff --git a/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc b/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc index 107a661..aff37a3 100644 --- a/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc +++ b/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc
@@ -2,17 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/memory/tab_manager.h" +#include "chrome/browser/memory/tab_manager_delegate_chromeos.h" #include <algorithm> #include <vector> #include "base/logging.h" -#include "base/strings/string16.h" -#include "base/time/time.h" -#include "chrome/browser/memory/tab_manager_delegate_chromeos.h" +#include "chrome/browser/chromeos/arc/arc_process.h" #include "chrome/browser/memory/tab_stats.h" #include "chrome/common/url_constants.h" +#include "components/arc/common/process.mojom.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -76,4 +75,46 @@ EXPECT_EQ(201, process_id_pairs[1].second); } +TEST_F(TabManagerDelegateTest, LowMemoryKill) { + std::vector<arc::ArcProcess> arc_processes = { + {1, 10, "top", arc::ProcessState::TOP}, + {2, 20, "foreground", arc::ProcessState::FOREGROUND_SERVICE}, + {3, 30, "service", arc::ProcessState::SERVICE} + }; + + TabStats tab1, tab2, tab3, tab4, tab5; + tab1.tab_contents_id = 100; + tab1.is_pinned = true; + + tab2.tab_contents_id = 200; + tab2.is_internal_page = true; + + tab3.tab_contents_id = 300; + tab3.is_pinned = true; + tab3.is_media = true; + + tab4.tab_contents_id = 400; + tab4.is_media = true; + + tab5.tab_contents_id = 500; + tab5.is_app = true; + TabStatsList tab_list = { + tab1, tab2, tab3, tab4, tab5 + }; + + std::vector<TabManagerDelegate::KillCandidate> candidates = + TabManagerDelegate::GetSortedKillCandidates( + tab_list, arc_processes); + EXPECT_EQ(8U, candidates.size()); + + EXPECT_EQ("service", candidates[0].app->process_name); + EXPECT_EQ("foreground", candidates[1].app->process_name); + EXPECT_EQ(200, candidates[2].tab->tab_contents_id); + EXPECT_EQ(500, candidates[3].tab->tab_contents_id); + EXPECT_EQ(100, candidates[4].tab->tab_contents_id); + EXPECT_EQ(400, candidates[5].tab->tab_contents_id); + EXPECT_EQ(300, candidates[6].tab->tab_contents_id); + EXPECT_EQ("top", candidates[7].app->process_name); +} + } // namespace memory
diff --git a/chrome/browser/net/predictor_tab_helper.cc b/chrome/browser/net/predictor_tab_helper.cc index 2c82e540..a6f59ba 100644 --- a/chrome/browser/net/predictor_tab_helper.cc +++ b/chrome/browser/net/predictor_tab_helper.cc
@@ -4,27 +4,16 @@ #include "chrome/browser/net/predictor_tab_helper.h" -#include "base/feature_list.h" +#include "base/command_line.h" #include "chrome/browser/net/predictor.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/url_constants.h" -#include "components/variations/variations_associated_data.h" -#include "content/public/browser/navigation_handle.h" DEFINE_WEB_CONTENTS_USER_DATA_KEY(chrome_browser_net::PredictorTabHelper); namespace chrome_browser_net { -namespace { - -// Triggers the preconnector on the new navigation api. This captures more -// navigations. -const base::Feature kPreconnectMore{"PreconnectMore", - base::FEATURE_DISABLED_BY_DEFAULT}; - -} // namespace - PredictorTabHelper::PredictorTabHelper(content::WebContents* web_contents) : content::WebContentsObserver(web_contents) { } @@ -32,32 +21,15 @@ PredictorTabHelper::~PredictorTabHelper() { } -void PredictorTabHelper::DidStartNavigation( - content::NavigationHandle* navigation_handle) { - if (!base::FeatureList::IsEnabled(kPreconnectMore)) - return; - // Subframe navigations require a param check. - if (!navigation_handle->IsInMainFrame() && - variations::GetVariationParamValue("PreconnectMore", - "preconnect_subframes") != "true") { - return; - } - PreconnectUrl(navigation_handle->GetURL()); -} - void PredictorTabHelper::DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) { - // The standard way to preconnect based on navigation. - if (!base::FeatureList::IsEnabled(kPreconnectMore)) - PreconnectUrl(url); -} - -void PredictorTabHelper::PreconnectUrl(const GURL& url) { Profile* profile = Profile::FromBrowserContext(web_contents()->GetBrowserContext()); chrome_browser_net::Predictor* predictor = profile->GetNetworkPredictor(); - if (predictor && url.SchemeIsHTTPOrHTTPS()) + if (!predictor) + return; + if (url.SchemeIs(url::kHttpScheme) || url.SchemeIs(url::kHttpsScheme)) predictor->PreconnectUrlAndSubresources(url, GURL()); }
diff --git a/chrome/browser/net/predictor_tab_helper.h b/chrome/browser/net/predictor_tab_helper.h index 355d711c..4d95ba0 100644 --- a/chrome/browser/net/predictor_tab_helper.h +++ b/chrome/browser/net/predictor_tab_helper.h
@@ -11,10 +11,6 @@ #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" -namespace content { -class NavigationHandle; -} - namespace chrome_browser_net { class PredictorTabHelper @@ -23,9 +19,7 @@ public: ~PredictorTabHelper() override; - // content::WebContentsObserver: - void DidStartNavigation( - content::NavigationHandle* navigation_handle) override; + // content::WebContentsObserver implementation void DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) override; @@ -34,8 +28,6 @@ explicit PredictorTabHelper(content::WebContents* web_contents); friend class content::WebContentsUserData<PredictorTabHelper>; - void PreconnectUrl(const GURL& url); - DISALLOW_COPY_AND_ASSIGN(PredictorTabHelper); };
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.cc index 514575c2..94447ba 100644 --- a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.cc +++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.cc
@@ -46,12 +46,6 @@ return Settings()->PromoAllowed(); } -jboolean DataReductionProxySettingsAndroid::IsIncludedInAltFieldTrial( - JNIEnv* env, - const JavaParamRef<jobject>& obj) { - return false; -} - jboolean DataReductionProxySettingsAndroid::IsDataReductionProxyEnabled( JNIEnv* env, const JavaParamRef<jobject>& obj) {
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h index d3510937..f70c58c 100644 --- a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h +++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h
@@ -40,9 +40,6 @@ jboolean IsDataReductionProxyPromoAllowed( JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); - jboolean IsIncludedInAltFieldTrial( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj); jboolean IsDataReductionProxyEnabled( JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
diff --git a/chrome/browser/policy/BUILD.gn b/chrome/browser/policy/BUILD.gn index 4f7ce16..abfe35e 100644 --- a/chrome/browser/policy/BUILD.gn +++ b/chrome/browser/policy/BUILD.gn
@@ -17,4 +17,8 @@ "//chrome/common:constants", "//components/policy", ] + + if (is_win) { + libs = [ "wtsapi32.lib" ] + } }
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h index 0f85de9..c3efa242 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_base_factory.h"
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index 947978b..4c33391 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -116,9 +116,6 @@ { key::kPasswordManagerEnabled, password_manager::prefs::kPasswordManagerSavingEnabled, base::Value::TYPE_BOOLEAN }, - { key::kPasswordManagerAllowShowPasswords, - password_manager::prefs::kPasswordManagerAllowShowPasswords, - base::Value::TYPE_BOOLEAN }, { key::kPrintingEnabled, prefs::kPrintingEnabled, base::Value::TYPE_BOOLEAN },
diff --git a/chrome/browser/policy/policy_path_parser_win.cc b/chrome/browser/policy/policy_path_parser_win.cc index 6a1888d..2acadee 100644 --- a/chrome/browser/policy/policy_path_parser_win.cc +++ b/chrome/browser/policy/policy_path_parser_win.cc
@@ -5,7 +5,6 @@ #include <shlobj.h> #include <stddef.h> #include <wtsapi32.h> -#pragma comment(lib, "wtsapi32.lib") #include "chrome/browser/policy/policy_path_parser.h"
diff --git a/chrome/browser/printing/pwg_raster_converter.h b/chrome/browser/printing/pwg_raster_converter.h index a101afcd..1ff51e77 100644 --- a/chrome/browser/printing/pwg_raster_converter.h +++ b/chrome/browser/printing/pwg_raster_converter.h
@@ -7,6 +7,7 @@ #include "base/callback.h" #include "base/memory/ref_counted_memory.h" +#include "base/memory/scoped_ptr.h" namespace base { class FilePath;
diff --git a/chrome/browser/private_working_set_snapshot_win.cc b/chrome/browser/private_working_set_snapshot_win.cc index 8c16fdbc..a0703fe4 100644 --- a/chrome/browser/private_working_set_snapshot_win.cc +++ b/chrome/browser/private_working_set_snapshot_win.cc
@@ -13,9 +13,6 @@ #include "base/numerics/safe_conversions.h" #include "base/win/windows_version.h" -// Link pdh.lib (import library for pdh.dll) whenever this file is linked in. -#pragma comment(lib, "pdh.lib") - PrivateWorkingSetSnapshot::PrivateWorkingSetSnapshot() {} PrivateWorkingSetSnapshot::~PrivateWorkingSetSnapshot() {}
diff --git a/chrome/browser/referrer_policy_browsertest.cc b/chrome/browser/referrer_policy_browsertest.cc index 05352f8..05542d8 100644 --- a/chrome/browser/referrer_policy_browsertest.cc +++ b/chrome/browser/referrer_policy_browsertest.cc
@@ -488,7 +488,7 @@ AddAllPossibleTitles(start_url, title_watcher.get()); // Shift-reload to B. - chrome::ReloadIgnoringCache(browser(), CURRENT_TAB); + chrome::ReloadBypassingCache(browser(), CURRENT_TAB); EXPECT_EQ(expected_title, title_watcher->WaitAndGetTitle()); }
diff --git a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc index 87c20c6..9fe24512 100644 --- a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc +++ b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc
@@ -4,12 +4,15 @@ #include "chrome/browser/renderer_context_menu/mock_render_view_context_menu.h" +#include "chrome/app/chrome_command_ids.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/grit/generated_resources.h" #include "chrome/test/base/testing_profile.h" #include "components/prefs/pref_service.h" #include "components/renderer_context_menu/render_view_context_menu_observer.h" #include "content/public/browser/browser_context.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/l10n/l10n_util.h" MockRenderViewContextMenu::MockMenuItem::MockMenuItem() : command_id(0), enabled(false), checked(false), hidden(true) {} @@ -105,6 +108,12 @@ FAIL() << "Menu observer is trying to change a menu item it doesn't own."; } +void MockRenderViewContextMenu::AddSpellCheckServiceItem(bool is_checked) { + AddCheckItem( + IDC_CONTENT_CONTEXT_SPELLING_TOGGLE, + l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE)); +} + content::RenderViewHost* MockRenderViewContextMenu::GetRenderViewHost() const { return nullptr; }
diff --git a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.h b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.h index a26f941..a8f8a7b 100644 --- a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.h +++ b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.h
@@ -60,6 +60,7 @@ bool enabled, bool hidden, const base::string16& title) override; + void AddSpellCheckServiceItem(bool is_checked) override; content::RenderViewHost* GetRenderViewHost() const override; content::BrowserContext* GetBrowserContext() const override; content::WebContents* GetWebContents() const override;
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc index bb935ab..b5c379e 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -145,6 +145,11 @@ #include "chrome/browser/media/router/media_router_metrics.h" #endif +#if defined(GOOGLE_CHROME_BUILD) +#include "grit/theme_resources.h" +#include "ui/base/resource/resource_bundle.h" +#endif + using base::UserMetricsAction; using blink::WebContextMenuData; using blink::WebMediaPlayerAction; @@ -177,6 +182,13 @@ OPEN_LINK_AS_USER_LAST_ENUM_ID, }; +// State of other profiles when the "Open Link as User" context menu is shown. +enum UmaEnumOpenLinkAsUserProfilesState { + OPEN_LINK_AS_USER_PROFILES_STATE_NO_OTHER_ACTIVE_PROFILES_ENUM_ID, + OPEN_LINK_AS_USER_PROFILES_STATE_OTHER_ACTIVE_PROFILES_ENUM_ID, + OPEN_LINK_AS_USER_PROFILES_STATE_LAST_ENUM_ID, +}; + #if !defined(OS_CHROMEOS) // We report the number of "Open Link as User" entries shown in the context // menu via UMA, differentiating between at most that many profiles. @@ -410,7 +422,7 @@ bool g_custom_id_ranges_initialized = false; #if !defined(OS_CHROMEOS) -void AddIconToLastMenuItem(gfx::Image icon, ui::SimpleMenuModel* menu) { +void AddAvatarToLastMenuItem(gfx::Image icon, ui::SimpleMenuModel* menu) { int width = icon.Width(); int height = icon.Height(); @@ -437,6 +449,19 @@ } #endif // !defined(OS_CHROMEOS) +// Adds Google icon to the last added menu item. Used for Google-powered +// services like translate and search. +void AddGoogleIconToLastMenuItem(ui::SimpleMenuModel* menu) { +#if defined(GOOGLE_CHROME_BUILD) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableGoogleBrandedContextMenu)) { + menu->SetIcon( + menu->GetItemCount() - 1, + ui::ResourceBundle::GetSharedInstance().GetImageNamed(IDR_GOOGLE_ICON)); + } +#endif // defined(GOOGLE_CHROME_BUILD) +} + void OnProfileCreated(const GURL& link_url, const content::Referrer& referrer, Profile* profile, @@ -485,6 +510,25 @@ return url.host() == chrome::kChromeUISyncResourcesHost; } +// static +void RenderViewContextMenu::AddSpellCheckServiceItem(ui::SimpleMenuModel* menu, + bool is_checked) { + // When the Google branding experiment is enabled, we want to show an icon + // next to this item, but we can't show icons on check items. So when the + // item is enabled show it as checked, and otherwise add it as a normal item + // (instead of a check item) so that, if necessary, we can add the Google + // icon. (If the experiment is off, there's no harm in adding this as a + // normal item, as it will look identical to an unchecked check item.) + if (is_checked) { + menu->AddCheckItemWithStringId(IDC_CONTENT_CONTEXT_SPELLING_TOGGLE, + IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE); + } else { + menu->AddItemWithStringId(IDC_CONTENT_CONTEXT_SPELLING_TOGGLE, + IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE); + AddGoogleIconToLastMenuItem(menu); + } +} + RenderViewContextMenu::RenderViewContextMenu( content::RenderFrameHost* render_frame_host, const content::ContextMenuParams& params) @@ -925,6 +969,18 @@ } if (!target_profiles_entries.empty()) { + UmaEnumOpenLinkAsUserProfilesState profiles_state; + if (multiple_profiles_open_) { + profiles_state = + OPEN_LINK_AS_USER_PROFILES_STATE_OTHER_ACTIVE_PROFILES_ENUM_ID; + } else { + profiles_state = + OPEN_LINK_AS_USER_PROFILES_STATE_NO_OTHER_ACTIVE_PROFILES_ENUM_ID; + } + UMA_HISTOGRAM_ENUMERATION( + "RenderViewContextMenu.OpenLinkAsUserProfilesState", profiles_state, + OPEN_LINK_AS_USER_PROFILES_STATE_LAST_ENUM_ID); + UMA_HISTOGRAM_ENUMERATION("RenderViewContextMenu.OpenLinkAsUserShown", target_profiles_entries.size(), kOpenLinkAsUserMaxProfilesReported); @@ -938,7 +994,7 @@ IDC_OPEN_LINK_IN_PROFILE_FIRST + menu_index, l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_OPENLINKINPROFILE, entry->GetName())); - AddIconToLastMenuItem(entry->GetAvatarIcon(), &menu_model_); + AddAvatarToLastMenuItem(entry->GetAvatarIcon(), &menu_model_); } else if (target_profiles_entries.size() > 1u) { for (ProfileAttributesEntry* entry : target_profiles_entries) { int menu_index = static_cast<int>(profile_link_paths_.size()); @@ -952,8 +1008,8 @@ profile_link_paths_.push_back(entry->GetPath()); profile_link_submenu_model_.AddItem( IDC_OPEN_LINK_IN_PROFILE_FIRST + menu_index, entry->GetName()); - AddIconToLastMenuItem(entry->GetAvatarIcon(), - &profile_link_submenu_model_); + AddAvatarToLastMenuItem(entry->GetAvatarIcon(), + &profile_link_submenu_model_); } menu_model_.AddSubMenuWithStringId( IDC_CONTENT_CONTEXT_OPENLINKINPROFILE, @@ -1021,6 +1077,10 @@ IDC_CONTENT_CONTEXT_SEARCHWEBFORIMAGE, l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_SEARCHWEBFORIMAGE, default_provider->short_name())); + if (default_provider->image_url_ref().HasGoogleBaseURLs( + service->search_terms_data())) { + AddGoogleIconToLastMenuItem(&menu_model_); + } } } @@ -1098,6 +1158,7 @@ menu_model_.AddItem( IDC_CONTENT_CONTEXT_TRANSLATE, l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_TRANSLATE, language)); + AddGoogleIconToLastMenuItem(&menu_model_); } } @@ -1170,6 +1231,12 @@ l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_SEARCHWEBFOR, default_provider->short_name(), printable_selection_text)); + TemplateURLService* service = + TemplateURLServiceFactory::GetForProfile(GetProfile()); + if (default_provider->url_ref().HasGoogleBaseURLs( + service->search_terms_data())) { + AddGoogleIconToLastMenuItem(&menu_model_); + } } else { if ((selection_navigation_url_ != params_.link_url) && ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( @@ -2103,6 +2170,10 @@ } } +void RenderViewContextMenu::AddSpellCheckServiceItem(bool is_checked) { + AddSpellCheckServiceItem(&menu_model_, is_checked); +} + ProtocolHandlerRegistry::ProtocolHandlerList RenderViewContextMenu::GetHandlersForLinkUrl() { ProtocolHandlerRegistry::ProtocolHandlerList handlers =
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.h b/chrome/browser/renderer_context_menu/render_view_context_menu.h index 9148d4d..43b95e5 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.h +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.h
@@ -66,10 +66,15 @@ // WebContents and the frame's WebContents. static gfx::Vector2d GetOffset(content::RenderFrameHost* render_frame_host); - // SimpleMenuModel::Delegate: + // Adds the spell check service item to the context menu. + static void AddSpellCheckServiceItem(ui::SimpleMenuModel* menu, + bool is_checked); + + // RenderViewContextMenuBase: bool IsCommandIdChecked(int command_id) const override; bool IsCommandIdEnabled(int command_id) const override; void ExecuteCommand(int command_id, int event_flags) override; + void AddSpellCheckServiceItem(bool is_checked) override; protected: Profile* GetProfile();
diff --git a/chrome/browser/renderer_context_menu/spelling_menu_observer.cc b/chrome/browser/renderer_context_menu/spelling_menu_observer.cc index c723c8e..9838234f 100644 --- a/chrome/browser/renderer_context_menu/spelling_menu_observer.cc +++ b/chrome/browser/renderer_context_menu/spelling_menu_observer.cc
@@ -165,11 +165,7 @@ // suggestions". proxy_->AddMenuItem(IDC_SPELLCHECK_ADD_TO_DICTIONARY, l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY)); - - proxy_->AddCheckItem( - IDC_CONTENT_CONTEXT_SPELLING_TOGGLE, - l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE)); - + proxy_->AddSpellCheckServiceItem(integrate_spelling_service_.GetValue()); proxy_->AddSeparator(); }
diff --git a/chrome/browser/renderer_context_menu/spelling_options_submenu_observer.cc b/chrome/browser/renderer_context_menu/spelling_options_submenu_observer.cc index e570a59..a8497a7 100644 --- a/chrome/browser/renderer_context_menu/spelling_options_submenu_observer.cc +++ b/chrome/browser/renderer_context_menu/spelling_options_submenu_observer.cc
@@ -4,11 +4,14 @@ #include "chrome/browser/renderer_context_menu/spelling_options_submenu_observer.h" +#include "base/command_line.h" #include "base/logging.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/renderer_context_menu/render_view_context_menu.h" #include "chrome/browser/spellchecker/spellcheck_service.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "components/prefs/pref_member.h" @@ -29,6 +32,11 @@ submenu_model_(delegate), language_group_id_(group_id), num_selected_dictionaries_(0) { + if (proxy_ && proxy_->GetBrowserContext()) { + Profile* profile = Profile::FromBrowserContext(proxy_->GetBrowserContext()); + use_spelling_service_.Init(prefs::kSpellCheckUseSpellingService, + profile->GetPrefs()); + } DCHECK(proxy_); } @@ -80,9 +88,8 @@ // Add a check item 'Ask Google for spelling suggestions'. This item is // handled in SpellingMenuObserver. - submenu_model_.AddCheckItem( - IDC_CONTENT_CONTEXT_SPELLING_TOGGLE, - l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE)); + RenderViewContextMenu::AddSpellCheckServiceItem( + &submenu_model_, use_spelling_service_.GetValue()); proxy_->AddSubMenu( IDC_SPELLCHECK_MENU,
diff --git a/chrome/browser/renderer_context_menu/spelling_options_submenu_observer.h b/chrome/browser/renderer_context_menu/spelling_options_submenu_observer.h index 12ae26f..5abff45 100644 --- a/chrome/browser/renderer_context_menu/spelling_options_submenu_observer.h +++ b/chrome/browser/renderer_context_menu/spelling_options_submenu_observer.h
@@ -11,6 +11,7 @@ #include "base/macros.h" #include "chrome/browser/spellchecker/spellcheck_service.h" +#include "components/prefs/pref_member.h" #include "components/renderer_context_menu/render_view_context_menu_observer.h" #include "ui/base/models/simple_menu_model.h" @@ -49,6 +50,9 @@ // The number of dictionaries currently selected for spellchecking. size_t num_selected_dictionaries_; + // Flag indicating whether the server-powered spellcheck service is enabled. + BooleanPrefMember use_spelling_service_; + DISALLOW_COPY_AND_ASSIGN(SpellingOptionsSubMenuObserver); };
diff --git a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm index 464d901..37abdf2 100644 --- a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm +++ b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm
@@ -193,6 +193,11 @@ [historySwiper_ rendererHandledWheelEvent:event consumed:consumed]; } +- (void)rendererHandledGestureScrollEvent:(const blink::WebGestureEvent&)event + consumed:(BOOL)consumed { + [historySwiper_ rendererHandledGestureScrollEvent:event consumed:consumed]; +} + // Spellchecking methods // The next five methods are implemented here since this class is the first // responder for anything in the browser.
diff --git a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h index 47fe073..56313254 100644 --- a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h +++ b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h
@@ -8,6 +8,7 @@ #import <Cocoa/Cocoa.h> namespace blink { +class WebGestureEvent; class WebMouseWheelEvent; } @@ -153,9 +154,19 @@ // the transition from kPending -> kPotential. BOOL historySwipeDirectionInverted_; - // Whether the event with phase NSEventPhaseBegan was not consumed by the - // renderer. This variables defaults to NO for new gestures. - BOOL beganEventUnconsumed_; + // Whether: + // 1) When wheel gestures are disabled if the wheel event with phase + // NSEventPhaseBegan was consumed by the renderer. + // 2) When wheel gestures are enabled and if the first gesture + // scroll was not consumed by the renderer. + // This variables defaults to NO for new gestures. + BOOL firstScrollUnconsumed_; + + // Whether we have received a gesture scroll begin and are awiting on the + // first gesture scroll update to deteremine of the event was consumed by + // the renderer. + BOOL waitingForFirstGestureScroll_; + history_swiper::RecognitionState recognitionState_; id<HistorySwiperDelegate> delegate_; @@ -171,6 +182,8 @@ - (BOOL)handleEvent:(NSEvent*)event; - (void)rendererHandledWheelEvent:(const blink::WebMouseWheelEvent&)event consumed:(BOOL)consumed; +- (void)rendererHandledGestureScrollEvent:(const blink::WebGestureEvent&)event + consumed:(BOOL)consumed; // The event passed in is a gesture event, and has touch data associated with // the trackpad.
diff --git a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm index b161b84f..bd71a90 100644 --- a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm +++ b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm
@@ -118,7 +118,25 @@ consumed:(BOOL)consumed { if (event.phase != NSEventPhaseBegan) return; - beganEventUnconsumed_ = !consumed; + firstScrollUnconsumed_ = !consumed; +} + +- (void)rendererHandledGestureScrollEvent:(const blink::WebGestureEvent&)event + consumed:(BOOL)consumed { + switch (event.type) { + case blink::WebInputEvent::GestureScrollBegin: + if (event.data.scrollBegin.synthetic || event.data.scrollBegin.inertial) + return; + waitingForFirstGestureScroll_ = YES; + break; + case blink::WebInputEvent::GestureScrollUpdate: + if (waitingForFirstGestureScroll_) + firstScrollUnconsumed_ = !consumed; + waitingForFirstGestureScroll_ = NO; + break; + default: + break; + } } - (BOOL)canRubberbandLeft:(NSView*)view { @@ -219,7 +237,8 @@ // Reset state pertaining to previous trackpad gestures. gestureStartPointValid_ = NO; gestureTotalY_ = 0; - beganEventUnconsumed_ = NO; + firstScrollUnconsumed_ = NO; + waitingForFirstGestureScroll_ = NO; recognitionState_ = history_swiper::kPending; } @@ -543,7 +562,7 @@ // Don't enable history swiping until the renderer has decided to not consume // the event with phase NSEventPhaseBegan. - if (!beganEventUnconsumed_) + if (!firstScrollUnconsumed_) return NO; // Magic mouse and touchpad swipe events are identical except magic mouse
diff --git a/chrome/browser/resources/chromeos/keyboard_overlay_data.js b/chrome/browser/resources/chromeos/keyboard_overlay_data.js index f929a27..c3489d6 100644 --- a/chrome/browser/resources/chromeos/keyboard_overlay_data.js +++ b/chrome/browser/resources/chromeos/keyboard_overlay_data.js
@@ -15882,7 +15882,7 @@ 'power': 'keyboardOverlayLockScreenOrPowerOff', 'q<>CTRL<>SHIFT': 'keyboardOverlaySignOut', 'r<>CTRL': 'keyboardOverlayReloadCurrentPage', - 'r<>CTRL<>SHIFT': 'keyboardOverlayReloadIgnoringCache', + 'r<>CTRL<>SHIFT': 'keyboardOverlayReloadBypassingCache', 'reload<>CTRL<>SHIFT': 'keyboardOverlayRotateScreen', 'reload<>SEARCH': 'keyboardOverlayF3', 'right<>ALT': 'keyboardOverlayGoForward',
diff --git a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js index fc2fbed..8488b3e9 100644 --- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js +++ b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
@@ -562,25 +562,21 @@ if (Oobe.getInstance().currentScreen === this) Oobe.getInstance().updateScreenSize(this); - if (data.forceReload || - JSON.stringify(this.gaiaAuthParams_) != JSON.stringify(params)) { - this.gaiaAuthParams_ = params; + this.gaiaAuthParams_ = params; + switch (this.screenMode_) { + case ScreenMode.DEFAULT: + this.loadGaiaAuthHost_(false /* doSamlRedirect */); + break; - switch (this.screenMode_) { - case ScreenMode.DEFAULT: - this.loadGaiaAuthHost_(false /* doSamlRedirect */); - break; + case ScreenMode.OFFLINE: + this.loadOffline(params); + break; - case ScreenMode.OFFLINE: - this.loadOffline(params); - break; - - case ScreenMode.SAML_INTERSTITIAL: - $('saml-interstitial').domain = data.enterpriseDomain; - if (this.loading) - this.loading = false; - break; - } + case ScreenMode.SAML_INTERSTITIAL: + $('saml-interstitial').domain = data.enterpriseDomain; + if (this.loading) + this.loading = false; + break; } this.updateControlsState(); },
diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.css b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.css index 5b781e80..d876977 100644 --- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.css +++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.css
@@ -192,9 +192,9 @@ * paper-icon-button. This should achieve the same dimensions as .sink-icon. */ #sink-search-icon { + -webkit-margin-start: 4px; -webkit-padding-end: 12px; - -webkit-padding-start: 16px; - width: 44px; + -webkit-padding-start: 12px; } #sink-search-input {
diff --git a/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.css b/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.css index 449e497c..0403eb1 100644 --- a/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.css +++ b/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.css
@@ -6,14 +6,14 @@ flex-grow: 1; } -#arrow-drop-icon::shadow #icon { - height: var(--navigation-icon-size); - width: var(--navigation-icon-size); +#arrow-drop-icon { + height: var(--navigation-icon-button-size); + width: var(--navigation-icon-button-size); } -#back-button::shadow #icon { - height: var(--navigation-icon-size); - width: var(--navigation-icon-size); +#back-button { + height: var(--navigation-icon-button-size); + width: var(--navigation-icon-button-size); } #back-button-container { @@ -22,11 +22,8 @@ #close-button { -webkit-margin-start: auto; -} - -#close-button::shadow #icon { - height: 15px; - width: 15px; + height: 31px; + width: 31px; } #close-button-container { @@ -37,6 +34,7 @@ #header-and-arrow-container { display: flex; + height: 36px; overflow: hidden; white-space: nowrap; } @@ -45,13 +43,13 @@ -webkit-padding-end: 4px; color: white; font-size: 1.175em; - margin: 0; + margin: 8px 0 0 0; overflow: hidden; text-overflow: ellipsis; } paper-icon-button { - display: inline; + display: inline-block; } paper-toolbar {
diff --git a/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js b/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js index c9581d2b..0eb1e45d 100644 --- a/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js +++ b/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js
@@ -211,11 +211,11 @@ * Updates header height to accomodate email text. This is called on changes * to |showEmail| and will return early if the value has not changed. * - * @param {boolean} oldValue . - * @param {boolean} newValue . + * @param {boolean} newValue The new value of |showEmail|. + * @param {boolean} oldValue The previous value of |showEmail|. * @private */ - maybeChangeHeaderHeight_: function(oldValue, newValue) { + maybeChangeHeaderHeight_: function(newValue, oldValue) { if (!!oldValue == !!newValue) { return; }
diff --git a/chrome/browser/resources/media_router/media_router_common.css b/chrome/browser/resources/media_router/media_router_common.css index 2a688ecf..2f640c1 100644 --- a/chrome/browser/resources/media_router/media_router_common.css +++ b/chrome/browser/resources/media_router/media_router_common.css
@@ -5,7 +5,7 @@ :root { --dialog-padding-end: 26px; --dialog-padding-start: 16px; - --navigation-icon-size: 20px; + --navigation-icon-button-size: 36px; --non-navigation-icon-size: 16px; --subtext-color: rgb(150, 150, 150); }
diff --git a/chrome/browser/resources/options/content_settings.html b/chrome/browser/resources/options/content_settings.html index e764ad4e..e7b2dfb 100644 --- a/chrome/browser/resources/options/content_settings.html +++ b/chrome/browser/resources/options/content_settings.html
@@ -596,6 +596,28 @@ </div> </div> </section> + <!-- Background sync --> + <section> + <h3 i18n-content="backgroundSyncHeader"></h3> + <div> + <div class="radio"> + <label> + <input type="radio" name="background-sync" value="allow"> + <span i18n-content="backgroundSyncAllow"></span> + </label> + </div> + <div class="radio"> + <label> + <input type="radio" name="background-sync" value="block"> + <span i18n-content="backgroundSyncBlock"></span> + </label> + </div> + <div class="settings-row"> + <button class="exceptions-list-button" contentType="background-sync" + i18n-content="manageExceptions"></button> + </div> + </div> + </section> <!-- Page zoom levels --> <section id="page-zoom-levels"> <h3 i18n-content="zoomlevelsHeader"></h3>
diff --git a/chrome/browser/resources/options/content_settings.js b/chrome/browser/resources/options/content_settings.js index db335e89b..33cac98 100644 --- a/chrome/browser/resources/options/content_settings.js +++ b/chrome/browser/resources/options/content_settings.js
@@ -19,21 +19,6 @@ /** @const */ var Page = cr.ui.pageManager.Page; /** @const */ var PageManager = cr.ui.pageManager.PageManager; - // Lookup table to generate the i18n strings. - /** @const */ var permissionsLookup = { - 'cookies': 'cookies', - 'images': 'images', - 'javascript': 'javascript', - 'keygen': 'keygen', - 'location': 'location', - 'media-stream-camera': 'mediaStreamCamera', - 'media-stream-mic': 'mediaStreamMic', - 'multiple-automatic-downloads': 'multipleAutomaticDownloads', - 'notifications': 'notifications', - 'plugins': 'plugins', - 'popups': 'popups', - }; - ////////////////////////////////////////////////////////////////////////////// // ContentSettings class: @@ -117,14 +102,6 @@ */ ContentSettings.setContentFilterSettingsValue = function(dict) { for (var group in dict) { - var settingLabel = $(group + '-default-string'); - if (settingLabel) { - var value = dict[group].value; - var valueId = - permissionsLookup[group] + value[0].toUpperCase() + value.slice(1); - settingLabel.textContent = loadTimeData.getString(valueId); - } - var managedBy = dict[group].managedBy; var controlledBy = managedBy == 'policy' || managedBy == 'extension' ? managedBy : null;
diff --git a/chrome/browser/resources/options/content_settings_exceptions_area.html b/chrome/browser/resources/options/content_settings_exceptions_area.html index bd4db34..4a16f4c 100644 --- a/chrome/browser/resources/options/content_settings_exceptions_area.html +++ b/chrome/browser/resources/options/content_settings_exceptions_area.html
@@ -156,6 +156,9 @@ <list mode="otr"></list> </div> </div> + <div contentType="background-sync"> + <list mode="normal"></list> + </div> <div contentType="zoomlevels"> <list mode="normal"></list> <div>
diff --git a/chrome/browser/resources/options/password_manager_list.js b/chrome/browser/resources/options/password_manager_list.js index 71274aff..e30894ea 100644 --- a/chrome/browser/resources/options/password_manager_list.js +++ b/chrome/browser/resources/options/password_manager_list.js
@@ -450,9 +450,6 @@ /** @override */ decorate: function() { DeletableItemList.prototype.decorate.call(this); - Preferences.getInstance().addEventListener( - 'profile.password_manager_allow_show_passwords', - this.onPreferenceChanged_.bind(this)); this.addEventListener('focus', this.onFocus_.bind(this)); },
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html index 881a4ba..b0610ef0 100644 --- a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html +++ b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html
@@ -38,9 +38,7 @@ <template is="dom-if" name="manage-passwords"> <settings-subpage page-title="[[i18n('passwords')]]"> <passwords-section saved-passwords="[[savedPasswords]]" - password-exceptions="[[passwordExceptions]]" - show-passwords= - "[[prefs.profile.password_manager_allow_show_passwords.value]]"> + password-exceptions="[[passwordExceptions]]"> </passwords-section> </settings-subpage> </template>
diff --git a/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc index 4cd23b2..cee69afe 100644 --- a/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc
@@ -9,6 +9,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/test/test_simple_task_runner.h" #include "base/thread_task_runner_handle.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/safe_browsing/local_database_manager.cc b/chrome/browser/safe_browsing/local_database_manager.cc index c49ed58..22818cbf 100644 --- a/chrome/browser/safe_browsing/local_database_manager.cc +++ b/chrome/browser/safe_browsing/local_database_manager.cc
@@ -34,7 +34,6 @@ #include "chrome/common/pref_names.h" #include "components/prefs/pref_service.h" #include "components/safe_browsing_db/util.h" -#include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "net/url_request/url_request_context_getter.h" @@ -67,9 +66,8 @@ SafeBrowsingProtocolManager::RecordGetHashResult(is_download, result); } -bool IsExpectedThreat( - const SBThreatType threat_type, - const std::vector<SBThreatType>& expected_threats) { +bool IsExpectedThreat(const SBThreatType threat_type, + const std::vector<SBThreatType>& expected_threats) { return expected_threats.end() != std::find(expected_threats.begin(), expected_threats.end(), threat_type); @@ -80,14 +78,14 @@ // level possible. int GetThreatSeverity(ListType threat) { switch (threat) { - case MALWARE: // Falls through. - case PHISH: // Falls through. - case BINURL: // Falls through. - case CSDWHITELIST: // Falls through. - case DOWNLOADWHITELIST: // Falls through. - case INCLUSIONWHITELIST: // Falls through. - case MODULEWHITELIST: // Falls through. - case EXTENSIONBLACKLIST: // Falls through. + case MALWARE: // Falls through. + case PHISH: // Falls through. + case BINURL: // Falls through. + case CSDWHITELIST: // Falls through. + case DOWNLOADWHITELIST: // Falls through. + case INCLUSIONWHITELIST: // Falls through. + case MODULEWHITELIST: // Falls through. + case EXTENSIONBLACKLIST: // Falls through. case IPBLACKLIST: return 0; case UNWANTEDURL: @@ -113,8 +111,7 @@ int pending_threat_severity = GetThreatSeverity(INVALID); for (size_t i = 0; i < full_hashes.size(); ++i) { if (SBFullHashEqual(hash, full_hashes[i].hash)) { - const ListType threat = - static_cast<ListType>(full_hashes[i].list_id); + const ListType threat = static_cast<ListType>(full_hashes[i].list_id); int threat_severity = GetThreatSeverity(threat); if (threat_severity < pending_threat_severity) { pending_threat = threat; @@ -217,8 +214,7 @@ << "Exactly one of urls and full_hashes must be set"; } -LocalSafeBrowsingDatabaseManager::SafeBrowsingCheck::~SafeBrowsingCheck() { -} +LocalSafeBrowsingDatabaseManager::SafeBrowsingCheck::~SafeBrowsingCheck() {} void LocalSafeBrowsingDatabaseManager::SafeBrowsingCheck:: OnSafeBrowsingResult() { @@ -255,8 +251,7 @@ case EXTENSIONBLACKLIST: { std::set<std::string> unsafe_extension_ids; for (size_t i = 0; i < full_hashes.size(); ++i) { - std::string extension_id = - SBFullHashToString(full_hashes[i]); + std::string extension_id = SBFullHashToString(full_hashes[i]); if (full_hash_results[i] == SB_THREAT_TYPE_EXTENSION) unsafe_extension_ids.insert(extension_id); } @@ -343,8 +338,7 @@ } bool LocalSafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { - return url.SchemeIs(url::kFtpScheme) || - url.SchemeIs(url::kHttpScheme) || + return url.SchemeIs(url::kFtpScheme) || url.SchemeIs(url::kHttpScheme) || url.SchemeIs(url::kHttpsScheme); } @@ -357,13 +351,9 @@ // We need to check the database for url prefix, and later may fetch the url // from the safebrowsing backends. These need to be asynchronous. - SafeBrowsingCheck* check = - new SafeBrowsingCheck(url_chain, - std::vector<SBFullHash>(), - client, - BINURL, - std::vector<SBThreatType>(1, - SB_THREAT_TYPE_BINARY_MALWARE_URL)); + SafeBrowsingCheck* check = new SafeBrowsingCheck( + url_chain, std::vector<SBFullHash>(), client, BINURL, + std::vector<SBThreatType>(1, SB_THREAT_TYPE_BINARY_MALWARE_URL)); std::vector<SBPrefix> prefixes; SafeBrowsingDatabase::GetDownloadUrlPrefixes(url_chain, &prefixes); StartSafeBrowsingCheck( @@ -374,7 +364,8 @@ } bool LocalSafeBrowsingDatabaseManager::CheckExtensionIDs( - const std::set<std::string>& extension_ids, Client* client) { + const std::set<std::string>& extension_ids, + Client* client) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!enabled_ || !enable_extension_blacklist_) @@ -382,17 +373,13 @@ std::vector<SBFullHash> extension_id_hashes; std::transform(extension_ids.begin(), extension_ids.end(), - std::back_inserter(extension_id_hashes), - StringToSBFullHash); + std::back_inserter(extension_id_hashes), StringToSBFullHash); std::vector<SBPrefix> prefixes; for (const SBFullHash& hash : extension_id_hashes) prefixes.push_back(hash.prefix); SafeBrowsingCheck* check = new SafeBrowsingCheck( - std::vector<GURL>(), - extension_id_hashes, - client, - EXTENSIONBLACKLIST, + std::vector<GURL>(), extension_id_hashes, client, EXTENSIONBLACKLIST, std::vector<SBThreatType>(1, SB_THREAT_TYPE_EXTENSION)); StartSafeBrowsingCheck( check, @@ -401,19 +388,19 @@ return false; } -bool LocalSafeBrowsingDatabaseManager::CheckResourceUrl( - const GURL& url, Client* client) { +bool LocalSafeBrowsingDatabaseManager::CheckResourceUrl(const GURL& url, + Client* client) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!enabled_ || !CanCheckUrl(url)) return true; - std::vector<SBThreatType> expected_threats = - {SB_THREAT_TYPE_BLACKLISTED_RESOURCE}; + std::vector<SBThreatType> expected_threats = { + SB_THREAT_TYPE_BLACKLISTED_RESOURCE}; if (!MakeDatabaseAvailable()) { - QueuedCheck queued_check(RESOURCEBLACKLIST, client, url, - expected_threats, base::TimeTicks::Now()); + QueuedCheck queued_check(RESOURCEBLACKLIST, client, url, expected_threats, + base::TimeTicks::Now()); queued_checks_.push_back(queued_check); return false; } @@ -504,7 +491,7 @@ } bool LocalSafeBrowsingDatabaseManager::CheckBrowseUrl(const GURL& url, - Client* client) { + Client* client) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!enabled_) return true; @@ -520,10 +507,7 @@ const base::TimeTicks start = base::TimeTicks::Now(); if (!MakeDatabaseAvailable()) { QueuedCheck queued_check(MALWARE, // or PHISH - client, - url, - expected_threats, - start); + client, url, expected_threats, start); queued_checks_.push_back(queued_check); return false; } @@ -551,10 +535,8 @@ // by default rather than building it here. std::vector<SBPrefix> prefix_hits(browse_prefix_hits.size() + unwanted_prefix_hits.size()); - std::merge(browse_prefix_hits.begin(), - browse_prefix_hits.end(), - unwanted_prefix_hits.begin(), - unwanted_prefix_hits.end(), + std::merge(browse_prefix_hits.begin(), browse_prefix_hits.end(), + unwanted_prefix_hits.begin(), unwanted_prefix_hits.end(), prefix_hits.begin()); prefix_hits.erase(std::unique(prefix_hits.begin(), prefix_hits.end()), prefix_hits.end()); @@ -570,11 +552,9 @@ // matches. These lists will then be filtered against the |expected_threats| // and the result callback for MALWARE (which is the same as for PHISH and // UNWANTEDURL) will eventually be invoked with the final decision. - SafeBrowsingCheck* check = new SafeBrowsingCheck(std::vector<GURL>(1, url), - std::vector<SBFullHash>(), - client, - MALWARE, - expected_threats); + SafeBrowsingCheck* check = new SafeBrowsingCheck( + std::vector<GURL>(1, url), std::vector<SBFullHash>(), client, MALWARE, + expected_threats); check->need_get_hash = cache_hits.empty(); check->prefix_hits.swap(prefix_hits); check->cache_hits.swap(cache_hits); @@ -600,7 +580,7 @@ // Scan the queued clients store. Clients may be here if they requested a URL // check before the database has finished loading. for (std::deque<QueuedCheck>::iterator it(queued_checks_.begin()); - it != queued_checks_.end(); ) { + it != queued_checks_.end();) { // In this case it's safe to delete matches entirely since nothing has a // pointer to them. if (it->client == client) @@ -660,7 +640,7 @@ } void LocalSafeBrowsingDatabaseManager::DeleteChunks( - scoped_ptr<std::vector<SBChunkDelete> > chunk_deletes) { + scoped_ptr<std::vector<SBChunkDelete>> chunk_deletes) { DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(enabled_); safe_browsing_task_runner_->PostTask( @@ -749,14 +729,12 @@ client(client), url(url), expected_threats(expected_threats), - start(start) { -} + start(start) {} LocalSafeBrowsingDatabaseManager::QueuedCheck::QueuedCheck( const QueuedCheck& other) = default; -LocalSafeBrowsingDatabaseManager::QueuedCheck::~QueuedCheck() { -} +LocalSafeBrowsingDatabaseManager::QueuedCheck::~QueuedCheck() {} void LocalSafeBrowsingDatabaseManager::DoStopOnIOThread() { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -771,10 +749,8 @@ QueuedCheck queued = queued_checks_.front(); if (queued.client) { SafeBrowsingCheck sb_check(std::vector<GURL>(1, queued.url), - std::vector<SBFullHash>(), - queued.client, - queued.check_type, - queued.expected_threats); + std::vector<SBFullHash>(), queued.client, + queued.check_type, queued.expected_threats); sb_check.OnSafeBrowsingResult(); } queued_checks_.pop_front(); @@ -803,8 +779,8 @@ // We have to do this after the db thread returns because methods on it can // have copies of these pointers, so deleting them might lead to accessing // garbage. - for (CurrentChecks::iterator it = checks_.begin(); - it != checks_.end(); ++it) { + for (CurrentChecks::iterator it = checks_.begin(); it != checks_.end(); + ++it) { SafeBrowsingCheck* check = *it; if (check->client) check->OnSafeBrowsingResult(); @@ -1026,10 +1002,8 @@ // the client). Since we're not the client, we have to convey this result. if (check.client && CheckBrowseUrl(check.url, check.client)) { SafeBrowsingCheck sb_check(std::vector<GURL>(1, check.url), - std::vector<SBFullHash>(), - check.client, - check.check_type, - check.expected_threats); + std::vector<SBFullHash>(), check.client, + check.check_type, check.expected_threats); sb_check.OnSafeBrowsingResult(); } queued_checks_.pop_front(); @@ -1050,7 +1024,7 @@ } void LocalSafeBrowsingDatabaseManager::DeleteDatabaseChunks( - scoped_ptr<std::vector<SBChunkDelete> > chunk_deletes) { + scoped_ptr<std::vector<SBChunkDelete>> chunk_deletes) { DCHECK(safe_browsing_task_runner_->RunsTasksOnCurrentThread()); if (chunk_deletes) GetDatabase()->DeleteChunks(*chunk_deletes); @@ -1154,15 +1128,14 @@ for (size_t i = 0; i < check->urls.size(); ++i) { size_t threat_index; - SBThreatType threat = GetUrlSeverestThreatType(check->urls[i], - expected_full_hashes, - &threat_index); + SBThreatType threat = GetUrlSeverestThreatType( + check->urls[i], expected_full_hashes, &threat_index); if (threat != SB_THREAT_TYPE_SAFE) { check->url_results[i] = threat; check->url_metadata[i] = expected_full_hashes[threat_index].metadata; const SBFullHash& hash = expected_full_hashes[threat_index].hash; - check->url_hit_hash[i] = std::string(hash.full_hash, - arraysize(hash.full_hash)); + check->url_hit_hash[i] = + std::string(hash.full_hash, arraysize(hash.full_hash)); is_threat = true; } }
diff --git a/chrome/browser/safe_browsing/local_database_manager.h b/chrome/browser/safe_browsing/local_database_manager.h index 4891d6c..6e9025d 100644 --- a/chrome/browser/safe_browsing/local_database_manager.h +++ b/chrome/browser/safe_browsing/local_database_manager.h
@@ -28,6 +28,7 @@ #include "chrome/browser/safe_browsing/protocol_manager.h" #include "chrome/browser/safe_browsing/safe_browsing_util.h" #include "components/safe_browsing_db/database_manager.h" +#include "components/safe_browsing_db/safebrowsing.pb.h" #include "components/safe_browsing_db/util.h" #include "url/gurl.h" @@ -82,7 +83,7 @@ bool is_extended_reporting; bool need_get_hash; base::TimeTicks start; // When check was sent to SB service. - ListType check_type; // See comment in constructor. + ListType check_type; // See comment in constructor. std::vector<SBThreatType> expected_threats; std::vector<SBPrefix> prefix_hits; std::vector<SBFullHashResult> cache_hits; @@ -131,9 +132,8 @@ bool IsMalwareKillSwitchOn() override; bool IsCsdWhitelistKillSwitchOn() override; void CancelCheck(Client* client) override; - void StartOnIOThread( - net::URLRequestContextGetter* request_context_getter, - const V4ProtocolConfig& config) override; + void StartOnIOThread(net::URLRequestContextGetter* request_context_getter, + const V4ProtocolConfig& config) override; void StopOnIOThread(bool shutdown) override; bool download_protection_enabled() const override; @@ -155,8 +155,7 @@ friend class SafeBrowsingServiceTest; friend class SafeBrowsingServiceTestHelper; friend class LocalDatabaseManagerTest; - FRIEND_TEST_ALL_PREFIXES(LocalDatabaseManagerTest, - GetUrlSeverestThreatType); + FRIEND_TEST_ALL_PREFIXES(LocalDatabaseManagerTest, GetUrlSeverestThreatType); FRIEND_TEST_ALL_PREFIXES(LocalDatabaseManagerTest, ServiceStopWithPendingChecks); @@ -256,7 +255,7 @@ AddChunksCallback callback); void DeleteDatabaseChunks( - scoped_ptr<std::vector<SBChunkDelete> > chunk_deletes); + scoped_ptr<std::vector<SBChunkDelete>> chunk_deletes); void NotifyClientBlockingComplete(Client* client, bool proceed);
diff --git a/chrome/browser/signin/easy_unlock_app_manager.h b/chrome/browser/signin/easy_unlock_app_manager.h index 1b7ac8b..ba6bb4c 100644 --- a/chrome/browser/signin/easy_unlock_app_manager.h +++ b/chrome/browser/signin/easy_unlock_app_manager.h
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" namespace extensions { class ExtensionSystem;
diff --git a/chrome/browser/spellchecker/spellcheck_action_unittest.cc b/chrome/browser/spellchecker/spellcheck_action_unittest.cc index 48a579f..d21014b5 100644 --- a/chrome/browser/spellchecker/spellcheck_action_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_action_unittest.cc
@@ -8,6 +8,7 @@ #include "base/json/json_reader.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/spellchecker/spellcheck_action.h"
diff --git a/chrome/browser/sxs_linux.cc b/chrome/browser/sxs_linux.cc deleted file mode 100644 index 57b2ef1..0000000 --- a/chrome/browser/sxs_linux.cc +++ /dev/null
@@ -1,158 +0,0 @@ -// Copyright 2013 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/sxs_linux.h" - -#include <vector> - -#include "base/command_line.h" -#include "base/files/file_path.h" -#include "base/files/file_util.h" -#include "base/files/important_file_writer.h" -#include "base/logging.h" -#include "base/path_service.h" -#include "base/strings/string_split.h" -#include "base/strings/string_util.h" -#include "chrome/common/channel_info.h" -#include "chrome/common/chrome_paths.h" -#include "chrome/common/chrome_result_codes.h" -#include "chrome/common/chrome_switches.h" -#include "components/version_info/version_info.h" -#include "content/public/browser/browser_thread.h" - -namespace { - -const char kChannelsFileName[] = "Channels"; - -std::string GetChannelMarkForThisExecutable() { - std::string product_channel_name; - version_info::Channel product_channel(chrome::GetChannel()); - switch (product_channel) { - case version_info::Channel::UNKNOWN: { - // Add the channel mark even for Chromium builds (which do not have - // channel) to better handle possibility of users using Chromium builds - // with their Google Chrome profiles. Include version string modifier - // as additional piece of information for debugging (it can't make - // a meaningful difference for the code since unknown does not match any - // real channel name). - std::string version_string_modifier(chrome::GetChannelString()); - product_channel_name = "unknown (" + version_string_modifier + ")"; - break; - } - case version_info::Channel::CANARY: - product_channel_name = "canary"; - break; - case version_info::Channel::DEV: - product_channel_name = "dev"; - break; - case version_info::Channel::BETA: - product_channel_name = "beta"; - break; - case version_info::Channel::STABLE: - product_channel_name = "stable"; - break; - // Rely on -Wswitch compiler warning to detect unhandled enum values. - } - - return product_channel_name; -} - -bool DoAddChannelMarkToUserDataDir(const base::FilePath& user_data_dir) { - std::string product_channel_name(GetChannelMarkForThisExecutable()); - base::FilePath channels_path(user_data_dir.AppendASCII(kChannelsFileName)); - std::vector<std::string> user_data_dir_channels; - - // Note: failure to read the channels file is not fatal. It's possible - // and legitimate that it doesn't exist, e.g. for new profile or for profile - // existing before channel marks have been introduced. - std::string channels_contents; - if (base::ReadFileToString(channels_path, &channels_contents)) { - base::SplitString(channels_contents, "\n", - base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - } - - if (std::find(user_data_dir_channels.begin(), - user_data_dir_channels.end(), - product_channel_name) != user_data_dir_channels.end()) { - // No need to do further disk writes if our channel mark is already present. - return true; - } - - user_data_dir_channels.push_back(product_channel_name); - return base::ImportantFileWriter::WriteFileAtomically( - channels_path, - base::JoinString(user_data_dir_channels, "\n")); -} - -} // namespace - -namespace sxs_linux { - -void AddChannelMarkToUserDataDir() { - DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); - base::FilePath user_data_dir; - if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { - LOG(ERROR) << "Failed to get user data dir path. The profile will not be " - << "automatically migrated for updated Linux packages."; - return; - } - - if (!DoAddChannelMarkToUserDataDir(user_data_dir)) { - LOG(ERROR) << "Failed to add channel mark to the user data dir (" - << user_data_dir.value() << "). This profile will not be " - << "automatically migrated for updated Linux packages."; - } -} - -bool ShouldMigrateUserDataDir() { - return base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kMigrateDataDirForSxS); -} - -int MigrateUserDataDir() { - DCHECK(ShouldMigrateUserDataDir()); - - base::FilePath source_path; - if (!PathService::Get(chrome::DIR_USER_DATA, &source_path)) { - LOG(ERROR) << "Failed to get value of chrome::DIR_USER_DATA"; - return chrome::RESULT_CODE_SXS_MIGRATION_FAILED; - } - - base::FilePath channels_path(source_path.AppendASCII(kChannelsFileName)); - - std::string channels_contents; - if (!base::ReadFileToString(channels_path, &channels_contents)) { - LOG(WARNING) << "Failed to read channels file."; - return chrome::RESULT_CODE_SXS_MIGRATION_FAILED; - } - - std::vector<std::string> user_data_dir_channels = base::SplitString( - channels_contents, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - - if (user_data_dir_channels.size() != 1) { - LOG(WARNING) << "User data dir migration is only possible when the profile " - << "is only used with a single channel."; - return chrome::RESULT_CODE_SXS_MIGRATION_FAILED; - } - - if (user_data_dir_channels[0] != GetChannelMarkForThisExecutable()) { - LOG(WARNING) << "User data dir migration is only possible when the profile " - << "is used with the same channel."; - return chrome::RESULT_CODE_SXS_MIGRATION_FAILED; - } - - base::FilePath target_path = - base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( - switches::kMigrateDataDirForSxS); - - if (!base::Move(source_path, target_path)) { - LOG(ERROR) << "Failed to rename '" << source_path.value() - << "' to '" << target_path.value() << "'"; - return chrome::RESULT_CODE_SXS_MIGRATION_FAILED; - } - - return content::RESULT_CODE_NORMAL_EXIT; -} - -} // namespace sxs_linux
diff --git a/chrome/browser/sxs_linux.h b/chrome/browser/sxs_linux.h deleted file mode 100644 index 618654e..0000000 --- a/chrome/browser/sxs_linux.h +++ /dev/null
@@ -1,31 +0,0 @@ -// Copyright 2013 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_SXS_LINUX_H_ -#define CHROME_BROWSER_SXS_LINUX_H_ - -#include "base/compiler_specific.h" - -namespace base { -class FilePath; -} - -namespace sxs_linux { - -// Records channel of the running browser in user data dir. This is needed -// to support a seamless and automatic upgrade from non-side-by-side -// to side-by-side Linux packages (the latter use different default data dirs). -// Must be run on a blocking thread pool. -void AddChannelMarkToUserDataDir(); - -// Returns true if user data dir migration has been requested. -bool ShouldMigrateUserDataDir() WARN_UNUSED_RESULT; - -// Migrates user data dir to a side-by-side-compatible one. -// Returns exit code - caller should make the process exit with that code. -int MigrateUserDataDir() WARN_UNUSED_RESULT; - -} // namespace sxs_linux - -#endif // CHROME_BROWSER_SXS_LINUX_H_
diff --git a/chrome/browser/sync/test/integration/apps_helper.cc b/chrome/browser/sync/test/integration/apps_helper.cc index 43569401..2b76b4d8 100644 --- a/chrome/browser/sync/test/integration/apps_helper.cc +++ b/chrome/browser/sync/test/integration/apps_helper.cc
@@ -35,16 +35,16 @@ namespace apps_helper { -bool HasSameApps(Profile* profile1, Profile* profile2) { - return SyncAppHelper::GetInstance()->AppStatesMatch(profile1, profile2); +bool HasSameAppsAsVerifier(int index) { + return SyncAppHelper::GetInstance()->AppStatesMatch( + test()->GetProfile(index), test()->verifier()); } -bool AllProfilesHaveSameApps() { - const auto& profiles = test()->GetAllProfiles(); - for (auto* profile : profiles) { - if (profile != profiles.front() && - !HasSameApps(profiles.front(), profile)) { - DVLOG(1) << "Profiles apps do not match."; +bool AllProfilesHaveSameAppsAsVerifier() { + for (int i = 0; i < test()->num_clients(); ++i) { + if (!HasSameAppsAsVerifier(i)) { + DVLOG(1) << "Profile " << i << " doesn't have the same apps as the" + " verifier profile."; return false; } } @@ -66,11 +66,9 @@ } std::string InstallAppForAllProfiles(int index) { - std::string extension_id; - for (auto* profile : test()->GetAllProfiles()) { - extension_id = InstallApp(profile, index); - } - return extension_id; + for (int i = 0; i < test()->num_clients(); ++i) + InstallApp(test()->GetProfile(i), index); + return InstallApp(test()->verifier(), index); } void UninstallApp(Profile* profile, int index) { @@ -88,11 +86,6 @@ profile, CreateFakeAppName(index)); } -bool IsAppEnabled(Profile* profile, int index) { - return SyncExtensionHelper::GetInstance()->IsExtensionEnabled( - profile, CreateFakeAppName(index)); -} - void IncognitoEnableApp(Profile* profile, int index) { return SyncExtensionHelper::GetInstance()->IncognitoEnableExtension( profile, CreateFakeAppName(index)); @@ -103,11 +96,6 @@ profile, CreateFakeAppName(index)); } -bool IsIncognitoEnabled(Profile* profile, int index) { - return SyncExtensionHelper::GetInstance()->IsIncognitoEnabled( - profile, CreateFakeAppName(index)); -} - void InstallAppsPendingForSync(Profile* profile) { SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(profile); }
diff --git a/chrome/browser/sync/test/integration/apps_helper.h b/chrome/browser/sync/test/integration/apps_helper.h index 1fba033b..27567e3 100644 --- a/chrome/browser/sync/test/integration/apps_helper.h +++ b/chrome/browser/sync/test/integration/apps_helper.h
@@ -13,13 +13,13 @@ namespace apps_helper { -// Returns true iff |profile1| has same apps (hosted, legacy packaged and -// platform) as |profile2|. -bool HasSameApps(Profile* profile1, Profile* profile2); +// Returns true iff the profile with index |index| has the same apps (hosted, +// legacy packaged and platform) as the verifier. +bool HasSameAppsAsVerifier(int index) WARN_UNUSED_RESULT; // Returns true iff all existing profiles have the same apps (hosted, -// legacy packaged and platform). -bool AllProfilesHaveSameApps() WARN_UNUSED_RESULT; +// legacy packaged and platform) as the verifier. +bool AllProfilesHaveSameAppsAsVerifier() WARN_UNUSED_RESULT; // Installs the app for the given index to |profile|, and returns the extension // ID of the new app. @@ -47,19 +47,12 @@ // Disables the app for the given index on |profile|. void DisableApp(Profile* profile, int index); -// Returns true if the app with index |index| is enabled on |profile|. -bool IsAppEnabled(Profile* profile, int index); - // Enables the app for the given index in incognito mode on |profile|. void IncognitoEnableApp(Profile* profile, int index); // Disables the app for the given index in incognito mode on |profile|. void IncognitoDisableApp(Profile* profile, int index); -// Returns true if the app with index |index| is enabled in incognito mode on -// |profile|. -bool IsIncognitoEnabled(Profile* profile, int index); - // Gets the page ordinal value for the application at the given index on // |profile|. syncer::StringOrdinal GetPageOrdinalForApp(Profile* profile, int app_index);
diff --git a/chrome/browser/sync/test/integration/autofill_helper.cc b/chrome/browser/sync/test/integration/autofill_helper.cc index 0fe79fd..b02a42c8 100644 --- a/chrome/browser/sync/test/integration/autofill_helper.cc +++ b/chrome/browser/sync/test/integration/autofill_helper.cc
@@ -315,8 +315,7 @@ } void AddProfile(int profile, const AutofillProfile& autofill_profile) { - const std::vector<AutofillProfile*>& all_profiles = - GetAllAutoFillProfiles(profile); + const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); std::vector<AutofillProfile> autofill_profiles; for (size_t i = 0; i < all_profiles.size(); ++i) autofill_profiles.push_back(*all_profiles[i]); @@ -325,8 +324,7 @@ } void RemoveProfile(int profile, const std::string& guid) { - const std::vector<AutofillProfile*>& all_profiles = - GetAllAutoFillProfiles(profile); + const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); std::vector<AutofillProfile> autofill_profiles; for (size_t i = 0; i < all_profiles.size(); ++i) { if (all_profiles[i]->guid() != guid) @@ -339,8 +337,7 @@ const std::string& guid, const AutofillType& type, const base::string16& value) { - const std::vector<AutofillProfile*>& all_profiles = - GetAllAutoFillProfiles(profile); + const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); std::vector<AutofillProfile> profiles; for (size_t i = 0; i < all_profiles.size(); ++i) { profiles.push_back(*all_profiles[i]); @@ -350,7 +347,7 @@ autofill_helper::SetProfiles(profile, &profiles); } -const std::vector<AutofillProfile*>& GetAllAutoFillProfiles( +const std::vector<AutofillProfile*>& GetAllProfiles( int profile) { MockPersonalDataManagerObserver observer; EXPECT_CALL(observer, OnPersonalDataChanged()). @@ -364,7 +361,7 @@ } int GetProfileCount(int profile) { - return GetAllAutoFillProfiles(profile).size(); + return GetAllProfiles(profile).size(); } int GetKeyCount(int profile) { @@ -412,9 +409,9 @@ bool ProfilesMatch(int profile_a, int profile_b) { const std::vector<AutofillProfile*>& autofill_profiles_a = - GetAllAutoFillProfiles(profile_a); + GetAllProfiles(profile_a); const std::vector<AutofillProfile*>& autofill_profiles_b = - GetAllAutoFillProfiles(profile_b); + GetAllProfiles(profile_b); return ProfilesMatchImpl( profile_a, autofill_profiles_a, profile_b, autofill_profiles_b); }
diff --git a/chrome/browser/sync/test/integration/autofill_helper.h b/chrome/browser/sync/test/integration/autofill_helper.h index 14dca507..3613731 100644 --- a/chrome/browser/sync/test/integration/autofill_helper.h +++ b/chrome/browser/sync/test/integration/autofill_helper.h
@@ -88,7 +88,7 @@ // Gets all the Autofill profiles in the PersonalDataManager of sync profile // |profile|. -const std::vector<autofill::AutofillProfile*>& GetAllAutoFillProfiles( +const std::vector<autofill::AutofillProfile*>& GetAllProfiles( int profile) WARN_UNUSED_RESULT; // Returns the number of autofill profiles contained by sync profile
diff --git a/chrome/browser/sync/test/integration/extensions_helper.cc b/chrome/browser/sync/test/integration/extensions_helper.cc index 1dad8f42..7f9a2fb 100644 --- a/chrome/browser/sync/test/integration/extensions_helper.cc +++ b/chrome/browser/sync/test/integration/extensions_helper.cc
@@ -70,11 +70,9 @@ } std::string InstallExtensionForAllProfiles(int index) { - std::string extension_id; - for (auto* profile : test()->GetAllProfiles()) { - extension_id = InstallExtension(profile, index); - } - return extension_id; + for (int i = 0; i < test()->num_clients(); ++i) + InstallExtension(test()->GetProfile(i), index); + return InstallExtension(test()->verifier(), index); } void UninstallExtension(Profile* profile, int index) {
diff --git a/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc index b89f270b..da288ab 100644 --- a/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc
@@ -21,8 +21,8 @@ using autofill::AutofillProfile; using autofill_helper::AllProfilesMatch; -using autofill_helper::GetAllAutoFillProfiles; using autofill_helper::GetAllKeys; +using autofill_helper::GetAllProfiles; using autofill_helper::GetKeyCount; using autofill_helper::GetProfileCount; using autofill_helper::RemoveKeys; @@ -89,7 +89,7 @@ void AutofillSyncPerfTest::AddProfiles(int profile, int num_profiles) { const std::vector<AutofillProfile*>& all_profiles = - GetAllAutoFillProfiles(profile); + GetAllProfiles(profile); std::vector<AutofillProfile> autofill_profiles; for (size_t i = 0; i < all_profiles.size(); ++i) { autofill_profiles.push_back(*all_profiles[i]); @@ -102,7 +102,7 @@ void AutofillSyncPerfTest::UpdateProfiles(int profile) { const std::vector<AutofillProfile*>& all_profiles = - GetAllAutoFillProfiles(profile); + GetAllProfiles(profile); std::vector<AutofillProfile> autofill_profiles; for (size_t i = 0; i < all_profiles.size(); ++i) { autofill_profiles.push_back(*all_profiles[i]);
diff --git a/chrome/browser/sync/test/integration/single_client_app_list_sync_test.cc b/chrome/browser/sync/test/integration/single_client_app_list_sync_test.cc index efa247b..274c2a1f 100644 --- a/chrome/browser/sync/test/integration/single_client_app_list_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_app_list_sync_test.cc
@@ -21,8 +21,9 @@ const size_t kNumDefaultApps = 2; -bool AllProfilesHaveSameAppList() { - return SyncAppListHelper::GetInstance()->AllProfilesHaveSameAppList(); +bool AllProfilesHaveSameAppListAsVerifier() { + return SyncAppListHelper::GetInstance()-> + AllProfilesHaveSameAppListAsVerifier(); } } // namespace @@ -56,7 +57,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientAppListSyncTest, AppListEmpty) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } IN_PROC_BROWSER_TEST_F(SingleClientAppListSyncTest, AppListSomeApps) { @@ -73,6 +74,6 @@ ASSERT_EQ(kNumApps + kNumDefaultApps, service->GetNumSyncItemsForTest()); ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); }
diff --git a/chrome/browser/sync/test/integration/single_client_apps_sync_test.cc b/chrome/browser/sync/test/integration/single_client_apps_sync_test.cc index 650f047e..2125f896 100644 --- a/chrome/browser/sync/test/integration/single_client_apps_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_apps_sync_test.cc
@@ -8,7 +8,7 @@ #include "chrome/browser/sync/test/integration/sync_test.h" #include "components/browser_sync/browser/profile_sync_service.h" -using apps_helper::AllProfilesHaveSameApps; +using apps_helper::AllProfilesHaveSameAppsAsVerifier; using apps_helper::InstallApp; using apps_helper::InstallPlatformApp; using sync_integration_test_util::AwaitCommitActivityCompletion; @@ -26,7 +26,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, StartWithNoApps) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameApps()); + ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); } IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, StartWithSomeLegacyApps) { @@ -40,7 +40,7 @@ ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameApps()); + ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); } IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, StartWithSomePlatformApps) { @@ -54,7 +54,7 @@ ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameApps()); + ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); } IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, InstallSomeLegacyApps) { @@ -68,7 +68,7 @@ ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); - ASSERT_TRUE(AllProfilesHaveSameApps()); + ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); } IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, InstallSomePlatformApps) { @@ -82,7 +82,7 @@ ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); - ASSERT_TRUE(AllProfilesHaveSameApps()); + ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); } IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, InstallSomeApps) { @@ -104,5 +104,5 @@ ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); - ASSERT_TRUE(AllProfilesHaveSameApps()); + ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); }
diff --git a/chrome/browser/sync/test/integration/sync_app_list_helper.cc b/chrome/browser/sync/test/integration/sync_app_list_helper.cc index 487209e..72c984b 100644 --- a/chrome/browser/sync/test/integration/sync_app_list_helper.cc +++ b/chrome/browser/sync/test/integration/sync_app_list_helper.cc
@@ -39,50 +39,53 @@ return; } test_ = test; - for (auto* profile : test_->GetAllProfiles()) { - extensions::ExtensionSystem::Get(profile)->InitForRegularProfile(true); + + for (int i = 0; i < test->num_clients(); ++i) { + extensions::ExtensionSystem::Get(test_->GetProfile(i)) + ->InitForRegularProfile(true); } + extensions::ExtensionSystem::Get(test_->verifier()) + ->InitForRegularProfile(true); setup_completed_ = true; } -bool SyncAppListHelper::AppListMatch(Profile* profile1, Profile* profile2) { - AppListSyncableService* service1 = - AppListSyncableServiceFactory::GetForProfile(profile1); - AppListSyncableService* service2 = - AppListSyncableServiceFactory::GetForProfile(profile2); +bool SyncAppListHelper::AppListMatchesVerifier(Profile* profile) { + AppListSyncableService* service = + AppListSyncableServiceFactory::GetForProfile(profile); + AppListSyncableService* verifier = + AppListSyncableServiceFactory::GetForProfile(test_->verifier()); // Note: sync item entries may not exist in verifier, but item lists should // match. - if (service1->GetModel()->top_level_item_list()->item_count() != - service2->GetModel()->top_level_item_list()->item_count()) { + if (service->GetModel()->top_level_item_list()->item_count() != + verifier->GetModel()->top_level_item_list()->item_count()) { LOG(ERROR) << "Model item count: " - << service1->GetModel()->top_level_item_list()->item_count() + << service->GetModel()->top_level_item_list()->item_count() << " != " - << service2->GetModel()->top_level_item_list()->item_count(); + << verifier->GetModel()->top_level_item_list()->item_count(); return false; } bool res = true; for (size_t i = 0; - i < service1->GetModel()->top_level_item_list()->item_count(); ++i) { - AppListItem* item1 = - service1->GetModel()->top_level_item_list()->item_at(i); + i < service->GetModel()->top_level_item_list()->item_count(); ++i) { + AppListItem* item1 = service->GetModel()->top_level_item_list()->item_at(i); AppListItem* item2 = - service2->GetModel()->top_level_item_list()->item_at(i); + verifier->GetModel()->top_level_item_list()->item_at(i); if (item1->CompareForTest(item2)) continue; LOG(ERROR) << "Item(" << i << "): " << item1->ToDebugString() << " != " << item2->ToDebugString(); size_t index2; - if (!service2->GetModel()->top_level_item_list()->FindItemIndex(item1->id(), + if (!verifier->GetModel()->top_level_item_list()->FindItemIndex(item1->id(), &index2)) { LOG(ERROR) << " Item(" << i << "): " << item1->ToDebugString() - << " Not in profile2."; + << " Not in verifier."; } else { LOG(ERROR) << " Item(" << i << "): " << item1->ToDebugString() - << " Has different profile2 index: " << index2; - item2 = service2->GetModel()->top_level_item_list()->item_at(index2); - LOG(ERROR) << " profile2 Item(" << index2 + << " Has different verifier index: " << index2; + item2 = verifier->GetModel()->top_level_item_list()->item_at(index2); + LOG(ERROR) << " Verifier Item(" << index2 << "): " << item2->ToDebugString(); } res = false; @@ -90,21 +93,28 @@ return res; } -bool SyncAppListHelper::AllProfilesHaveSameAppList() { - const auto& profiles = test_->GetAllProfiles(); - for (auto* profile : profiles) { - if (profile != profiles.front() && - !AppListMatch(profiles.front(), profile)) { - DVLOG(1) << "Profile1: " - << AppListSyncableServiceFactory::GetForProfile(profile); - PrintAppList(profile); - DVLOG(1) << "Profile2: " << - AppListSyncableServiceFactory::GetForProfile(profiles.front()); - PrintAppList(profiles.front()); - return false; +bool SyncAppListHelper::AllProfilesHaveSameAppListAsVerifier() { + bool res = true; + for (int i = 0; i < test_->num_clients(); ++i) { + if (!AppListMatchesVerifier(test_->GetProfile(i))) { + LOG(ERROR) << "Profile " << i + << " doesn't have the same app list as the verifier profile."; + res = false; } } - return true; + if (!res) { + Profile* verifier = test_->verifier(); + DVLOG(1) << "Verifier: " + << AppListSyncableServiceFactory::GetForProfile(verifier); + PrintAppList(test_->verifier()); + for (int i = 0; i < test_->num_clients(); ++i) { + Profile* profile = test_->GetProfile(i); + DVLOG(1) << "Profile: " << i << ": " + << AppListSyncableServiceFactory::GetForProfile(profile); + PrintAppList(profile); + } + } + return res; } void SyncAppListHelper::MoveApp(Profile* profile, size_t from, size_t to) { @@ -136,6 +146,17 @@ folder->item_list()->item_at(index_in_folder), ""); } +void SyncAppListHelper::CopyOrdinalsToVerifier(Profile* profile, + const std::string& id) { + AppListSyncableService* service = + AppListSyncableServiceFactory::GetForProfile(profile); + AppListSyncableService* verifier = + AppListSyncableServiceFactory::GetForProfile(test_->verifier()); + verifier->GetModel()->top_level_item_list()->SetItemPosition( + verifier->GetModel()->FindItem(id), + service->GetModel()->FindItem(id)->position()); +} + void SyncAppListHelper::PrintAppList(Profile* profile) { AppListSyncableService* service = AppListSyncableServiceFactory::GetForProfile(profile);
diff --git a/chrome/browser/sync/test/integration/sync_app_list_helper.h b/chrome/browser/sync/test/integration/sync_app_list_helper.h index 90ec898..cd788b25 100644 --- a/chrome/browser/sync/test/integration/sync_app_list_helper.h +++ b/chrome/browser/sync/test/integration/sync_app_list_helper.h
@@ -29,8 +29,9 @@ // internal data structures. void SetupIfNecessary(SyncTest* test); - // Returns true iff all existing profiles have the same app list entries. - bool AllProfilesHaveSameAppList(); + // Returns true iff all existing profiles have the same app list entries + // as the verifier. + bool AllProfilesHaveSameAppListAsVerifier(); // Moves an app in |profile|. void MoveApp(Profile* profile, size_t from, size_t to); @@ -45,6 +46,9 @@ size_t index_in_folder, const std::string& folder_id); + // Copies ordinals for item matching |id| from |profile1| to test_->verifier. + void CopyOrdinalsToVerifier(Profile* profile1, const std::string& id); + // Helper function for debugging, used to log the app lists on test failures. void PrintAppList(Profile* profile); @@ -54,9 +58,9 @@ SyncAppListHelper(); ~SyncAppListHelper(); - // Returns true iff |profile1| has the same app list as |profile2| + // Returns true iff |profile| has the same app list as |test_|->verifier() // and the app list entries all have the same state. - bool AppListMatch(Profile* profile1, Profile* profile2); + bool AppListMatchesVerifier(Profile* profile); // Helper function for debugging, logs info for an item, including the // contents of any folder items.
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index 3448e3d..4527584 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -420,17 +420,6 @@ return profiles_[index]; } -std::vector<Profile*> SyncTest::GetAllProfiles() { - std::vector<Profile*> profiles; - if (use_verifier()) { - profiles.push_back(verifier()); - } - for (int i = 0; i < num_clients(); ++i) { - profiles.push_back(GetProfile(i)); - } - return profiles; -} - Browser* SyncTest::GetBrowser(int index) { if (browsers_.empty()) LOG(FATAL) << "SetupClients() has not yet been called.";
diff --git a/chrome/browser/sync/test/integration/sync_test.h b/chrome/browser/sync/test/integration/sync_test.h index be8b35db..c6680d87 100644 --- a/chrome/browser/sync/test/integration/sync_test.h +++ b/chrome/browser/sync/test/integration/sync_test.h
@@ -130,10 +130,6 @@ // and manages its lifetime. Profile* GetProfile(int index) WARN_UNUSED_RESULT; - // Returns a list of all profiles including the verifier if available. Callee - // owns the objects and manages its lifetime. - std::vector<Profile*> GetAllProfiles(); - // Returns a pointer to a particular browser. Callee owns the object // and manages its lifetime. Browser* GetBrowser(int index) WARN_UNUSED_RESULT;
diff --git a/chrome/browser/sync/test/integration/two_client_app_list_sync_test.cc b/chrome/browser/sync/test/integration/two_client_app_list_sync_test.cc index d2fe638..2e707f04 100644 --- a/chrome/browser/sync/test/integration/two_client_app_list_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_app_list_sync_test.cc
@@ -11,7 +11,6 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/test/integration/apps_helper.h" -#include "chrome/browser/sync/test/integration/extensions_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" #include "chrome/browser/sync/test/integration/sync_app_list_helper.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" @@ -27,16 +26,13 @@ #include "ui/app_list/app_list_model.h" #include "ui/app_list/app_list_switches.h" -using apps_helper::AwaitAllProfilesHaveSameApps; using apps_helper::DisableApp; using apps_helper::EnableApp; -using apps_helper::HasSameApps; +using apps_helper::HasSameAppsAsVerifier; using apps_helper::IncognitoDisableApp; using apps_helper::IncognitoEnableApp; using apps_helper::InstallApp; using apps_helper::InstallAppsPendingForSync; -using apps_helper::IsAppEnabled; -using apps_helper::IsIncognitoEnabled; using apps_helper::UninstallApp; using sync_integration_test_util::AwaitCommitActivityCompletion; @@ -44,8 +40,9 @@ const size_t kNumDefaultApps = 2; -bool AllProfilesHaveSameAppList() { - return SyncAppListHelper::GetInstance()->AllProfilesHaveSameAppList(); +bool AllProfilesHaveSameAppListAsVerifier() { + return SyncAppListHelper::GetInstance()-> + AllProfilesHaveSameAppListAsVerifier(); } const app_list::AppListSyncableService::SyncItem* GetSyncItem( @@ -85,9 +82,7 @@ class TwoClientAppListSyncTest : public SyncTest { public: - TwoClientAppListSyncTest() : SyncTest(TWO_CLIENT_LEGACY) { - DisableVerifier(); - } + TwoClientAppListSyncTest() : SyncTest(TWO_CLIENT_LEGACY) {} ~TwoClientAppListSyncTest() override {} @@ -118,6 +113,7 @@ void WaitForExtensionServicesToLoad() { for (int i = 0; i < num_clients(); ++i) WaitForExtensionsServiceToLoadForProfile(GetProfile(i)); + WaitForExtensionsServiceToLoadForProfile(verifier()); } void WaitForExtensionsServiceToLoadForProfile(Profile* profile) { @@ -137,7 +133,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, StartWithNoApps) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, StartWithSameApps) { @@ -147,13 +143,14 @@ for (int i = 0; i < kNumApps; ++i) { InstallApp(GetProfile(0), i); InstallApp(GetProfile(1), i); + InstallApp(verifier(), i); } ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } // Install some apps on both clients, some on only one client, some on only the @@ -170,16 +167,21 @@ for (int j = 0; j < kNumCommonApps; ++i, ++j) { InstallApp(GetProfile(0), i); InstallApp(GetProfile(1), i); + InstallApp(verifier(), i); } const int kNumProfile0Apps = 10; for (int j = 0; j < kNumProfile0Apps; ++i, ++j) { std::string id = InstallApp(GetProfile(0), i); + InstallApp(verifier(), i); + SyncAppListHelper::GetInstance()->CopyOrdinalsToVerifier(GetProfile(0), id); } const int kNumProfile1Apps = 10; for (int j = 0; j < kNumProfile1Apps; ++i, ++j) { std::string id = InstallApp(GetProfile(1), i); + InstallApp(verifier(), i); + SyncAppListHelper::GetInstance()->CopyOrdinalsToVerifier(GetProfile(1), id); } ASSERT_TRUE(SetupSync()); @@ -191,7 +193,7 @@ // Verify the app lists, but ignore absolute position values, checking only // relative positions (see note in app_list_syncable_service.h). - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } // Install some apps on both clients, then sync. Then install some apps on only @@ -206,6 +208,7 @@ for (int j = 0; j < kNumCommonApps; ++i, ++j) { InstallApp(GetProfile(0), i); InstallApp(GetProfile(1), i); + InstallApp(verifier(), i); } ASSERT_TRUE(SetupSync()); @@ -215,11 +218,15 @@ const int kNumProfile0Apps = 10; for (int j = 0; j < kNumProfile0Apps; ++i, ++j) { std::string id = InstallApp(GetProfile(0), i); + InstallApp(verifier(), i); + SyncAppListHelper::GetInstance()->CopyOrdinalsToVerifier(GetProfile(0), id); } const int kNumProfile1Apps = 10; for (int j = 0; j < kNumProfile1Apps; ++i, ++j) { std::string id = InstallApp(GetProfile(1), i); + InstallApp(verifier(), i); + SyncAppListHelper::GetInstance()->CopyOrdinalsToVerifier(GetProfile(1), id); } ASSERT_TRUE(AwaitQuiescence()); @@ -229,35 +236,38 @@ // Verify the app lists, but ignore absolute position values, checking only // relative positions (see note in app_list_syncable_service.h). - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, Install) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); InstallApp(GetProfile(0), 0); + InstallApp(verifier(), 0); ASSERT_TRUE(AwaitQuiescence()); InstallAppsPendingForSync(GetProfile(0)); InstallAppsPendingForSync(GetProfile(1)); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, Uninstall) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); InstallApp(GetProfile(0), 0); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); + InstallApp(verifier(), 0); + ASSERT_TRUE(AwaitQuiescence()); InstallAppsPendingForSync(GetProfile(0)); InstallAppsPendingForSync(GetProfile(1)); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); UninstallApp(GetProfile(0), 0); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + UninstallApp(verifier(), 0); + ASSERT_TRUE(AwaitQuiescence()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } // Install an app on one client, then sync. Then uninstall the app on the first @@ -266,117 +276,125 @@ // ordinals. IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, UninstallThenInstall) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); InstallApp(GetProfile(0), 0); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); + InstallApp(verifier(), 0); + ASSERT_TRUE(AwaitQuiescence()); InstallAppsPendingForSync(GetProfile(0)); InstallAppsPendingForSync(GetProfile(1)); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); UninstallApp(GetProfile(0), 0); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + UninstallApp(verifier(), 0); + ASSERT_TRUE(AwaitQuiescence()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); InstallApp(GetProfile(0), 1); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); + InstallApp(verifier(), 1); + ASSERT_TRUE(AwaitQuiescence()); InstallAppsPendingForSync(GetProfile(0)); InstallAppsPendingForSync(GetProfile(1)); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, Merge) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); InstallApp(GetProfile(0), 0); InstallApp(GetProfile(1), 0); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); + ASSERT_TRUE(AwaitQuiescence()); UninstallApp(GetProfile(0), 0); InstallApp(GetProfile(0), 1); + InstallApp(verifier(), 1); InstallApp(GetProfile(0), 2); InstallApp(GetProfile(1), 2); + InstallApp(verifier(), 2); InstallApp(GetProfile(1), 3); + InstallApp(verifier(), 3); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); + ASSERT_TRUE(AwaitQuiescence()); InstallAppsPendingForSync(GetProfile(0)); InstallAppsPendingForSync(GetProfile(1)); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, UpdateEnableDisableApp) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); InstallApp(GetProfile(0), 0); InstallApp(GetProfile(1), 0); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); - - ASSERT_TRUE(IsAppEnabled(GetProfile(0), 0)); - ASSERT_TRUE(IsAppEnabled(GetProfile(1), 0)); + InstallApp(verifier(), 0); + ASSERT_TRUE(AwaitQuiescence()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); DisableApp(GetProfile(0), 0); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); - ASSERT_TRUE(HasSameApps(GetProfile(0), GetProfile(1))); - ASSERT_FALSE(IsAppEnabled(GetProfile(0), 0)); - ASSERT_FALSE(IsAppEnabled(GetProfile(1), 0)); + DisableApp(verifier(), 0); + ASSERT_TRUE(HasSameAppsAsVerifier(0)); + ASSERT_FALSE(HasSameAppsAsVerifier(1)); + + ASSERT_TRUE(AwaitQuiescence()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); EnableApp(GetProfile(1), 0); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + EnableApp(verifier(), 0); + ASSERT_TRUE(HasSameAppsAsVerifier(1)); + ASSERT_FALSE(HasSameAppsAsVerifier(0)); - ASSERT_TRUE(IsAppEnabled(GetProfile(0), 0)); - ASSERT_TRUE(IsAppEnabled(GetProfile(1), 0)); + ASSERT_TRUE(AwaitQuiescence()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, UpdateIncognitoEnableDisable) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); InstallApp(GetProfile(0), 0); InstallApp(GetProfile(1), 0); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); - - ASSERT_FALSE(IsIncognitoEnabled(GetProfile(0), 0)); - ASSERT_FALSE(IsIncognitoEnabled(GetProfile(1), 0)); + InstallApp(verifier(), 0); + ASSERT_TRUE(AwaitQuiescence()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); IncognitoEnableApp(GetProfile(0), 0); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + IncognitoEnableApp(verifier(), 0); + ASSERT_TRUE(HasSameAppsAsVerifier(0)); + ASSERT_FALSE(HasSameAppsAsVerifier(1)); - ASSERT_TRUE(IsIncognitoEnabled(GetProfile(0), 0)); - ASSERT_TRUE(IsIncognitoEnabled(GetProfile(1), 0)); + ASSERT_TRUE(AwaitQuiescence()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); IncognitoDisableApp(GetProfile(1), 0); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + IncognitoDisableApp(verifier(), 0); + ASSERT_TRUE(HasSameAppsAsVerifier(1)); + ASSERT_FALSE(HasSameAppsAsVerifier(0)); - ASSERT_FALSE(IsIncognitoEnabled(GetProfile(0), 0)); - ASSERT_FALSE(IsIncognitoEnabled(GetProfile(1), 0)); + ASSERT_TRUE(AwaitQuiescence()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, DisableApps) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::APP_LIST)); InstallApp(GetProfile(0), 0); + InstallApp(verifier(), 0); ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); - ASSERT_FALSE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(HasSameAppsAsVerifier(0)); + ASSERT_FALSE(HasSameAppsAsVerifier(1)); ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::APP_LIST)); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); + ASSERT_TRUE(AwaitQuiescence()); InstallAppsPendingForSync(GetProfile(0)); InstallAppsPendingForSync(GetProfile(1)); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } // Disable sync for the second client and then install an app on the first @@ -384,26 +402,28 @@ // same app with identical app and page ordinals. IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, DisableSync) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes()); InstallApp(GetProfile(0), 0); + InstallApp(verifier(), 0); ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); - ASSERT_FALSE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(HasSameAppsAsVerifier(0)); + ASSERT_FALSE(HasSameAppsAsVerifier(1)); ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); + ASSERT_TRUE(AwaitQuiescence()); InstallAppsPendingForSync(GetProfile(0)); InstallAppsPendingForSync(GetProfile(1)); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } // Install some apps on both clients, then sync. Move an app on one client // and sync. Both clients should have the updated position for the app. IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, Move) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); std::vector<std::string> app_ids; // AppListPrefs should be empty since it only begins observing the model after @@ -414,9 +434,10 @@ for (int i = 0; i < kNumApps; ++i) { app_ids.push_back(InstallApp(GetProfile(0), i)); InstallApp(GetProfile(1), i); + InstallApp(verifier(), i); } - ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AwaitQuiescence()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); // AppListPrefs should contain the newly installed apps. CheckAppInfoInPrefs(GetProfile(1), app_ids); @@ -424,9 +445,11 @@ size_t first = kNumDefaultApps; SyncAppListHelper::GetInstance()->MoveApp( GetProfile(0), first + 1, first + 2); + SyncAppListHelper::GetInstance()->MoveApp( + verifier(), first + 1, first + 2); ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); // AppListPrefs should reflect the apps being moved in the model. CheckAppInfoInPrefs(GetProfile(1), app_ids); @@ -442,15 +465,19 @@ // Install a non-default app. InstallApp(GetProfile(0), 0); InstallApp(GetProfile(1), 0); + InstallApp(verifier(), 0); // Install a default app in Profile 0 only. const int default_app_index = 1; std::string default_app_id = InstallApp(GetProfile(0), default_app_index); + InstallApp(verifier(), default_app_index); + SyncAppListHelper::GetInstance()->CopyOrdinalsToVerifier( + GetProfile(0), default_app_id); ASSERT_TRUE(AwaitQuiescence()); InstallAppsPendingForSync(GetProfile(0)); InstallAppsPendingForSync(GetProfile(1)); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); // Flag Default app in Profile 1. extensions::ExtensionPrefs::Get(GetProfile(1)) @@ -461,8 +488,9 @@ // Remove the default app in Profile 0 and verifier, ensure it was removed // in Profile 1. UninstallApp(GetProfile(0), default_app_index); + UninstallApp(verifier(), default_app_index); ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); // Ensure that a REMOVE_DEFAULT_APP SyncItem entry exists in Profile 1. const app_list::AppListSyncableService::SyncItem* sync_item = @@ -474,13 +502,14 @@ // Re-Install the same app in Profile 0. std::string app_id2 = InstallApp(GetProfile(0), default_app_index); EXPECT_EQ(default_app_id, app_id2); + InstallApp(verifier(), default_app_index); sync_item = GetSyncItem(GetProfile(0), app_id2); EXPECT_EQ(sync_pb::AppListSpecifics::TYPE_APP, sync_item->item_type); ASSERT_TRUE(AwaitQuiescence()); InstallAppsPendingForSync(GetProfile(0)); InstallAppsPendingForSync(GetProfile(1)); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); // Ensure that the REMOVE_DEFAULT_APP SyncItem entry in Profile 1 is replaced // with an APP entry after an install. @@ -491,40 +520,65 @@ #if !defined(OS_MACOSX) +class TwoClientAppListSyncFolderTest : public TwoClientAppListSyncTest { + public: + TwoClientAppListSyncFolderTest() {} + ~TwoClientAppListSyncFolderTest() override {} + + void SetUpCommandLine(base::CommandLine* command_line) override { + TwoClientAppListSyncTest::SetUpCommandLine(command_line); + } + + bool SetupClients() override { + bool res = TwoClientAppListSyncTest::SetupClients(); + app_list::AppListSyncableService* verifier_service = + app_list::AppListSyncableServiceFactory::GetForProfile(verifier()); + verifier_service->GetModel()->SetFoldersEnabled(true); + return res; + } + + private: + DISALLOW_COPY_AND_ASSIGN(TwoClientAppListSyncFolderTest); +}; + // Install some apps on both clients, then sync. Move an app on one client // to a folder and sync. The app lists, including folders, should match. -IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, MoveToFolder) { +IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncFolderTest, MoveToFolder) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); const int kNumApps = 5; for (int i = 0; i < kNumApps; ++i) { InstallApp(GetProfile(0), i); InstallApp(GetProfile(1), i); + InstallApp(verifier(), i); } ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); size_t index = 2u; std::string folder_id = "Folder 0"; SyncAppListHelper::GetInstance()->MoveAppToFolder( GetProfile(0), index, folder_id); + SyncAppListHelper::GetInstance()->MoveAppToFolder( + verifier(), index, folder_id); ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } -IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncTest, FolderAddRemove) { +IN_PROC_BROWSER_TEST_F(TwoClientAppListSyncFolderTest, FolderAddRemove) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); const int kNumApps = 10; for (int i = 0; i < kNumApps; ++i) { InstallApp(GetProfile(0), i); InstallApp(GetProfile(1), i); + InstallApp(verifier(), i); } ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); // Move a few apps to a folder. const size_t kNumAppsToMove = 3; @@ -535,34 +589,42 @@ for (size_t i = 0; i < kNumAppsToMove; ++i) { SyncAppListHelper::GetInstance()->MoveAppToFolder( GetProfile(0), item_index, folder_id); + SyncAppListHelper::GetInstance()->MoveAppToFolder( + verifier(), item_index, folder_id); } ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); // Remove one app from the folder. SyncAppListHelper::GetInstance()->MoveAppFromFolder( GetProfile(0), 0, folder_id); + SyncAppListHelper::GetInstance()->MoveAppFromFolder( + verifier(), 0, folder_id); ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); // Remove remaining apps from the folder (deletes folder). for (size_t i = 1; i < kNumAppsToMove; ++i) { SyncAppListHelper::GetInstance()->MoveAppFromFolder( GetProfile(0), 0, folder_id); + SyncAppListHelper::GetInstance()->MoveAppFromFolder( + verifier(), 0, folder_id); } ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); // Move apps back to a (new) folder. for (size_t i = 0; i < kNumAppsToMove; ++i) { SyncAppListHelper::GetInstance()->MoveAppToFolder( GetProfile(0), item_index, folder_id); + SyncAppListHelper::GetInstance()->MoveAppToFolder( + verifier(), item_index, folder_id); } ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(AllProfilesHaveSameAppList()); + ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); } #endif // !defined(OS_MACOSX)
diff --git a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc index 6ba8a21..0dae46c 100644 --- a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
@@ -27,12 +27,13 @@ #include "extensions/common/constants.h" #include "sync/api/string_ordinal.h" -using apps_helper::AllProfilesHaveSameApps; +using apps_helper::AllProfilesHaveSameAppsAsVerifier; using apps_helper::CopyNTPOrdinals; using apps_helper::DisableApp; using apps_helper::EnableApp; using apps_helper::FixNTPOrdinalCollisions; using apps_helper::GetAppLaunchOrdinalForApp; +using apps_helper::HasSameAppsAsVerifier; using apps_helper::IncognitoDisableApp; using apps_helper::IncognitoEnableApp; using apps_helper::InstallApp; @@ -56,9 +57,7 @@ class TwoClientAppsSyncTest : public SyncTest { public: - TwoClientAppsSyncTest() : SyncTest(TWO_CLIENT) { - DisableVerifier(); - } + TwoClientAppsSyncTest() : SyncTest(TWO_CLIENT) {} ~TwoClientAppsSyncTest() override {} @@ -75,6 +74,7 @@ } IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(StartWithSameApps)) { + DisableVerifier(); ASSERT_TRUE(SetupClients()); const int kNumApps = 5; @@ -101,22 +101,32 @@ for (int j = 0; j < kNumCommonApps; ++i, ++j) { InstallApp(GetProfile(0), i); InstallApp(GetProfile(1), i); + InstallApp(verifier(), i); } const int kNumProfile0Apps = 10; for (int j = 0; j < kNumProfile0Apps; ++i, ++j) { InstallApp(GetProfile(0), i); + InstallApp(verifier(), i); + CopyNTPOrdinals(GetProfile(0), verifier(), i); } const int kNumProfile1Apps = 10; for (int j = 0; j < kNumProfile1Apps; ++i, ++j) { InstallApp(GetProfile(1), i); + InstallApp(verifier(), i); + CopyNTPOrdinals(GetProfile(1), verifier(), i); } const int kNumPlatformApps = 5; for (int j = 0; j < kNumPlatformApps; ++i, ++j) { InstallPlatformApp(GetProfile(1), i); + InstallPlatformApp(verifier(), i); + CopyNTPOrdinals(GetProfile(1), verifier(), i); } + + FixNTPOrdinalCollisions(verifier()); + ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); @@ -127,6 +137,7 @@ // end up with all apps, and the app and page ordinals should be identical. IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(InstallDifferentApps)) { + DisableVerifier(); ASSERT_TRUE(SetupClients()); int i = 0; @@ -154,6 +165,7 @@ // TCM ID - 3711279. IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(Add)) { + DisableVerifier(); ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); @@ -164,6 +176,7 @@ // TCM ID - 3706267. IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(Uninstall)) { + DisableVerifier(); ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); @@ -180,6 +193,7 @@ // ordinals. IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(UninstallThenInstall)) { + DisableVerifier(); ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); @@ -195,6 +209,7 @@ // TCM ID - 3699295. IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(Merge)) { + DisableVerifier(); ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); @@ -215,6 +230,7 @@ // TCM ID - 7723126. IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(UpdateEnableDisableApp)) { + DisableVerifier(); ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); @@ -231,6 +247,7 @@ // TCM ID - 7706637. IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(UpdateIncognitoEnableDisable)) { + DisableVerifier(); ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); @@ -248,6 +265,7 @@ // one client and sync. Both clients should have the updated page ordinal for // the app. IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(UpdatePageOrdinal)) { + DisableVerifier(); ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); @@ -266,6 +284,7 @@ // launch ordinal for the app. IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(UpdateAppLaunchOrdinal)) { + DisableVerifier(); ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); @@ -284,6 +303,7 @@ // which page the CWS appears on and sync. Both clients should have the same // page and app launch ordinal values for the CWS. IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(UpdateCWSOrdinals)) { + DisableVerifier(); ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); @@ -313,6 +333,7 @@ // Adjust the launch type on the first client and sync. Both clients should // have the same launch type values for the CWS. IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(UpdateLaunchType)) { + DisableVerifier(); ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); @@ -340,10 +361,12 @@ IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UnexpectedLaunchType) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameApps()); + ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); extensions::SetLaunchType(GetProfile(1), extensions::kWebStoreAppId, extensions::LAUNCH_TYPE_REGULAR); + extensions::SetLaunchType(verifier(), extensions::kWebStoreAppId, + extensions::LAUNCH_TYPE_REGULAR); ASSERT_TRUE(AwaitAllProfilesHaveSameApps()); const extensions::Extension* extension = @@ -379,7 +402,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, BookmarkApp) { ASSERT_TRUE(SetupSync()); - ASSERT_TRUE(AllProfilesHaveSameApps()); + ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); size_t num_extensions = GetExtensionRegistry(GetProfile(0))->enabled_extensions().size(); @@ -400,10 +423,20 @@ GetExtensionRegistry(GetProfile(0))->enabled_extensions().size()); } { + content::WindowedNotificationObserver windowed_observer( + extensions::NOTIFICATION_CRX_INSTALLER_DONE, + content::NotificationService::AllSources()); + extensions::CreateOrUpdateBookmarkApp(GetExtensionService(verifier()), + &web_app_info); + windowed_observer.Wait(); + EXPECT_EQ(num_extensions, + GetExtensionRegistry(verifier())->enabled_extensions().size()); + } + { // Wait for the synced app to install. content::WindowedNotificationObserver windowed_observer( extensions::NOTIFICATION_CRX_INSTALLER_DONE, - base::Bind(&AllProfilesHaveSameApps)); + base::Bind(&AllProfilesHaveSameAppsAsVerifier)); windowed_observer.Wait(); } }
diff --git a/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc b/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc index ee2c569..d8e9e6ab 100644 --- a/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc
@@ -28,8 +28,8 @@ using autofill_helper::AwaitProfilesMatch; using autofill_helper::CreateAutofillProfile; using autofill_helper::CreateUniqueAutofillProfile; -using autofill_helper::GetAllAutoFillProfiles; using autofill_helper::GetAllKeys; +using autofill_helper::GetAllProfiles; using autofill_helper::GetPersonalDataManager; using autofill_helper::GetProfileCount; using autofill_helper::KeysMatch; @@ -162,40 +162,40 @@ AddProfile(0, CreateAutofillProfile(PROFILE_HOMER)); MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); // Client1 adds a profile. AddProfile(1, CreateAutofillProfile(PROFILE_MARION)); MakeABookmarkChange(1); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(2U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(2U, GetAllProfiles(0).size()); // Client0 adds the same profile. AddProfile(0, CreateAutofillProfile(PROFILE_MARION)); MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(2U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(2U, GetAllProfiles(0).size()); // Client1 removes a profile. - RemoveProfile(1, GetAllAutoFillProfiles(1)[0]->guid()); + RemoveProfile(1, GetAllProfiles(1)[0]->guid()); MakeABookmarkChange(1); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); // Client0 updates a profile. UpdateProfile(0, - GetAllAutoFillProfiles(0)[0]->guid(), + GetAllProfiles(0)[0]->guid(), AutofillType(autofill::NAME_FIRST), base::ASCIIToUTF16("Bart")); MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); // Client1 removes remaining profile. - RemoveProfile(1, GetAllAutoFillProfiles(1)[0]->guid()); + RemoveProfile(1, GetAllProfiles(1)[0]->guid()); MakeABookmarkChange(1); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(0U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(0U, GetAllProfiles(0).size()); } // TCM ID - 7261786. @@ -206,7 +206,7 @@ AddProfile(0, CreateAutofillProfile(PROFILE_HOMER)); ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); } // TCM ID - 3636294. @@ -222,7 +222,7 @@ AddProfile(1, profile1); ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); } // TCM ID - 3626291. @@ -231,7 +231,7 @@ AddProfile(0, CreateAutofillProfile(PROFILE_NULL)); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(0U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(0U, GetAllProfiles(0).size()); } // TCM ID - 3616283. @@ -241,7 +241,7 @@ AddProfile(0, CreateAutofillProfile(PROFILE_HOMER)); MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); } // TCM ID - 3632260. @@ -253,7 +253,7 @@ AddProfile(0, CreateAutofillProfile(PROFILE_FRASIER)); MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(3U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(3U, GetAllProfiles(0).size()); } // TCM ID - 3602257. @@ -263,12 +263,12 @@ AddProfile(0, CreateAutofillProfile(PROFILE_HOMER)); MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); - RemoveProfile(1, GetAllAutoFillProfiles(1)[0]->guid()); + RemoveProfile(1, GetAllProfiles(1)[0]->guid()); MakeABookmarkChange(1); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(0U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(0U, GetAllProfiles(0).size()); } // TCM ID - 3627300. @@ -280,7 +280,7 @@ AddProfile(1, CreateAutofillProfile(PROFILE_FRASIER)); ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(3U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(3U, GetAllProfiles(0).size()); } // TCM ID - 3665264. @@ -290,19 +290,19 @@ AddProfile(0, CreateAutofillProfile(PROFILE_HOMER)); MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); UpdateProfile(0, - GetAllAutoFillProfiles(0)[0]->guid(), + GetAllProfiles(0)[0]->guid(), AutofillType(autofill::NAME_FIRST), base::ASCIIToUTF16("Lisa")); UpdateProfile(0, - GetAllAutoFillProfiles(0)[0]->guid(), + GetAllProfiles(0)[0]->guid(), AutofillType(autofill::EMAIL_ADDRESS), base::ASCIIToUTF16("grrrl@TV.com")); MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); } // TCM ID - 3628299. @@ -312,19 +312,19 @@ AddProfile(0, CreateAutofillProfile(PROFILE_HOMER)); MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); UpdateProfile(0, - GetAllAutoFillProfiles(0)[0]->guid(), + GetAllProfiles(0)[0]->guid(), AutofillType(autofill::NAME_FIRST), base::ASCIIToUTF16("Lisa")); MakeABookmarkChange(0); UpdateProfile(1, - GetAllAutoFillProfiles(1)[0]->guid(), + GetAllProfiles(1)[0]->guid(), AutofillType(autofill::NAME_FIRST), base::ASCIIToUTF16("Bart")); MakeABookmarkChange(1); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); } // TCM ID - 3608295. @@ -334,19 +334,19 @@ AddProfile(0, CreateAutofillProfile(PROFILE_HOMER)); MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); base::string16 max_length_string(AutofillTable::kMaxDataLength, '.'); UpdateProfile(0, - GetAllAutoFillProfiles(0)[0]->guid(), + GetAllProfiles(0)[0]->guid(), AutofillType(autofill::NAME_FULL), max_length_string); UpdateProfile(0, - GetAllAutoFillProfiles(0)[0]->guid(), + GetAllProfiles(0)[0]->guid(), AutofillType(autofill::EMAIL_ADDRESS), max_length_string); UpdateProfile(0, - GetAllAutoFillProfiles(0)[0]->guid(), + GetAllProfiles(0)[0]->guid(), AutofillType(autofill::ADDRESS_HOME_LINE1), max_length_string); @@ -360,24 +360,24 @@ AddProfile(0, CreateAutofillProfile(PROFILE_HOMER)); MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); base::string16 exceeds_max_length_string( AutofillTable::kMaxDataLength + 1, '.'); UpdateProfile(0, - GetAllAutoFillProfiles(0)[0]->guid(), + GetAllProfiles(0)[0]->guid(), AutofillType(autofill::NAME_FIRST), exceeds_max_length_string); UpdateProfile(0, - GetAllAutoFillProfiles(0)[0]->guid(), + GetAllProfiles(0)[0]->guid(), AutofillType(autofill::NAME_LAST), exceeds_max_length_string); UpdateProfile(0, - GetAllAutoFillProfiles(0)[0]->guid(), + GetAllProfiles(0)[0]->guid(), AutofillType(autofill::EMAIL_ADDRESS), exceeds_max_length_string); UpdateProfile(0, - GetAllAutoFillProfiles(0)[0]->guid(), + GetAllProfiles(0)[0]->guid(), AutofillType(autofill::ADDRESS_HOME_LINE1), exceeds_max_length_string); @@ -401,7 +401,7 @@ MakeABookmarkChange(0); ASSERT_TRUE(AwaitProfilesMatch(0, 1)); - ASSERT_EQ(1U, GetAllAutoFillProfiles(0).size()); + ASSERT_EQ(1U, GetAllProfiles(0).size()); PersonalDataManager* pdm = GetPersonalDataManager(1); ASSERT_EQ(0U, pdm->GetCreditCards().size());
diff --git a/chrome/browser/sync_file_system/drive_backend/callback_helper.h b/chrome/browser/sync_file_system/drive_backend/callback_helper.h index c220571..440a6d6e 100644 --- a/chrome/browser/sync_file_system/drive_backend/callback_helper.h +++ b/chrome/browser/sync_file_system/drive_backend/callback_helper.h
@@ -11,6 +11,7 @@ #include "base/location.h" #include "base/logging.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/sequenced_task_runner.h" #include "base/thread_task_runner_handle.h"
diff --git a/chrome/browser/task_management/sampling/task_group_sampler.h b/chrome/browser/task_management/sampling/task_group_sampler.h index b70b6eb..60fec2b 100644 --- a/chrome/browser/task_management/sampling/task_group_sampler.h +++ b/chrome/browser/task_management/sampling/task_group_sampler.h
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/process/process.h" #include "base/process/process_handle.h" #include "base/process/process_metrics.h"
diff --git a/chrome/browser/task_manager/task_manager.h b/chrome/browser/task_manager/task_manager.h index 859559a..71c0257 100644 --- a/chrome/browser/task_manager/task_manager.h +++ b/chrome/browser/task_manager/task_manager.h
@@ -15,6 +15,7 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/observer_list.h" #include "base/strings/string16.h"
diff --git a/chrome/browser/ui/app_list/app_list_prefs.h b/chrome/browser/ui/app_list/app_list_prefs.h index 9f2a5a29..5d00357b 100644 --- a/chrome/browser/ui/app_list/app_list_prefs.h +++ b/chrome/browser/ui/app_list/app_list_prefs.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/values.h" #include "components/keyed_service/core/keyed_service.h"
diff --git a/chrome/browser/ui/app_list/profile_loader.h b/chrome/browser/ui/app_list/profile_loader.h index 5af1bfba..8db286c 100644 --- a/chrome/browser/ui/app_list/profile_loader.h +++ b/chrome/browser/ui/app_list/profile_loader.h
@@ -7,6 +7,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" namespace base {
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 1d4d32f..297de4d 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc
@@ -1557,7 +1557,8 @@ // need to update the command state early on load to always present usable // actions in the face of slow-to-commit pages. if (changed_flags & (content::INVALIDATE_TYPE_URL | - content::INVALIDATE_TYPE_LOAD)) + content::INVALIDATE_TYPE_LOAD | + content::INVALIDATE_TYPE_TAB)) command_controller_->TabStateChanged(); if (hosted_app_controller_)
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index 5a75ec5a..758148d 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h
@@ -819,7 +819,7 @@ int index, DetachType type); - // Shared code between Reload() and ReloadIgnoringCache(). + // Shared code between Reload() and ReloadBypassingCache(). void ReloadInternal(WindowOpenDisposition disposition, bool ignore_cache); // Returns true if the Browser window supports a location bar. Having support
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 1c7bf67..c624c8c 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc
@@ -327,8 +327,8 @@ case IDC_RELOAD_CLEARING_CACHE: ClearCache(browser_); // FALL THROUGH - case IDC_RELOAD_IGNORING_CACHE: - ReloadIgnoringCache(browser_, disposition); + case IDC_RELOAD_BYPASSING_CACHE: + ReloadBypassingCache(browser_, disposition); break; case IDC_HOME: Home(browser_, disposition); @@ -788,7 +788,7 @@ // Navigation commands command_updater_.UpdateCommandEnabled(IDC_RELOAD, true); - command_updater_.UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE, true); + command_updater_.UpdateCommandEnabled(IDC_RELOAD_BYPASSING_CACHE, true); command_updater_.UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, true); // Window management commands @@ -984,7 +984,7 @@ command_updater_.UpdateCommandEnabled(IDC_BACK, CanGoBack(browser_)); command_updater_.UpdateCommandEnabled(IDC_FORWARD, CanGoForward(browser_)); command_updater_.UpdateCommandEnabled(IDC_RELOAD, CanReload(browser_)); - command_updater_.UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE, + command_updater_.UpdateCommandEnabled(IDC_RELOAD_BYPASSING_CACHE, CanReload(browser_)); command_updater_.UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, CanReload(browser_));
diff --git a/chrome/browser/ui/browser_command_controller_unittest.cc b/chrome/browser/ui/browser_command_controller_unittest.cc index 422a346..23746a31 100644 --- a/chrome/browser/ui/browser_command_controller_unittest.cc +++ b/chrome/browser/ui/browser_command_controller_unittest.cc
@@ -51,13 +51,13 @@ // When there are modifier keys pressed, don't reserve. EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey( - IDC_RELOAD_IGNORING_CACHE, content::NativeWebKeyboardEvent(ui::KeyEvent( - ui::ET_KEY_PRESSED, ui::VKEY_F3, - ui::DomCode::F3, ui::EF_SHIFT_DOWN)))); + IDC_RELOAD_BYPASSING_CACHE, content::NativeWebKeyboardEvent(ui::KeyEvent( + ui::ET_KEY_PRESSED, ui::VKEY_F3, + ui::DomCode::F3, ui::EF_SHIFT_DOWN)))); EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey( - IDC_RELOAD_IGNORING_CACHE, content::NativeWebKeyboardEvent(ui::KeyEvent( - ui::ET_KEY_PRESSED, ui::VKEY_F3, - ui::DomCode::F3, ui::EF_CONTROL_DOWN)))); + IDC_RELOAD_BYPASSING_CACHE, content::NativeWebKeyboardEvent(ui::KeyEvent( + ui::ET_KEY_PRESSED, ui::VKEY_F3, + ui::DomCode::F3, ui::EF_CONTROL_DOWN)))); EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey( IDC_FULLSCREEN, content::NativeWebKeyboardEvent( ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_F4,
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index 13fd6fa..2cad2c4 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc
@@ -230,7 +230,7 @@ return; if (ignore_cache) - new_tab->GetController().ReloadIgnoringCache(true); + new_tab->GetController().ReloadBypassingCache(true); else new_tab->GetController().Reload(true); } @@ -426,8 +426,8 @@ ReloadInternal(browser, disposition, false); } -void ReloadIgnoringCache(Browser* browser, WindowOpenDisposition disposition) { - content::RecordAction(UserMetricsAction("ReloadIgnoringCache")); +void ReloadBypassingCache(Browser* browser, WindowOpenDisposition disposition) { + content::RecordAction(UserMetricsAction("ReloadBypassingCache")); ReloadInternal(browser, disposition, true); } @@ -877,14 +877,17 @@ bool CanPrint(Browser* browser) { // Do not print when printing is disabled via pref or policy. + // Do not print when a page has crashed. // Do not print when a constrained window is showing. It's confusing. // TODO(gbillock): Need to re-assess the call to // IsShowingWebContentsModalDialog after a popup management policy is // refined -- we will probably want to just queue the print request, not // block it. + WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); return browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) && + (current_tab && !current_tab->IsCrashed()) && !(IsShowingWebContentsModalDialog(browser) || - GetContentRestrictions(browser) & CONTENT_RESTRICTION_PRINT); + GetContentRestrictions(browser) & CONTENT_RESTRICTION_PRINT); } #if defined(ENABLE_BASIC_PRINTING)
diff --git a/chrome/browser/ui/browser_commands.h b/chrome/browser/ui/browser_commands.h index ef99d3d8..984144b0e 100644 --- a/chrome/browser/ui/browser_commands.h +++ b/chrome/browser/ui/browser_commands.h
@@ -63,7 +63,7 @@ int index, WindowOpenDisposition disposition); void Reload(Browser* browser, WindowOpenDisposition disposition); -void ReloadIgnoringCache(Browser* browser, WindowOpenDisposition disposition); +void ReloadBypassingCache(Browser* browser, WindowOpenDisposition disposition); bool CanReload(const Browser* browser); void Home(Browser* browser, WindowOpenDisposition disposition); void OpenCurrentURL(Browser* browser);
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc index 75ab079..746e8f5d 100644 --- a/chrome/browser/ui/browser_navigator.cc +++ b/chrome/browser/ui/browser_navigator.cc
@@ -338,7 +338,9 @@ const GURL& url) { WebContents::CreateParams create_params( params.browser->profile(), - tab_util::GetSiteInstanceForNewTab(params.browser->profile(), url)); + params.source_site_instance + ? params.source_site_instance + : tab_util::GetSiteInstanceForNewTab(params.browser->profile(), url)); if (params.source_contents) { create_params.initial_size = params.source_contents->GetContainerBounds().size();
diff --git a/chrome/browser/ui/browser_unittest.cc b/chrome/browser/ui/browser_unittest.cc index 5d15200..e8d6bd5 100644 --- a/chrome/browser/ui/browser_unittest.cc +++ b/chrome/browser/ui/browser_unittest.cc
@@ -5,6 +5,8 @@ #include "chrome/browser/ui/browser.h" #include "base/macros.h" +#include "chrome/app/chrome_command_ids.h" +#include "chrome/browser/ui/browser_command_controller.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/test/base/browser_with_test_window_test.h" @@ -63,6 +65,28 @@ EXPECT_TRUE(contents2->IsCrashed()); } +// Ensure the print command gets disabled when a tab crashes. +TEST_F(BrowserUnitTest, DisablePrintOnCrashedTab) { + TabStripModel* tab_strip_model = browser()->tab_strip_model(); + + WebContents* contents = CreateTestWebContents(); + tab_strip_model->AppendWebContents(contents, true); + WebContentsTester::For(contents)->NavigateAndCommit(GURL("about:blank")); + + CommandUpdater* command_updater = + browser()->command_controller()->command_updater(); + + EXPECT_FALSE(contents->IsCrashed()); + EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_PRINT)); + EXPECT_TRUE(chrome::CanPrint(browser())); + + contents->SetIsCrashed(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); + + EXPECT_TRUE(contents->IsCrashed()); + EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_PRINT)); + EXPECT_FALSE(chrome::CanPrint(browser())); +} + class BrowserBookmarkBarTest : public BrowserWithTestWindowTest { public: BrowserBookmarkBarTest() {}
diff --git a/chrome/browser/ui/cocoa/accelerators_cocoa.mm b/chrome/browser/ui/cocoa/accelerators_cocoa.mm index 6038cac..8410dbe 100644 --- a/chrome/browser/ui/cocoa/accelerators_cocoa.mm +++ b/chrome/browser/ui/cocoa/accelerators_cocoa.mm
@@ -90,7 +90,7 @@ {IDC_ZOOM_MINUS, NSCommandKeyMask, ui::VKEY_OEM_MINUS}, {IDC_STOP, NSCommandKeyMask, ui::VKEY_OEM_PERIOD}, {IDC_RELOAD, NSCommandKeyMask, ui::VKEY_R}, - {IDC_RELOAD_IGNORING_CACHE, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_R}, + {IDC_RELOAD_BYPASSING_CACHE, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_R}, {IDC_PRESENTATION_MODE, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_F}, {IDC_ZOOM_NORMAL, NSCommandKeyMask, ui::VKEY_0}, {IDC_HOME, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_H},
diff --git a/chrome/browser/ui/cocoa/browser_window_command_handler.mm b/chrome/browser/ui/cocoa/browser_window_command_handler.mm index 27b634c..50fbb6a 100644 --- a/chrome/browser/ui/cocoa/browser_window_command_handler.mm +++ b/chrome/browser/ui/cocoa/browser_window_command_handler.mm
@@ -265,7 +265,7 @@ NSUInteger modifierFlags = [[NSApp currentEvent] modifierFlags]; if ((command == IDC_RELOAD) && (modifierFlags & (NSShiftKeyMask | NSControlKeyMask))) { - command = IDC_RELOAD_IGNORING_CACHE; + command = IDC_RELOAD_BYPASSING_CACHE; // Mask off Shift and Control so they don't affect the disposition below. modifierFlags &= ~(NSShiftKeyMask | NSControlKeyMask); }
diff --git a/chrome/browser/ui/cocoa/download/download_util_mac_unittest.mm b/chrome/browser/ui/cocoa/download/download_util_mac_unittest.mm index 41cf86f..9427a5c 100644 --- a/chrome/browser/ui/cocoa/download/download_util_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/download/download_util_mac_unittest.mm
@@ -5,6 +5,7 @@ // Download utility test for Mac OS X. #include "base/files/file_path.h" +#include "base/memory/ref_counted.h" #include "base/path_service.h" #include "base/strings/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" @@ -13,21 +14,18 @@ #include "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #include "testing/platform_test.h" +#import "ui/base/clipboard/clipboard_util_mac.h" namespace { class DownloadUtilMacTest : public CocoaTest { public: - DownloadUtilMacTest() { - pasteboard_ = [NSPasteboard pasteboardWithUniqueName]; - } + DownloadUtilMacTest() { pasteboard_ = new ui::UniquePasteboard; } - ~DownloadUtilMacTest() override { [pasteboard_ releaseGlobally]; } - - NSPasteboard* pasteboard() { return pasteboard_; } + NSPasteboard* pasteboard() { return pasteboard_->get(); } private: - NSPasteboard* pasteboard_; + scoped_refptr<ui::UniquePasteboard> pasteboard_; }; // Ensure adding files to the pasteboard methods works as expected.
diff --git a/chrome/browser/ui/cocoa/find_pasteboard_unittest.mm b/chrome/browser/ui/cocoa/find_pasteboard_unittest.mm index 374abc68..f590606 100644 --- a/chrome/browser/ui/cocoa/find_pasteboard_unittest.mm +++ b/chrome/browser/ui/cocoa/find_pasteboard_unittest.mm
@@ -5,9 +5,11 @@ #import <Cocoa/Cocoa.h> #include "base/mac/scoped_nsobject.h" +#include "base/memory/ref_counted.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" +#include "ui/base/clipboard/clipboard_util_mac.h" #import "ui/base/cocoa/find_pasteboard.h" // A subclass of FindPasteboard that doesn't write to the real find pasteboard. @@ -15,7 +17,7 @@ @public int notificationCount_; @private - NSPasteboard* pboard_; + scoped_refptr<ui::UniquePasteboard> pboard_; } - (NSPasteboard*)findPboard; @@ -29,20 +31,12 @@ @implementation FindPasteboardTesting -- (id)init { - if ((self = [super init])) { - pboard_ = [NSPasteboard pasteboardWithUniqueName]; - } - return self; -} - -- (void)dealloc { - [pboard_ releaseGlobally]; - [super dealloc]; -} - - (NSPasteboard*)findPboard { - return pboard_; + // This method is called by the super class's -init, otherwise initialization + // would go into this class's -init. + if (!pboard_) + pboard_ = new ui::UniquePasteboard; + return pboard_->get(); } - (void)callback:(id)sender { @@ -50,13 +44,13 @@ } - (void)setFindPboardText:(NSString*)text { - [pboard_ declareTypes:[NSArray arrayWithObject:NSStringPboardType] - owner:nil]; - [pboard_ setString:text forType:NSStringPboardType]; + [pboard_->get() declareTypes:[NSArray arrayWithObject:NSStringPboardType] + owner:nil]; + [pboard_->get() setString:text forType:NSStringPboardType]; } - (NSString*)findPboardText { - return [pboard_ stringForType:NSStringPboardType]; + return [pboard_->get() stringForType:NSStringPboardType]; } @end @@ -64,9 +58,19 @@ class FindPasteboardTest : public CocoaTest { public: - FindPasteboardTest() { + FindPasteboardTest() {} + + void SetUp() override { + CocoaTest::SetUp(); pboard_.reset([[FindPasteboardTesting alloc] init]); + ASSERT_TRUE(pboard_.get()); } + + void TearDown() override { + pboard_.reset(); + CocoaTest::TearDown(); + } + protected: base::scoped_nsobject<FindPasteboardTesting> pboard_; };
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h index 9c30285..b7a4d84b 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h
@@ -45,8 +45,11 @@ // Return |true| if there is a selection to copy. virtual bool CanCopy() = 0; - // Clears the |pboard| and adds the field's current selection. - // Called when the user does a copy or drag. + // Creates a pasteboard item from the field's current selection. + virtual base::scoped_nsobject<NSPasteboardItem> CreatePasteboardItem() = 0; + + // Copies the pasteboard item returned from |CreatePasteboardItem()| to + // |pboard|. virtual void CopyToPasteboard(NSPasteboard* pboard) = 0; // Returns true if the Show URL option should be available.
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm index 8630301..7d8cb9a 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
@@ -4,6 +4,7 @@ #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h" +#include "base/mac/sdk_forward_declarations.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" // IDC_* @@ -20,6 +21,11 @@ namespace { +// Set to true when an instance of this class is running a nested run loop. +// Since this must always be run on the UI thread, there should never be two +// simultaneous drags. +bool gInDrag = false; + // When too much data is put into a single-line text field, things get // janky due to the cost of computing the blink rect. Sometimes users // accidentally paste large amounts, so place a limit on what will be @@ -45,6 +51,9 @@ } // namespace +@interface AutocompleteTextFieldEditor ()<NSDraggingSource> +@end + @implementation AutocompleteTextFieldEditor - (BOOL)shouldDrawInsertionPoint { @@ -104,19 +113,24 @@ AutocompleteTextFieldObserver* observer = [self observer]; DCHECK(observer); if (observer && observer->CanCopy()) { - NSPasteboard* pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; - observer->CopyToPasteboard(pboard); - NSPoint p; NSImage* image = [self dragImageForSelectionWithEvent:event origin:&p]; - [self dragImage:image - at:p - offset:mouseOffset - event:event - pasteboard:pboard - source:self - slideBack:slideBack]; + base::scoped_nsobject<NSPasteboardItem> item( + observer->CreatePasteboardItem()); + base::scoped_nsobject<NSDraggingItem> dragItem( + [[NSDraggingItem alloc] initWithPasteboardWriter:item]); + [dragItem setDraggingFrame:[self bounds] contents:image]; + [self beginDraggingSessionWithItems:@[ dragItem.get() ] + event:event + source:self]; + DCHECK(!gInDrag); + gInDrag = true; + while (gInDrag) { + [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode + beforeDate:[NSDate distantFuture]]; + } + return YES; } return [super dragSelectionWithEvent:event @@ -124,6 +138,12 @@ slideBack:slideBack]; } +- (void)draggingSession:(NSDraggingSession*)session + endedAtPoint:(NSPoint)aPoint + operation:(NSDragOperation)operation { + gInDrag = false; +} + - (void)copy:(id)sender { AutocompleteTextFieldObserver* observer = [self observer]; DCHECK(observer);
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest_helper.h b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest_helper.h index 9d1b77c..6f9d2ba3 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest_helper.h +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest_helper.h
@@ -37,6 +37,7 @@ MOCK_METHOD1(SelectionRangeForProposedRange, NSRange(NSRange range)); MOCK_METHOD1(OnControlKeyChanged, void(bool pressed)); MOCK_METHOD0(CanCopy, bool()); + MOCK_METHOD0(CreatePasteboardItem, base::scoped_nsobject<NSPasteboardItem>()); MOCK_METHOD1(CopyToPasteboard, void(NSPasteboard* pboard)); MOCK_METHOD0(ShouldEnableShowURL, bool()); MOCK_METHOD0(ShowURL, void());
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h index 5640fa94..53e5786a 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h
@@ -92,6 +92,7 @@ NSRange SelectionRangeForProposedRange(NSRange proposed_range) override; void OnControlKeyChanged(bool pressed) override; bool CanCopy() override; + base::scoped_nsobject<NSPasteboardItem> CreatePasteboardItem() override; void CopyToPasteboard(NSPasteboard* pboard) override; bool ShouldEnableShowURL() override; void ShowURL() override;
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm index 479d8e91..3d8450a 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
@@ -34,6 +34,7 @@ #import "skia/ext/skia_utils_mac.h" #import "third_party/mozilla/NSPasteboard+Utils.h" #include "ui/base/clipboard/clipboard.h" +#include "ui/base/clipboard/clipboard_util_mac.h" #import "ui/base/cocoa/cocoa_base_utils.h" #include "ui/base/material_design/material_design_controller.h" #include "ui/base/resource/resource_bundle.h" @@ -926,7 +927,7 @@ return selection.length > 0; } -void OmniboxViewMac::CopyToPasteboard(NSPasteboard* pb) { +base::scoped_nsobject<NSPasteboardItem> OmniboxViewMac::CreatePasteboardItem() { DCHECK(CanCopy()); const NSRange selection = GetSelectedRange(); @@ -947,15 +948,19 @@ UMA_HISTOGRAM_COUNTS(OmniboxEditModel::kCutOrCopyAllTextHistogram, 1); NSString* nstext = base::SysUTF16ToNSString(text); - [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; - [pb setString:nstext forType:NSStringPboardType]; - if (write_url) { - [pb declareURLPasteboardWithAdditionalTypes:[NSArray array] owner:nil]; - [pb setDataForURL:base::SysUTF8ToNSString(url.spec()) title:nstext]; + return ui::ClipboardUtil::PasteboardItemFromUrl( + base::SysUTF8ToNSString(url.spec()), nstext); + } else { + return ui::ClipboardUtil::PasteboardItemFromString(nstext); } } +void OmniboxViewMac::CopyToPasteboard(NSPasteboard* pboard) { + base::scoped_nsobject<NSPasteboardItem> item(CreatePasteboardItem()); + [pboard writeObjects:@[ item.get() ]]; +} + void OmniboxViewMac::ShowURL() { DCHECK(ShouldEnableShowURL()); OmniboxView::ShowURL();
diff --git a/chrome/browser/ui/cocoa/toolbar/reload_button_cocoa.mm b/chrome/browser/ui/cocoa/toolbar/reload_button_cocoa.mm index 9740529..7a102e2 100644 --- a/chrome/browser/ui/cocoa/toolbar/reload_button_cocoa.mm +++ b/chrome/browser/ui/cocoa/toolbar/reload_button_cocoa.mm
@@ -34,7 +34,7 @@ // Note: must have the same size as |kReloadMenuItems|. const int kReloadMenuCommands[] = { IDC_RELOAD, - IDC_RELOAD_IGNORING_CACHE, + IDC_RELOAD_BYPASSING_CACHE, IDC_RELOAD_CLEARING_CACHE, };
diff --git a/chrome/browser/ui/network_profile_bubble.cc b/chrome/browser/ui/network_profile_bubble.cc index d6fb3d9..8cd552a 100644 --- a/chrome/browser/ui/network_profile_bubble.cc +++ b/chrome/browser/ui/network_profile_bubble.cc
@@ -8,8 +8,6 @@ #include <stdint.h> #include <wtsapi32.h> -// Make sure we link the wtsapi lib file in. -#pragma comment(lib, "wtsapi32.lib") #include "base/bind.h" #include "base/command_line.h"
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc index 04f8182..c75c3208 100644 --- a/chrome/browser/ui/panels/panel.cc +++ b/chrome/browser/ui/panels/panel.cc
@@ -379,8 +379,8 @@ case IDC_RELOAD: panel_host_->Reload(); break; - case IDC_RELOAD_IGNORING_CACHE: - panel_host_->ReloadIgnoringCache(); + case IDC_RELOAD_BYPASSING_CACHE: + panel_host_->ReloadBypassingCache(); break; case IDC_STOP: panel_host_->StopLoading(); @@ -847,7 +847,7 @@ // Navigation commands command_updater_.UpdateCommandEnabled(IDC_RELOAD, true); - command_updater_.UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE, true); + command_updater_.UpdateCommandEnabled(IDC_RELOAD_BYPASSING_CACHE, true); // Window management commands command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true);
diff --git a/chrome/browser/ui/panels/panel_host.cc b/chrome/browser/ui/panels/panel_host.cc index 7f2013b..65344c8 100644 --- a/chrome/browser/ui/panels/panel_host.cc +++ b/chrome/browser/ui/panels/panel_host.cc
@@ -236,9 +236,9 @@ web_contents_->GetController().Reload(true); } -void PanelHost::ReloadIgnoringCache() { - content::RecordAction(UserMetricsAction("ReloadIgnoringCache")); - web_contents_->GetController().ReloadIgnoringCache(true); +void PanelHost::ReloadBypassingCache() { + content::RecordAction(UserMetricsAction("ReloadBypassingCache")); + web_contents_->GetController().ReloadBypassingCache(true); } void PanelHost::StopLoading() {
diff --git a/chrome/browser/ui/panels/panel_host.h b/chrome/browser/ui/panels/panel_host.h index 9784dcb..49c25b5 100644 --- a/chrome/browser/ui/panels/panel_host.h +++ b/chrome/browser/ui/panels/panel_host.h
@@ -84,7 +84,7 @@ // Actions on web contents. void Reload(); - void ReloadIgnoringCache(); + void ReloadBypassingCache(); void StopLoading(); void Zoom(content::PageZoom zoom);
diff --git a/chrome/browser/ui/passwords/password_manager_presenter.cc b/chrome/browser/ui/passwords/password_manager_presenter.cc index 6cc5e82..a7b8980e 100644 --- a/chrome/browser/ui/passwords/password_manager_presenter.cc +++ b/chrome/browser/ui/passwords/password_manager_presenter.cc
@@ -135,9 +135,6 @@ PasswordUIView* password_view) : populater_(this), exception_populater_(this), - require_reauthentication_( - !base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisablePasswordManagerReauthentication)), password_view_(password_view) { DCHECK(password_view_); } @@ -149,20 +146,6 @@ } void PasswordManagerPresenter::Initialize() { - // Due to the way that handlers are (re)initialized under certain types of - // navigation, the presenter may already be initialized. (See bugs 88986 - // and 86448). If this is the case, return immediately. This is a hack. - // TODO(mdm): remove this hack once it is no longer necessary. - if (!show_passwords_.GetPrefName().empty()) - return; - - show_passwords_.Init( - password_manager::prefs::kPasswordManagerAllowShowPasswords, - password_view_->GetProfile()->GetPrefs(), - base::Bind(&PasswordManagerPresenter::UpdatePasswordLists, - base::Unretained(this))); - // TODO(jhawkins) We should not cache web_ui()->GetProfile().See - // crosbug.com/6304. PasswordStore* store = GetPasswordStore(); if (store) store->AddObserver(this); @@ -240,9 +223,8 @@ NOTREACHED(); return; } - if (require_reauthentication_ && - (base::TimeTicks::Now() - last_authentication_time_) > - base::TimeDelta::FromSeconds(60)) { + if ((base::TimeTicks::Now() - last_authentication_time_) > + base::TimeDelta::FromSeconds(60)) { bool authenticated = true; #if defined(OS_WIN) authenticated = password_manager_util_win::AuthenticateUser( @@ -303,16 +285,7 @@ } void PasswordManagerPresenter::SetPasswordList() { - // Due to the way that handlers are (re)initialized under certain types of - // navigation, the presenter may already be initialized. (See bugs 88986 - // and 86448). If this is the case, return immediately. This is a hack. - // If this is the case, initialize on demand. This is a hack. - // TODO(mdm): remove this hack once it is no longer necessary. - if (show_passwords_.GetPrefName().empty()) - Initialize(); - - bool show_passwords = *show_passwords_ && !require_reauthentication_; - password_view_->SetPasswordList(password_list_, show_passwords); + password_view_->SetPasswordList(password_list_); } void PasswordManagerPresenter::SetPasswordExceptionList() {
diff --git a/chrome/browser/ui/passwords/password_manager_presenter.h b/chrome/browser/ui/passwords/password_manager_presenter.h index f8a8b7e7..2b19b80 100644 --- a/chrome/browser/ui/passwords/password_manager_presenter.h +++ b/chrome/browser/ui/passwords/password_manager_presenter.h
@@ -137,13 +137,6 @@ DuplicatesMap password_duplicates_; DuplicatesMap password_exception_duplicates_; - // Whether to show stored passwords or not. - BooleanPrefMember show_passwords_; - - // Indicates whether or not the password manager should require the user to - // reauthenticate before revealing plaintext passwords. - const bool require_reauthentication_; - // The last time the user was successfully authenticated. // Used to determine whether or not to reveal plaintext passwords. base::TimeTicks last_authentication_time_;
diff --git a/chrome/browser/ui/passwords/password_manager_presenter_unittest.cc b/chrome/browser/ui/passwords/password_manager_presenter_unittest.cc index bde87b03..5bfb379d 100644 --- a/chrome/browser/ui/passwords/password_manager_presenter_unittest.cc +++ b/chrome/browser/ui/passwords/password_manager_presenter_unittest.cc
@@ -48,9 +48,8 @@ #endif MOCK_METHOD4(ShowPassword, void( size_t, const std::string&, const std::string&, const base::string16&)); - MOCK_METHOD2(SetPasswordList, - void(const std::vector<scoped_ptr<autofill::PasswordForm>>&, - bool)); + MOCK_METHOD1(SetPasswordList, + void(const std::vector<scoped_ptr<autofill::PasswordForm>>&)); MOCK_METHOD1(SetPasswordExceptionList, void(const std::vector<scoped_ptr<autofill::PasswordForm>>&)); PasswordManagerPresenter* GetPasswordManagerPresenter() { @@ -177,10 +176,8 @@ TEST_F(PasswordManagerPresenterTest, UIControllerIsCalled) { EXPECT_CALL( *GetUIController(), - SetPasswordList( - Property(&std::vector<scoped_ptr<autofill::PasswordForm>>::size, - Eq(0u)), - testing::_)); + SetPasswordList(Property( + &std::vector<scoped_ptr<autofill::PasswordForm>>::size, Eq(0u)))); EXPECT_CALL( *GetUIController(), SetPasswordExceptionList(Property( @@ -190,10 +187,8 @@ AddPasswordEntry(pass_origin, "test@gmail.com", "test"); EXPECT_CALL( *GetUIController(), - SetPasswordList( - Property(&std::vector<scoped_ptr<autofill::PasswordForm>>::size, - Eq(1u)), - testing::_)); + SetPasswordList(Property( + &std::vector<scoped_ptr<autofill::PasswordForm>>::size, Eq(1u)))); EXPECT_CALL( *GetUIController(), SetPasswordExceptionList(Property( @@ -203,10 +198,8 @@ AddPasswordException(except_origin); EXPECT_CALL( *GetUIController(), - SetPasswordList( - Property(&std::vector<scoped_ptr<autofill::PasswordForm>>::size, - Eq(1u)), - testing::_)); + SetPasswordList(Property( + &std::vector<scoped_ptr<autofill::PasswordForm>>::size, Eq(1u)))); EXPECT_CALL( *GetUIController(), SetPasswordExceptionList(Property( @@ -216,10 +209,8 @@ AddPasswordEntry(pass_origin2, "test@gmail.com", "test"); EXPECT_CALL( *GetUIController(), - SetPasswordList( - Property(&std::vector<scoped_ptr<autofill::PasswordForm>>::size, - Eq(2u)), - testing::_)); + SetPasswordList(Property( + &std::vector<scoped_ptr<autofill::PasswordForm>>::size, Eq(2u)))); EXPECT_CALL( *GetUIController(), SetPasswordExceptionList(Property(
diff --git a/chrome/browser/ui/passwords/password_ui_view.h b/chrome/browser/ui/passwords/password_ui_view.h index 62e4c2d..3c112eb 100644 --- a/chrome/browser/ui/passwords/password_ui_view.h +++ b/chrome/browser/ui/passwords/password_ui_view.h
@@ -45,8 +45,7 @@ // |password_list| the list of saved password entries. // |show_passwords| true if the passwords should be shown in the UI. virtual void SetPasswordList( - const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list, - bool show_passwords) = 0; + const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list) = 0; // Updates the list of password exceptions in the UI. // |password_exception_list| The list of saved password exceptions.
diff --git a/chrome/browser/ui/views/accelerator_table.cc b/chrome/browser/ui/views/accelerator_table.cc index 21f858d..402c225da 100644 --- a/chrome/browser/ui/views/accelerator_table.cc +++ b/chrome/browser/ui/views/accelerator_table.cc
@@ -66,7 +66,7 @@ #endif // ENABLE_BASIC_PRINTING { ui::VKEY_R, ui::EF_CONTROL_DOWN, IDC_RELOAD }, { ui::VKEY_R, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, - IDC_RELOAD_IGNORING_CACHE }, + IDC_RELOAD_BYPASSING_CACHE }, { ui::VKEY_HOME, ui::EF_ALT_DOWN, IDC_HOME }, { ui::VKEY_S, ui::EF_CONTROL_DOWN, IDC_SAVE_PAGE }, { ui::VKEY_9, kPlatformModifier, IDC_SELECT_LAST_TAB }, @@ -140,8 +140,8 @@ { ui::VKEY_F4, ui::EF_CONTROL_DOWN, IDC_CLOSE_TAB }, { ui::VKEY_F4, ui::EF_ALT_DOWN, IDC_CLOSE_WINDOW }, { ui::VKEY_F5, ui::EF_NONE, IDC_RELOAD }, - { ui::VKEY_F5, ui::EF_CONTROL_DOWN, IDC_RELOAD_IGNORING_CACHE }, - { ui::VKEY_F5, ui::EF_SHIFT_DOWN, IDC_RELOAD_IGNORING_CACHE }, + { ui::VKEY_F5, ui::EF_CONTROL_DOWN, IDC_RELOAD_BYPASSING_CACHE }, + { ui::VKEY_F5, ui::EF_SHIFT_DOWN, IDC_RELOAD_BYPASSING_CACHE }, { ui::VKEY_F6, ui::EF_NONE, IDC_FOCUS_NEXT_PANE }, { ui::VKEY_F6, ui::EF_SHIFT_DOWN, IDC_FOCUS_PREVIOUS_PANE }, { ui::VKEY_F10, ui::EF_NONE, IDC_FOCUS_MENU_BAR }, @@ -153,8 +153,8 @@ { ui::VKEY_BROWSER_FORWARD, ui::EF_NONE, IDC_FORWARD }, { ui::VKEY_BROWSER_HOME, ui::EF_NONE, IDC_HOME }, { ui::VKEY_BROWSER_REFRESH, ui::EF_NONE, IDC_RELOAD }, - { ui::VKEY_BROWSER_REFRESH, ui::EF_CONTROL_DOWN, IDC_RELOAD_IGNORING_CACHE }, - { ui::VKEY_BROWSER_REFRESH, ui::EF_SHIFT_DOWN, IDC_RELOAD_IGNORING_CACHE }, + { ui::VKEY_BROWSER_REFRESH, ui::EF_CONTROL_DOWN, IDC_RELOAD_BYPASSING_CACHE }, + { ui::VKEY_BROWSER_REFRESH, ui::EF_SHIFT_DOWN, IDC_RELOAD_BYPASSING_CACHE }, #endif // defined(OS_LINUX) #if defined(OS_CHROMEOS)
diff --git a/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc b/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc index b645a632..e8ec90d6 100644 --- a/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc +++ b/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc
@@ -13,8 +13,6 @@ #include "ui/gfx/win/dpi.h" #include "ui/views/controls/menu/native_menu_win.h" -#pragma comment(lib, "dwmapi.lib") - AppWindowDesktopWindowTreeHostWin::AppWindowDesktopWindowTreeHostWin( ChromeNativeAppWindowViewsWin* app_window, views::DesktopNativeWidgetAura* desktop_native_widget_aura)
diff --git a/chrome/browser/ui/views/certificate_viewer_win.cc b/chrome/browser/ui/views/certificate_viewer_win.cc index fbbd3a2..47b2721 100644 --- a/chrome/browser/ui/views/certificate_viewer_win.cc +++ b/chrome/browser/ui/views/certificate_viewer_win.cc
@@ -6,7 +6,6 @@ #include <windows.h> #include <cryptuiapi.h> -#pragma comment(lib, "cryptui.lib") #include "base/bind.h" #include "base/bind_helpers.h"
diff --git a/chrome/browser/ui/views/collected_cookies_views.cc b/chrome/browser/ui/views/collected_cookies_views.cc index d5ae435..fb76417 100644 --- a/chrome/browser/ui/views/collected_cookies_views.cc +++ b/chrome/browser/ui/views/collected_cookies_views.cc
@@ -331,6 +331,7 @@ // Create the controls that go into the pane. allowed_label_ = new views::Label(l10n_util::GetStringUTF16( IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_LABEL)); + allowed_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); allowed_cookies_tree_model_ = content_settings->CreateAllowedCookiesTreeModel();
diff --git a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc index b91e5f10..372482c 100644 --- a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc +++ b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc
@@ -23,8 +23,6 @@ #include "ui/gfx/win/dpi.h" #include "ui/views/controls/menu/native_menu_win.h" -#pragma comment(lib, "dwmapi.lib") - namespace { const int kClientEdgeThickness = 3;
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 246e3543..30a320de 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -2464,7 +2464,7 @@ content::RecordAction(UserMetricsAction("Accel_Forward_Right")); break; case IDC_RELOAD: - case IDC_RELOAD_IGNORING_CACHE: + case IDC_RELOAD_BYPASSING_CACHE: if (key_code == ui::VKEY_R) content::RecordAction(UserMetricsAction("Accel_Reload_R")); else if (key_code == ui::VKEY_BROWSER_REFRESH)
diff --git a/chrome/browser/ui/views/panels/panel_view.cc b/chrome/browser/ui/views/panels/panel_view.cc index 3eb3ebd..075a15d 100644 --- a/chrome/browser/ui/views/panels/panel_view.cc +++ b/chrome/browser/ui/views/panels/panel_view.cc
@@ -74,9 +74,9 @@ { ui::VKEY_R, ui::EF_CONTROL_DOWN, IDC_RELOAD }, { ui::VKEY_F5, ui::EF_NONE, IDC_RELOAD }, { ui::VKEY_R, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, - IDC_RELOAD_IGNORING_CACHE }, - { ui::VKEY_F5, ui::EF_CONTROL_DOWN, IDC_RELOAD_IGNORING_CACHE }, - { ui::VKEY_F5, ui::EF_SHIFT_DOWN, IDC_RELOAD_IGNORING_CACHE }, + IDC_RELOAD_BYPASSING_CACHE }, + { ui::VKEY_F5, ui::EF_CONTROL_DOWN, IDC_RELOAD_BYPASSING_CACHE }, + { ui::VKEY_F5, ui::EF_SHIFT_DOWN, IDC_RELOAD_BYPASSING_CACHE }, { ui::VKEY_ESCAPE, ui::EF_NONE, IDC_STOP }, { ui::VKEY_OEM_MINUS, ui::EF_CONTROL_DOWN, IDC_ZOOM_MINUS }, { ui::VKEY_SUBTRACT, ui::EF_CONTROL_DOWN, IDC_ZOOM_MINUS },
diff --git a/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc b/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc index 6f117219..b56e81e 100644 --- a/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc +++ b/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc
@@ -6,6 +6,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" #include "chrome/browser/ui/passwords/password_dialog_controller.h" #include "chrome/browser/ui/views/passwords/credentials_item_view.h" #include "chrome/grit/generated_resources.h" @@ -16,13 +17,18 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/border.h" +#include "ui/views/controls/scroll_view.h" #include "ui/views/controls/styled_label.h" +#include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_constants.h" #include "ui/views/widget/widget.h" namespace { +// Maximum number of accounts displayed before vertical scrolling appears. +const size_t kMaxAccounts = 3; + const int kVerticalAvatarMargin = 8; // An identifier for views::ColumnSet. @@ -59,6 +65,34 @@ return Profile::FromBrowserContext(web_contents->GetBrowserContext()); } +// Creates a list view of credentials in |forms|. +views::ScrollView* CreateCredentialsView( + const PasswordDialogController::FormsVector& forms, + views::ButtonListener* button_listener, + net::URLRequestContextGetter* request_context) { + views::View* list_view = new views::View; + list_view->SetLayoutManager( + new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); + int item_height = 0; + for (const auto& form : forms) { + std::pair<base::string16, base::string16> titles = + GetCredentialLabelsForAccountChooser(*form); + CredentialsItemView* credential_view = new CredentialsItemView( + button_listener, titles.first, titles.second, kButtonHoverColor, + form.get(), request_context); + credential_view->SetLowerLabelColor(kAutoSigninTextColor); + credential_view->SetBorder(views::Border::CreateEmptyBorder( + kVerticalAvatarMargin, views::kButtonHEdgeMarginNew, + kVerticalAvatarMargin, views::kButtonHEdgeMarginNew)); + item_height = std::max(item_height, credential_view->GetPreferredHeight()); + list_view->AddChildView(credential_view); + } + views::ScrollView* scroll_view = new views::ScrollView; + scroll_view->ClipHeightTo(0, kMaxAccounts * item_height); + scroll_view->SetContents(list_view); + return scroll_view; +} + } // namespace AccountChooserDialogView::AccountChooserDialogView( @@ -152,31 +186,12 @@ layout->AddPaddingRow(0, 2*views::kRelatedControlVerticalSpacing); // Show credentials. - net::URLRequestContextGetter* request_context = - GetProfileFromWebContents(web_contents_)->GetRequestContext(); BuildColumnSet(SINGLE_VIEW_COLUMN_SET_NO_PADDING, layout); - for (const auto& form : controller_->GetLocalForms()) { - const base::string16& upper_string = - form->display_name.empty() ? form->username_value : form->display_name; - base::string16 lower_string; - if (form->federation_origin.unique()) { - if (!form->display_name.empty()) - lower_string = form->username_value; - } else { - lower_string = l10n_util::GetStringFUTF16( - IDS_PASSWORDS_VIA_FEDERATION, - base::UTF8ToUTF16(form->federation_origin.host())); - } - layout->StartRow(0, SINGLE_VIEW_COLUMN_SET_NO_PADDING); - CredentialsItemView* view = new CredentialsItemView( - this, upper_string, lower_string, kButtonHoverColor, - form.get(), request_context); - view->SetLowerLabelColor(kAutoSigninTextColor); - view->SetBorder(views::Border::CreateEmptyBorder( - kVerticalAvatarMargin, views::kButtonHEdgeMarginNew, - kVerticalAvatarMargin, views::kButtonHEdgeMarginNew)); - layout->AddView(view); - } + layout->StartRow(0, SINGLE_VIEW_COLUMN_SET_NO_PADDING); + layout->AddView(CreateCredentialsView( + controller_->GetLocalForms(), + this, + GetProfileFromWebContents(web_contents_)->GetRequestContext())); // DialogClientView adds kRelatedControlVerticalSpacing padding once more for // the buttons. layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
diff --git a/chrome/browser/ui/views/passwords/credentials_item_view.cc b/chrome/browser/ui/views/passwords/credentials_item_view.cc index e905a06e..42d5c78 100644 --- a/chrome/browser/ui/views/passwords/credentials_item_view.cc +++ b/chrome/browser/ui/views/passwords/credentials_item_view.cc
@@ -123,6 +123,10 @@ hover_color_ = color; } +int CredentialsItemView::GetPreferredHeight() const { + return GetPreferredSize().height(); +} + gfx::Size CredentialsItemView::GetPreferredSize() const { gfx::Size labels_size = GetTextLabelsSize(upper_label_, lower_label_); gfx::Size size = gfx::Size(kAvatarImageSize + labels_size.width(),
diff --git a/chrome/browser/ui/views/passwords/credentials_item_view.h b/chrome/browser/ui/views/passwords/credentials_item_view.h index a0cb4fd5..f11287c2 100644 --- a/chrome/browser/ui/views/passwords/credentials_item_view.h +++ b/chrome/browser/ui/views/passwords/credentials_item_view.h
@@ -48,6 +48,8 @@ void SetLowerLabelColor(SkColor color); void SetHoverColor(SkColor color); + int GetPreferredHeight() const; + private: // views::LabelButton: gfx::Size GetPreferredSize() const override;
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.h b/chrome/browser/ui/views/tabs/tab_drag_controller.h index 8768c33..b42e387a 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.h +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "base/timer/timer.h"
diff --git a/chrome/browser/ui/views/toolbar/reload_button.cc b/chrome/browser/ui/views/toolbar/reload_button.cc index fbacf1e..4d9b593 100644 --- a/chrome/browser/ui/views/toolbar/reload_button.cc +++ b/chrome/browser/ui/views/toolbar/reload_button.cc
@@ -149,7 +149,7 @@ int command; int flags = event.flags(); if (event.IsShiftDown() || event.IsControlDown()) { - command = IDC_RELOAD_IGNORING_CACHE; + command = IDC_RELOAD_BYPASSING_CACHE; // Mask off Shift and Control so they don't affect the disposition below. flags &= ~(ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); } else { @@ -188,7 +188,7 @@ GetWidget()->GetAccelerator(IDC_RELOAD, accelerator); return true; case IDS_RELOAD_MENU_HARD_RELOAD_ITEM: - GetWidget()->GetAccelerator(IDC_RELOAD_IGNORING_CACHE, accelerator); + GetWidget()->GetAccelerator(IDC_RELOAD_BYPASSING_CACHE, accelerator); return true; } return GetWidget()->GetAccelerator(command_id, accelerator); @@ -201,7 +201,7 @@ browser_command = IDC_RELOAD; break; case IDS_RELOAD_MENU_HARD_RELOAD_ITEM: - browser_command = IDC_RELOAD_IGNORING_CACHE; + browser_command = IDC_RELOAD_BYPASSING_CACHE; break; case IDS_RELOAD_MENU_EMPTY_AND_HARD_RELOAD_ITEM: browser_command = IDC_RELOAD_CLEARING_CACHE;
diff --git a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc index 7da385d..c7658e53 100644 --- a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc +++ b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
@@ -221,8 +221,8 @@ { "keyboardOverlayPrint", IDS_KEYBOARD_OVERLAY_PRINT }, { "keyboardOverlayReloadCurrentPage", IDS_KEYBOARD_OVERLAY_RELOAD_CURRENT_PAGE }, - { "keyboardOverlayReloadIgnoringCache", - IDS_KEYBOARD_OVERLAY_RELOAD_IGNORING_CACHE }, + { "keyboardOverlayReloadBypassingCache", + IDS_KEYBOARD_OVERLAY_RELOAD_BYPASSING_CACHE }, { "keyboardOverlayReopenLastClosedTab", IDS_KEYBOARD_OVERLAY_REOPEN_LAST_CLOSED_TAB }, { "keyboardOverlayReportIssue", IDS_KEYBOARD_OVERLAY_REPORT_ISSUE },
diff --git a/chrome/browser/ui/webui/inspect_ui.h b/chrome/browser/ui/webui/inspect_ui.h index be58d14e..3a814e39 100644 --- a/chrome/browser/ui/webui/inspect_ui.h +++ b/chrome/browser/ui/webui/inspect_ui.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "components/prefs/pref_change_registrar.h" #include "content/public/browser/notification_observer.h"
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index 3f17e4b..69c929d2 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -148,6 +148,7 @@ {CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, "protectedContent"}, #endif {CONTENT_SETTINGS_TYPE_KEYGEN, "keygen"}, + {CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, "background-sync"}, }; ChooserContextBase* GetUsbChooserContext(Profile* profile) { @@ -257,6 +258,11 @@ ContentSettingWithExceptions( false, UserMetricsAction("Options_DefaultMIDISysExSettingChanged")))); + exceptions_info_map.insert(std::make_pair( + CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, + ContentSettingWithExceptions( + false, + UserMetricsAction("Options_DefaultBackgroundSyncSettingChanged")))); } return exceptions_info_map; @@ -577,24 +583,30 @@ {"ppapiBrokerAllow", IDS_PPAPI_BROKER_ALLOW_RADIO}, {"ppapiBrokerAsk", IDS_PPAPI_BROKER_ASK_RADIO}, {"ppapiBrokerBlock", IDS_PPAPI_BROKER_BLOCK_RADIO}, - // Multiple automatic downloads + // Multiple automatic downloads. {"multipleAutomaticDownloadsTabLabel", IDS_AUTOMATIC_DOWNLOADS_TAB_LABEL}, {"multipleAutomaticDownloadsHeader", IDS_AUTOMATIC_DOWNLOADS_TAB_LABEL}, {"multipleAutomaticDownloadsAllow", IDS_AUTOMATIC_DOWNLOADS_ALLOW_RADIO}, {"multipleAutomaticDownloadsAsk", IDS_AUTOMATIC_DOWNLOADS_ASK_RADIO}, {"multipleAutomaticDownloadsBlock", IDS_AUTOMATIC_DOWNLOADS_BLOCK_RADIO}, - // MIDI system exclusive messages + // MIDI system exclusive messages. {"midiSysexHeader", IDS_MIDI_SYSEX_TAB_LABEL}, {"midiSysExAllow", IDS_MIDI_SYSEX_ALLOW_RADIO}, {"midiSysExAsk", IDS_MIDI_SYSEX_ASK_RADIO}, {"midiSysExBlock", IDS_MIDI_SYSEX_BLOCK_RADIO}, - // Push messaging strings + // Push messaging strings. {"pushMessagingHeader", IDS_PUSH_MESSAGES_TAB_LABEL}, {"pushMessagingAllow", IDS_PUSH_MESSSAGING_ALLOW_RADIO}, {"pushMessagingAsk", IDS_PUSH_MESSSAGING_ASK_RADIO}, {"pushMessagingBlock", IDS_PUSH_MESSSAGING_BLOCK_RADIO}, + // USB devices. {"usbDevicesHeader", IDS_USB_DEVICES_HEADER_AND_TAB_LABEL}, {"usbDevicesManage", IDS_USB_DEVICES_MANAGE_BUTTON}, + // Background sync. + {"backgroundSyncHeader", IDS_BACKGROUND_SYNC_HEADER}, + {"backgroundSyncAllow", IDS_BACKGROUND_SYNC_ALLOW_RADIO}, + {"backgroundSyncBlock", IDS_BACKGROUND_SYNC_BLOCK_RADIO}, + // Zoom levels. {"zoomlevelsHeader", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL}, {"zoomLevelsManage", IDS_ZOOMLEVELS_MANAGE_BUTTON}, // Keygen filter. @@ -656,6 +668,8 @@ IDS_MIDI_SYSEX_TAB_LABEL); RegisterTitle(localized_strings, "usb-devices", IDS_USB_DEVICES_HEADER_AND_TAB_LABEL); + RegisterTitle(localized_strings, "background-sync", + IDS_BACKGROUND_SYNC_HEADER); RegisterTitle(localized_strings, "zoomlevels", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL); RegisterTitle(localized_strings, "keygen", IDS_KEYGEN_TAB_LABEL);
diff --git a/chrome/browser/ui/webui/options/password_manager_handler.cc b/chrome/browser/ui/webui/options/password_manager_handler.cc index 88cd876..b6842fc 100644 --- a/chrome/browser/ui/webui/options/password_manager_handler.cc +++ b/chrome/browser/ui/webui/options/password_manager_handler.cc
@@ -228,8 +228,7 @@ } void PasswordManagerHandler::SetPasswordList( - const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list, - bool show_passwords) { + const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list) { base::ListValue entries; languages_ = GetProfile()->GetPrefs()->GetString(prefs::kAcceptLanguages); base::string16 placeholder(base::ASCIIToUTF16(" ")); @@ -238,14 +237,10 @@ CopyOriginInfoOfPasswordForm(*saved_password, languages_, entry.get()); entry->SetString(kUsernameField, saved_password->username_value); - if (show_passwords) { - entry->SetString(kPasswordField, saved_password->password_value); - } else { - // Use a placeholder value with the same length as the password. - entry->SetString( - kPasswordField, - base::string16(saved_password->password_value.length(), ' ')); - } + // Use a placeholder value with the same length as the password. + entry->SetString( + kPasswordField, + base::string16(saved_password->password_value.length(), ' ')); if (!saved_password->federation_origin.unique()) { entry->SetString( kFederationField,
diff --git a/chrome/browser/ui/webui/options/password_manager_handler.h b/chrome/browser/ui/webui/options/password_manager_handler.h index d8ed6c0..832a90f 100644 --- a/chrome/browser/ui/webui/options/password_manager_handler.h +++ b/chrome/browser/ui/webui/options/password_manager_handler.h
@@ -39,8 +39,8 @@ const std::string& username, const base::string16& password_value) override; void SetPasswordList( - const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list, - bool show_passwords) override; + const std::vector<scoped_ptr<autofill::PasswordForm>>& password_list) + override; void SetPasswordExceptionList( const std::vector<scoped_ptr<autofill::PasswordForm>>& password_exception_list) override;
diff --git a/chrome/browser/ui/webui/settings/search_engines_handler.h b/chrome/browser/ui/webui/settings/search_engines_handler.h index f211bc6e..b856ef5 100644 --- a/chrome/browser/ui/webui/settings/search_engines_handler.h +++ b/chrome/browser/ui/webui/settings/search_engines_handler.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SEARCH_ENGINES_HANDLER_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" #include "ui/base/models/table_model_observer.h"
diff --git a/chrome/browser/ui/webui/settings_utils_win.cc b/chrome/browser/ui/webui/settings_utils_win.cc index 69bc3c8..765b517 100644 --- a/chrome/browser/ui/webui/settings_utils_win.cc +++ b/chrome/browser/ui/webui/settings_utils_win.cc
@@ -6,7 +6,6 @@ #include <windows.h> #include <cryptuiapi.h> -#pragma comment(lib, "cryptui.lib") #include <shellapi.h> #include "base/bind.h"
diff --git a/chrome/browser_tests.isolate b/chrome/browser_tests.isolate index 107a0903..4e97ddb 100644 --- a/chrome/browser_tests.isolate +++ b/chrome/browser_tests.isolate
@@ -185,7 +185,6 @@ '<(PRODUCT_DIR)/content_shell.pak', '<(PRODUCT_DIR)/libclearkeycdm.dylib', '<(PRODUCT_DIR)/osmesa.so', - '<(PRODUCT_DIR)/plugins/test_netscape_plugin.plugin/', '<(PRODUCT_DIR)/power_saver_test_plugin.plugin/Contents/MacOS/power_saver_test_plugin', '<(PRODUCT_DIR)/ppapi_tests.plugin/Contents/MacOS/ppapi_tests', ], @@ -207,7 +206,6 @@ '<(PRODUCT_DIR)/clearkeycdm.dll', '<(PRODUCT_DIR)/clearkeycdmadapter.dll', '<(PRODUCT_DIR)/crashpad_handler.exe', - '<(PRODUCT_DIR)/plugins/', '<(PRODUCT_DIR)/power_saver_test_plugin.dll', '<(PRODUCT_DIR)/ppapi_tests.dll', 'tools/build/repack_locales.py',
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 5252ae8..6ed93f8 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp
@@ -456,6 +456,13 @@ 'common/safe_browsing/pe_image_reader_win.h', 'tools/safe_browsing/sb_sigutil.cc', ], + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'wintrust.lib', + ], + }, + }, }, ], # 'targets' 'includes': [
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 99d7db7..c8d5094 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi
@@ -1134,8 +1134,6 @@ 'browser/shell_integration_linux.cc', 'browser/shell_integration_linux.h', 'browser/speech/tts_linux.cc', - 'browser/sxs_linux.cc', - 'browser/sxs_linux.h', 'browser/themes/theme_service_aurax11.cc', 'browser/themes/theme_service_aurax11.h', 'browser/web_applications/web_app_linux.cc', @@ -3859,7 +3857,11 @@ 'ndfapi.dll', ], 'AdditionalDependencies': [ + 'cryptui.lib', + 'dwmapi.lib', 'ndfapi.lib', + 'pdh.lib', + 'wtsapi32.lib', ], }, }, @@ -3870,7 +3872,11 @@ 'ndfapi.dll', ], 'AdditionalDependencies': [ + 'cryptui.lib', + 'dwmapi.lib', 'ndfapi.lib', + 'pdh.lib', + 'wtsapi32.lib', ], }, },
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index 130f6db0..b167808 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi
@@ -494,7 +494,7 @@ 'sources': [ '<@(chrome_common_importer_sources)' ], 'dependencies': [ '<(DEPTH)/url/ipc/url_ipc.gyp:url_ipc', - ], + ], }], ['OS=="win"', { 'include_dirs': [ @@ -503,6 +503,22 @@ 'dependencies': [ '<(DEPTH)/components/components.gyp:dom_distiller_core', # Needed by chrome_content_client.cc. ], + 'all_dependent_settings': { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'wintrust.lib', + ], + }, + }, + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'wintrust.lib', + ], + }, + }, }], ['OS=="mac"', { 'dependencies': [
diff --git a/chrome/chrome_installer_util.gypi b/chrome/chrome_installer_util.gypi index e21ccbd..7242b49 100644 --- a/chrome/chrome_installer_util.gypi +++ b/chrome/chrome_installer_util.gypi
@@ -179,6 +179,26 @@ ], # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 'msvs_disabled_warnings': [ 4267, ], + 'all_dependent_settings': { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'urlmon.lib', + 'wbemuuid.lib', + 'wtsapi32.lib', + ], + }, + }, + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'urlmon.lib', + 'wbemuuid.lib', + 'wtsapi32.lib', + ], + }, + }, }, ], }], @@ -210,6 +230,22 @@ 'msvs_target_platform': 'x64', }, }, + 'all_dependent_settings': { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'wbemuuid.lib', + ], + }, + }, + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'wbemuuid.lib', + ], + }, + }, }, ], }],
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index fd414be..aafe00f 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi
@@ -3301,7 +3301,6 @@ 'target_name': 'browser_tests_run', 'type': 'none', 'dependencies': [ - '../content/content_shell_and_tests.gyp:copy_test_netscape_plugin', 'browser_tests', 'chrome', ],
diff --git a/chrome/chrome_utility.gypi b/chrome/chrome_utility.gypi index 401761a7..54cf329 100644 --- a/chrome/chrome_utility.gypi +++ b/chrome/chrome_utility.gypi
@@ -13,8 +13,6 @@ 'utility/cloud_print/bitmap_image.h', 'utility/cloud_print/pwg_encoder.cc', 'utility/cloud_print/pwg_encoder.h', - 'utility/font_cache_handler_win.cc', - 'utility/font_cache_handler_win.h', 'utility/printing_handler.cc', 'utility/printing_handler.h', 'utility/safe_json_parser_handler.cc',
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index d8b3ddd..b0a1ec9 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn
@@ -245,6 +245,8 @@ "//components/dom_distiller/core", # Needed by chrome_content_client.cc. "//third_party/wtl", ] + + libs = [ "wintrust.lib" ] } if (is_mac) {
diff --git a/chrome/common/auto_start_linux.cc b/chrome/common/auto_start_linux.cc index b5ff4c77..6076e27 100644 --- a/chrome/common/auto_start_linux.cc +++ b/chrome/common/auto_start_linux.cc
@@ -10,6 +10,7 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "base/nix/xdg_util.h" #include "base/strings/string_tokenizer.h"
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 02cdb9f..33af97d 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc
@@ -295,11 +295,6 @@ // Disable out-of-process V8 proxy resolver. const char kDisableOutOfProcessPac[] = "disable-out-of-process-pac"; -// Disable the setting to prompt the user for their OS account password before -// revealing plaintext passwords in the password manager. -const char kDisablePasswordManagerReauthentication[] = - "disable-password-manager-reauthentication"; - // Disables the Permissions Blacklist, which blocks access to permissions // for blacklisted sites. const char kDisablePermissionsBlacklist[] = "disable-permissions-blacklist"; @@ -424,6 +419,12 @@ // crbug.com/142458 . const char kEnableFastUnload[] = "enable-fast-unload"; +#if defined(GOOGLE_CHROME_BUILD) +// Shows a Google icon next to context menu items powered by Google services. +const char kEnableGoogleBrandedContextMenu[] = + "enable-google-branded-context-menu"; +#endif // defined(GOOGLE_CHROME_BUILD) + // Enables the Material Design version of chrome://extensions. const char kEnableMaterialDesignExtensions[] = "enable-md-extensions"; @@ -1134,14 +1135,6 @@ const char kPasswordStore[] = "password-store"; #endif -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) -// Triggers migration of user data directory to another directory -// specified as a parameter. The migration is done under singleton lock, -// and sanity checks are made to avoid corrupting the profile. -// The browser exits after migration is complete. -const char kMigrateDataDirForSxS[] = "migrate-data-dir-for-sxs"; -#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) - #if defined(OS_MACOSX) // Prevents Chrome from quitting when Chrome Apps are open. const char kAppsKeepChromeAliveInTests[] = "apps-keep-chrome-alive-in-tests";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 31ca1e6..d931240 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h
@@ -122,6 +122,9 @@ extern const char kEnableExtensionActivityLogging[]; extern const char kEnableExtensionActivityLogTesting[]; extern const char kEnableFastUnload[]; +#if defined(GOOGLE_CHROME_BUILD) +extern const char kEnableGoogleBrandedContextMenu[]; +#endif // defined(GOOGLE_CHROME_BUILD) extern const char kEnableMaterialDesignExtensions[]; extern const char kEnableMaterialDesignPolicyPage[]; extern const char kEnableNaCl[]; @@ -326,10 +329,6 @@ extern const char kPasswordStore[]; #endif -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) -extern const char kMigrateDataDirForSxS[]; -#endif - #if defined(OS_MACOSX) extern const char kAppsKeepChromeAliveInTests[]; extern const char kHostedAppQuitNotification[];
diff --git a/chrome/common/chrome_utility_messages.h b/chrome/common/chrome_utility_messages.h index 2ec58721..c644fcb 100644 --- a/chrome/common/chrome_utility_messages.h +++ b/chrome/common/chrome_utility_messages.h
@@ -288,6 +288,4 @@ IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetSaveFileName_Result, base::FilePath /* path */, int /* one_based_filter_index */) -IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_BuildDirectWriteFontCache, - base::FilePath /* cache file path */) #endif // defined(OS_WIN)
diff --git a/chrome/common/component_flash_hint_file_linux.cc b/chrome/common/component_flash_hint_file_linux.cc index d56e97c..92065ca 100644 --- a/chrome/common/component_flash_hint_file_linux.cc +++ b/chrome/common/component_flash_hint_file_linux.cc
@@ -16,6 +16,7 @@ #include "base/files/memory_mapped_file.h" #include "base/files/scoped_file.h" #include "base/json/json_string_value_serializer.h" +#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/posix/eintr_wrapper.h" #include "base/stl_util.h"
diff --git a/chrome/common/crash_keys.cc b/chrome/common/crash_keys.cc index e82bd1e1..ac0d40a5 100644 --- a/chrome/common/crash_keys.cc +++ b/chrome/common/crash_keys.cc
@@ -177,6 +177,12 @@ // Temporary for https://crbug.com/591478. { "initrf_parent_proxy_exists", kSmallSize }, { "initrf_render_view_is_live", kSmallSize }, + { "initrf_parent_is_in_same_site_instance", kSmallSize}, + { "initrf_parent_process_is_live", kSmallSize}, + { "initrf_root_is_in_same_site_instance", kSmallSize}, + { "initrf_root_is_in_same_site_instance_as_parent", kSmallSize}, + { "initrf_root_process_is_live", kSmallSize}, + { "initrf_root_proxy_is_live", kSmallSize}, }; // This dynamic set of keys is used for sets of key value pairs when gathering
diff --git a/chrome/common/extensions/api/accessibility_features.json b/chrome/common/extensions/api/accessibility_features.json index d251adc..4311c073b 100644 --- a/chrome/common/extensions/api/accessibility_features.json +++ b/chrome/common/extensions/api/accessibility_features.json
@@ -6,7 +6,6 @@ { "namespace": "accessibilityFeatures", "description": "Use the <code>chrome.accessibilityFeatures</code> API to manage Chrome's accessibility features. This API relies on the <a href='types#ChromeSetting'>ChromeSetting prototype of the type API</a> for getting and setting individual accessibility features. In order to get feature states the extension must request <code>accessibilityFeatures.read</code> permission. For modifying feature state, the extension needs <code>accessibilityFeatures.modify</code> permission. Note that <code>accessibilityFeatures.modify</code> does not imply <code>accessibilityFeatures.read</code> permission.", - "compiler_options": { "use_movable_types": true }, "properties": { "spokenFeedback": { "$ref": "types.ChromeSetting",
diff --git a/chrome/common/extensions/api/activity_log_private.json b/chrome/common/extensions/api/activity_log_private.json index 2c351bf..685ac82 100644 --- a/chrome/common/extensions/api/activity_log_private.json +++ b/chrome/common/extensions/api/activity_log_private.json
@@ -6,7 +6,6 @@ { "namespace": "activityLogPrivate", "description": "none", - "compiler_options": { "use_movable_types": true }, "types": [ { "id": "ExtensionActivityType",
diff --git a/chrome/common/extensions/api/appview_tag.idl b/chrome/common/extensions/api/appview_tag.idl index 573dde5..efa6b613 100644 --- a/chrome/common/extensions/api/appview_tag.idl +++ b/chrome/common/extensions/api/appview_tag.idl
@@ -6,8 +6,7 @@ // Chrome App. (see <a href=#usage>Usage</a>). [documentation_title="<appview> Tag", documentation_namespace="<appview>", - documented_in="tags/appview", - use_movable_types=true] + documented_in="tags/appview"] namespace appviewTag { // This object specifies details and operations to perform on the embedding // request. The app to be embedded can make a decision on whether or not to
diff --git a/chrome/common/extensions/api/audio_modem.idl b/chrome/common/extensions/api/audio_modem.idl index 275daeb..a306f7c2 100644 --- a/chrome/common/extensions/api/audio_modem.idl +++ b/chrome/common/extensions/api/audio_modem.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.audio_modem</code> API // to transmit and receive short tokens over audio. -[use_movable_types=true]namespace audioModem { +namespace audioModem { // The audio bands supported. enum Audioband { // Audible (up to 3 kHz)
diff --git a/chrome/common/extensions/api/autofill_private.idl b/chrome/common/extensions/api/autofill_private.idl index 6bb71bc..43edb3d 100644 --- a/chrome/common/extensions/api/autofill_private.idl +++ b/chrome/common/extensions/api/autofill_private.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.autofillPrivate</code> API to add, remove, or update // autofill data from the settings UI. -[use_movable_types=true]namespace autofillPrivate { +namespace autofillPrivate { // Fields used as part of an address. enum AddressField { FULL_NAME,
diff --git a/chrome/common/extensions/api/automation.idl b/chrome/common/extensions/api/automation.idl index 0a2d9acb..bf02ca32 100644 --- a/chrome/common/extensions/api/automation.idl +++ b/chrome/common/extensions/api/automation.idl
@@ -7,7 +7,7 @@ // tree, but only exposes the <em>semantic</em> structure of a page. It can be // used to programmatically interact with a page by examining names, roles, and // states, listening for events, and performing actions on nodes. -[nocompile,use_movable_types=true] namespace automation { +[nocompile] namespace automation { // Keep the following enums in sync with 'ui/accessibility/ax_enums.idl'. // They are kept here purely for extension docs generation.
diff --git a/chrome/common/extensions/api/automation_internal.idl b/chrome/common/extensions/api/automation_internal.idl index 825742b..12eca78 100644 --- a/chrome/common/extensions/api/automation_internal.idl +++ b/chrome/common/extensions/api/automation_internal.idl
@@ -5,7 +5,7 @@ // This is the implementation layer of the chrome.automation API, and is // essentially a translation of the internal accessibility tree update system // into an extension API. -[use_movable_types=true] namespace automationInternal { +namespace automationInternal { // Data for an accessibility event and/or an atomic change to an accessibility // tree. See ui/accessibility/ax_tree_update.h for an extended explanation of // the tree update format.
diff --git a/chrome/common/extensions/api/autotest_private.idl b/chrome/common/extensions/api/autotest_private.idl index 46c8d72..65f89b2 100644 --- a/chrome/common/extensions/api/autotest_private.idl +++ b/chrome/common/extensions/api/autotest_private.idl
@@ -4,7 +4,7 @@ // API for integration testing. To be used on test images with a test component // extension. -[use_movable_types=true] namespace autotestPrivate { +namespace autotestPrivate { dictionary LoginStatusDict { // Are we logged in?
diff --git a/chrome/common/extensions/api/bluetooth_low_energy.idl b/chrome/common/extensions/api/bluetooth_low_energy.idl index 74204f8..2fd511d 100644 --- a/chrome/common/extensions/api/bluetooth_low_energy.idl +++ b/chrome/common/extensions/api/bluetooth_low_energy.idl
@@ -6,7 +6,7 @@ // Bluetooth Smart (Low Energy) devices using the // <a href="https://developer.bluetooth.org/TechnologyOverview/Pages/GATT.aspx"> // Generic Attribute Profile (GATT)</a>. -[use_movable_types=true] namespace bluetoothLowEnergy { +namespace bluetoothLowEnergy { // Values representing the possible properties of a characteristic. enum CharacteristicProperty {broadcast, read, writeWithoutResponse, write, notify, indicate, authenticatedSignedWrites,
diff --git a/chrome/common/extensions/api/bookmark_manager_private.json b/chrome/common/extensions/api/bookmark_manager_private.json index 6b59d3f..ecd66ef 100644 --- a/chrome/common/extensions/api/bookmark_manager_private.json +++ b/chrome/common/extensions/api/bookmark_manager_private.json
@@ -6,7 +6,6 @@ { "namespace": "bookmarkManagerPrivate", "description": "none", - "compiler_options": { "use_movable_types": true }, "types": [ { "id": "BookmarkNodeDataElement",
diff --git a/chrome/common/extensions/api/bookmarks.json b/chrome/common/extensions/api/bookmarks.json index fdb9b69..c9fc5cf6 100644 --- a/chrome/common/extensions/api/bookmarks.json +++ b/chrome/common/extensions/api/bookmarks.json
@@ -6,7 +6,6 @@ { "namespace": "bookmarks", "description": "Use the <code>chrome.bookmarks</code> API to create, organize, and otherwise manipulate bookmarks. Also see <a href='override'>Override Pages</a>, which you can use to create a custom Bookmark Manager page.", - "compiler_options": { "use_movable_types": true }, "properties": { "MAX_WRITE_OPERATIONS_PER_HOUR": { "value": 1000000,
diff --git a/chrome/common/extensions/api/braille_display_private.idl b/chrome/common/extensions/api/braille_display_private.idl index 9892185..0c7a3e6 100644 --- a/chrome/common/extensions/api/braille_display_private.idl +++ b/chrome/common/extensions/api/braille_display_private.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Braille display access private API. -[use_movable_types=true]namespace brailleDisplayPrivate { +namespace brailleDisplayPrivate { // Braille display keyboard command. enum KeyCommand { line_up,
diff --git a/chrome/common/extensions/api/browser.idl b/chrome/common/extensions/api/browser.idl index 84858ddb..971164b 100644 --- a/chrome/common/extensions/api/browser.idl +++ b/chrome/common/extensions/api/browser.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.browser</code> API to interact with the Chrome browser // associated with the current application and Chrome profile. -[use_movable_types=true] namespace browser { +namespace browser { // Options for the $(ref:openTab) function. dictionary OpenTabOptions { // The URL to navigate to when the new tab is initially opened.
diff --git a/chrome/common/extensions/api/browser_action.json b/chrome/common/extensions/api/browser_action.json index 75ba57b..8b7898c6 100644 --- a/chrome/common/extensions/api/browser_action.json +++ b/chrome/common/extensions/api/browser_action.json
@@ -6,7 +6,6 @@ { "namespace": "browserAction", "description": "Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its <a href='browserAction#icon'>icon</a>, a browser action can also have a <a href='browserAction#tooltip'>tooltip</a>, a <a href='browserAction#badge'>badge</a>, and a <a href='browserAction#popups'>popup</a>.", - "compiler_options": { "use_movable_types": true }, "types": [ { "id": "ColorArray",
diff --git a/chrome/common/extensions/api/browsing_data.json b/chrome/common/extensions/api/browsing_data.json index 900d330..10fd0b71 100644 --- a/chrome/common/extensions/api/browsing_data.json +++ b/chrome/common/extensions/api/browsing_data.json
@@ -6,7 +6,6 @@ { "namespace": "browsingData", "description": "Use the <code>chrome.browsingData</code> API to remove browsing data from a user's local profile.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "RemovalOptions",
diff --git a/chrome/common/extensions/api/cast_devices_private.idl b/chrome/common/extensions/api/cast_devices_private.idl index d6e4f85..2903a58 100644 --- a/chrome/common/extensions/api/cast_devices_private.idl +++ b/chrome/common/extensions/api/cast_devices_private.idl
@@ -5,7 +5,7 @@ // The <code>chrome.cast.devicesPrivate</code> API manages starting and stopping // casts based on receiver names. It also provides a list of available // receivers. -[use_movable_types=true] namespace cast.devicesPrivate { +namespace cast.devicesPrivate { // A cast receiver is an actual cast device. It has a unique |id| and a // non-unique |name| which is how people identify it. dictionary Receiver {
diff --git a/chrome/common/extensions/api/cast_streaming_receiver_session.idl b/chrome/common/extensions/api/cast_streaming_receiver_session.idl index 6c5f8ca..15a7f0a7 100644 --- a/chrome/common/extensions/api/cast_streaming_receiver_session.idl +++ b/chrome/common/extensions/api/cast_streaming_receiver_session.idl
@@ -5,7 +5,7 @@ // The <code>chrome.cast.streaming.receiverSession</code> API creates a Cast // receiver session and adds the resulting audio and video tracks to a // MediaStream. -[use_movable_types=true]namespace cast.streaming.receiverSession { +namespace cast.streaming.receiverSession { // The UDP socket address and port. dictionary IPEndPoint { DOMString address;
diff --git a/chrome/common/extensions/api/cast_streaming_rtp_stream.idl b/chrome/common/extensions/api/cast_streaming_rtp_stream.idl index da5d02f..8425609 100644 --- a/chrome/common/extensions/api/cast_streaming_rtp_stream.idl +++ b/chrome/common/extensions/api/cast_streaming_rtp_stream.idl
@@ -7,7 +7,7 @@ // session. // // Valid stream IDs are positive and non-zero. -[use_movable_types=true]namespace cast.streaming.rtpStream { +namespace cast.streaming.rtpStream { // Params for audio and video codec. dictionary CodecSpecificParams { DOMString key;
diff --git a/chrome/common/extensions/api/cast_streaming_session.idl b/chrome/common/extensions/api/cast_streaming_session.idl index e2ad5954..29d43d9e 100644 --- a/chrome/common/extensions/api/cast_streaming_session.idl +++ b/chrome/common/extensions/api/cast_streaming_session.idl
@@ -11,7 +11,7 @@ // APIs. // // Valid resource IDs are positive and non-zero. -[use_movable_types=true]namespace cast.streaming.session { +namespace cast.streaming.session { // Callback from the <code>create</code> method. // |audioStreamId| : The audio RTP stream ID. // |videoStreamId| : The video RTP stream ID.
diff --git a/chrome/common/extensions/api/cast_streaming_udp_transport.idl b/chrome/common/extensions/api/cast_streaming_udp_transport.idl index fd43a6181..8106a58 100644 --- a/chrome/common/extensions/api/cast_streaming_udp_transport.idl +++ b/chrome/common/extensions/api/cast_streaming_udp_transport.idl
@@ -8,7 +8,7 @@ // It is used to configure the UDP transport used in Cast session. // // Valid transport IDs are positive and non-zero. -[use_movable_types=true]namespace cast.streaming.udpTransport { +namespace cast.streaming.udpTransport { // The UDP socket address and port. dictionary IPEndPoint { DOMString address;
diff --git a/chrome/common/extensions/api/certificate_provider.idl b/chrome/common/extensions/api/certificate_provider.idl index 50ec63a4..4062d04 100644 --- a/chrome/common/extensions/api/certificate_provider.idl +++ b/chrome/common/extensions/api/certificate_provider.idl
@@ -4,7 +4,7 @@ // Use this API to expose certificates to the platform which can use these // certificates for TLS authentications. -[use_movable_types=true]namespace certificateProvider { +namespace certificateProvider { enum Hash { MD5_SHA1, SHA1,
diff --git a/chrome/common/extensions/api/certificate_provider_internal.idl b/chrome/common/extensions/api/certificate_provider_internal.idl index dc2d3aa..aa179d26 100644 --- a/chrome/common/extensions/api/certificate_provider_internal.idl +++ b/chrome/common/extensions/api/certificate_provider_internal.idl
@@ -10,7 +10,7 @@ // runs the callback to report its results, the callback magically prepends the // request ID to the results and calls the respective internal report function // (reportSignature or reportCertificates). -[implemented_in = "chrome/browser/extensions/api/certificate_provider/certificate_provider_api.h",use_movable_types=true] +[implemented_in = "chrome/browser/extensions/api/certificate_provider/certificate_provider_api.h"] namespace certificateProviderInternal { callback DoneCallback = void (); callback ResultCallback = void (ArrayBuffer[] rejectedCertificates);
diff --git a/chrome/common/extensions/api/chrome_web_view_internal.json b/chrome/common/extensions/api/chrome_web_view_internal.json index 225147f..0797d47e 100644 --- a/chrome/common/extensions/api/chrome_web_view_internal.json +++ b/chrome/common/extensions/api/chrome_web_view_internal.json
@@ -7,8 +7,7 @@ "namespace": "chromeWebViewInternal", "description": "none", "compiler_options": { - "implemented_in": "chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.h", - "use_movable_types": true + "implemented_in": "chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.h" }, "dependencies": ["contextMenusInternal", "contextMenus"], "types": [
diff --git a/chrome/common/extensions/api/chromeos_info_private.json b/chrome/common/extensions/api/chromeos_info_private.json index 8b8c7e1..b87c6069 100644 --- a/chrome/common/extensions/api/chromeos_info_private.json +++ b/chrome/common/extensions/api/chromeos_info_private.json
@@ -7,8 +7,7 @@ "namespace": "chromeosInfoPrivate", "description": "none", "compiler_options": { - "implemented_in": "chrome/browser/chromeos/extensions/info_private_api.h", - "use_movable_types": true + "implemented_in": "chrome/browser/chromeos/extensions/info_private_api.h" }, "types": [ {
diff --git a/chrome/common/extensions/api/cloud_print_private.json b/chrome/common/extensions/api/cloud_print_private.json index f1fb223..edd3e02 100644 --- a/chrome/common/extensions/api/cloud_print_private.json +++ b/chrome/common/extensions/api/cloud_print_private.json
@@ -6,7 +6,6 @@ { "namespace": "cloudPrintPrivate", "description": "none", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "PrinterSettings",
diff --git a/chrome/common/extensions/api/command_line_private.json b/chrome/common/extensions/api/command_line_private.json index 9a9d670..90c052d 100644 --- a/chrome/common/extensions/api/command_line_private.json +++ b/chrome/common/extensions/api/command_line_private.json
@@ -6,7 +6,6 @@ { "namespace": "commandLinePrivate", "description": "none", - "compiler_options": {"use_movable_types": true}, "functions": [ { "name": "hasSwitch",
diff --git a/chrome/common/extensions/api/commands.json b/chrome/common/extensions/api/commands.json index e6d1e23..c02008e7 100644 --- a/chrome/common/extensions/api/commands.json +++ b/chrome/common/extensions/api/commands.json
@@ -6,7 +6,6 @@ { "namespace": "commands", "description": "Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "Command",
diff --git a/chrome/common/extensions/api/content_settings.json b/chrome/common/extensions/api/content_settings.json index a89f010..a21a8ff 100644 --- a/chrome/common/extensions/api/content_settings.json +++ b/chrome/common/extensions/api/content_settings.json
@@ -6,10 +6,7 @@ { "namespace": "contentSettings", "description": "Use the <code>chrome.contentSettings</code> API to change settings that control whether websites can use features such as cookies, JavaScript, and plugins. More generally speaking, content settings allow you to customize Chrome's behavior on a per-site basis instead of globally.", - "compiler_options": { - "generate_type_functions": true, - "use_movable_types": true - }, + "compiler_options": { "generate_type_functions": true }, "types": [ { "id": "ResourceIdentifier",
diff --git a/chrome/common/extensions/api/context_menus.json b/chrome/common/extensions/api/context_menus.json index 53ca171..764af5b 100644 --- a/chrome/common/extensions/api/context_menus.json +++ b/chrome/common/extensions/api/context_menus.json
@@ -6,7 +6,6 @@ { "namespace": "contextMenus", "description": "Use the <code>chrome.contextMenus</code> API to add items to Google Chrome's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.", - "compiler_options": {"use_movable_types": true}, "properties": { "ACTION_MENU_TOP_LEVEL_LIMIT": { "value": 6,
diff --git a/chrome/common/extensions/api/context_menus_internal.json b/chrome/common/extensions/api/context_menus_internal.json index b6d4e56..2e879b06 100644 --- a/chrome/common/extensions/api/context_menus_internal.json +++ b/chrome/common/extensions/api/context_menus_internal.json
@@ -6,7 +6,6 @@ { "namespace": "contextMenusInternal", "description": "Use the <code>chrome.contextMenus</code> API to add items to Google Chrome's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "OnClickData",
diff --git a/chrome/common/extensions/api/cookies.json b/chrome/common/extensions/api/cookies.json index 0bd4e2d..98dd565b 100644 --- a/chrome/common/extensions/api/cookies.json +++ b/chrome/common/extensions/api/cookies.json
@@ -6,7 +6,6 @@ { "namespace": "cookies", "description": "Use the <code>chrome.cookies</code> API to query and modify cookies, and to be notified when they change.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "SameSiteStatus",
diff --git a/chrome/common/extensions/api/copresence.idl b/chrome/common/extensions/api/copresence.idl index fd87efa8..a9c6090 100644 --- a/chrome/common/extensions/api/copresence.idl +++ b/chrome/common/extensions/api/copresence.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.copresence</code> API to communicate with other nearby // devices using Google's copresence service. -[use_movable_types=true] namespace copresence { +namespace copresence { // Suggestions to copresence on how to do the publication and subscription. // Note: These are only suggestions. Actual behavior may not always match // what is requested.
diff --git a/chrome/common/extensions/api/copresence_private.idl b/chrome/common/extensions/api/copresence_private.idl index f6b4cb84..6db3420 100644 --- a/chrome/common/extensions/api/copresence_private.idl +++ b/chrome/common/extensions/api/copresence_private.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.copresencePrivate</code> API to interface with Chrome // from the whispernet_proxy extension. -[use_movable_types=true]namespace copresencePrivate { +namespace copresencePrivate { dictionary Token { DOMString token; boolean audible;
diff --git a/chrome/common/extensions/api/cryptotoken_private.idl b/chrome/common/extensions/api/cryptotoken_private.idl index f424a25ea..8a091bb 100644 --- a/chrome/common/extensions/api/cryptotoken_private.idl +++ b/chrome/common/extensions/api/cryptotoken_private.idl
@@ -4,7 +4,7 @@ // <code>chrome.cryptotokenPrivate</code> API that provides hooks to Chrome to // be used by cryptotoken component extension. -[use_movable_types=true] namespace cryptotokenPrivate { +namespace cryptotokenPrivate { // Callback for appId check callback AppIdCallback = void(boolean result);
diff --git a/chrome/common/extensions/api/dashboard_private.json b/chrome/common/extensions/api/dashboard_private.json index fc11358..30e9e24 100644 --- a/chrome/common/extensions/api/dashboard_private.json +++ b/chrome/common/extensions/api/dashboard_private.json
@@ -6,7 +6,6 @@ { "namespace":"dashboardPrivate", "description": "none", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "Result",
diff --git a/chrome/common/extensions/api/data_reduction_proxy.json b/chrome/common/extensions/api/data_reduction_proxy.json index 1742e59..4c96518 100644 --- a/chrome/common/extensions/api/data_reduction_proxy.json +++ b/chrome/common/extensions/api/data_reduction_proxy.json
@@ -6,7 +6,6 @@ { "namespace": "dataReductionProxy", "description": "Use the <code>chrome.dataReductionProxy</code> API to control the data reduction proxy and access usage metrics. This API relies on the <a href='types#ChromeSetting'>ChromeSetting prototype of the type API</a> for getting and setting Chrome's configuration.", - "compiler_options": {"use_movable_types": true}, "properties": { "spdyProxyEnabled": { "nocompile": true,
diff --git a/chrome/common/extensions/api/debugger.json b/chrome/common/extensions/api/debugger.json index 958bf84..c00c749 100644 --- a/chrome/common/extensions/api/debugger.json +++ b/chrome/common/extensions/api/debugger.json
@@ -6,7 +6,6 @@ { "namespace": "debugger", "description": "The <code>chrome.debugger</code> API serves as an alternate transport for Chrome's <a href='https://developer.chrome.com/devtools/docs/debugger-protocol'>remote debugging protocol</a>. Use <code>chrome.debugger</code> to attach to one or more tabs to instrument network interaction, debug JavaScript, mutate the DOM and CSS, etc. Use the Debuggee <code>tabId</code> to target tabs with sendCommand and route events by <code>tabId</code> from onEvent callbacks.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "Debuggee",
diff --git a/chrome/common/extensions/api/declarative_content.json b/chrome/common/extensions/api/declarative_content.json index a857103..c84a29a 100644 --- a/chrome/common/extensions/api/declarative_content.json +++ b/chrome/common/extensions/api/declarative_content.json
@@ -6,7 +6,6 @@ { "namespace": "declarativeContent", "description": "Use the <code>chrome.declarativeContent</code> API to take actions depending on the content of a page, without requiring permission to read the page's content.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "ImageDataType",
diff --git a/chrome/common/extensions/api/desktop_capture.json b/chrome/common/extensions/api/desktop_capture.json index 359b7da..5b9ff00 100644 --- a/chrome/common/extensions/api/desktop_capture.json +++ b/chrome/common/extensions/api/desktop_capture.json
@@ -6,7 +6,6 @@ { "namespace": "desktopCapture", "description": "Desktop Capture API that can be used to capture content of screen, individual windows or tabs.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "DesktopCaptureSourceType",
diff --git a/chrome/common/extensions/api/developer_private.idl b/chrome/common/extensions/api/developer_private.idl index bf6e490..564b1cb 100644 --- a/chrome/common/extensions/api/developer_private.idl +++ b/chrome/common/extensions/api/developer_private.idl
@@ -5,7 +5,7 @@ // developerPrivate API. // This is a private API exposing developing and debugging functionalities for // apps and extensions. -[use_movable_types=true] namespace developerPrivate { +namespace developerPrivate { // DEPRECATED: Prefer ExtensionType. enum ItemType {
diff --git a/chrome/common/extensions/api/dial.idl b/chrome/common/extensions/api/dial.idl index fa2abac..d16fdfd 100644 --- a/chrome/common/extensions/api/dial.idl +++ b/chrome/common/extensions/api/dial.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.dial</code> API to discover devices that support DIAL. // Protocol specification: http://www.dial-multiscreen.org/ -[use_movable_types=true] namespace dial { +namespace dial { // Represents a unique device that responded to a DIAL discovery request. dictionary DialDevice {
diff --git a/chrome/common/extensions/api/downloads.idl b/chrome/common/extensions/api/downloads.idl index 1ff6915..0381c88 100644 --- a/chrome/common/extensions/api/downloads.idl +++ b/chrome/common/extensions/api/downloads.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.downloads</code> API to programmatically initiate, // monitor, manipulate, and search for downloads. -[permissions=downloads,use_movable_types=true] +[permissions=downloads] namespace downloads { [inline_doc] dictionary HeaderNameValuePair { // Name of the HTTP header.
diff --git a/chrome/common/extensions/api/downloads_internal.idl b/chrome/common/extensions/api/downloads_internal.idl index 7dab5a04..bbbfbcd1 100644 --- a/chrome/common/extensions/api/downloads_internal.idl +++ b/chrome/common/extensions/api/downloads_internal.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // downloadsInternal -[nodoc=true,use_movable_types=true] +[nodoc=true] namespace downloadsInternal { interface Functions { // Secretly called when onDeterminingFilename handlers return.
diff --git a/chrome/common/extensions/api/easy_unlock_private.idl b/chrome/common/extensions/api/easy_unlock_private.idl index 9f86bb5..0359bd8 100644 --- a/chrome/common/extensions/api/easy_unlock_private.idl +++ b/chrome/common/extensions/api/easy_unlock_private.idl
@@ -4,7 +4,7 @@ // <code>chrome.easyUnlockPrivate</code> API that provides hooks to Chrome to // be used by Easy Unlock component app. -[use_movable_types=true] namespace easyUnlockPrivate { +namespace easyUnlockPrivate { // Signature algorithms supported by the crypto library methods used by // Easy Unlock. enum SignatureType {
diff --git a/chrome/common/extensions/api/echo_private.json b/chrome/common/extensions/api/echo_private.json index bef972b5..f85c3ce 100644 --- a/chrome/common/extensions/api/echo_private.json +++ b/chrome/common/extensions/api/echo_private.json
@@ -6,8 +6,7 @@ { "namespace": "echoPrivate", "compiler_options": { - "implemented_in": "chrome/browser/chromeos/extensions/echo_private_api.h", - "use_movable_types": true + "implemented_in": "chrome/browser/chromeos/extensions/echo_private_api.h" }, "description": "none", "functions": [
diff --git a/chrome/common/extensions/api/enterprise_device_attributes.idl b/chrome/common/extensions/api/enterprise_device_attributes.idl index e3a14e5..1960c4d 100644 --- a/chrome/common/extensions/api/enterprise_device_attributes.idl +++ b/chrome/common/extensions/api/enterprise_device_attributes.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.enterprise.deviceAttributes</code> API to read device // attributes. -[use_movable_types=true] namespace enterprise.deviceAttributes { +namespace enterprise.deviceAttributes { callback GetDirectoryDeviceIdCallback = void (DOMString deviceId); interface Functions {
diff --git a/chrome/common/extensions/api/enterprise_platform_keys.idl b/chrome/common/extensions/api/enterprise_platform_keys.idl index ceef3b7..bb5cfb1 100644 --- a/chrome/common/extensions/api/enterprise_platform_keys.idl +++ b/chrome/common/extensions/api/enterprise_platform_keys.idl
@@ -7,7 +7,7 @@ // certificates will be managed by the platform and can be used for TLS // authentication, network access or by other extension through // $(ref:platformKeys chrome.platformKeys). -[platforms = ("chromeos"), use_movable_types=true] +[platforms = ("chromeos")] namespace enterprise.platformKeys { [nocompile, noinline_doc] dictionary Token { // Uniquely identifies this <code>Token</code>.
diff --git a/chrome/common/extensions/api/enterprise_platform_keys_internal.idl b/chrome/common/extensions/api/enterprise_platform_keys_internal.idl index 2fc35e1..7d35f90f 100644 --- a/chrome/common/extensions/api/enterprise_platform_keys_internal.idl +++ b/chrome/common/extensions/api/enterprise_platform_keys_internal.idl
@@ -4,8 +4,7 @@ // Internal API for platform keys and certificate management. [ platforms = ("chromeos"), - implemented_in = "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h", - use_movable_types=true ] + implemented_in = "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h" ] namespace enterprise.platformKeysInternal { // Invoked by <code>getTokens</code>. // |tokenIds| The list of IDs of the avialable Tokens.
diff --git a/chrome/common/extensions/api/enterprise_platform_keys_private.json b/chrome/common/extensions/api/enterprise_platform_keys_private.json index 50d0b04..5b77df6d 100644 --- a/chrome/common/extensions/api/enterprise_platform_keys_private.json +++ b/chrome/common/extensions/api/enterprise_platform_keys_private.json
@@ -6,7 +6,6 @@ { "namespace": "enterprise.platformKeysPrivate", "description": "none", - "compiler_options": {"use_movable_types": true}, "functions": [ { "name": "challengeMachineKey",
diff --git a/chrome/common/extensions/api/experience_sampling_private.json b/chrome/common/extensions/api/experience_sampling_private.json index 4aeb609..c6a171f 100644 --- a/chrome/common/extensions/api/experience_sampling_private.json +++ b/chrome/common/extensions/api/experience_sampling_private.json
@@ -6,7 +6,6 @@ { "namespace": "experienceSamplingPrivate", "description": "The experienceSamplingPrivate API listens for when various types of UI elements are displayed and closed (interstitials, infobars, etc.) and pass these events along to whitelisted extensions, along with information about the user’s decisions.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "UIElement",
diff --git a/chrome/common/extensions/api/extension.json b/chrome/common/extensions/api/extension.json index ece6d32..c83f89ec 100644 --- a/chrome/common/extensions/api/extension.json +++ b/chrome/common/extensions/api/extension.json
@@ -7,8 +7,7 @@ "namespace": "extension", "description": "The <code>chrome.extension</code> API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in <a href='messaging'>Message Passing</a>.", "compiler_options": { - "implemented_in": "chrome/browser/extensions/api/module/module.h", - "use_movable_types": true + "implemented_in": "chrome/browser/extensions/api/module/module.h" }, "properties": { "lastError": {
diff --git a/chrome/common/extensions/api/feedback_private.idl b/chrome/common/extensions/api/feedback_private.idl index a58b4b4..54990c3 100644 --- a/chrome/common/extensions/api/feedback_private.idl +++ b/chrome/common/extensions/api/feedback_private.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.feedbackPrivate</code> API to provide Chrome [OS] // feedback to the Google Feedback servers. -[use_movable_types=true] namespace feedbackPrivate { +namespace feedbackPrivate { dictionary AttachedFile { DOMString name;
diff --git a/chrome/common/extensions/api/file_browser_handler.json b/chrome/common/extensions/api/file_browser_handler.json index 9c63cf55..0012ac7c 100644 --- a/chrome/common/extensions/api/file_browser_handler.json +++ b/chrome/common/extensions/api/file_browser_handler.json
@@ -6,7 +6,6 @@ { "namespace":"fileBrowserHandler", "description": "Use the <code>chrome.fileBrowserHandler</code> API to extend the Chrome OS file browser. For example, you can use this API to enable users to upload files to your website.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "FileHandlerExecuteEventDetails",
diff --git a/chrome/common/extensions/api/file_browser_handler_internal.json b/chrome/common/extensions/api/file_browser_handler_internal.json index 68a3314..b3023e4 100644 --- a/chrome/common/extensions/api/file_browser_handler_internal.json +++ b/chrome/common/extensions/api/file_browser_handler_internal.json
@@ -6,8 +6,7 @@ { "namespace": "fileBrowserHandlerInternal", "compiler_options": { - "implemented_in": "chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h", - "use_movable_types": true + "implemented_in": "chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h" }, "description": "none", "types": [
diff --git a/chrome/common/extensions/api/file_manager_private.idl b/chrome/common/extensions/api/file_manager_private.idl index 8313ea9bc..1f9248643 100644 --- a/chrome/common/extensions/api/file_manager_private.idl +++ b/chrome/common/extensions/api/file_manager_private.idl
@@ -5,8 +5,7 @@ // fileManagerPrivate API. // This is a private API used by the file browser of ChromeOS. [platforms=("chromeos"), - implemented_in="chrome/browser/chromeos/extensions/file_manager/file_manager_private_api_functions.h", - use_movable_types=true] + implemented_in="chrome/browser/chromeos/extensions/file_manager/file_manager_private_api_functions.h"] namespace fileManagerPrivate { // Type of the mounted volume. enum VolumeType { drive, downloads, removable, archive, provided, mtp,
diff --git a/chrome/common/extensions/api/file_manager_private_internal.idl b/chrome/common/extensions/api/file_manager_private_internal.idl index 404a19d..39739f2 100644 --- a/chrome/common/extensions/api/file_manager_private_internal.idl +++ b/chrome/common/extensions/api/file_manager_private_internal.idl
@@ -4,8 +4,7 @@ // Internal, used by fileManagerPrivate's custom bindings. [platforms=("chromeos"), - implemented_in="chrome/browser/chromeos/extensions/file_manager/file_manager_private_api_functions.h", - use_movable_types=true] + implemented_in="chrome/browser/chromeos/extensions/file_manager/file_manager_private_api_functions.h"] namespace fileManagerPrivateInternal { // Entry information that renderers need to create an Entry instance. dictionary EntryDescription {
diff --git a/chrome/common/extensions/api/file_system.idl b/chrome/common/extensions/api/file_system.idl index 0df621c..6ea554a 100644 --- a/chrome/common/extensions/api/file_system.idl +++ b/chrome/common/extensions/api/file_system.idl
@@ -7,7 +7,7 @@ // read and write to a user-selected location. For example, a text editor app // can use the API to read and write local documents. All failures are notified // via chrome.runtime.lastError. -[use_movable_types=true] namespace fileSystem { +namespace fileSystem { dictionary AcceptOption { // This is the optional text description for this option. If not present, // a description will be automatically generated; typically containing an
diff --git a/chrome/common/extensions/api/file_system_provider.idl b/chrome/common/extensions/api/file_system_provider.idl index 38882b1a..b18d46af 100644 --- a/chrome/common/extensions/api/file_system_provider.idl +++ b/chrome/common/extensions/api/file_system_provider.idl
@@ -4,8 +4,7 @@ // Use the <code>chrome.fileSystemProvider</code> API to create file systems, // that can be accessible from the file manager on Chrome OS. -[implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h", - use_movable_types=true] +[implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h"] namespace fileSystemProvider { // Error codes used by providing extensions in response to requests as well // as in case of errors when calling methods of the API. For success,
diff --git a/chrome/common/extensions/api/file_system_provider_internal.idl b/chrome/common/extensions/api/file_system_provider_internal.idl index 449e37c..df92502 100644 --- a/chrome/common/extensions/api/file_system_provider_internal.idl +++ b/chrome/common/extensions/api/file_system_provider_internal.idl
@@ -5,8 +5,7 @@ // Internal, used by fileSystemProvider's custom bindings. These functions are // called when events' callbacks are invoked. [implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h", - nodoc, - use_movable_types=true] + nodoc] namespace fileSystemProviderInternal { interface Functions { // Internal. Success callback of the <code>onUnmountRequested</code>
diff --git a/chrome/common/extensions/api/first_run_private.json b/chrome/common/extensions/api/first_run_private.json index a8c5742..6882d08d 100644 --- a/chrome/common/extensions/api/first_run_private.json +++ b/chrome/common/extensions/api/first_run_private.json
@@ -6,8 +6,7 @@ { "namespace": "firstRunPrivate", "compiler_options": { - "implemented_in": "chrome/browser/chromeos/extensions/first_run_private_api.h", - "use_movable_types": true + "implemented_in": "chrome/browser/chromeos/extensions/first_run_private_api.h" }, "description": "none", "functions": [
diff --git a/chrome/common/extensions/api/font_settings.json b/chrome/common/extensions/api/font_settings.json index 093d7927..fa14ef3 100644 --- a/chrome/common/extensions/api/font_settings.json +++ b/chrome/common/extensions/api/font_settings.json
@@ -6,7 +6,6 @@ { "namespace": "fontSettings", "description": "Use the <code>chrome.fontSettings</code> API to manage Chrome's font settings.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "FontName",
diff --git a/chrome/common/extensions/api/gcd_private.idl b/chrome/common/extensions/api/gcd_private.idl index 490b4f5..12f5c43 100644 --- a/chrome/common/extensions/api/gcd_private.idl +++ b/chrome/common/extensions/api/gcd_private.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.gcdPrivate</code> API to discover GCD APIs and register // them. -[use_movable_types=true] namespace gcdPrivate { +namespace gcdPrivate { enum Status { // Success.
diff --git a/chrome/common/extensions/api/gcm.json b/chrome/common/extensions/api/gcm.json index b93057d..aefee4b 100644 --- a/chrome/common/extensions/api/gcm.json +++ b/chrome/common/extensions/api/gcm.json
@@ -6,7 +6,6 @@ { "namespace": "gcm", "description": "Use <code>chrome.gcm</code> to enable apps and extensions to send and receive messages through the <a href='http://developer.android.com/google/gcm/'>Google Cloud Messaging Service</a>.", - "compiler_options": {"use_movable_types": true}, "properties": { "MAX_MESSAGE_SIZE": { "value": 4096,
diff --git a/chrome/common/extensions/api/hangouts_private.idl b/chrome/common/extensions/api/hangouts_private.idl index e574dc3..513b34f 100644 --- a/chrome/common/extensions/api/hangouts_private.idl +++ b/chrome/common/extensions/api/hangouts_private.idl
@@ -8,7 +8,7 @@ // replacing this with a scheme based solution which might be implemented // using registerProtocolHandler, but we are still finishing that design. // See crbug.com/306672 -[use_movable_types=true] namespace hangoutsPrivate { +namespace hangoutsPrivate { enum HangoutType {chat, video, audio};
diff --git a/chrome/common/extensions/api/history.json b/chrome/common/extensions/api/history.json index 210cce89..2eb7044ad 100644 --- a/chrome/common/extensions/api/history.json +++ b/chrome/common/extensions/api/history.json
@@ -6,7 +6,6 @@ { "namespace": "history", "description": "Use the <code>chrome.history</code> API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see <a href='override'>Override Pages</a>.", - "compler_options": {"use_movable_types": true}, "types": [ { "id": "TransitionType",
diff --git a/chrome/common/extensions/api/hotword_private.idl b/chrome/common/extensions/api/hotword_private.idl index 93c6d527..a7ffeb1 100644 --- a/chrome/common/extensions/api/hotword_private.idl +++ b/chrome/common/extensions/api/hotword_private.idl
@@ -10,7 +10,7 @@ // // For an FYI, visit http://goo.gl/AyHbkH -[use_movable_types=true] namespace hotwordPrivate { +namespace hotwordPrivate { dictionary StatusDetails { // Whether the hotword preference has been set.
diff --git a/chrome/common/extensions/api/i18n.json b/chrome/common/extensions/api/i18n.json index 88258c93..d9fc392 100644 --- a/chrome/common/extensions/api/i18n.json +++ b/chrome/common/extensions/api/i18n.json
@@ -6,7 +6,6 @@ { "namespace": "i18n", "description": "Use the <code>chrome.i18n</code> infrastructure to implement internationalization across your whole app or extension.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "LanguageCode",
diff --git a/chrome/common/extensions/api/identity.idl b/chrome/common/extensions/api/identity.idl index 70d6903..bad51d5c 100644 --- a/chrome/common/extensions/api/identity.idl +++ b/chrome/common/extensions/api/identity.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Use the <code>chrome.identity</code> API to get OAuth2 access tokens. -[use_movable_types=true] namespace identity { +namespace identity { dictionary AccountInfo { // A unique identifier for the account. This ID will not change
diff --git a/chrome/common/extensions/api/identity_private.idl b/chrome/common/extensions/api/identity_private.idl index a580ff9c..33856ef 100644 --- a/chrome/common/extensions/api/identity_private.idl +++ b/chrome/common/extensions/api/identity_private.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // identityPrivate. -[use_movable_types=true] namespace identityPrivate { +namespace identityPrivate { interface Events { // Fired when a web flow dialog should be displayed.
diff --git a/chrome/common/extensions/api/idltest.idl b/chrome/common/extensions/api/idltest.idl index 08c6654..4bb0ab5e0a 100644 --- a/chrome/common/extensions/api/idltest.idl +++ b/chrome/common/extensions/api/idltest.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // An API to test IDL schema specifications. -[use_movable_types=true] namespace idltest { +namespace idltest { callback LongArrayCallback = void(long[] array); callback ArrayBufferCallback = void(ArrayBuffer buffer);
diff --git a/chrome/common/extensions/api/image_writer_private.idl b/chrome/common/extensions/api/image_writer_private.idl index 596a08a..c4efd19 100644 --- a/chrome/common/extensions/api/image_writer_private.idl +++ b/chrome/common/extensions/api/image_writer_private.idl
@@ -7,7 +7,7 @@ // // See the design doc for a detailed description of this API. // https://goo.gl/KzMEFq -[use_movable_types=true] namespace imageWriterPrivate { +namespace imageWriterPrivate { // The different stages of a write call. // // <dl>
diff --git a/chrome/common/extensions/api/inline_install_private.idl b/chrome/common/extensions/api/inline_install_private.idl index de5b87c..70af8c0 100644 --- a/chrome/common/extensions/api/inline_install_private.idl +++ b/chrome/common/extensions/api/inline_install_private.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Private API to initiate inline install flow of other apps. -[use_movable_types=true] namespace inlineInstallPrivate { +namespace inlineInstallPrivate { // This returns a developer-readable error message in error and // a string error code in errorCode (see $ref:webstore.ErrorCode)
diff --git a/chrome/common/extensions/api/input_ime.json b/chrome/common/extensions/api/input_ime.json index ce9c7a1..5a9ced36 100644 --- a/chrome/common/extensions/api/input_ime.json +++ b/chrome/common/extensions/api/input_ime.json
@@ -6,7 +6,6 @@ { "namespace": "input.ime", "description": "Use the <code>chrome.input.ime</code> API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "KeyboardEventType",
diff --git a/chrome/common/extensions/api/input_method_private.json b/chrome/common/extensions/api/input_method_private.json index 33284d137..69d1862b 100644 --- a/chrome/common/extensions/api/input_method_private.json +++ b/chrome/common/extensions/api/input_method_private.json
@@ -6,8 +6,7 @@ { "namespace": "inputMethodPrivate", "compiler_options": { - "implemented_in": "chrome/browser/chromeos/extensions/input_method_api.h", - "use_movable_types": true + "implemented_in": "chrome/browser/chromeos/extensions/input_method_api.h" }, "description": "none", "types": [
diff --git a/chrome/common/extensions/api/instance_id.json b/chrome/common/extensions/api/instance_id.json index c1f5887..71d70119 100644 --- a/chrome/common/extensions/api/instance_id.json +++ b/chrome/common/extensions/api/instance_id.json
@@ -6,7 +6,6 @@ { "namespace": "instanceID", "description": "Use <code>chrome.instanceID</code> to access the Instance ID service.", - "compiler_options": {"use_movable_types": true}, "functions": [ { "name": "getID",
diff --git a/chrome/common/extensions/api/language_settings_private.idl b/chrome/common/extensions/api/language_settings_private.idl index 91fec6a8..f1ac49c 100644 --- a/chrome/common/extensions/api/language_settings_private.idl +++ b/chrome/common/extensions/api/language_settings_private.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.languageSettingsPrivate</code> API to get or change // language and input method settings. -[use_movable_types=true] namespace languageSettingsPrivate { +namespace languageSettingsPrivate { dictionary Language { // The unique code identifying the language. DOMString code;
diff --git a/chrome/common/extensions/api/launcher_page.idl b/chrome/common/extensions/api/launcher_page.idl index f8a4237..7e7896a8 100644 --- a/chrome/common/extensions/api/launcher_page.idl +++ b/chrome/common/extensions/api/launcher_page.idl
@@ -4,7 +4,7 @@ // The <code>chrome.launcherPage</code> API provides launcher pages in the // Chrome Launcher with the capabilities and events they need. -[use_movable_types=true] namespace launcherPage { +namespace launcherPage { callback PushSubpageCallback = void(); callback ShowCallback = void(); callback HideCallback = void();
diff --git a/chrome/common/extensions/api/launcher_search_provider.idl b/chrome/common/extensions/api/launcher_search_provider.idl index 9b5d0f8..5f59f72 100644 --- a/chrome/common/extensions/api/launcher_search_provider.idl +++ b/chrome/common/extensions/api/launcher_search_provider.idl
@@ -6,8 +6,7 @@ // to it. [platforms=("chromeos"), implemented_in="chrome/browser/chromeos/extensions/launcher_search_provider.h", - nodoc, - use_movable_types=true] + nodoc] namespace launcherSearchProvider { dictionary SearchResult { DOMString itemId;
diff --git a/chrome/common/extensions/api/log_private.idl b/chrome/common/extensions/api/log_private.idl index 128e83d4..3b96acf5 100644 --- a/chrome/common/extensions/api/log_private.idl +++ b/chrome/common/extensions/api/log_private.idl
@@ -4,7 +4,7 @@ // Use chrome.logPrivate API to retrieve log information from multiple // resources in a consistent format. -[use_movable_types=true] namespace logPrivate { +namespace logPrivate { // A filter class that filters log entries by different fields dictionary Filter {
diff --git a/chrome/common/extensions/api/manifest_types.json b/chrome/common/extensions/api/manifest_types.json index 0602d335..de60535 100644 --- a/chrome/common/extensions/api/manifest_types.json +++ b/chrome/common/extensions/api/manifest_types.json
@@ -8,10 +8,7 @@ { "namespace": "manifestTypes", "description": "Schemas for structured manifest entries", - "compiler_options": { - "generate_error_messages": true, - "use_movable_types": true - }, + "compiler_options": { "generate_error_messages": true }, "types": [ { "id": "ChromeSettingsOverrides",
diff --git a/chrome/common/extensions/api/mdns.idl b/chrome/common/extensions/api/mdns.idl index d651e8b..000d435 100644 --- a/chrome/common/extensions/api/mdns.idl +++ b/chrome/common/extensions/api/mdns.idl
@@ -5,7 +5,7 @@ // Use the <code>chrome.mdns</code> API to discover services over mDNS. // This comprises a subset of the features of the NSD spec: // http://www.w3.org/TR/discovery-api/ -[use_movable_types=true] namespace mdns { +namespace mdns { // Represents a mDNS/DNS-SD service. dictionary MDnsService {
diff --git a/chrome/common/extensions/api/media_galleries.idl b/chrome/common/extensions/api/media_galleries.idl index b3024bf..ebbb1f35 100644 --- a/chrome/common/extensions/api/media_galleries.idl +++ b/chrome/common/extensions/api/media_galleries.idl
@@ -5,7 +5,7 @@ // Use the <code>chrome.mediaGalleries</code> API to access media files (audio, // images, video) from the user's local disks (with the user's consent). -[use_movable_types=true] namespace mediaGalleries { +namespace mediaGalleries { [inline_doc] enum GalleryChangeType { // The contents of the gallery have changed.
diff --git a/chrome/common/extensions/api/media_player_private.json b/chrome/common/extensions/api/media_player_private.json index c397e87..1a143b21 100644 --- a/chrome/common/extensions/api/media_player_private.json +++ b/chrome/common/extensions/api/media_player_private.json
@@ -6,8 +6,7 @@ { "namespace": "mediaPlayerPrivate", "compiler_options": { - "implemented_in": "chrome/browser/chromeos/extensions/media_player_api.h", - "use_movable_types": true + "implemented_in": "chrome/browser/chromeos/extensions/media_player_api.h" }, "description": "none", "events": [
diff --git a/chrome/common/extensions/api/metrics_private.json b/chrome/common/extensions/api/metrics_private.json index 8eaf9dbc..ba8cc90 100644 --- a/chrome/common/extensions/api/metrics_private.json +++ b/chrome/common/extensions/api/metrics_private.json
@@ -6,7 +6,6 @@ { "namespace": "metricsPrivate", "description": "none", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "MetricTypeType",
diff --git a/chrome/common/extensions/api/music_manager_private.idl b/chrome/common/extensions/api/music_manager_private.idl index 37c292d3..b6d13fba 100644 --- a/chrome/common/extensions/api/music_manager_private.idl +++ b/chrome/common/extensions/api/music_manager_private.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // musicManagerPrivate. -[use_movable_types=true] namespace musicManagerPrivate { +namespace musicManagerPrivate { callback GetDeviceIdCallback = void (DOMString device_id);
diff --git a/chrome/common/extensions/api/notification_provider.idl b/chrome/common/extensions/api/notification_provider.idl index d70f663..435615b5 100644 --- a/chrome/common/extensions/api/notification_provider.idl +++ b/chrome/common/extensions/api/notification_provider.idl
@@ -6,7 +6,7 @@ // notifications that would otherwise go into the Chrome Notification Center, // get notifiers' information, and inform notifiers about users' actions on the // notifications. -[use_movable_types=true] namespace notificationProvider { +namespace notificationProvider { // TODO(liyanhou): Use notifications.PermissionLevel everywhere and delete // this type. See http://crbug.com/398266.
diff --git a/chrome/common/extensions/api/notifications.idl b/chrome/common/extensions/api/notifications.idl index 14b0f6b..d3cc1ac 100644 --- a/chrome/common/extensions/api/notifications.idl +++ b/chrome/common/extensions/api/notifications.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.notifications</code> API to create rich notifications // using templates and show these notifications to users in the system tray. -[use_movable_types=true] namespace notifications { +namespace notifications { [noinline_doc] enum TemplateType { // icon, title, message, expandedMessage, up to two buttons basic,
diff --git a/chrome/common/extensions/api/omnibox.json b/chrome/common/extensions/api/omnibox.json index 8bcb636..614f5ec 100644 --- a/chrome/common/extensions/api/omnibox.json +++ b/chrome/common/extensions/api/omnibox.json
@@ -6,7 +6,6 @@ { "namespace": "omnibox", "description": "The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "DescriptionStyleType",
diff --git a/chrome/common/extensions/api/page_action.json b/chrome/common/extensions/api/page_action.json index 1f0f8ba..a53c02e 100644 --- a/chrome/common/extensions/api/page_action.json +++ b/chrome/common/extensions/api/page_action.json
@@ -6,7 +6,6 @@ { "namespace": "pageAction", "description": "Use the <code>chrome.pageAction</code> API to put icons in the main Google Chrome toolbar, to the right of the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages. Page actions appear grayed out when inactive.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "ImageDataType",
diff --git a/chrome/common/extensions/api/page_capture.json b/chrome/common/extensions/api/page_capture.json index ab26c22..e0fd86b 100644 --- a/chrome/common/extensions/api/page_capture.json +++ b/chrome/common/extensions/api/page_capture.json
@@ -6,7 +6,6 @@ { "namespace": "pageCapture", "description": "Use the <code>chrome.pageCapture</code> API to save a tab as MHTML.", - "compiler_options": {"use_movable_types": true}, "functions": [ { "name": "saveAsMHTML",
diff --git a/chrome/common/extensions/api/passwords_private.idl b/chrome/common/extensions/api/passwords_private.idl index 72c0177..c2a1265f 100644 --- a/chrome/common/extensions/api/passwords_private.idl +++ b/chrome/common/extensions/api/passwords_private.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.passwordsPrivate</code> API to add or remove password // data from the settings UI. -[use_movable_types=true] namespace passwordsPrivate { +namespace passwordsPrivate { // Pair of origin URL and login saved for that URL. dictionary LoginPair { // The human-readable origin for the URL where the password is used.
diff --git a/chrome/common/extensions/api/permissions.json b/chrome/common/extensions/api/permissions.json index cd883a2f..a5047460 100644 --- a/chrome/common/extensions/api/permissions.json +++ b/chrome/common/extensions/api/permissions.json
@@ -6,7 +6,6 @@ { "namespace": "permissions", "description": "Use the <code>chrome.permissions</code> API to request <a href='permissions#manifest'>declared optional permissions</a> at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "Permissions",
diff --git a/chrome/common/extensions/api/platform_keys.idl b/chrome/common/extensions/api/platform_keys.idl index 029f2ab3..dc875fc 100644 --- a/chrome/common/extensions/api/platform_keys.idl +++ b/chrome/common/extensions/api/platform_keys.idl
@@ -7,7 +7,7 @@ // extension can use such a certficate in its custom authentication protocol. // E.g. this allows usage of platform managed certificates in third party VPNs // (see $(ref:vpnProvider chrome.vpnProvider)). -[use_movable_types=true] namespace platformKeys { +namespace platformKeys { [noinline_doc] dictionary Match { // The DER encoding of a X.509 certificate. ArrayBuffer certificate;
diff --git a/chrome/common/extensions/api/platform_keys_internal.idl b/chrome/common/extensions/api/platform_keys_internal.idl index 8af6c12..48719e2c 100644 --- a/chrome/common/extensions/api/platform_keys_internal.idl +++ b/chrome/common/extensions/api/platform_keys_internal.idl
@@ -4,8 +4,7 @@ // Internal API for to implement the platformKeys and enterprise.platformKeys // APIs. -[implemented_in = "chrome/browser/extensions/api/platform_keys/platform_keys_api.h", -use_movable_types=true] +[implemented_in = "chrome/browser/extensions/api/platform_keys/platform_keys_api.h"] namespace platformKeysInternal { callback SelectCallback = void (platformKeys.Match[] certs);
diff --git a/chrome/common/extensions/api/preferences_private.json b/chrome/common/extensions/api/preferences_private.json index 7c296bf9..e409fb1 100644 --- a/chrome/common/extensions/api/preferences_private.json +++ b/chrome/common/extensions/api/preferences_private.json
@@ -6,7 +6,6 @@ { "namespace": "preferencesPrivate", "description": "none", - "compiler_options": {"use_movable_types": true}, "properties": { "easyUnlockProximityRequired": { "nocompile": true,
diff --git a/chrome/common/extensions/api/privacy.json b/chrome/common/extensions/api/privacy.json index d01f718..f235aaf 100644 --- a/chrome/common/extensions/api/privacy.json +++ b/chrome/common/extensions/api/privacy.json
@@ -6,7 +6,6 @@ { "namespace": "privacy", "description": "Use the <code>chrome.privacy</code> API to control usage of the features in Chrome that can affect a user's privacy. This API relies on the <a href='types#ChromeSetting'>ChromeSetting prototype of the type API</a> for getting and setting Chrome's configuration.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "IPHandlingPolicy",
diff --git a/chrome/common/extensions/api/processes.idl b/chrome/common/extensions/api/processes.idl index 3ca1763..a1c479f9 100644 --- a/chrome/common/extensions/api/processes.idl +++ b/chrome/common/extensions/api/processes.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.processes</code> API to interact with the browser's // processes. -[use_movable_types=true]namespace processes { +namespace processes { // The types of the browser processes. enum ProcessType { browser,
diff --git a/chrome/common/extensions/api/proxy.json b/chrome/common/extensions/api/proxy.json index 6911594f..4604dc2 100644 --- a/chrome/common/extensions/api/proxy.json +++ b/chrome/common/extensions/api/proxy.json
@@ -6,7 +6,6 @@ { "namespace": "proxy", "description": "Use the <code>chrome.proxy</code> API to manage Chrome's proxy settings. This API relies on the <a href='types#ChromeSetting'>ChromeSetting prototype of the type API</a> for getting and setting the proxy configuration.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "ProxyServer",
diff --git a/chrome/common/extensions/api/resources_private.idl b/chrome/common/extensions/api/resources_private.idl index 7705288..836b366d 100644 --- a/chrome/common/extensions/api/resources_private.idl +++ b/chrome/common/extensions/api/resources_private.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // resourcesPrivate. -[use_movable_types=true]namespace resourcesPrivate { +namespace resourcesPrivate { enum Component { identity, pdf }; callback GetStringsCallback = void (object result);
diff --git a/chrome/common/extensions/api/screenlock_private.idl b/chrome/common/extensions/api/screenlock_private.idl index 565f1fb..9af2160 100644 --- a/chrome/common/extensions/api/screenlock_private.idl +++ b/chrome/common/extensions/api/screenlock_private.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Control and monitor the screen locker. -[permissions=screenlockPrivate, nodoc, use_movable_types=true] +[permissions=screenlockPrivate, nodoc] namespace screenlockPrivate { // Supported authentication types shown on the user pod. // |offlinePassword|: The standard password field, which authenticates using
diff --git a/chrome/common/extensions/api/sessions.json b/chrome/common/extensions/api/sessions.json index 35d8596..1776796 100644 --- a/chrome/common/extensions/api/sessions.json +++ b/chrome/common/extensions/api/sessions.json
@@ -6,7 +6,6 @@ { "namespace": "sessions", "description": "Use the <code>chrome.sessions</code> API to query and restore tabs and windows from a browsing session.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "Filter",
diff --git a/chrome/common/extensions/api/settings_private.idl b/chrome/common/extensions/api/settings_private.idl index c8f4367..815cf61 100644 --- a/chrome/common/extensions/api/settings_private.idl +++ b/chrome/common/extensions/api/settings_private.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.settingsPrivate</code> API to get or set preferences // from the settings UI. -[use_movable_types=true] namespace settingsPrivate { +namespace settingsPrivate { // Type of a pref. enum PrefType { BOOLEAN, NUMBER, STRING, URL, LIST, DICTIONARY };
diff --git a/chrome/common/extensions/api/signed_in_devices.idl b/chrome/common/extensions/api/signed_in_devices.idl index 1bab998f..dd3be4c 100644 --- a/chrome/common/extensions/api/signed_in_devices.idl +++ b/chrome/common/extensions/api/signed_in_devices.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.signedInDevices</code> API to get a list of devices // signed into chrome with the same account as the current profile. -[use_movable_types=true] namespace signedInDevices { +namespace signedInDevices { enum OS { win, mac,
diff --git a/chrome/common/extensions/api/streams_private.idl b/chrome/common/extensions/api/streams_private.idl index 72764c26..ed24130 100644 --- a/chrome/common/extensions/api/streams_private.idl +++ b/chrome/common/extensions/api/streams_private.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Streams Private API. -[use_movable_types=true] namespace streamsPrivate { +namespace streamsPrivate { dictionary StreamInfo { // The MIME type of the intercepted URL request. DOMString mimeType;
diff --git a/chrome/common/extensions/api/sync_file_system.idl b/chrome/common/extensions/api/sync_file_system.idl index 27e0257..71162566 100644 --- a/chrome/common/extensions/api/sync_file_system.idl +++ b/chrome/common/extensions/api/sync_file_system.idl
@@ -8,7 +8,7 @@ // caching usage so that the same data can be available across different // clients. Read <a href="app_storage.html">Manage Data</a> for more on using // this API. -[use_movable_types=true] namespace syncFileSystem { +namespace syncFileSystem { enum SyncAction { added, updated, deleted };
diff --git a/chrome/common/extensions/api/system_indicator.idl b/chrome/common/extensions/api/system_indicator.idl index e7743466..c24f814 100644 --- a/chrome/common/extensions/api/system_indicator.idl +++ b/chrome/common/extensions/api/system_indicator.idl
@@ -6,7 +6,7 @@ // menubar, system tray, or other visible area provided by the OS. // This is modelled after the other extension action APIs, such as // chrome.browserAction and chrome.pageAction. -[use_movable_types=true] namespace systemIndicator { +namespace systemIndicator { dictionary SetIconDetails { any? path; any? imageData;
diff --git a/chrome/common/extensions/api/system_private.json b/chrome/common/extensions/api/system_private.json index 625fc31ec..4f00e07 100644 --- a/chrome/common/extensions/api/system_private.json +++ b/chrome/common/extensions/api/system_private.json
@@ -6,7 +6,6 @@ { "namespace": "systemPrivate", "description": "none", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "UpdateStatusState",
diff --git a/chrome/common/extensions/api/tab_capture.idl b/chrome/common/extensions/api/tab_capture.idl index fb3eaf5..01df3c82c 100644 --- a/chrome/common/extensions/api/tab_capture.idl +++ b/chrome/common/extensions/api/tab_capture.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.tabCapture</code> API to interact with tab media // streams. -[use_movable_types=true] namespace tabCapture { +namespace tabCapture { enum TabCaptureState { pending,
diff --git a/chrome/common/extensions/api/tabs.json b/chrome/common/extensions/api/tabs.json index 6d83625..3608889 100644 --- a/chrome/common/extensions/api/tabs.json +++ b/chrome/common/extensions/api/tabs.json
@@ -6,7 +6,6 @@ { "namespace": "tabs", "description": "Use the <code>chrome.tabs</code> API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "MutedInfoReason", "type": "string",
diff --git a/chrome/common/extensions/api/terminal_private.json b/chrome/common/extensions/api/terminal_private.json index 458f808..46c4e94b 100644 --- a/chrome/common/extensions/api/terminal_private.json +++ b/chrome/common/extensions/api/terminal_private.json
@@ -6,8 +6,7 @@ { "namespace": "terminalPrivate", "compiler_options": { - "implemented_in": "chrome/browser/extensions/api/terminal/terminal_private_api.h", - "use_movable_types": true + "implemented_in": "chrome/browser/extensions/api/terminal/terminal_private_api.h" }, "description": "none", "types": [
diff --git a/chrome/common/extensions/api/top_sites.json b/chrome/common/extensions/api/top_sites.json index b6abec4..3a8ece8 100644 --- a/chrome/common/extensions/api/top_sites.json +++ b/chrome/common/extensions/api/top_sites.json
@@ -6,7 +6,6 @@ { "namespace": "topSites", "description": "Use the <code>chrome.topSites</code> API to access the top sites that are displayed on the new tab page.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "MostVisitedURL",
diff --git a/chrome/common/extensions/api/tts.json b/chrome/common/extensions/api/tts.json index d4e4553..8bc8a08 100644 --- a/chrome/common/extensions/api/tts.json +++ b/chrome/common/extensions/api/tts.json
@@ -6,7 +6,6 @@ { "namespace": "tts", "description": "Use the <code>chrome.tts</code> API to play synthesized text-to-speech (TTS). See also the related <a href='http://developer.chrome.com/extensions/ttsEngine'>ttsEngine</a> API, which allows an extension to implement a speech engine.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "TtsEvent",
diff --git a/chrome/common/extensions/api/tts_engine.json b/chrome/common/extensions/api/tts_engine.json index 57a8048..7f0e24e 100644 --- a/chrome/common/extensions/api/tts_engine.json +++ b/chrome/common/extensions/api/tts_engine.json
@@ -6,7 +6,6 @@ { "namespace": "ttsEngine", "description": "Use the <code>chrome.ttsEngine</code> API to implement a text-to-speech(TTS) engine using an extension. If your extension registers using this API, it will receive events containing an utterance to be spoken and other parameters when any extension or Chrome App uses the <a href='tts'>tts</a> API to generate speech. Your extension can then use any available web technology to synthesize and output the speech, and send events back to the calling function to report the status.", - "compiler_options": {"use_movable_types": true}, "functions": [ { "name": "sendTtsEvent",
diff --git a/chrome/common/extensions/api/types.json b/chrome/common/extensions/api/types.json index f4930ce..cc59b8e 100644 --- a/chrome/common/extensions/api/types.json +++ b/chrome/common/extensions/api/types.json
@@ -6,7 +6,6 @@ { "namespace": "types", "description": "The <code>chrome.types</code> API contains type declarations for Chrome.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "ChromeSettingScope",
diff --git a/chrome/common/extensions/api/types_private.json b/chrome/common/extensions/api/types_private.json index faa3849..19c7f1c 100644 --- a/chrome/common/extensions/api/types_private.json +++ b/chrome/common/extensions/api/types_private.json
@@ -6,7 +6,6 @@ { "namespace": "types.private", "description": "The <code>chrome.types.private</code> API contains private type declarations for Chrome.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "ChromeDirectSetting",
diff --git a/chrome/common/extensions/api/users_private.idl b/chrome/common/extensions/api/users_private.idl index 86cf97e..ac47873 100644 --- a/chrome/common/extensions/api/users_private.idl +++ b/chrome/common/extensions/api/users_private.idl
@@ -4,8 +4,7 @@ // Use the <code>chrome.usersPrivate</code> API to manage users. [platforms=("chromeos"), - implemented_in="chrome/browser/chromeos/extensions/users_private/users_private_api.h", - use_movable_types=true] + implemented_in="chrome/browser/chromeos/extensions/users_private/users_private_api.h"] namespace usersPrivate { dictionary User {
diff --git a/chrome/common/extensions/api/wallpaper.json b/chrome/common/extensions/api/wallpaper.json index 971cb0d0..a4263d3 100644 --- a/chrome/common/extensions/api/wallpaper.json +++ b/chrome/common/extensions/api/wallpaper.json
@@ -6,8 +6,7 @@ { "namespace":"wallpaper", "compiler_options": { - "implemented_in": "chrome/browser/chromeos/extensions/wallpaper_api.h", - "use_movable_types": true + "implemented_in": "chrome/browser/chromeos/extensions/wallpaper_api.h" }, "description": "Use the <code>chrome.wallpaper</code> API to change the ChromeOS wallpaper.", "types":
diff --git a/chrome/common/extensions/api/wallpaper_private.json b/chrome/common/extensions/api/wallpaper_private.json index 3684d64..5e8c27a 100644 --- a/chrome/common/extensions/api/wallpaper_private.json +++ b/chrome/common/extensions/api/wallpaper_private.json
@@ -6,8 +6,7 @@ { "namespace":"wallpaperPrivate", "compiler_options": { - "implemented_in": "chrome/browser/chromeos/extensions/wallpaper_private_api.h", - "use_movable_types": true + "implemented_in": "chrome/browser/chromeos/extensions/wallpaper_private_api.h" }, "description": "none", "types": [
diff --git a/chrome/common/extensions/api/web_navigation.json b/chrome/common/extensions/api/web_navigation.json index 449e931d..6d18dd581 100644 --- a/chrome/common/extensions/api/web_navigation.json +++ b/chrome/common/extensions/api/web_navigation.json
@@ -6,7 +6,6 @@ { "namespace": "webNavigation", "description": "Use the <code>chrome.webNavigation</code> API to receive notifications about the status of navigation requests in-flight.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "TransitionType",
diff --git a/chrome/common/extensions/api/webrtc_audio_private.idl b/chrome/common/extensions/api/webrtc_audio_private.idl index d29e258..32afbd4 100644 --- a/chrome/common/extensions/api/webrtc_audio_private.idl +++ b/chrome/common/extensions/api/webrtc_audio_private.idl
@@ -14,7 +14,7 @@ // // See http://goo.gl/8rOmgk for further documentation of this API. -[use_movable_types=true] namespace webrtcAudioPrivate { +namespace webrtcAudioPrivate { dictionary SinkInfo { // The opaque identifier of the audio sink device, which is unique
diff --git a/chrome/common/extensions/api/webrtc_desktop_capture_private.idl b/chrome/common/extensions/api/webrtc_desktop_capture_private.idl index 3861551..d71f518b 100644 --- a/chrome/common/extensions/api/webrtc_desktop_capture_private.idl +++ b/chrome/common/extensions/api/webrtc_desktop_capture_private.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.webrtcDesktopCapturePrivate</code> API to capture // desktop media requested from a WebView. -[use_movable_types=true] namespace webrtcDesktopCapturePrivate { +namespace webrtcDesktopCapturePrivate { dictionary RequestInfo { // The guest process id for the requester. long guestProcessId;
diff --git a/chrome/common/extensions/api/webrtc_logging_private.idl b/chrome/common/extensions/api/webrtc_logging_private.idl index 8a76f20..0f900f9 100644 --- a/chrome/common/extensions/api/webrtc_logging_private.idl +++ b/chrome/common/extensions/api/webrtc_logging_private.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.webrtcLoggingPrivate</code> API to control diagnostic // WebRTC logging. -[use_movable_types=true] namespace webrtcLoggingPrivate { +namespace webrtcLoggingPrivate { dictionary MetaDataEntry { // The meta data entry key. DOMString key;
diff --git a/chrome/common/extensions/api/webstore.json b/chrome/common/extensions/api/webstore.json index 915f97bb..df5dde78 100644 --- a/chrome/common/extensions/api/webstore.json +++ b/chrome/common/extensions/api/webstore.json
@@ -6,7 +6,6 @@ { "namespace": "webstore", "description": "Use the <code>chrome.webstore</code> API to initiate app and extension installations \"inline\" from your site.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "InstallStage",
diff --git a/chrome/common/extensions/api/webstore_private.json b/chrome/common/extensions/api/webstore_private.json index d36d8d36..65e4b10 100644 --- a/chrome/common/extensions/api/webstore_private.json +++ b/chrome/common/extensions/api/webstore_private.json
@@ -6,7 +6,6 @@ { "namespace":"webstorePrivate", "description": "none", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "Result",
diff --git a/chrome/common/extensions/api/webstore_widget_private.idl b/chrome/common/extensions/api/webstore_widget_private.idl index b2e12e13..362f37c5 100644 --- a/chrome/common/extensions/api/webstore_widget_private.idl +++ b/chrome/common/extensions/api/webstore_widget_private.idl
@@ -4,7 +4,7 @@ // webstoreWidgetPrivate API. // This is a private API used by the Chrome Webstore widget app on Chrome OS. -[platforms=("chromeos"), use_movable_types=true] +[platforms=("chromeos")] namespace webstoreWidgetPrivate { // The type of apps that should be shown in the Webstore widget. enum Type {
diff --git a/chrome/common/extensions/api/webview_tag.json b/chrome/common/extensions/api/webview_tag.json index 1117822..0263954 100644 --- a/chrome/common/extensions/api/webview_tag.json +++ b/chrome/common/extensions/api/webview_tag.json
@@ -6,7 +6,6 @@ { "namespace": "webviewTag", "description": "Use the <code>webview</code> tag to actively load live content from the web over the network and embed it in your Chrome App. Your app can control the appearance of the <code>webview</code> and interact with the web content, initiate navigations in an embedded web page, react to error events that happen within it, and more (see <a href=\"#usage\">Usage</a>).", - "compiler_options": {"use_movable_types": true}, "documentation_options": { "title": "<webview> Tag", "namespace": "<webview>",
diff --git a/chrome/common/extensions/api/windows.json b/chrome/common/extensions/api/windows.json index f6868d6..3a3a592 100644 --- a/chrome/common/extensions/api/windows.json +++ b/chrome/common/extensions/api/windows.json
@@ -7,8 +7,7 @@ "namespace": "windows", "description": "Use the <code>chrome.windows</code> API to interact with browser windows. You can use this API to create, modify, and rearrange windows in the browser.", "compiler_options": { - "implemented_in": "chrome/browser/extensions/api/tabs/tabs_api.h", - "use_movable_types": true + "implemented_in": "chrome/browser/extensions/api/tabs/tabs_api.h" }, "types": [ {
diff --git a/chrome/common/extensions/docs/templates/intros/commands.html b/chrome/common/extensions/docs/templates/intros/commands.html index 8aebec77..f48d5fc 100644 --- a/chrome/common/extensions/docs/templates/intros/commands.html +++ b/chrome/common/extensions/docs/templates/intros/commands.html
@@ -78,7 +78,7 @@ code. </p> -<h2 id="usage">Scope</h2> +<h2 id="scope">Scope</h2> <p>By default, Commands are scoped to the Chrome browser, which means that while the browser does not have focus, the shortcut will be inactive. On desktop Chrome, Commands can instead have global scope, as of version 35, and will then
diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index a0b2e9c..5702c508 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc
@@ -39,6 +39,7 @@ #include "base/environment.h" #include "base/files/file_path.h" #include "base/files/file_util.h" +#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h"
diff --git a/chrome/common/safe_browsing/binary_feature_extractor_unittest.cc b/chrome/common/safe_browsing/binary_feature_extractor_unittest.cc index 83dd259..ca30758 100644 --- a/chrome/common/safe_browsing/binary_feature_extractor_unittest.cc +++ b/chrome/common/safe_browsing/binary_feature_extractor_unittest.cc
@@ -10,6 +10,7 @@ #include "base/base_paths.h" #include "base/files/file.h" #include "base/files/scoped_temp_dir.h" +#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "chrome/common/safe_browsing/csd.pb.h" #include "crypto/sha2.h"
diff --git a/chrome/common/safe_browsing/binary_feature_extractor_win.cc b/chrome/common/safe_browsing/binary_feature_extractor_win.cc index c213a6d..a504631 100644 --- a/chrome/common/safe_browsing/binary_feature_extractor_win.cc +++ b/chrome/common/safe_browsing/binary_feature_extractor_win.cc
@@ -15,8 +15,6 @@ #include "chrome/common/safe_browsing/csd.pb.h" #include "chrome/common/safe_browsing/pe_image_reader_win.h" -#pragma comment(lib, "wintrust.lib") - namespace safe_browsing { namespace {
diff --git a/chrome/common/trace_event_args_whitelist.cc b/chrome/common/trace_event_args_whitelist.cc index 21d76c7..0bffd04 100644 --- a/chrome/common/trace_event_args_whitelist.cc +++ b/chrome/common/trace_event_args_whitelist.cc
@@ -27,6 +27,7 @@ {nullptr, nullptr, nullptr}}; const char* kMetadataWhitelist[] = { + "clock-domain", "command_line", "config", "cpu-*",
diff --git a/chrome/common/variations/variations_util_unittest.cc b/chrome/common/variations/variations_util_unittest.cc index 21eba93..d3fc97257 100644 --- a/chrome/common/variations/variations_util_unittest.cc +++ b/chrome/common/variations/variations_util_unittest.cc
@@ -8,6 +8,7 @@ #include "base/feature_list.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/metrics/field_trial.h" #include "chrome/common/variations/fieldtrial_testing_config.h" #include "components/variations/variations_associated_data.h"
diff --git a/chrome/installer/linux/common/wrapper b/chrome/installer/linux/common/wrapper index b4537e8..0adf9887 100755 --- a/chrome/installer/linux/common/wrapper +++ b/chrome/installer/linux/common/wrapper
@@ -58,15 +58,6 @@ # We don't want bug-buddy intercepting our crashes. http://crbug.com/24120 export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME -# Automagically migrate user data directory. -# TODO(phajdan.jr): Remove along with migration code in the browser for M33. -if [[ -n "@@SXS_USER_DATA_DIR@@" ]]; then - if [[ ! -d "@@SXS_USER_DATA_DIR@@" ]]; then - "$HERE/@@PROGNAME@@" "--migrate-data-dir-for-sxs=@@SXS_USER_DATA_DIR@@" \ - --enable-logging=stderr --log-level=0 - fi -fi - # Sanitize std{in,out,err} because they'll be shared with untrusted child # processes (http://crbug.com/376567). exec < /dev/null
diff --git a/chrome/installer/util/BUILD.gn b/chrome/installer/util/BUILD.gn index 13ca030..b78e1ede 100644 --- a/chrome/installer/util/BUILD.gn +++ b/chrome/installer/util/BUILD.gn
@@ -121,6 +121,12 @@ "//third_party/lzma_sdk", ] + libs = [ + "urlmon.lib", + "wbemuuid.lib", + "wtsapi32.lib", + ] + configs += [ "//build/config:precompiled_headers",
diff --git a/chrome/installer/util/html_dialog_impl.cc b/chrome/installer/util/html_dialog_impl.cc index 7376359..3798cf1 100644 --- a/chrome/installer/util/html_dialog_impl.cc +++ b/chrome/installer/util/html_dialog_impl.cc
@@ -9,8 +9,6 @@ #include "base/win/scoped_variant.h" #include "chrome/installer/util/html_dialog.h" -#pragma comment(lib, "urlmon.lib") - namespace installer { // Windows implementation of the HTML dialog class. The main danger with
diff --git a/chrome/renderer/autofill/password_generation_agent_browsertest.cc b/chrome/renderer/autofill/password_generation_agent_browsertest.cc index 1b92b5a..cdcdeb9b 100644 --- a/chrome/renderer/autofill/password_generation_agent_browsertest.cc +++ b/chrome/renderer/autofill/password_generation_agent_browsertest.cc
@@ -92,14 +92,21 @@ const char kAccountCreationFormHTML[] = "<FORM name = 'blah' action = 'http://www.random.com/'> " " <INPUT type = 'text' id = 'username'/> " - " <INPUT type = 'password' id = 'first_password' " - " autocomplete = 'off' size = 5/>" + " <INPUT type = 'password' id = 'first_password' size = 5/>" " <INPUT type = 'password' id = 'second_password' size = 5/> " " <INPUT type = 'text' id = 'address'/> " " <INPUT type = 'button' id = 'dummy'/> " " <INPUT type = 'submit' value = 'LOGIN' />" "</FORM>"; +const char kAccountCreationNoForm[] = + "<INPUT type = 'text' id = 'username'/> " + "<INPUT type = 'password' id = 'first_password' size = 5/>" + "<INPUT type = 'password' id = 'second_password' size = 5/> " + "<INPUT type = 'text' id = 'address'/> " + "<INPUT type = 'button' id = 'dummy'/> " + "<INPUT type = 'submit' value = 'LOGIN' />"; + const char kDisabledElementAccountCreationFormHTML[] = "<FORM name = 'blah' action = 'http://www.random.com/'> " " <INPUT type = 'text' id = 'username'/> " @@ -575,11 +582,18 @@ ExpectGenerationAvailable("newpassword", true); } -TEST_F(PasswordGenerationAgentTest, ManualGenerationTest) { +TEST_F(PasswordGenerationAgentTest, ManualGenerationInFormTest) { LoadHTMLWithUserGesture(kAccountCreationFormHTML); ShowGenerationPopUpManually("first_password"); ExpectGenerationAvailable("first_password", true); ExpectGenerationAvailable("second_password", false); } +TEST_F(PasswordGenerationAgentTest, ManualGenerationNoFormTest) { + LoadHTMLWithUserGesture(kAccountCreationNoForm); + ShowGenerationPopUpManually("first_password"); + ExpectGenerationAvailable("first_password", true); + ExpectGenerationAvailable("second_password", false); +} + } // namespace autofill
diff --git a/chrome/renderer/extensions/cast_streaming_native_handler.h b/chrome/renderer/extensions/cast_streaming_native_handler.h index 407f02e..4e40fa6 100644 --- a/chrome/renderer/extensions/cast_streaming_native_handler.h +++ b/chrome/renderer/extensions/cast_streaming_native_handler.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/memory/linked_ptr.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "extensions/renderer/object_backed_native_handler.h" #include "v8/include/v8.h"
diff --git a/chrome/test/chromedriver/chrome/log.cc b/chrome/test/chromedriver/chrome/log.cc index c564acb..d2fb952 100644 --- a/chrome/test/chromedriver/chrome/log.cc +++ b/chrome/test/chromedriver/chrome/log.cc
@@ -5,10 +5,12 @@ #include "chrome/test/chromedriver/chrome/log.h" #include <stddef.h> + #include <utility> #include "base/json/json_reader.h" #include "base/json/json_writer.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/string_util.h" #include "base/values.h" #include "build/build_config.h"
diff --git a/chrome/test/data/extensions/api_test/window_open/panel_browsing_instance/background.js b/chrome/test/data/extensions/api_test/window_open/panel_browsing_instance/background.js index f32f4f86..aacc56c 100644 --- a/chrome/test/data/extensions/api_test/window_open/panel_browsing_instance/background.js +++ b/chrome/test/data/extensions/api_test/window_open/panel_browsing_instance/background.js
@@ -7,6 +7,7 @@ chrome.test.log('executing background.js ...'); var oldNumberOfTabs; +var expectedWindowType; chrome.test.runTests([ function testPanelBrowsingInstance() { chrome.test.log('counting all the tabs (before window.open) ...'); @@ -23,6 +24,8 @@ // attempting navigation is neither same-origin with the target, nor is // it the target's parent or opener. chrome.test.getConfig(function(config) { + expectedWindowType = config.customArg; + var baseUri = 'http://foo.com:' + config.testServer.port + '/extensions/api_test/window_open/panel_browsing_instance/'; @@ -47,7 +50,7 @@ chrome.windows.create( { 'url': chrome.extension.getURL('panel.html'), 'type': 'panel' }, function(win) { - chrome.test.assertEq('panel', win.type); + chrome.test.assertEq(expectedWindowType, win.type); }); // panel.js will navigate panel-subframe and then panel-subframe.js will @@ -60,7 +63,17 @@ var newNumberOfTabs = tabs.length; chrome.test.log('newNumberOfTabs = ' + newNumberOfTabs); - chrome.test.assertEq(newNumberOfTabs, oldNumberOfTabs); + switch (expectedWindowType) { + case 'panel': + chrome.test.assertEq(newNumberOfTabs, oldNumberOfTabs); + break; + case 'popup': + chrome.test.assertEq(newNumberOfTabs, oldNumberOfTabs + 1); + break; + default: + // Unexpected expected window type. + chrome.test.fail(); + } chrome.test.notifyPass(); }); }
diff --git a/chrome/test/data/policy/policy_test_cases.json b/chrome/test/data/policy/policy_test_cases.json index bfa7c58..9ad87ff6 100644 --- a/chrome/test/data/policy/policy_test_cases.json +++ b/chrome/test/data/policy/policy_test_cases.json
@@ -334,11 +334,7 @@ }, "PasswordManagerAllowShowPasswords": { - "os": ["win", "linux", "mac", "chromeos"], - "test_policy": { "PasswordManagerAllowShowPasswords": false }, - "pref_mappings": [ - { "pref": "profile.password_manager_allow_show_passwords" } - ] + "note": "This policy is retired, see http://crbug.com/598698." }, "ContextualSearchEnabled": {
diff --git a/chrome/test/data/push_messaging/push_test.js b/chrome/test/data/push_messaging/push_test.js index 2b27e91..cc817ee 100644 --- a/chrome/test/data/push_messaging/push_test.js +++ b/chrome/test/data/push_messaging/push_test.js
@@ -129,8 +129,8 @@ function documentSubscribePushBadKey() { navigator.serviceWorker.ready.then(function(swRegistration) { - var invalidApplicationServerKey = Uint8Array.from(kApplicationServerKey); - invalidApplicationServerKey[0] = 0x05; + var invalidApplicationServerKey = new Uint8Array(300); + invalidApplicationServerKey.fill('0x05', 1, 300); pushSubscriptionOptions.applicationServerKey = invalidApplicationServerKey.buffer; return swRegistration.pushManager.subscribe(pushSubscriptionOptions)
diff --git a/chrome/test/data/webui/test_api.js b/chrome/test/data/webui/test_api.js index 62aea22e..41c2f597 100644 --- a/chrome/test/data/webui/test_api.js +++ b/chrome/test/data/webui/test_api.js
@@ -56,13 +56,29 @@ var noAnimationStyle = document.createElement('style'); noAnimationStyle.id = 'no-animation'; noAnimationStyle.textContent = - '* {' + + '*, * /deep/ * {' + ' -webkit-transition-duration: 0ms !important;' + ' -webkit-transition-delay: 0ms !important;' + ' -webkit-animation-duration: 0ms !important;' + ' -webkit-animation-delay: 0ms !important;' + '}'; document.querySelector('head').appendChild(noAnimationStyle); + + var realElementAnimate = Element.prototype.animate; + Element.prototype.animate = function(keyframes, opt_options) { + if (typeof opt_options == 'object') + opt_options.duration = 0; + else + opt_options = 0; + return realElementAnimate.call(this, keyframes, opt_options); + }; + if (document.timeline && document.timeline.play) { + var realTimelinePlay = document.timeline.play; + document.timeline.play = function(a) { + a.timing.duration = 0; + return realTimelinePlay.call(document.timeline, a); + }; + } }; Test.prototype = {
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc index 7d54f4ee..85cbd63 100644 --- a/chrome/utility/chrome_content_utility_client.cc +++ b/chrome/utility/chrome_content_utility_client.cc
@@ -44,7 +44,6 @@ #endif #if defined(OS_WIN) -#include "chrome/utility/font_cache_handler_win.h" #include "chrome/utility/shell_handler_win.h" #endif @@ -132,7 +131,6 @@ #if defined(OS_WIN) handlers_.push_back(new ShellHandler()); - handlers_.push_back(new FontCacheHandler()); #endif handlers_.push_back(new SafeJsonParserHandler());
diff --git a/chrome/utility/font_cache_handler_win.cc b/chrome/utility/font_cache_handler_win.cc deleted file mode 100644 index cf850c07..0000000 --- a/chrome/utility/font_cache_handler_win.cc +++ /dev/null
@@ -1,56 +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. - -#include "chrome/utility/font_cache_handler_win.h" - -#include "base/task_runner_util.h" -#include "base/threading/thread.h" -#include "chrome/common/chrome_utility_messages.h" -#include "content/public/common/dwrite_font_platform_win.h" -#include "content/public/utility/utility_thread.h" - -FontCacheHandler::FontCacheHandler() { -} - -FontCacheHandler::~FontCacheHandler() { -} - -bool FontCacheHandler::OnMessageReceived(const IPC::Message& message) { - bool handled = true; - IPC_BEGIN_MESSAGE_MAP(FontCacheHandler, message) - IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_BuildDirectWriteFontCache, - OnBuildFontCache) - IPC_MESSAGE_UNHANDLED(handled = false) - IPC_END_MESSAGE_MAP() - return handled; -} - -void FontCacheHandler::OnBuildFontCache(const base::FilePath& full_path) { - DCHECK(!cache_thread_); - - utility_task_runner_ = base::MessageLoop::current()->task_runner(); - - // Create worker thread for building font cache. - cache_thread_.reset(new base::Thread("font_cache_thread")); - if (!cache_thread_->Start()) { - NOTREACHED(); - return; - } - cache_thread_->message_loop()->PostTask( - FROM_HERE, base::Bind(&FontCacheHandler::StartBuildingFontCache, - base::Unretained(this), - full_path)); -} - -void FontCacheHandler::StartBuildingFontCache(const base::FilePath& full_path) { - content::BuildFontCache(full_path); - utility_task_runner_->PostTask(FROM_HERE, - base::Bind(&FontCacheHandler::Cleanup, - base::Unretained(this))); -} - -void FontCacheHandler::Cleanup() { - cache_thread_.reset(); - content::UtilityThread::Get()->ReleaseProcessIfNeeded(); -}
diff --git a/chrome/utility/font_cache_handler_win.h b/chrome/utility/font_cache_handler_win.h deleted file mode 100644 index b3bb90ae..0000000 --- a/chrome/utility/font_cache_handler_win.h +++ /dev/null
@@ -1,46 +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. - -#ifndef CHROME_UTILITY_FONT_CACHE_HANDLER_WIN_H_ -#define CHROME_UTILITY_FONT_CACHE_HANDLER_WIN_H_ - -#include "base/files/file_path.h" -#include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" -#include "chrome/utility/utility_message_handler.h" - -namespace base { -class TaskRunner; -class Thread; -} - -// Handles requests to build a static direct write font cache. Must be invoked -// in a non-sandboxed utility process. We build static font cache in utility -// process as it is time consuming as well as crash prone thing. We already -// have fall back of loading fonts from system fonts directory in place, so even -// if we fail to build static cache in utility process, chrome will still -// continue to run as is. -class FontCacheHandler : public UtilityMessageHandler { - public: - FontCacheHandler(); - ~FontCacheHandler() override; - - // IPC::Listener implementation - bool OnMessageReceived(const IPC::Message& message) override; - - private: - void OnBuildFontCache(const base::FilePath& full_path); - void StartBuildingFontCache(const base::FilePath& full_path); - void Cleanup(); - - scoped_refptr<base::TaskRunner> utility_task_runner_; - - // Thread that caching process runs on, while FontCacheHandler handles - // messages from the browser process. - scoped_ptr<base::Thread> cache_thread_; - - DISALLOW_COPY_AND_ASSIGN(FontCacheHandler); -}; - -#endif // CHROME_UTILITY_FONT_CACHE_HANDLER_WIN_H_
diff --git a/chrome/utility/image_writer/image_writer_handler.h b/chrome/utility/image_writer/image_writer_handler.h index 54791f3..e8f7ee2 100644 --- a/chrome/utility/image_writer/image_writer_handler.h +++ b/chrome/utility/image_writer/image_writer_handler.h
@@ -9,6 +9,7 @@ #include <string> +#include "base/memory/scoped_ptr.h" #include "chrome/utility/image_writer/image_writer.h" #include "chrome/utility/utility_message_handler.h" #include "ipc/ipc_message.h"
diff --git a/chrome/version.gni b/chrome/version.gni index a29cb8d..2b53246 100644 --- a/chrome/version.gni +++ b/chrome/version.gni
@@ -95,10 +95,6 @@ args = [] - if (is_official_build) { - args += [ "--official" ] - } - if (defined(invoker.sources)) { inputs += invoker.sources foreach(i, invoker.sources) {
diff --git a/chromecast/BUILD.gn b/chromecast/BUILD.gn index 03385af..85da5f3 100644 --- a/chromecast/BUILD.gn +++ b/chromecast/BUILD.gn
@@ -116,6 +116,7 @@ filters += [ "cast_shell_browser_test --no-sandbox --enable-local-file-accesses --enable-cma-media-pipeline --ozone-platform=cast --test-launcher-jobs=1", "cast_media_unittests --test-launcher-jobs=1", + "ipc_tests --test-launcher-jobs=1", ] if (use_alsa) {
diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc index 26f520a..0c2dae8 100644 --- a/chromeos/chromeos_switches.cc +++ b/chromeos/chromeos_switches.cc
@@ -4,6 +4,8 @@ #include "chromeos/chromeos_switches.h" +#include <string> + #include "base/command_line.h" #include "base/metrics/field_trial.h" @@ -122,6 +124,9 @@ // Enables starting the ARC instance upon session start. const char kEnableArc[] = "enable-arc"; +// Enable ARC memory management in user space. +const char kEnableArcMemoryManagement[] = "enable-arc-memory-management"; + // Enables consumer management, which allows user to enroll, remotely lock and // locate the device. const char kEnableConsumerManagement[] = "enable-consumer-management";
diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h index 237b638..4b293fb 100644 --- a/chromeos/chromeos_switches.h +++ b/chromeos/chromeos_switches.h
@@ -60,6 +60,7 @@ CHROMEOS_EXPORT extern const char kEafeUrl[]; CHROMEOS_EXPORT extern const char kEafePath[]; CHROMEOS_EXPORT extern const char kEnableArc[]; +CHROMEOS_EXPORT extern const char kEnableArcMemoryManagement[]; CHROMEOS_EXPORT extern const char kEnableConsumerManagement[]; CHROMEOS_EXPORT extern const char kEnableExperimentalAccessibilityFeatures[]; CHROMEOS_EXPORT extern const char kEnableExtensionAssetsSharing[];
diff --git a/components/arc/common/notifications.mojom b/components/arc/common/notifications.mojom index 96e1657..068a084 100644 --- a/components/arc/common/notifications.mojom +++ b/components/arc/common/notifications.mojom
@@ -63,15 +63,33 @@ bool ongoing_event; }; +[MinVersion=2] +struct ArcToastData { + // Unique identifier + string id; + // Toast text. + string text; + // Toast duration in milliseconds. + int32 duration; +}; + interface NotificationsHost { // Tells the Chrome that a notification is posted (created or updated) on // Android. // |notification_data| is the data of notification (id, texts, icon and ...). - OnNotificationPosted(ArcNotificationData notification_data); + OnNotificationPosted@0(ArcNotificationData notification_data); // Notifies that a notification is removed on Android. // |key| is the identifier of the notification. - OnNotificationRemoved(string key); + OnNotificationRemoved@1(string key); + + [MinVersion=2] + // Shows a toast, or queues it if another toast is visible. + OnToastPosted@2(ArcToastData data); + + [MinVersion=2] + // Hides the visible toast immediately, or cancels the scheduled one. + OnToastCancelled@3(ArcToastData data); }; // TODO(lhchavez): Migrate all request/response messages to Mojo.
diff --git a/components/autofill/content/renderer/password_generation_agent.cc b/components/autofill/content/renderer/password_generation_agent.cc index c41310de..a1087843 100644 --- a/components/autofill/content/renderer/password_generation_agent.cc +++ b/components/autofill/content/renderer/password_generation_agent.cc
@@ -35,18 +35,12 @@ // Returns true if we think that this form is for account creation. |passwords| // is filled with the password field(s) in the form. bool GetAccountCreationPasswordFields( - const blink::WebFormElement& form, + const std::vector<blink::WebFormControlElement>& control_elements, std::vector<blink::WebInputElement>* passwords) { - // Grab all of the passwords for the form. - blink::WebVector<blink::WebFormControlElement> control_elements; - form.getFormControlElements(control_elements); - - size_t num_input_elements = 0; for (size_t i = 0; i < control_elements.size(); i++) { - blink::WebInputElement* input_element = + const blink::WebInputElement* input_element = toWebInputElement(&control_elements[i]); if (input_element && input_element->isTextField()) { - num_input_elements++; if (input_element->isPasswordField()) passwords->push_back(*input_element); } @@ -78,7 +72,9 @@ auto iter = std::find_if(all_password_elements.begin(), all_password_elements.end(), [&field_name](const blink::WebInputElement& input) { - return input.nameForAutofill() == field_name; + // Make explicit conversion before comparing with string16. + base::string16 input_name = input.nameForAutofill(); + return input_name == field_name; }); std::vector<blink::WebInputElement> passwords; @@ -221,7 +217,9 @@ continue; std::vector<blink::WebInputElement> passwords; - if (GetAccountCreationPasswordFields(forms[i], &passwords)) { + if (GetAccountCreationPasswordFields( + form_util::ExtractAutofillableElementsInForm(forms[i]), + &passwords)) { AccountCreationFormData ac_form_data( make_linked_ptr(password_form.release()), passwords); possible_account_creation_forms_.push_back(ac_form_data); @@ -477,17 +475,25 @@ return; blink::WebFormElement form = element->form(); - if (form.isNull()) - return; + scoped_ptr<PasswordForm> password_form; + std::vector<blink::WebFormControlElement> control_elements; + if (!form.isNull()) { + password_form = CreatePasswordFormFromWebForm(form, nullptr, nullptr); + control_elements = form_util::ExtractAutofillableElementsInForm(form); + } else { + const blink::WebFrame& frame = *render_frame()->GetWebFrame(); + password_form = + CreatePasswordFormFromUnownedInputElements(frame, nullptr, nullptr); + control_elements = + form_util::GetUnownedFormFieldElements(frame.document().all(), nullptr); + } - scoped_ptr<PasswordForm> password_form( - CreatePasswordFormFromWebForm(form, nullptr, nullptr)); if (!password_form) return; generation_element_ = *element; std::vector<blink::WebInputElement> password_elements; - GetAccountCreationPasswordFields(form, &password_elements); + GetAccountCreationPasswordFields(control_elements, &password_elements); password_elements = FindPasswordElementsForGeneration( password_elements, element->nameForAutofill()); generation_form_data_.reset(new AccountCreationFormData(
diff --git a/components/autofill/core/browser/webdata/autofill_table.h b/components/autofill/core/browser/webdata/autofill_table.h index f7cd14b..6bcf067 100644 --- a/components/autofill/core/browser/webdata/autofill_table.h +++ b/components/autofill/core/browser/webdata/autofill_table.h
@@ -11,6 +11,7 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/strings/string16.h" #include "components/webdata/common/web_database_table.h"
diff --git a/components/bookmarks/managed/managed_bookmarks_tracker.h b/components/bookmarks/managed/managed_bookmarks_tracker.h index 19036531..4586aa3 100644 --- a/components/bookmarks/managed/managed_bookmarks_tracker.h +++ b/components/bookmarks/managed/managed_bookmarks_tracker.h
@@ -10,6 +10,7 @@ #include "base/callback_forward.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "components/prefs/pref_change_registrar.h"
diff --git a/components/browsing_data_ui/history_notice_utils.cc b/components/browsing_data_ui/history_notice_utils.cc index 0abea5aa..c651520 100644 --- a/components/browsing_data_ui/history_notice_utils.cc +++ b/components/browsing_data_ui/history_notice_utils.cc
@@ -26,4 +26,12 @@ history_service->QueryWebAndAppActivity(callback); } +void ShouldPopupDialogAboutOtherFormsOfBrowsingHistory( + const ProfileSyncService* sync_service, + history::WebHistoryService* history_service, + base::Callback<void(bool)> callback) { + ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( + sync_service, history_service, callback); +} + } // namespace browsing_data_ui
diff --git a/components/browsing_data_ui/history_notice_utils.h b/components/browsing_data_ui/history_notice_utils.h index dabd09a..b6b68e9 100644 --- a/components/browsing_data_ui/history_notice_utils.h +++ b/components/browsing_data_ui/history_notice_utils.h
@@ -23,6 +23,15 @@ history::WebHistoryService* history_service, base::Callback<void(bool)> callback); +// Whether the Clear Browsing Data UI should popup a dialog with information +// about the existence of other forms of browsing history stored in user's +// account when the user deletes their browsing history for the first time. +// The response is returned in a |callback|. +void ShouldPopupDialogAboutOtherFormsOfBrowsingHistory( + const ProfileSyncService* sync_service, + history::WebHistoryService* history_service, + base::Callback<void(bool)> callback); + } // namespace browsing_data_ui #endif // COMPONENTS_BROWSING_DATA_UI_HISTORY_NOTICE_UTILS_H_
diff --git a/components/cloud_devices/common/cloud_device_description.h b/components/cloud_devices/common/cloud_device_description.h index c0b7eef..c415ad5 100644 --- a/components/cloud_devices/common/cloud_device_description.h +++ b/components/cloud_devices/common/cloud_device_description.h
@@ -9,6 +9,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" namespace base { class DictionaryValue;
diff --git a/components/crash.gypi b/components/crash.gypi index ddf0c15..08160b3 100644 --- a/components/crash.gypi +++ b/components/crash.gypi
@@ -298,6 +298,22 @@ '..', '../breakpad/src', ], + 'all_dependent_settings': { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'userenv.lib', + ], + }, + }, + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'userenv.lib', + ], + }, + }, }], ], }, @@ -373,6 +389,26 @@ 'msvs_target_platform': 'x64', }, }, + 'conditions': [ + ['OS=="win"', { + 'all_dependent_settings': { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'userenv.lib', + ], + }, + }, + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'userenv.lib', + ], + }, + }, + }], + ], }, { # GN version: //components/crash/content/tools:crash_service
diff --git a/components/crash/content/app/BUILD.gn b/components/crash/content/app/BUILD.gn index 9638bea9..7e8f1f6 100644 --- a/components/crash/content/app/BUILD.gn +++ b/components/crash/content/app/BUILD.gn
@@ -187,6 +187,7 @@ if (is_win) { deps += [ "//breakpad:breakpad_handler" ] + libs = [ "userenv.lib" ] } } }
diff --git a/components/crash/content/app/breakpad_win.cc b/components/crash/content/app/breakpad_win.cc index 9cb1c3b..760bf489 100644 --- a/components/crash/content/app/breakpad_win.cc +++ b/components/crash/content/app/breakpad_win.cc
@@ -43,9 +43,6 @@ #include "sandbox/win/src/nt_internals.h" #include "sandbox/win/src/sidestep/preamble_patcher.h" -// userenv.dll is required for GetProfileType(). -#pragma comment(lib, "userenv.lib") - #pragma intrinsic(_AddressOfReturnAddress) #pragma intrinsic(_ReturnAddress)
diff --git a/components/cronet/android/BUILD.gn b/components/cronet/android/BUILD.gn index 6faf6fe5..5925423 100644 --- a/components/cronet/android/BUILD.gn +++ b/components/cronet/android/BUILD.gn
@@ -528,6 +528,8 @@ "test/assets/test/redirect.html.mock-http-headers", "test/assets/test/redirect_invalid_scheme.html", "test/assets/test/redirect_invalid_scheme.html.mock-http-headers", + "test/assets/test/set_cookie.html", + "test/assets/test/set_cookie.html.mock-http-headers", "test/assets/test/sdch/dict/LeQxM80O", "test/assets/test/sdch/dict/LeQxM80O.mock-http-headers", "test/assets/test/sdch/index",
diff --git a/components/cronet/android/cronet_url_request_context_adapter.cc b/components/cronet/android/cronet_url_request_context_adapter.cc index 0150fdb..2b24566b 100644 --- a/components/cronet/android/cronet_url_request_context_adapter.cc +++ b/components/cronet/android/cronet_url_request_context_adapter.cc
@@ -38,12 +38,14 @@ #include "net/base/network_delegate_impl.h" #include "net/base/url_util.h" #include "net/cert/cert_verifier.h" +#include "net/cookies/cookie_monster.h" #include "net/http/http_auth_handler_factory.h" #include "net/http/http_server_properties_manager.h" #include "net/log/write_to_file_net_log_observer.h" #include "net/proxy/proxy_config_service_android.h" #include "net/proxy/proxy_service.h" #include "net/sdch/sdch_owner.h" +#include "net/ssl/channel_id_service.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_builder.h" #include "net/url_request/url_request_interceptor.h" @@ -246,12 +248,14 @@ bool OnCanGetCookies(const net::URLRequest& request, const net::CookieList& cookie_list) override { + // Disallow sending cookies by default. return false; } bool OnCanSetCookie(const net::URLRequest& request, const std::string& cookie_line, net::CookieOptions* options) override { + // Disallow saving cookies by default. return false; } @@ -478,10 +482,11 @@ // of HPKP by specifying transport_security_persister_path in the future. context_builder.set_transport_security_persister_path(base::FilePath()); + // Disable net::CookieStore and net::ChannelIDService. + context_builder.SetCookieAndChannelIdStores(nullptr, nullptr); + context_ = context_builder.Build(); - default_load_flags_ = net::LOAD_DO_NOT_SAVE_COOKIES | - net::LOAD_DO_NOT_SEND_COOKIES; if (config->load_disable_cache) default_load_flags_ |= net::LOAD_DISABLE_CACHE;
diff --git a/components/cronet/android/test/assets/test/set_cookie.html b/components/cronet/android/test/assets/test/set_cookie.html new file mode 100644 index 0000000..4effa19f4 --- /dev/null +++ b/components/cronet/android/test/assets/test/set_cookie.html
@@ -0,0 +1 @@ +hello!
diff --git a/components/cronet/android/test/assets/test/set_cookie.html.mock-http-headers b/components/cronet/android/test/assets/test/set_cookie.html.mock-http-headers new file mode 100644 index 0000000..cea4a16 --- /dev/null +++ b/components/cronet/android/test/assets/test/set_cookie.html.mock-http-headers
@@ -0,0 +1,2 @@ +HTTP/1.1 200 OK +Set-Cookie: A=B
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java index fbe1c39..cc2a0cd 100644 --- a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java +++ b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java
@@ -1724,6 +1724,26 @@ checkSpecificErrorCode(-2, UrlRequestException.ERROR_OTHER, "FAILED", false); } + /* + * Verifies no cookies are saved or sent by default. + */ + @SmallTest + @Feature({"Cronet"}) + public void testCookiesArentSavedOrSent() throws Exception { + // Make a request to a url that sets the cookie + String url = NativeTestServer.getFileURL("/set_cookie.html"); + TestUrlRequestCallback callback = startAndWaitForComplete(url); + assertEquals(200, callback.mResponseInfo.getHttpStatusCode()); + assertEquals("A=B", callback.mResponseInfo.getAllHeaders().get("Set-Cookie").get(0)); + + // Make a request that check that cookie header isn't sent. + String headerName = "Cookie"; + String url2 = NativeTestServer.getEchoHeaderURL(headerName); + TestUrlRequestCallback callback2 = startAndWaitForComplete(url2); + assertEquals(200, callback2.mResponseInfo.getHttpStatusCode()); + assertEquals("Header not found. :(", callback2.mResponseAsString); + } + private void checkSpecificErrorCode(int netError, int errorCode, String name, boolean immediatelyRetryable) throws Exception { TestUrlRequestCallback callback = startAndWaitForComplete(
diff --git a/components/data_reduction_proxy/core/browser/db_data_owner.h b/components/data_reduction_proxy/core/browser/db_data_owner.h index 1dd7055b..752f8ed 100644 --- a/components/data_reduction_proxy/core/browser/db_data_owner.h +++ b/components/data_reduction_proxy/core/browser/db_data_owner.h
@@ -8,6 +8,7 @@ #include <vector> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h"
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc index 8ce9ecc..4e94d36b 100644 --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc
@@ -26,6 +26,7 @@ const char kEnabled[] = "Enabled"; const char kControl[] = "Control"; +const char kDisabled[] = "Disabled"; const char kPreview[] = "Enabled_Preview"; const char kDefaultSpdyOrigin[] = "https://proxy.googlezip.net:443"; const char kDefaultQuicOrigin[] = "quic://proxy.googlezip.net:443"; @@ -63,13 +64,13 @@ namespace params { bool IsIncludedInPromoFieldTrial() { - return FieldTrialList::FindFullName( - "DataCompressionProxyPromoVisibility") == kEnabled; + return FieldTrialList::FindFullName("DataCompressionProxyPromoVisibility") + .find(kEnabled) == 0; } bool IsIncludedInHoldbackFieldTrial() { - return FieldTrialList::FindFullName( - "DataCompressionProxyHoldback") == kEnabled; + return FieldTrialList::FindFullName("DataCompressionProxyHoldback") + .find(kEnabled) == 0; } bool IsIncludedInAndroidOnePromoFieldTrial(const char* build_fingerprint) { @@ -184,9 +185,11 @@ } bool IsConfigClientEnabled() { - // TODO(tbansal): crbug.com/597768 Remove the data reduction proxy deprecated - // code which was used when config client is not enabled. - return true; + // Config client is enabled by default. It can be disabled only if Chromium + // belongs to a field trial group whose name starts with "Disabled". + return !base::StartsWith( + base::FieldTrialList::FindFullName("DataReductionProxyConfigService"), + kDisabled, base::CompareCase::SENSITIVE); } GURL GetConfigServiceURL() {
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc index cbc77cd..fb3be91 100644 --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc
@@ -229,6 +229,45 @@ "google/hammerhead/hammerhead:5.0/LRX210/1570415:user/release-keys")); } +TEST_F(DataReductionProxyParamsTest, IsClientConfigEnabled) { + const struct { + std::string test_case; + std::string trial_group_value; + bool expected; + } tests[] = { + { + "Nothing set", "", true, + }, + { + "Enabled in experiment", "Enabled", true, + }, + { + "Alternate enabled in experiment", "Enabled_Other", true, + }, + { + "Control in experiment", "Control", true, + }, + { + "Disabled in experiment", "Disabled", false, + }, + { + "Disabled in experiment", "Disabled_Other", false, + }, + { + "disabled in experiment lower case", "disabled", true, + }, + }; + + for (const auto& test : tests) { + base::FieldTrialList field_trial_list(nullptr); + if (!test.trial_group_value.empty()) { + ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( + "DataReductionProxyConfigService", test.trial_group_value)); + } + EXPECT_EQ(test.expected, params::IsConfigClientEnabled()) << test.test_case; + } +} + TEST_F(DataReductionProxyParamsTest, SecureProxyCheckDefault) { struct { bool command_line_set; @@ -268,9 +307,9 @@ } if (test_case.experiment_enabled) { - base::FieldTrialList::CreateFieldTrial( + ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( "DataReductionProxySecureProxyAfterCheck", - test_case.in_trial_group ? "Enabled" : "Disabled"); + test_case.in_trial_group ? "Enabled" : "Disabled")); } EXPECT_EQ(test_case.expected_use_by_default, @@ -373,6 +412,48 @@ } } +TEST_F(DataReductionProxyParamsTest, HoldbackEnabledFieldTrial) { + const struct { + std::string trial_group_name; + bool expected_enabled; + } tests[] = { + {"Enabled", true}, + {"Enabled_Control", true}, + {"Disabled", false}, + {"enabled", false}, + }; + + for (const auto& test : tests) { + base::FieldTrialList field_trial_list(nullptr); + + ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( + "DataCompressionProxyHoldback", test.trial_group_name)); + EXPECT_EQ(test.expected_enabled, params::IsIncludedInHoldbackFieldTrial()) + << test.trial_group_name; + } +} + +TEST_F(DataReductionProxyParamsTest, PromoFieldTrial) { + const struct { + std::string trial_group_name; + bool expected_enabled; + } tests[] = { + {"Enabled", true}, + {"Enabled_Control", true}, + {"Disabled", false}, + {"enabled", false}, + }; + + for (const auto& test : tests) { + base::FieldTrialList field_trial_list(nullptr); + + ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( + "DataCompressionProxyPromoVisibility", test.trial_group_name)); + EXPECT_EQ(test.expected_enabled, params::IsIncludedInPromoFieldTrial()) + << test.trial_group_name; + } +} + TEST_F(DataReductionProxyParamsTest, GetConfigServiceURL) { const struct { std::string test_case;
diff --git a/components/favicon/content/content_favicon_driver.cc b/components/favicon/content/content_favicon_driver.cc index 3ce6942..413517a 100644 --- a/components/favicon/content/content_favicon_driver.cc +++ b/components/favicon/content/content_favicon_driver.cc
@@ -171,7 +171,8 @@ bypass_cache_page_url_ = url; SetFaviconOutOfDateForPage( - url, reload_type == content::NavigationController::RELOAD_IGNORING_CACHE); + url, + reload_type == content::NavigationController::RELOAD_BYPASSING_CACHE); } void ContentFaviconDriver::DidNavigateMainFrame(
diff --git a/components/favicon/core/favicon_driver_impl.h b/components/favicon/core/favicon_driver_impl.h index 54e8d3ae..d3cd660 100644 --- a/components/favicon/core/favicon_driver_impl.h +++ b/components/favicon/core/favicon_driver_impl.h
@@ -8,6 +8,7 @@ #include <vector> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "components/favicon/core/favicon_driver.h" class GURL;
diff --git a/components/gcm_driver/crypto/gcm_encryption_provider.h b/components/gcm_driver/crypto/gcm_encryption_provider.h index 294dc6e..b07d42f1 100644 --- a/components/gcm_driver/crypto/gcm_encryption_provider.h +++ b/components/gcm_driver/crypto/gcm_encryption_provider.h
@@ -6,11 +6,13 @@ #define COMPONENTS_GCM_DRIVER_CRYPTO_GCM_ENCRYPTION_PROVIDER_H_ #include <stdint.h> + #include <string> #include "base/callback_forward.h" #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" namespace base {
diff --git a/components/gcm_driver/gcm_delayed_task_controller_unittest.cc b/components/gcm_driver/gcm_delayed_task_controller_unittest.cc index 28f5d6e..993ec30d 100644 --- a/components/gcm_driver/gcm_delayed_task_controller_unittest.cc +++ b/components/gcm_driver/gcm_delayed_task_controller_unittest.cc
@@ -5,6 +5,7 @@ #include "components/gcm_driver/gcm_delayed_task_controller.h" #include "base/bind.h" +#include "base/memory/scoped_ptr.h" #include "testing/gtest/include/gtest/gtest.h" namespace gcm {
diff --git a/components/guest_view/renderer/guest_view_request.h b/components/guest_view/renderer/guest_view_request.h index 2c50a44..054b253 100644 --- a/components/guest_view/renderer/guest_view_request.h +++ b/components/guest_view/renderer/guest_view_request.h
@@ -6,6 +6,7 @@ #define COMPONENTS_GUEST_VIEW_RENDERER_GUEST_VIEW_REQUEST_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "ipc/ipc_message.h" #include "v8/include/v8.h"
diff --git a/components/keyed_service/content/browser_context_dependency_manager.h b/components/keyed_service/content/browser_context_dependency_manager.h index 42173b2..6f0ecf1 100644 --- a/components/keyed_service/content/browser_context_dependency_manager.h +++ b/components/keyed_service/content/browser_context_dependency_manager.h
@@ -7,6 +7,7 @@ #include "base/callback_forward.h" #include "base/callback_list.h" +#include "base/memory/scoped_ptr.h" #include "components/keyed_service/core/dependency_manager.h" #include "components/keyed_service/core/keyed_service_export.h"
diff --git a/components/keyed_service/core/keyed_service_shutdown_notifier.h b/components/keyed_service/core/keyed_service_shutdown_notifier.h index 51f130d..5e5c395 100644 --- a/components/keyed_service/core/keyed_service_shutdown_notifier.h +++ b/components/keyed_service/core/keyed_service_shutdown_notifier.h
@@ -7,6 +7,7 @@ #include "base/callback_list.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "components/keyed_service/core/keyed_service.h" // This is a helper class for objects that depend on one or more keyed services,
diff --git a/components/metrics/profiler/tracking_synchronizer.h b/components/metrics/profiler/tracking_synchronizer.h index e7c51aa..511cf2b 100644 --- a/components/metrics/profiler/tracking_synchronizer.h +++ b/components/metrics/profiler/tracking_synchronizer.h
@@ -13,6 +13,7 @@ #include "base/lazy_instance.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" #include "base/time/tick_clock.h"
diff --git a/components/mus/BUILD.gn b/components/mus/BUILD.gn index f8e2972a..85fbd16 100644 --- a/components/mus/BUILD.gn +++ b/components/mus/BUILD.gn
@@ -6,6 +6,7 @@ import("//testing/test.gni") import("//mojo/public/mojo_application.gni") import("//mojo/public/mojo_application_manifest.gni") +import("//mojo/public/mojo_constants.gni") import("//tools/grit/repack.gni") if (is_android) { @@ -67,7 +68,7 @@ ] outputs = [ - "$root_out_dir/mus/{{source_file_part}}", + "$root_out_dir/$mojo_application_subdir/mus/{{source_file_part}}", ] } } @@ -120,7 +121,7 @@ sources = [ "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", ] - output = "$root_out_dir/mus/resources/mus_app_resources_strings.pak" + output = "$root_out_dir/$mojo_application_subdir/mus/resources/mus_app_resources_strings.pak" deps = [ "//ui/strings", ] @@ -130,7 +131,7 @@ sources = [ "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", ] - output = "$root_out_dir/mus/resources/mus_app_resources_100.pak" + output = "$root_out_dir/$mojo_application_subdir/mus/resources/mus_app_resources_100.pak" deps = [ "//ui/resources", ] @@ -140,7 +141,7 @@ sources = [ "$root_gen_dir/ui/resources/ui_resources_200_percent.pak", ] - output = "$root_out_dir/mus/resources/mus_app_resources_200.pak" + output = "$root_out_dir/$mojo_application_subdir/mus/resources/mus_app_resources_200.pak" deps = [ "//ui/resources", ]
diff --git a/components/mus/gles2/BUILD.gn b/components/mus/gles2/BUILD.gn index 8299e82..284fc43 100644 --- a/components/mus/gles2/BUILD.gn +++ b/components/mus/gles2/BUILD.gn
@@ -24,6 +24,8 @@ "command_buffer_local_client.h", "command_buffer_task_runner.cc", "command_buffer_task_runner.h", + "gl_surface_adapter.cc", + "gl_surface_adapter.h", "gpu_impl.cc", "gpu_impl.h", "gpu_memory_tracker.cc",
diff --git a/components/mus/gles2/OWNERS b/components/mus/gles2/OWNERS index c92691f..1f1af6b 100644 --- a/components/mus/gles2/OWNERS +++ b/components/mus/gles2/OWNERS
@@ -1 +1,2 @@ fsamuel@chromium.org +rjkroege@chromium.org
diff --git a/components/mus/gles2/command_buffer_driver.cc b/components/mus/gles2/command_buffer_driver.cc index 06639e60..9fba1fa2 100644 --- a/components/mus/gles2/command_buffer_driver.cc +++ b/components/mus/gles2/command_buffer_driver.cc
@@ -11,6 +11,7 @@ #include "base/memory/shared_memory.h" #include "base/thread_task_runner_handle.h" #include "build/build_config.h" +#include "components/mus/gles2/gl_surface_adapter.h" #include "components/mus/gles2/gpu_memory_tracker.h" #include "components/mus/gles2/gpu_state.h" #include "components/mus/gles2/mojo_buffer_backing.h" @@ -81,10 +82,17 @@ return false; const bool offscreen = widget_ == gfx::kNullAcceleratedWidget; + static scoped_refptr<gfx::GLSurface> underlying_surface; if (offscreen) { surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); } else { - surface_ = gfx::GLSurface::CreateViewGLSurface(widget_); + scoped_refptr<GLSurfaceAdapterMus> surface_adapter = + new GLSurfaceAdapterMus(gfx::GLSurface::CreateViewGLSurface(widget_)); + surface_adapter->SetGpuCompletedSwapBuffersCallback( + base::Bind(&CommandBufferDriver::OnGpuCompletedSwapBuffers, + weak_factory_.GetWeakPtr())); + surface_ = surface_adapter; + gfx::VSyncProvider* vsync_provider = surface_ ? surface_->GetVSyncProvider() : nullptr; if (vsync_provider) { @@ -496,4 +504,11 @@ callback.Run(); } +void CommandBufferDriver::OnGpuCompletedSwapBuffers(gfx::SwapResult result) { + DCHECK(CalledOnValidThread()); + if (client_) { + client_->OnGpuCompletedSwapBuffers(result); + } +} + } // namespace mus
diff --git a/components/mus/gles2/command_buffer_driver.h b/components/mus/gles2/command_buffer_driver.h index 390d5cc..e28a6e6 100644 --- a/components/mus/gles2/command_buffer_driver.h +++ b/components/mus/gles2/command_buffer_driver.h
@@ -21,6 +21,7 @@ #include "mojo/public/cpp/bindings/array.h" #include "mojo/public/cpp/system/buffer.h" #include "ui/gfx/native_widget_types.h" +#include "ui/gfx/swap_result.h" #include "ui/mojo/geometry/geometry.mojom.h" namespace gpu { @@ -51,6 +52,7 @@ virtual ~Client(); virtual void DidLoseContext(uint32_t reason) = 0; virtual void UpdateVSyncParameters(int64_t timebase, int64_t interval) = 0; + virtual void OnGpuCompletedSwapBuffers(gfx::SwapResult result) = 0; }; CommandBufferDriver(gpu::CommandBufferNamespace command_buffer_namespace, gpu::CommandBufferId command_buffer_id, @@ -58,7 +60,10 @@ scoped_refptr<GpuState> gpu_state); ~CommandBufferDriver(); - void set_client(scoped_ptr<Client> client) { client_ = std::move(client); } + // The class owning the CommandBufferDriver instance (e.g. CommandBufferLocal) + // is itself the Client implementation so CommandBufferDriver does not own the + // client. + void set_client(Client* client) { client_ = client; } bool Initialize(mojo::ScopedSharedBufferHandle shared_state, mojo::Array<int32_t> attribs); @@ -118,11 +123,12 @@ uint64_t release); void OnParseError(); void OnContextLost(uint32_t reason); + void OnGpuCompletedSwapBuffers(gfx::SwapResult result); const gpu::CommandBufferNamespace command_buffer_namespace_; const gpu::CommandBufferId command_buffer_id_; gfx::AcceleratedWidget widget_; - scoped_ptr<Client> client_; + Client* client_; // NOT OWNED. scoped_ptr<gpu::CommandBufferService> command_buffer_; scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; scoped_ptr<gpu::CommandExecutor> executor_;
diff --git a/components/mus/gles2/command_buffer_impl.cc b/components/mus/gles2/command_buffer_impl.cc index 13ce77c..20018b11 100644 --- a/components/mus/gles2/command_buffer_impl.cc +++ b/components/mus/gles2/command_buffer_impl.cc
@@ -32,23 +32,6 @@ } // namespace -class CommandBufferImpl::CommandBufferDriverClientImpl - : public CommandBufferDriver::Client { - public: - explicit CommandBufferDriverClientImpl(CommandBufferImpl* command_buffer) - : command_buffer_(command_buffer) {} - - private: - void DidLoseContext(uint32_t reason) override { - command_buffer_->DidLoseContext(reason); - } - void UpdateVSyncParameters(int64_t timebase, int64_t interval) override {} - - CommandBufferImpl* command_buffer_; - - DISALLOW_COPY_AND_ASSIGN(CommandBufferDriverClientImpl); -}; - CommandBufferImpl::CommandBufferImpl( mojo::InterfaceRequest<mus::mojom::CommandBuffer> request, scoped_refptr<GpuState> gpu_state) @@ -65,6 +48,11 @@ client_->Destroyed(reason, gpu::error::kLostContext); } +void CommandBufferImpl::UpdateVSyncParameters(int64_t timebase, + int64_t interval) {} + +void CommandBufferImpl::OnGpuCompletedSwapBuffers(gfx::SwapResult result) {} + CommandBufferImpl::~CommandBufferImpl() { } @@ -192,7 +180,7 @@ gpu::CommandBufferNamespace::MOJO, gpu::CommandBufferId::FromUnsafeValue(++g_next_command_buffer_id), gfx::kNullAcceleratedWidget, gpu_state_)); - driver_->set_client(make_scoped_ptr(new CommandBufferDriverClientImpl(this))); + driver_->set_client(this); client_ = mojo::MakeProxy(client.PassInterface()); bool result = driver_->Initialize(std::move(shared_state), std::move(attribs));
diff --git a/components/mus/gles2/command_buffer_impl.h b/components/mus/gles2/command_buffer_impl.h index 6bdbef88..1bcc429 100644 --- a/components/mus/gles2/command_buffer_impl.h +++ b/components/mus/gles2/command_buffer_impl.h
@@ -11,6 +11,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" +#include "components/mus/gles2/command_buffer_driver.h" #include "components/mus/public/interfaces/command_buffer.mojom.h" #include "gpu/command_buffer/common/command_buffer.h" #include "mojo/public/cpp/bindings/binding.h" @@ -24,16 +25,21 @@ // so that we can insert sync points without blocking on the GL driver. It // forwards most method calls to the CommandBufferDriver, which runs on the // same thread as the native viewport. -class CommandBufferImpl : public mojom::CommandBuffer { +class CommandBufferImpl : public mojom::CommandBuffer, + public CommandBufferDriver::Client { public: CommandBufferImpl(mojo::InterfaceRequest<CommandBuffer> request, scoped_refptr<GpuState> gpu_state); - void DidLoseContext(uint32_t reason); private: class CommandBufferDriverClientImpl; ~CommandBufferImpl() override; + // CommandBufferDriver::Client. All called on the GPU thread. + void DidLoseContext(uint32_t reason) override; + void UpdateVSyncParameters(int64_t timebase, int64_t interval) override; + void OnGpuCompletedSwapBuffers(gfx::SwapResult result) override; + // mojom::CommandBuffer: void Initialize( mojom::CommandBufferClientPtr client,
diff --git a/components/mus/gles2/command_buffer_local.cc b/components/mus/gles2/command_buffer_local.cc index d4b2b035..719ffdd 100644 --- a/components/mus/gles2/command_buffer_local.cc +++ b/components/mus/gles2/command_buffer_local.cc
@@ -406,6 +406,15 @@ } } +void CommandBufferLocal::OnGpuCompletedSwapBuffers(gfx::SwapResult result) { + if (client_) { + client_thread_task_runner_->PostTask( + FROM_HERE, + base::Bind(&CommandBufferLocal::OnGpuCompletedSwapBuffersOnClientThread, + weak_ptr_, result)); + } +} + CommandBufferLocal::~CommandBufferLocal() {} void CommandBufferLocal::TryUpdateState() { @@ -433,6 +442,7 @@ gpu::CommandBufferNamespace::MOJO_LOCAL, gpu::CommandBufferId::FromUnsafeValue(++g_next_command_buffer_id), widget_, gpu_state_)); + driver_->set_client(this); const size_t kSharedStateSize = sizeof(gpu::CommandBufferSharedState); void* memory = nullptr; mojo::ScopedSharedBufferHandle duped; @@ -541,4 +551,10 @@ client_->UpdateVSyncParameters(timebase, interval); } +void CommandBufferLocal::OnGpuCompletedSwapBuffersOnClientThread( + gfx::SwapResult result) { + if (client_) + client_->GpuCompletedSwapBuffers(result); +} + } // namespace mus
diff --git a/components/mus/gles2/command_buffer_local.h b/components/mus/gles2/command_buffer_local.h index bfc9e77..6c5cef5 100644 --- a/components/mus/gles2/command_buffer_local.h +++ b/components/mus/gles2/command_buffer_local.h
@@ -99,11 +99,12 @@ const base::Closure& callback) override; bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; - // CommandBufferDriver::Client implementation: + private: + // CommandBufferDriver::Client implementation. All called on GPU thread. void DidLoseContext(uint32_t reason) override; void UpdateVSyncParameters(int64_t timebase, int64_t interval) override; + void OnGpuCompletedSwapBuffers(gfx::SwapResult result) override; - private: ~CommandBufferLocal() override; gpu::CommandBufferSharedState* shared_state() const { return shared_state_; } @@ -134,6 +135,7 @@ // Helper functions are called in the client thread. void DidLoseContextOnClientThread(uint32_t reason); void UpdateVSyncParametersOnClientThread(int64_t timebase, int64_t interval); + void OnGpuCompletedSwapBuffersOnClientThread(gfx::SwapResult result); gfx::AcceleratedWidget widget_; scoped_refptr<GpuState> gpu_state_;
diff --git a/components/mus/gles2/command_buffer_local_client.h b/components/mus/gles2/command_buffer_local_client.h index f4b3cb4..4999f7e4 100644 --- a/components/mus/gles2/command_buffer_local_client.h +++ b/components/mus/gles2/command_buffer_local_client.h
@@ -7,12 +7,15 @@ #include <stdint.h> +#include "ui/gfx/swap_result.h" + namespace mus { class CommandBufferLocalClient { public: virtual void UpdateVSyncParameters(int64_t timebase, int64_t interval) = 0; virtual void DidLoseContext() = 0; + virtual void GpuCompletedSwapBuffers(gfx::SwapResult result) = 0; protected: virtual ~CommandBufferLocalClient() {}
diff --git a/components/mus/gles2/gl_surface_adapter.cc b/components/mus/gles2/gl_surface_adapter.cc new file mode 100644 index 0000000..82702882 --- /dev/null +++ b/components/mus/gles2/gl_surface_adapter.cc
@@ -0,0 +1,57 @@ +// Copyright (c) 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. + +#include "components/mus/gles2/gl_surface_adapter.h" + +#include "base/bind.h" + +namespace mus { + +GLSurfaceAdapterMus::GLSurfaceAdapterMus(scoped_refptr<gfx::GLSurface> surface) + : gfx::GLSurfaceAdapter(surface.get()), + surface_(surface), + weak_ptr_factory_(this) {} + +GLSurfaceAdapterMus::~GLSurfaceAdapterMus() {} + +void GLSurfaceAdapterMus::SwapBuffersAsync( + const GLSurface::SwapCompletionCallback& callback) { + gfx::GLSurfaceAdapter::SwapBuffersAsync( + base::Bind(&GLSurfaceAdapterMus::WrappedCallbackForSwapBuffersAsync, + weak_ptr_factory_.GetWeakPtr(), callback)); +} + +void GLSurfaceAdapterMus::PostSubBufferAsync( + int x, + int y, + int width, + int height, + const GLSurface::SwapCompletionCallback& callback) { + gfx::GLSurfaceAdapter::PostSubBufferAsync( + x, y, width, height, + base::Bind(&GLSurfaceAdapterMus::WrappedCallbackForSwapBuffersAsync, + weak_ptr_factory_.GetWeakPtr(), callback)); +} + +void GLSurfaceAdapterMus::CommitOverlayPlanesAsync( + const GLSurface::SwapCompletionCallback& callback) { + gfx::GLSurfaceAdapter::CommitOverlayPlanesAsync( + base::Bind(&GLSurfaceAdapterMus::WrappedCallbackForSwapBuffersAsync, + weak_ptr_factory_.GetWeakPtr(), callback)); +} + +void GLSurfaceAdapterMus::WrappedCallbackForSwapBuffersAsync( + const gfx::GLSurface::SwapCompletionCallback& original_callback, + gfx::SwapResult result) { + if (!adapter_callback_.is_null()) + adapter_callback_.Run(result); + original_callback.Run(result); +} + +void GLSurfaceAdapterMus::SetGpuCompletedSwapBuffersCallback( + gfx::GLSurface::SwapCompletionCallback callback) { + adapter_callback_ = std::move(callback); +} + +} // namespace mus
diff --git a/components/mus/gles2/gl_surface_adapter.h b/components/mus/gles2/gl_surface_adapter.h new file mode 100644 index 0000000..df7d10e6 --- /dev/null +++ b/components/mus/gles2/gl_surface_adapter.h
@@ -0,0 +1,71 @@ +// Copyright (c) 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. + +#ifndef COMPONENTS_MUS_GLES2_GL_SURFACE_ADAPTER_H_ +#define COMPONENTS_MUS_GLES2_GL_SURFACE_ADAPTER_H_ + +#include <stdint.h> + +#include <vector> + +#include "base/callback.h" +#include "base/memory/weak_ptr.h" +#include "ui/gfx/swap_result.h" +#include "ui/gl/gl_surface.h" + +namespace mus { + +// Wraps a GLSurface such that there is a real GLSurface instance acting as +// delegate. Implements the GLSurface interface. The |gfx::GLSurfaceAdapter| +// superclass provides a default implementation that forwards all GLSurface +// methods to the provided delegate. |GLSurfaceAdapterMus| overrides only the +// necessary methods to augment the completion callback argument to +// |SwapBuffersAsync|, |PostSubBufferAsync| and |CommitOverlayPlanesAsync| with +// a callback provided with the |SetGpuCompletedSwapBuffersCallback| method. +class GLSurfaceAdapterMus : public gfx::GLSurfaceAdapter { + public: + // Creates a new |GLSurfaceAdapterMus| that delegates to |surface|. + explicit GLSurfaceAdapterMus(scoped_refptr<gfx::GLSurface> surface); + + // gfx::GLSurfaceAdapter. + void SwapBuffersAsync( + const gfx::GLSurface::SwapCompletionCallback& callback) override; + void PostSubBufferAsync( + int x, + int y, + int width, + int height, + const gfx::GLSurface::SwapCompletionCallback& callback) override; + void CommitOverlayPlanesAsync( + const gfx::GLSurface::SwapCompletionCallback& callback) override; + + // Set an additional callback to run on SwapBuffers completion. + void SetGpuCompletedSwapBuffersCallback( + gfx::GLSurface::SwapCompletionCallback callback); + + private: + ~GLSurfaceAdapterMus() override; + + // We wrap the callback given to the |gfx::GLSurfaceAdapter| overrides above + // with an invocation of this function. It invokes |adapter_callback_| and the + // original |original_callback| provided by the original invoker of + // |SwapBuffersAsync| etc. + void WrappedCallbackForSwapBuffersAsync( + const gfx::GLSurface::SwapCompletionCallback& original_callback, + gfx::SwapResult result); + + gfx::GLSurface::SwapCompletionCallback adapter_callback_; + + // gfx::GLSurfaceAdapter doesn't own the delegate surface so keep a reference + // here. + scoped_refptr<gfx::GLSurface> surface_; + + base::WeakPtrFactory<GLSurfaceAdapterMus> weak_ptr_factory_; + + DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapterMus); +}; + +} // namespace mus + +#endif // COMPONENTS_MUS_GLES2_GL_SURFACE_ADAPTER_H_
diff --git a/components/mus/surfaces/OWNERS b/components/mus/surfaces/OWNERS index c92691f..1f1af6b 100644 --- a/components/mus/surfaces/OWNERS +++ b/components/mus/surfaces/OWNERS
@@ -1 +1,2 @@ fsamuel@chromium.org +rjkroege@chromium.org
diff --git a/components/mus/surfaces/surfaces_context_provider.cc b/components/mus/surfaces/surfaces_context_provider.cc index 6995806..434ad60d3 100644 --- a/components/mus/surfaces/surfaces_context_provider.cc +++ b/components/mus/surfaces/surfaces_context_provider.cc
@@ -114,4 +114,15 @@ lost_context_callback_.Run(); } +void SurfacesContextProvider::GpuCompletedSwapBuffers(gfx::SwapResult result) { + if (!swap_buffers_completion_callback_.is_null()) { + swap_buffers_completion_callback_.Run(result); + } +} + +void SurfacesContextProvider::SetSwapBuffersCompletionCallback( + gfx::GLSurface::SwapCompletionCallback callback) { + swap_buffers_completion_callback_ = callback; +} + } // namespace mus
diff --git a/components/mus/surfaces/surfaces_context_provider.h b/components/mus/surfaces/surfaces_context_provider.h index 520ff138..bb3a4c66 100644 --- a/components/mus/surfaces/surfaces_context_provider.h +++ b/components/mus/surfaces/surfaces_context_provider.h
@@ -8,11 +8,13 @@ #include <stdint.h> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" #include "base/threading/non_thread_safe.h" #include "cc/output/context_provider.h" #include "components/mus/gles2/command_buffer_local_client.h" #include "ui/gfx/native_widget_types.h" +#include "ui/gl/gl_surface.h" namespace gpu { @@ -54,6 +56,10 @@ void SetupLock() override; base::Lock* GetLock() override; + // SurfacesContextProvider API. + void SetSwapBuffersCompletionCallback( + gfx::GLSurface::SwapCompletionCallback callback); + protected: friend class base::RefCountedThreadSafe<SurfacesContextProvider>; ~SurfacesContextProvider() override; @@ -62,6 +68,7 @@ // CommandBufferLocalClient: void UpdateVSyncParameters(int64_t timebase, int64_t interval) override; void DidLoseContext() override; + void GpuCompletedSwapBuffers(gfx::SwapResult result) override; // From GLES2Context: // Initialized in BindToCurrentThread. @@ -76,6 +83,8 @@ gfx::AcceleratedWidget widget_; CommandBufferLocal* command_buffer_local_; + gfx::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; + base::Lock context_lock_; DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider);
diff --git a/components/mus/surfaces/top_level_display_client.h b/components/mus/surfaces/top_level_display_client.h index de5ce2a..edc2d45 100644 --- a/components/mus/surfaces/top_level_display_client.h +++ b/components/mus/surfaces/top_level_display_client.h
@@ -2,12 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_MUS_SURFACES_DISPLAY_IMPL_H_ -#define COMPONENTS_MUS_SURFACES_DISPLAY_IMPL_H_ +#ifndef COMPONENTS_MUS_SURFACES_TOP_LEVEL_DISPLAY_CLIENT_H_ +#define COMPONENTS_MUS_SURFACES_TOP_LEVEL_DISPLAY_CLIENT_H_ #include <stdint.h> #include "base/macros.h" +#include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "cc/surfaces/display_client.h" #include "cc/surfaces/surface_factory.h" @@ -83,4 +84,4 @@ } // namespace mus -#endif // COMPONENTS_MUS_SURFACES_DISPLAY_IMPL_H_ +#endif // COMPONENTS_MUS_SURFACES_TOP_LEVEL_DISPLAY_CLIENT_H_
diff --git a/components/mus/ws/window_tree_client_unittest.cc b/components/mus/ws/window_tree_client_unittest.cc index bc7a234..cd45783 100644 --- a/components/mus/ws/window_tree_client_unittest.cc +++ b/components/mus/ws/window_tree_client_unittest.cc
@@ -596,6 +596,16 @@ changes1()->clear(); } + void TearDown() override { + // Destroy these before the message loop is destroyed (happens in + // WindowServerShellTestBase::TearDown). + wt_client1_.reset(); + wt_client2_.reset(); + wt_client3_.reset(); + client_factory_.reset(); + WindowServerShellTestBase::TearDown(); + } + scoped_ptr<TestWindowTreeClientImpl> wt_client1_; scoped_ptr<TestWindowTreeClientImpl> wt_client2_; scoped_ptr<TestWindowTreeClientImpl> wt_client3_; @@ -619,15 +629,8 @@ ASSERT_NE(connection_id_1(), connection_id_2()); } -// Disabled due to flakes on win8_chromium_ng; see https://crbug.com/598925. -#if defined(OS_WIN) -#define MAYBE_WindowsRemovedWhenEmbedding \ - DISABLED_WindowsRemovedWhenEmbedding -#else -#define MAYBE_WindowsRemovedWhenEmbedding WindowsRemovedWhenEmbedding -#endif // Verifies when Embed() is invoked any child windows are removed. -TEST_F(WindowTreeClientTest, MAYBE_WindowsRemovedWhenEmbedding) { +TEST_F(WindowTreeClientTest, WindowsRemovedWhenEmbedding) { // Two windows 1 and 2. 2 is parented to 1. Id window_1_1 = wt_client1()->NewWindow(1); ASSERT_TRUE(window_1_1);
diff --git a/components/nacl/browser/pnacl_translation_cache.h b/components/nacl/browser/pnacl_translation_cache.h index 07305b2..db07f47c 100644 --- a/components/nacl/browser/pnacl_translation_cache.h +++ b/components/nacl/browser/pnacl_translation_cache.h
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "net/base/cache_type.h"
diff --git a/components/os_crypt.gypi b/components/os_crypt.gypi index 5965474..e5b38f1 100644 --- a/components/os_crypt.gypi +++ b/components/os_crypt.gypi
@@ -32,6 +32,24 @@ 'os_crypt/os_crypt_posix.cc', ], }], + ['OS=="win"', { + 'all_dependent_settings': { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'crypt32.lib', + ], + }, + }, + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'crypt32.lib', + ], + }, + }, + }], ], 'target_conditions': [ ['OS=="ios"', {
diff --git a/components/os_crypt/BUILD.gn b/components/os_crypt/BUILD.gn index 457b3cd2..37adbe9 100644 --- a/components/os_crypt/BUILD.gn +++ b/components/os_crypt/BUILD.gn
@@ -36,6 +36,10 @@ ] set_sources_assignment_filter(sources_assignment_filter) } + + if (is_win) { + libs = [ "crypt32.lib" ] + } } source_set("unit_tests") {
diff --git a/components/os_crypt/os_crypt_win.cc b/components/os_crypt/os_crypt_win.cc index bbed44136..093878d 100644 --- a/components/os_crypt/os_crypt_win.cc +++ b/components/os_crypt/os_crypt_win.cc
@@ -9,8 +9,6 @@ #include "base/strings/utf_string_conversions.h" #include "crypto/wincrypt_shim.h" -#pragma comment(lib, "crypt32.lib") - bool OSCrypt::EncryptString16(const base::string16& plaintext, std::string* ciphertext) { return EncryptString(base::UTF16ToUTF8(plaintext), ciphertext);
diff --git a/components/password_manager/core/browser/facet_manager_unittest.cc b/components/password_manager/core/browser/facet_manager_unittest.cc index aa94a5a0..554e49d 100644 --- a/components/password_manager/core/browser/facet_manager_unittest.cc +++ b/components/password_manager/core/browser/facet_manager_unittest.cc
@@ -11,6 +11,7 @@ #include "base/location.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/rand_util.h" #include "base/test/test_mock_time_task_runner.h" #include "base/test/test_simple_task_runner.h"
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc index 6ed264a7..60cdeb6d 100644 --- a/components/password_manager/core/browser/password_manager.cc +++ b/components/password_manager/core/browser/password_manager.cc
@@ -145,8 +145,6 @@ registry->RegisterBooleanPref( prefs::kCredentialsEnableAutosignin, true, user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); - registry->RegisterBooleanPref(prefs::kPasswordManagerAllowShowPasswords, - true); #if defined(OS_MACOSX) registry->RegisterIntegerPref(prefs::kKeychainMigrationStatus, static_cast<int>(MigrationStatus::NOT_STARTED));
diff --git a/components/password_manager/core/browser/password_store_consumer.h b/components/password_manager/core/browser/password_store_consumer.h index 01a15b4..ffd5ee9 100644 --- a/components/password_manager/core/browser/password_store_consumer.h +++ b/components/password_manager/core/browser/password_store_consumer.h
@@ -7,6 +7,7 @@ #include <vector> +#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/task/cancelable_task_tracker.h"
diff --git a/components/password_manager/core/common/password_manager_pref_names.cc b/components/password_manager/core/common/password_manager_pref_names.cc index 96300b5..8e65f41 100644 --- a/components/password_manager/core/common/password_manager_pref_names.cc +++ b/components/password_manager/core/common/password_manager_pref_names.cc
@@ -25,8 +25,6 @@ const char kKeychainMigrationStatus[] = "password_manager.keychain_migration"; #endif -const char kPasswordManagerAllowShowPasswords[] = - "profile.password_manager_allow_show_passwords"; const char kPasswordManagerSavingEnabled[] = "profile.password_manager_enabled"; const char kWasAutoSignInFirstRunExperienceShown[] =
diff --git a/components/password_manager/core/common/password_manager_pref_names.h b/components/password_manager/core/common/password_manager_pref_names.h index 0ec526b..8cd45dc 100644 --- a/components/password_manager/core/common/password_manager_pref_names.h +++ b/components/password_manager/core/common/password_manager_pref_names.h
@@ -46,10 +46,6 @@ extern const char kKeychainMigrationStatus[]; #endif -// Boolean controlling whether the password manager allows to retrieve passwords -// in clear text. -extern const char kPasswordManagerAllowShowPasswords[]; - // Boolean that is true if password saving is on (will record new // passwords and fill in known passwords). When it is false, it doesn't // ask if you want to save passwords but will continue to fill passwords.
diff --git a/components/policy/core/common/BUILD.gn b/components/policy/core/common/BUILD.gn index dcad6d1..47759a3 100644 --- a/components/policy/core/common/BUILD.gn +++ b/components/policy/core/common/BUILD.gn
@@ -148,7 +148,12 @@ ] if (is_win) { - libs = [ "netapi32.lib" ] + libs = [ + "netapi32.lib", + "shlwapi.lib", + "userenv.lib", + "ntdsapi.lib", + ] } if (is_android) { sources += [ "cloud/component_cloud_policy_service_stub.cc" ]
diff --git a/components/policy/core/common/policy_loader_win.cc b/components/policy/core/common/policy_loader_win.cc index fe4d197..f8b6358 100644 --- a/components/policy/core/common/policy_loader_win.cc +++ b/components/policy/core/common/policy_loader_win.cc
@@ -15,13 +15,6 @@ #include <string> #include <vector> -// shlwapi.dll is required for PathIsUNC(). -#pragma comment(lib, "shlwapi.lib") -// userenv.dll is required for various GPO functions. -#pragma comment(lib, "userenv.lib") -// ntdsapi.dll is required for Ds[Un]Bind calls. -#pragma comment(lib, "ntdsapi.lib") - #include "base/bind.h" #include "base/files/file_util.h" #include "base/json/json_reader.h"
diff --git a/components/policy/policy_common.gypi b/components/policy/policy_common.gypi index 7beb4c5..cfd634d 100644 --- a/components/policy/policy_common.gypi +++ b/components/policy/policy_common.gypi
@@ -193,6 +193,28 @@ 'core/common/mac_util.h', ], }], + ['OS=="win"', { + 'all_dependent_settings': { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'shlwapi.lib', + 'userenv.lib', + 'ntdsapi.lib', + ], + }, + }, + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'shlwapi.lib', + 'userenv.lib', + 'ntdsapi.lib', + ], + }, + }, + }], ], }, { # configuration_policy==0 # Some of the policy code is always enabled, so that other parts of
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 2eb824f..53b111b7 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -1149,7 +1149,7 @@ 'name': 'PasswordManager', 'type': 'group', 'caption': '''Password manager''', - 'desc': '''Configures the password manager. If the password manager is enabled, then you can choose to enable or disable whether the user may show stored passwords in clear text.''', + 'desc': '''Configures the password manager.''', 'policies': [ { 'name': 'PasswordManagerEnabled', @@ -1187,16 +1187,19 @@ 'name': 'PasswordManagerAllowShowPasswords', 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.*:8-', 'chrome_os:11-'], + 'supported_on': ['chrome.*:8-50', 'chrome_os:11-50'], 'features': { 'dynamic_refresh': True, 'per_profile': True, }, + 'deprecated': True, 'example_value': False, 'id': 17, - 'caption': '''Allow users to show passwords in Password Manager''', + 'caption': '''Allow users to show passwords in Password Manager (deprecated)''', 'tags': [], - 'desc': '''Controls whether the user may show passwords in clear text in the password manager. + 'desc': '''The associated setting was used before reauthentication on viewing passwords was introduced. Since then, the setting and hence this policy had no effect on the behavior of Chrome. The current behavior of Chrome is now the same as if the the policy was set to disable showing passwords in clear text in the password manager settings page. That means that the settings page contains just a placeholder, and only upon the user clicking "Show" (and reauthenticating, if applicable) Chrome shows the password. Original description of the policy follows below. + + Controls whether the user may show passwords in clear text in the password manager. If you disable this setting, the password manager does not allow showing stored passwords in clear text in the password manager window.
diff --git a/components/proximity_auth/cryptauth/sync_scheduler.h b/components/proximity_auth/cryptauth/sync_scheduler.h index 55d516b..33dbfef 100644 --- a/components/proximity_auth/cryptauth/sync_scheduler.h +++ b/components/proximity_auth/cryptauth/sync_scheduler.h
@@ -6,6 +6,7 @@ #define COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_SYNC_SCHEDULER_H #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h"
diff --git a/components/renderer_context_menu/render_view_context_menu_proxy.h b/components/renderer_context_menu/render_view_context_menu_proxy.h index 86662da5..38d08e5 100644 --- a/components/renderer_context_menu/render_view_context_menu_proxy.h +++ b/components/renderer_context_menu/render_view_context_menu_proxy.h
@@ -90,6 +90,9 @@ bool hidden, const base::string16& title) = 0; + // Add spell check service item to the context menu. + virtual void AddSpellCheckServiceItem(bool is_checked) = 0; + // Retrieve the given associated objects with a context menu. virtual content::RenderViewHost* GetRenderViewHost() const = 0; virtual content::WebContents* GetWebContents() const = 0;
diff --git a/components/resource_provider/file_utils.cc b/components/resource_provider/file_utils.cc index 9c3948e..b8063da 100644 --- a/components/resource_provider/file_utils.cc +++ b/components/resource_provider/file_utils.cc
@@ -69,7 +69,9 @@ #else PathService::Get(base::DIR_EXE, &base_path); #endif - return base_path.AppendASCII(path).AppendASCII("resources"); + // TODO(beng): this won't handle user-specific components. + return base_path.AppendASCII("Mojo Applications").AppendASCII(path). + AppendASCII("resources"); } base::FilePath GetPathForResourceNamed(const base::FilePath& app_path,
diff --git a/components/safe_browsing_db/BUILD.gn b/components/safe_browsing_db/BUILD.gn index 975861a..419bef801 100644 --- a/components/safe_browsing_db/BUILD.gn +++ b/components/safe_browsing_db/BUILD.gn
@@ -30,6 +30,7 @@ group("safe_browsing_db") { deps = [ ":safe_browsing_db_shared", + ":v4_update_protocol_manager", ] } @@ -51,7 +52,6 @@ ":hit_report", ":util", ":v4_get_hash_protocol_manager", - ":v4_update_protocol_manager", "//base:base", "//content/public/browser", "//content/public/common",
diff --git a/components/safe_browsing_db/database_manager.cc b/components/safe_browsing_db/database_manager.cc index e4cc777..b8998b4 100644 --- a/components/safe_browsing_db/database_manager.cc +++ b/components/safe_browsing_db/database_manager.cc
@@ -5,7 +5,6 @@ #include "components/safe_browsing_db/database_manager.h" #include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" -#include "components/safe_browsing_db/v4_update_protocol_manager.h" #include "content/public/browser/browser_thread.h" #include "net/url_request/url_request_context_getter.h" #include "url/gurl.h" @@ -15,13 +14,11 @@ namespace safe_browsing { SafeBrowsingDatabaseManager::SafeBrowsingDatabaseManager() - : v4_get_hash_protocol_manager_(NULL), - v4_update_protocol_manager_(NULL) { + : v4_get_hash_protocol_manager_(NULL) { } SafeBrowsingDatabaseManager::~SafeBrowsingDatabaseManager() { DCHECK(v4_get_hash_protocol_manager_ == NULL); - DCHECK(v4_update_protocol_manager_ == NULL); } void SafeBrowsingDatabaseManager::StartOnIOThread( @@ -32,9 +29,6 @@ // Instantiate a V4GetHashProtocolManager. v4_get_hash_protocol_manager_ = V4GetHashProtocolManager::Create( request_context_getter, config); - // Instantiate a V4UpdateProtocolManager. - v4_update_protocol_manager_ = V4UpdateProtocolManager::Create( - request_context_getter, config); } } @@ -48,12 +42,6 @@ delete v4_get_hash_protocol_manager_; v4_get_hash_protocol_manager_ = NULL; } - - // This cancels any in-flight update request. - if (v4_update_protocol_manager_) { - delete v4_update_protocol_manager_; - v4_update_protocol_manager_ = NULL; - } } void SafeBrowsingDatabaseManager::CheckApiBlacklistUrl(const GURL& url,
diff --git a/components/safe_browsing_db/database_manager.h b/components/safe_browsing_db/database_manager.h index 9ad4430..5fa427f 100644 --- a/components/safe_browsing_db/database_manager.h +++ b/components/safe_browsing_db/database_manager.h
@@ -28,7 +28,6 @@ struct V4ProtocolConfig; class V4GetHashProtocolManager; -class V4UpdateProtocolManager; // Base class to either the locally-managed or a remotely-managed database. class SafeBrowsingDatabaseManager @@ -178,7 +177,6 @@ // Created and destroyed via StartonIOThread/StopOnIOThread. V4GetHashProtocolManager* v4_get_hash_protocol_manager_; - V4UpdateProtocolManager* v4_update_protocol_manager_; }; // class SafeBrowsingDatabaseManager } // namespace safe_browsing
diff --git a/components/safe_browsing_db/v4_protocol_manager_util.cc b/components/safe_browsing_db/v4_protocol_manager_util.cc index 2dddc16..fbbad5b 100644 --- a/components/safe_browsing_db/v4_protocol_manager_util.cc +++ b/components/safe_browsing_db/v4_protocol_manager_util.cc
@@ -37,6 +37,10 @@ return base::HashInts(interim, third); } +V4ProtocolConfig::V4ProtocolConfig() : disable_auto_update(false) {} + +V4ProtocolConfig::~V4ProtocolConfig() {} + // static // Backoff interval is MIN(((2^(n-1))*15 minutes) * (RAND + 1), 24 hours) where // n is the number of consecutive errors. @@ -72,9 +76,9 @@ // static // The API hash call uses the pver4 Safe Browsing server. -GURL V4ProtocolManagerUtil::GetRequestUrl( - const std::string& request_base64, const std::string& method_name, - const V4ProtocolConfig& config) { +GURL V4ProtocolManagerUtil::GetRequestUrl(const std::string& request_base64, + const std::string& method_name, + const V4ProtocolConfig& config) { std::string url = ComposeUrl(kSbV4UrlPrefix, method_name, request_base64, config.client_name, config.version, config.key_param); @@ -82,13 +86,12 @@ } // static -std::string V4ProtocolManagerUtil::ComposeUrl( - const std::string& prefix, - const std::string& method, - const std::string& request_base64, - const std::string& client_id, - const std::string& version, - const std::string& key_param) { +std::string V4ProtocolManagerUtil::ComposeUrl(const std::string& prefix, + const std::string& method, + const std::string& request_base64, + const std::string& client_id, + const std::string& version, + const std::string& key_param) { DCHECK(!prefix.empty() && !method.empty() && !client_id.empty() && !version.empty()); std::string url =
diff --git a/components/safe_browsing_db/v4_protocol_manager_util.h b/components/safe_browsing_db/v4_protocol_manager_util.h index 6671555f4..54e88994 100644 --- a/components/safe_browsing_db/v4_protocol_manager_util.h +++ b/components/safe_browsing_db/v4_protocol_manager_util.h
@@ -27,6 +27,12 @@ // The Google API key. std::string key_param; + + // Disable auto-updates using a command line switch? + bool disable_auto_update; + + V4ProtocolConfig(); + ~V4ProtocolConfig(); }; // The information required to uniquely identify each list the client is @@ -102,7 +108,7 @@ size_t* multiplier); private: - V4ProtocolManagerUtil() {}; + V4ProtocolManagerUtil(){}; FRIEND_TEST_ALL_PREFIXES(SafeBrowsingV4ProtocolManagerUtilTest, TestBackOffLogic); FRIEND_TEST_ALL_PREFIXES(SafeBrowsingV4ProtocolManagerUtilTest,
diff --git a/components/safe_browsing_db/v4_update_protocol_manager.cc b/components/safe_browsing_db/v4_update_protocol_manager.cc index 96869c8..91bf26e 100644 --- a/components/safe_browsing_db/v4_update_protocol_manager.cc +++ b/components/safe_browsing_db/v4_update_protocol_manager.cc
@@ -9,6 +9,7 @@ #include "base/base64.h" #include "base/macros.h" #include "base/metrics/histogram_macros.h" +#include "base/rand_util.h" #include "base/timer/timer.h" #include "components/safe_browsing_db/safebrowsing.pb.h" #include "net/base/load_flags.h" @@ -61,16 +62,26 @@ namespace safe_browsing { +// Minimum time, in seconds, from start up before we must issue an update query. +static const int kV4TimerStartIntervalSecMin = 60; + +// Maximum time, in seconds, from start up before we must issue an update query. +static const int kV4TimerStartIntervalSecMax = 300; + // The default V4UpdateProtocolManagerFactory. class V4UpdateProtocolManagerFactoryImpl : public V4UpdateProtocolManagerFactory { public: V4UpdateProtocolManagerFactoryImpl() {} ~V4UpdateProtocolManagerFactoryImpl() override {} - V4UpdateProtocolManager* CreateProtocolManager( + scoped_ptr<V4UpdateProtocolManager> CreateProtocolManager( net::URLRequestContextGetter* request_context_getter, - const V4ProtocolConfig& config) override { - return new V4UpdateProtocolManager(request_context_getter, config); + const V4ProtocolConfig& config, + const base::hash_map<UpdateListIdentifier, std::string>& + current_list_states, + V4UpdateCallback callback) override { + return scoped_ptr<V4UpdateProtocolManager>(new V4UpdateProtocolManager( + request_context_getter, config, current_list_states, callback)); } private: @@ -83,12 +94,16 @@ V4UpdateProtocolManagerFactory* V4UpdateProtocolManager::factory_ = NULL; // static -V4UpdateProtocolManager* V4UpdateProtocolManager::Create( +scoped_ptr<V4UpdateProtocolManager> V4UpdateProtocolManager::Create( net::URLRequestContextGetter* request_context_getter, - const V4ProtocolConfig& config) { + const V4ProtocolConfig& config, + const base::hash_map<UpdateListIdentifier, std::string>& + current_list_states, + V4UpdateCallback callback) { if (!factory_) factory_ = new V4UpdateProtocolManagerFactoryImpl(); - return factory_->CreateProtocolManager(request_context_getter, config); + return factory_->CreateProtocolManager(request_context_getter, config, + current_list_states, callback); } void V4UpdateProtocolManager::ResetUpdateErrors() { @@ -98,36 +113,82 @@ V4UpdateProtocolManager::V4UpdateProtocolManager( net::URLRequestContextGetter* request_context_getter, - const V4ProtocolConfig& config) - : update_error_count_(0), + const V4ProtocolConfig& config, + const base::hash_map<UpdateListIdentifier, std::string>& + current_list_states, + V4UpdateCallback callback) + : current_list_states_(current_list_states), + update_error_count_(0), update_back_off_mult_(1), - next_update_time_(base::Time()), + next_update_interval_(base::TimeDelta::FromSeconds( + base::RandInt(kV4TimerStartIntervalSecMin, + kV4TimerStartIntervalSecMax))), config_(config), request_context_getter_(request_context_getter), - url_fetcher_id_(0) {} - -V4UpdateProtocolManager::~V4UpdateProtocolManager() { + url_fetcher_id_(0), + callback_(callback) { + ScheduleNextUpdate(false /* no back off */); } -std::string V4UpdateProtocolManager::GetUpdateRequest( - const base::hash_set<UpdateListIdentifier>& lists_to_update, +V4UpdateProtocolManager::~V4UpdateProtocolManager() {} + +bool V4UpdateProtocolManager::IsUpdateScheduled() const { + return update_timer_.IsRunning(); +} + +void V4UpdateProtocolManager::ScheduleNextUpdate(bool back_off) { + // TODO(vakh): Set disable_auto_update correctly using the command line + // switch. + if (config_.disable_auto_update) { + DCHECK(!IsUpdateScheduled()); + return; + } + + // Reschedule with the new update. + base::TimeDelta next_update_interval = GetNextUpdateInterval(back_off); + ScheduleNextUpdateAfterInterval(next_update_interval); +} + +// According to section 5 of the SafeBrowsing protocol specification, we must +// back off after a certain number of errors. +base::TimeDelta V4UpdateProtocolManager::GetNextUpdateInterval(bool back_off) { + DCHECK(CalledOnValidThread()); + DCHECK(next_update_interval_ > base::TimeDelta()); + base::TimeDelta next = next_update_interval_; + if (back_off) { + next = V4ProtocolManagerUtil::GetNextBackOffInterval( + &update_error_count_, &update_back_off_mult_); + } + return next; +} + +void V4UpdateProtocolManager::ScheduleNextUpdateAfterInterval( + base::TimeDelta interval) { + DCHECK(CalledOnValidThread()); + DCHECK(interval >= base::TimeDelta()); + // Unschedule any current timer. + update_timer_.Stop(); + update_timer_.Start(FROM_HERE, interval, this, + &V4UpdateProtocolManager::IssueUpdateRequest); +} + +std::string V4UpdateProtocolManager::GetBase64SerializedUpdateRequestProto( const base::hash_map<UpdateListIdentifier, std::string>& current_list_states) { // Build the request. Client info and client states are not added to the // request protocol buffer. Client info is passed as params in the url. FetchThreatListUpdatesRequest request; - for (const auto& list_to_update : lists_to_update) { + for (const auto& entry : current_list_states) { + const auto& list_to_update = entry.first; + const auto& state = entry.second; ListUpdateRequest* list_update_request = request.add_list_update_requests(); list_update_request->set_platform_type(list_to_update.platform_type); list_update_request->set_threat_entry_type( list_to_update.threat_entry_type); list_update_request->set_threat_type(list_to_update.threat_type); - // If the current state of the list is available, add that to the proto. - base::hash_map<UpdateListIdentifier, std::string>::const_iterator - list_iter = current_list_states.find(list_to_update); - if (list_iter != current_list_states.end()) { - list_update_request->set_state(list_iter->second); + if (!state.empty()) { + list_update_request->set_state(state); } } @@ -151,9 +212,15 @@ if (response.has_minimum_wait_duration()) { // Seconds resolution is good enough so we ignore the nanos field. - base::TimeDelta next_update_interval = base::TimeDelta::FromSeconds( - response.minimum_wait_duration().seconds()); - next_update_time_ = Time::Now() + next_update_interval; + int64_t minimum_wait_duration_seconds = + response.minimum_wait_duration().seconds(); + + // Do not let the next_update_interval_ to be too low. + if (minimum_wait_duration_seconds < kV4TimerStartIntervalSecMin) { + minimum_wait_duration_seconds = kV4TimerStartIntervalSecMin; + } + next_update_interval_ = + base::TimeDelta::FromSeconds(minimum_wait_duration_seconds); } // TODO(vakh): Do something useful with this response. @@ -174,48 +241,27 @@ return true; } -void V4UpdateProtocolManager::GetUpdates( - const base::hash_set<UpdateListIdentifier>& lists_to_update, - const base::hash_map<UpdateListIdentifier, std::string>& - current_list_states, - UpdateCallback callback) { +void V4UpdateProtocolManager::IssueUpdateRequest() { DCHECK(CalledOnValidThread()); - // If an update request is already pending, return an empty result. - if (request_) { + // If an update request is already pending, record and return silently. + if (request_.get()) { RecordUpdateResult(V4OperationResult::ALREADY_PENDING_ERROR); - std::vector<ListUpdateResponse> list_update_responses; - callback.Run(list_update_responses); return; } - // We need to wait the minimum waiting duration, and if we are in backoff, - // we need to check if we're past the next allowed time. If we are, we can - // proceed with the request. If not, we are required to return empty results. - if (Time::Now() <= next_update_time_) { - if (update_error_count_) { - RecordUpdateResult(V4OperationResult::BACKOFF_ERROR); - } else { - RecordUpdateResult(V4OperationResult::MIN_WAIT_DURATION_ERROR); - } - std::vector<ListUpdateResponse> list_update_responses; - callback.Run(list_update_responses); - return; - } - - std::string req_base64 = - GetUpdateRequest(lists_to_update, current_list_states); + std::string req_base64 = GetBase64SerializedUpdateRequestProto( + current_list_states_); GURL update_url = GetUpdateUrl(req_base64); request_.reset(net::URLFetcher::Create(url_fetcher_id_++, update_url, net::URLFetcher::GET, this) .release()); - callback_ = callback; request_->SetLoadFlags(net::LOAD_DISABLE_CACHE); request_->SetRequestContext(request_context_getter_.get()); request_->Start(); - //TODO(vakh): Handle request timeout. + // TODO(vakh): Handle request timeout. } // net::URLFetcherDelegate implementation ---------------------------------- @@ -228,10 +274,12 @@ int response_code = source->GetResponseCode(); net::URLRequestStatus status = source->GetStatus(); V4ProtocolManagerUtil::RecordHttpResponseOrErrorCode( - "SafeBrowsing.V4UpdateHttpResponseOrErrorCode", status, response_code); + "SafeBrowsing.V4UpdateHttpResponseOrErrorCode", status, response_code); std::vector<ListUpdateResponse> list_update_responses; + bool back_off; if (status.is_success() && response_code == net::HTTP_OK) { + back_off = false; RecordUpdateResult(V4OperationResult::STATUS_200); ResetUpdateErrors(); std::string data; @@ -240,9 +288,11 @@ list_update_responses.clear(); RecordUpdateResult(V4OperationResult::PARSE_ERROR); } + // Invoke the callback with list_update_responses. + // The caller should update its state now, based on list_update_responses. + callback_.Run(list_update_responses); } else { - HandleUpdateError(Time::Now()); - + back_off = true; DVLOG(1) << "SafeBrowsing GetEncodedUpdates request for: " << source->GetURL() << " failed with error: " << status.error() << " and response code: " << response_code; @@ -252,20 +302,11 @@ } else { RecordUpdateResult(V4OperationResult::HTTP_ERROR); } + // TODO(vakh): Figure out whether it is just a network error vs backoff vs + // another condition and RecordUpdateResult more accurately. } - - // Invoke the callback with list_update_responses, even if there was a parse - // error or an error response code (in which case list_update_responses will - // be empty). The caller can't be blocked indefinitely. - callback_.Run(list_update_responses); request_.reset(); -} - -void V4UpdateProtocolManager::HandleUpdateError(const Time& now) { - DCHECK(CalledOnValidThread()); - base::TimeDelta next = V4ProtocolManagerUtil::GetNextBackOffInterval( - &update_error_count_, &update_back_off_mult_); - next_update_time_ = now + next; + ScheduleNextUpdate(back_off); } GURL V4UpdateProtocolManager::GetUpdateUrl(
diff --git a/components/safe_browsing_db/v4_update_protocol_manager.h b/components/safe_browsing_db/v4_update_protocol_manager.h index 19e3234..be91bc57 100644 --- a/components/safe_browsing_db/v4_update_protocol_manager.h +++ b/components/safe_browsing_db/v4_update_protocol_manager.h
@@ -36,20 +36,19 @@ class V4UpdateProtocolManagerFactory; +typedef FetchThreatListUpdatesRequest::ListUpdateRequest ListUpdateRequest; +typedef FetchThreatListUpdatesResponse::ListUpdateResponse ListUpdateResponse; + +// V4UpdateCallback is invoked when a scheduled update completes. +// Parameters: +// - The vector of update response protobufs received from the server for +// each list type. +typedef base::Callback<void(const std::vector<ListUpdateResponse>&)> + V4UpdateCallback; + class V4UpdateProtocolManager : public net::URLFetcherDelegate, public base::NonThreadSafe { public: - typedef FetchThreatListUpdatesRequest::ListUpdateRequest ListUpdateRequest; - typedef FetchThreatListUpdatesResponse::ListUpdateResponse ListUpdateResponse; - - // UpdateCallback is invoked when GetUpdates completes. - // Parameters: - // - The vector of update response protobufs received from the server for - // each list type. - // The caller can then use this vector to re-build the current_list_states. - typedef base::Callback<void(const std::vector<ListUpdateResponse>&)> - UpdateCallback; - ~V4UpdateProtocolManager() override; // Makes the passed |factory| the factory used to instantiate @@ -59,32 +58,28 @@ } // Create an instance of the safe browsing v4 protocol manager. - static V4UpdateProtocolManager* Create( + static scoped_ptr<V4UpdateProtocolManager> Create( net::URLRequestContextGetter* request_context_getter, - const V4ProtocolConfig& config); + const V4ProtocolConfig& config, + const base::hash_map<UpdateListIdentifier, std::string>& + current_list_states, + V4UpdateCallback callback); // net::URLFetcherDelegate interface. void OnURLFetchComplete(const net::URLFetcher* source) override; - // Retrieve the hash prefix update, and invoke the callback argument when the - // results are retrieved. The callback may be invoked synchronously. - // Parameters: - // - The set of lists to fetch the updates for. - // - The last known state for each of the known lists. - // It is valid to have one or more lists in lists_to_update set that have no - // corresponding value in the current_list_states map. This corresponds to the - // initial state for those lists. - virtual void GetUpdates( - const base::hash_set<UpdateListIdentifier>& lists_to_update, - const base::hash_map<UpdateListIdentifier, std::string>& - current_list_states, - UpdateCallback callback); - protected: // Constructs a V4UpdateProtocolManager that issues network requests using // |request_context_getter|. - V4UpdateProtocolManager(net::URLRequestContextGetter* request_context_getter, - const V4ProtocolConfig& config); + // Schedules an update to get the hash prefixes for the lists in + // |current_list_states|, and invoke |callback| when the results + // are retrieved. The callback may be invoked synchronously. + V4UpdateProtocolManager( + net::URLRequestContextGetter* request_context_getter, + const V4ProtocolConfig& config, + const base::hash_map<UpdateListIdentifier, std::string>& + current_list_states, + V4UpdateCallback callback); private: FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, @@ -92,6 +87,8 @@ FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, TestGetUpdatesErrorHandlingResponseCode); FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, TestGetUpdatesNoError); + FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, + TestGetUpdatesWithOneBackoff); friend class V4UpdateProtocolManagerFactoryImpl; // The method to generate the URL for the request to be sent to the server. @@ -101,8 +98,7 @@ // Fills a FetchThreatListUpdatesRequest protocol buffer for a request. // Returns the serialized and base 64 encoded request as a string. - std::string GetUpdateRequest( - const base::hash_set<UpdateListIdentifier>& lists_to_update, + std::string GetBase64SerializedUpdateRequestProto( const base::hash_map<UpdateListIdentifier, std::string>& current_list_states); @@ -121,10 +117,32 @@ // assuming that the current time is |now|. void HandleUpdateError(const base::Time& now); + // Generates the URL for the update request and issues the request for the + // lists passed to the constructor. + void IssueUpdateRequest(); + + // Returns whether another update is currently scheduled. + bool IsUpdateScheduled() const; + + // Schedule the next update, considering whether we are in backoff. + void ScheduleNextUpdate(bool back_off); + + // Schedule the next update, after the given interval. + void ScheduleNextUpdateAfterInterval(base::TimeDelta interval); + + // Get the next update interval, considering whether we are in backoff. + base::TimeDelta GetNextUpdateInterval(bool back_off); + // The factory that controls the creation of V4UpdateProtocolManager. // This is used by tests. static V4UpdateProtocolManagerFactory* factory_; + // The last known state of the lists. + // At init, this is read from the disk or is empty for no prior state. + // Each successful update from the server contains a new state for each + // requested list. + base::hash_map<UpdateListIdentifier, std::string> current_list_states_; + // The number of HTTP response errors since the the last successful HTTP // response, used for request backoff timing. size_t update_error_count_; @@ -132,11 +150,10 @@ // Multiplier for the backoff error after the second. size_t update_back_off_mult_; - // The time before which the next update request may not be sent. - // It is set to: - // the backoff time, if the last response was an error, or - // the minimum wait time, if the last response was successful. - base::Time next_update_time_; + // The time delta after which the next update request may be sent. + // It is set to a random interval between 60 and 300 seconds at start. + // The server can set it by setting the minimum_wait_duration. + base::TimeDelta next_update_interval_; // The config of the client making Pver4 requests. const V4ProtocolConfig config_; @@ -147,16 +164,16 @@ // ID for URLFetchers for testing. int url_fetcher_id_; - // True if there's a request pending. - bool update_request_pending_; - // The callback that's called when GetUpdates completes. - UpdateCallback callback_; + V4UpdateCallback callback_; // The pending update request. The request must be canceled when the object is // destroyed. scoped_ptr<net::URLFetcher> request_; + // Timer to setup the next update request. + base::OneShotTimer update_timer_; + DISALLOW_COPY_AND_ASSIGN(V4UpdateProtocolManager); }; @@ -165,9 +182,12 @@ public: V4UpdateProtocolManagerFactory() {} virtual ~V4UpdateProtocolManagerFactory() {} - virtual V4UpdateProtocolManager* CreateProtocolManager( + virtual scoped_ptr<V4UpdateProtocolManager> CreateProtocolManager( net::URLRequestContextGetter* request_context_getter, - const V4ProtocolConfig& config) = 0; + const V4ProtocolConfig& config, + const base::hash_map<UpdateListIdentifier, std::string>& + current_list_states, + V4UpdateCallback callback) = 0; private: DISALLOW_COPY_AND_ASSIGN(V4UpdateProtocolManagerFactory);
diff --git a/components/safe_browsing_db/v4_update_protocol_manager_unittest.cc b/components/safe_browsing_db/v4_update_protocol_manager_unittest.cc index 2a9a239b..c7665cd 100644 --- a/components/safe_browsing_db/v4_update_protocol_manager_unittest.cc +++ b/components/safe_browsing_db/v4_update_protocol_manager_unittest.cc
@@ -7,6 +7,8 @@ #include "base/base64.h" #include "base/memory/scoped_ptr.h" #include "base/strings/stringprintf.h" +#include "base/test/test_simple_task_runner.h" +#include "base/thread_task_runner_handle.h" #include "base/time/time.h" #include "components/safe_browsing_db/safebrowsing.pb.h" #include "components/safe_browsing_db/util.h" @@ -30,71 +32,101 @@ namespace safe_browsing { -typedef V4UpdateProtocolManager::ListUpdateRequest ListUpdateRequest; -typedef V4UpdateProtocolManager::ListUpdateResponse ListUpdateResponse; - class V4UpdateProtocolManagerTest : public testing::Test { protected: - scoped_ptr<V4UpdateProtocolManager> CreateProtocolManager() { + void ValidateGetUpdatesResults( + const std::vector<ListUpdateResponse>& expected_lurs, + const std::vector<ListUpdateResponse>& list_update_responses) { + // The callback should never be called if expect_callback_to_be_called_ is + // false. + EXPECT_TRUE(expect_callback_to_be_called_); + ASSERT_EQ(expected_lurs.size(), list_update_responses.size()); + + for (unsigned int i = 0; i < list_update_responses.size(); ++i) { + const ListUpdateResponse& expected = expected_lurs[i]; + const ListUpdateResponse& actual = list_update_responses[i]; + + EXPECT_EQ(expected.platform_type(), actual.platform_type()); + EXPECT_EQ(expected.response_type(), actual.response_type()); + EXPECT_EQ(expected.threat_entry_type(), actual.threat_entry_type()); + EXPECT_EQ(expected.threat_type(), actual.threat_type()); + EXPECT_EQ(expected.new_client_state(), actual.new_client_state()); + + // TODO(vakh): Test more fields from the proto. + } + } + + scoped_ptr<V4UpdateProtocolManager> CreateProtocolManager( + const base::hash_map<UpdateListIdentifier, std::string> + current_list_states, + const std::vector<ListUpdateResponse>& expected_lurs) { V4ProtocolConfig config; config.client_name = kClient; config.version = kAppVer; config.key_param = kKeyParam; - return scoped_ptr<V4UpdateProtocolManager>( - V4UpdateProtocolManager::Create(NULL, config)); + config.disable_auto_update = false; + return V4UpdateProtocolManager::Create( + NULL, config, current_list_states, + base::Bind(&V4UpdateProtocolManagerTest::ValidateGetUpdatesResults, + base::Unretained(this), expected_lurs)); } - void SetupListsToUpdate( - base::hash_set<UpdateListIdentifier>* lists_to_update) { + void SetupCurrentListStates( + base::hash_map<UpdateListIdentifier, std::string>* current_list_states) { UpdateListIdentifier list_identifier; list_identifier.platform_type = WINDOWS_PLATFORM; list_identifier.threat_entry_type = URL_EXPRESSION; list_identifier.threat_type = MALWARE_THREAT; - lists_to_update->insert(list_identifier); + current_list_states->insert({list_identifier, "initial_state_1"}); list_identifier.platform_type = WINDOWS_PLATFORM; list_identifier.threat_entry_type = URL_EXPRESSION; list_identifier.threat_type = UNWANTED_SOFTWARE; - lists_to_update->insert(list_identifier); + current_list_states->insert({list_identifier, "initial_state_2"}); list_identifier.platform_type = WINDOWS_PLATFORM; list_identifier.threat_entry_type = BINARY_DIGEST; list_identifier.threat_type = MALWARE_THREAT; - lists_to_update->insert(list_identifier); + current_list_states->insert({list_identifier, "initial_state_3"}); } - void ClearListsToUpdate( - base::hash_set<UpdateListIdentifier>* lists_to_update) { - lists_to_update->clear(); + void SetupExpectedListUpdateResponse( + std::vector<ListUpdateResponse>* expected_lurs) { + ListUpdateResponse lur; + lur.set_platform_type(WINDOWS_PLATFORM); + lur.set_response_type(ListUpdateResponse::PARTIAL_UPDATE); + lur.set_threat_entry_type(URL_EXPRESSION); + lur.set_threat_type(MALWARE_THREAT); + lur.set_new_client_state("new_state_1"); + expected_lurs->push_back(lur); + + lur.set_platform_type(WINDOWS_PLATFORM); + lur.set_response_type(ListUpdateResponse::PARTIAL_UPDATE); + lur.set_threat_entry_type(URL_EXPRESSION); + lur.set_threat_type(UNWANTED_SOFTWARE); + lur.set_new_client_state("new_state_2"); + expected_lurs->push_back(lur); + + lur.set_platform_type(WINDOWS_PLATFORM); + lur.set_response_type(ListUpdateResponse::FULL_UPDATE); + lur.set_threat_entry_type(BINARY_DIGEST); + lur.set_threat_type(MALWARE_THREAT); + lur.set_new_client_state("new_state_3"); + expected_lurs->push_back(lur); } - void SetupCurrentListStates( - const base::hash_set<UpdateListIdentifier>& lists_to_update, - base::hash_map<UpdateListIdentifier, std::string>* current_list_states) { - // TODO(vakh): Implement this to test the cases when we have an existing - // state for some of the lists. - } - - std::string GetStockV4UpdateResponse() { + std::string GetExpectedV4UpdateResponse( + std::vector<ListUpdateResponse>& expected_lurs) const { FetchThreatListUpdatesResponse response; - ListUpdateResponse* lur = response.add_list_update_responses(); - lur->set_platform_type(WINDOWS_PLATFORM); - lur->set_response_type(ListUpdateResponse::PARTIAL_UPDATE); - lur->set_threat_entry_type(URL_EXPRESSION); - lur->set_threat_type(MALWARE_THREAT); - - lur = response.add_list_update_responses(); - lur->set_platform_type(WINDOWS_PLATFORM); - lur->set_response_type(ListUpdateResponse::PARTIAL_UPDATE); - lur->set_threat_entry_type(URL_EXPRESSION); - lur->set_threat_type(UNWANTED_SOFTWARE); - - lur = response.add_list_update_responses(); - lur->set_platform_type(WINDOWS_PLATFORM); - lur->set_response_type(ListUpdateResponse::FULL_UPDATE); - lur->set_threat_entry_type(BINARY_DIGEST); - lur->set_threat_type(MALWARE_THREAT); + for (const auto& expected_lur : expected_lurs) { + ListUpdateResponse* lur = response.add_list_update_responses(); + lur->set_new_client_state(expected_lur.new_client_state()); + lur->set_platform_type(expected_lur.platform_type()); + lur->set_response_type(expected_lur.response_type()); + lur->set_threat_entry_type(expected_lur.threat_entry_type()); + lur->set_threat_type(expected_lur.threat_type()); + } // Serialize. std::string res_data; @@ -102,37 +134,31 @@ return res_data; } + + bool expect_callback_to_be_called_; }; -void ValidateGetUpdatesResults( - const std::vector<ListUpdateResponse>& expected_lurs, - const std::vector<ListUpdateResponse>& list_update_responses) { - ASSERT_EQ(expected_lurs.size(), list_update_responses.size()); - - for (unsigned int i = 0; i < list_update_responses.size(); ++i) { - const ListUpdateResponse& expected = expected_lurs[i]; - const ListUpdateResponse& actual = list_update_responses[i]; - - EXPECT_EQ(expected.platform_type(), actual.platform_type()); - EXPECT_EQ(expected.response_type(), actual.response_type()); - EXPECT_EQ(expected.threat_entry_type(), actual.threat_entry_type()); - EXPECT_EQ(expected.threat_type(), actual.threat_type()); - - // TODO(vakh): Test more fields from the proto. - } -} - // TODO(vakh): Add many more tests. - TEST_F(V4UpdateProtocolManagerTest, TestGetUpdatesErrorHandlingNetwork) { + scoped_refptr<base::TestSimpleTaskRunner> runner( + new base::TestSimpleTaskRunner()); + base::ThreadTaskRunnerHandle runner_handler(runner); net::TestURLFetcherFactory factory; - scoped_ptr<V4UpdateProtocolManager> pm(CreateProtocolManager()); - - const std::vector<ListUpdateResponse> expected_lurs; - const base::hash_set<UpdateListIdentifier> lists_to_update; const base::hash_map<UpdateListIdentifier, std::string> current_list_states; - pm->GetUpdates(lists_to_update, current_list_states, - base::Bind(&ValidateGetUpdatesResults, expected_lurs)); + const std::vector<ListUpdateResponse> expected_lurs; + scoped_ptr<V4UpdateProtocolManager> pm( + CreateProtocolManager(current_list_states, expected_lurs)); + runner->ClearPendingTasks(); + + // Initial state. No errors. + EXPECT_EQ(0ul, pm->update_error_count_); + EXPECT_EQ(1ul, pm->update_back_off_mult_); + expect_callback_to_be_called_ = false; + pm->IssueUpdateRequest(); + + EXPECT_FALSE(pm->IsUpdateScheduled()); + + runner->RunPendingTasks(); net::TestURLFetcher* fetcher = factory.GetFetcherByID(0); DCHECK(fetcher); @@ -144,56 +170,131 @@ // Should have recorded one error, but back off multiplier is unchanged. EXPECT_EQ(1ul, pm->update_error_count_); EXPECT_EQ(1ul, pm->update_back_off_mult_); + EXPECT_TRUE(pm->IsUpdateScheduled()); } TEST_F(V4UpdateProtocolManagerTest, TestGetUpdatesErrorHandlingResponseCode) { + scoped_refptr<base::TestSimpleTaskRunner> runner( + new base::TestSimpleTaskRunner()); + base::ThreadTaskRunnerHandle runner_handler(runner); net::TestURLFetcherFactory factory; - scoped_ptr<V4UpdateProtocolManager> pm(CreateProtocolManager()); - const std::vector<ListUpdateResponse> expected_lurs; - const base::hash_set<UpdateListIdentifier> lists_to_update; const base::hash_map<UpdateListIdentifier, std::string> current_list_states; - pm->GetUpdates(lists_to_update, current_list_states, - base::Bind(&ValidateGetUpdatesResults, expected_lurs)); + scoped_ptr<V4UpdateProtocolManager> pm( + CreateProtocolManager(current_list_states, expected_lurs)); + runner->ClearPendingTasks(); + // Initial state. No errors. + EXPECT_EQ(0ul, pm->update_error_count_); + EXPECT_EQ(1ul, pm->update_back_off_mult_); + expect_callback_to_be_called_ = false; + pm->IssueUpdateRequest(); + + EXPECT_FALSE(pm->IsUpdateScheduled()); + + runner->RunPendingTasks(); net::TestURLFetcher* fetcher = factory.GetFetcherByID(0); DCHECK(fetcher); fetcher->set_status(net::URLRequestStatus()); // Response code of anything other than 200 should result in error. - fetcher->set_response_code(204); - fetcher->SetResponseString(GetStockV4UpdateResponse()); + fetcher->set_response_code(net::HTTP_NO_CONTENT); + fetcher->SetResponseString(""); fetcher->delegate()->OnURLFetchComplete(fetcher); // Should have recorded one error, but back off multiplier is unchanged. EXPECT_EQ(1ul, pm->update_error_count_); EXPECT_EQ(1ul, pm->update_back_off_mult_); + EXPECT_TRUE(pm->IsUpdateScheduled()); } TEST_F(V4UpdateProtocolManagerTest, TestGetUpdatesNoError) { + scoped_refptr<base::TestSimpleTaskRunner> runner( + new base::TestSimpleTaskRunner()); + base::ThreadTaskRunnerHandle runner_handler(runner); net::TestURLFetcherFactory factory; - scoped_ptr<V4UpdateProtocolManager> pm(CreateProtocolManager()); - - - const std::vector<ListUpdateResponse> expected_lurs; - base::hash_set<UpdateListIdentifier> lists_to_update; - SetupListsToUpdate(&lists_to_update); + std::vector<ListUpdateResponse> expected_lurs; + SetupExpectedListUpdateResponse(&expected_lurs); base::hash_map<UpdateListIdentifier, std::string> current_list_states; - SetupCurrentListStates(lists_to_update, ¤t_list_states); - pm->GetUpdates(lists_to_update, current_list_states, - base::Bind(&ValidateGetUpdatesResults, expected_lurs)); - ClearListsToUpdate(&lists_to_update); + SetupCurrentListStates(¤t_list_states); + scoped_ptr<V4UpdateProtocolManager> pm( + CreateProtocolManager(current_list_states, expected_lurs)); + runner->ClearPendingTasks(); + + // Initial state. No errors. + EXPECT_EQ(0ul, pm->update_error_count_); + EXPECT_EQ(1ul, pm->update_back_off_mult_); + expect_callback_to_be_called_ = true; + pm->IssueUpdateRequest(); + + EXPECT_FALSE(pm->IsUpdateScheduled()); + + runner->RunPendingTasks(); net::TestURLFetcher* fetcher = factory.GetFetcherByID(0); DCHECK(fetcher); fetcher->set_status(net::URLRequestStatus()); - fetcher->set_response_code(200); - fetcher->SetResponseString(GetStockV4UpdateResponse()); + fetcher->set_response_code(net::HTTP_OK); + fetcher->SetResponseString(GetExpectedV4UpdateResponse(expected_lurs)); fetcher->delegate()->OnURLFetchComplete(fetcher); // No error, back off multiplier is unchanged. EXPECT_EQ(0ul, pm->update_error_count_); EXPECT_EQ(1ul, pm->update_back_off_mult_); + EXPECT_TRUE(pm->IsUpdateScheduled()); +} + +TEST_F(V4UpdateProtocolManagerTest, TestGetUpdatesWithOneBackoff) { + scoped_refptr<base::TestSimpleTaskRunner> runner( + new base::TestSimpleTaskRunner()); + base::ThreadTaskRunnerHandle runner_handler(runner); + net::TestURLFetcherFactory factory; + std::vector<ListUpdateResponse> expected_lurs; + SetupExpectedListUpdateResponse(&expected_lurs); + base::hash_map<UpdateListIdentifier, std::string> current_list_states; + SetupCurrentListStates(¤t_list_states); + scoped_ptr<V4UpdateProtocolManager> pm( + CreateProtocolManager(current_list_states, expected_lurs)); + runner->ClearPendingTasks(); + + // Initial state. No errors. + EXPECT_EQ(0ul, pm->update_error_count_); + EXPECT_EQ(1ul, pm->update_back_off_mult_); + expect_callback_to_be_called_ = false; + pm->IssueUpdateRequest(); + + EXPECT_FALSE(pm->IsUpdateScheduled()); + + runner->RunPendingTasks(); + + net::TestURLFetcher* fetcher = factory.GetFetcherByID(0); + DCHECK(fetcher); + fetcher->set_status(net::URLRequestStatus()); + // Response code of anything other than 200 should result in error. + fetcher->set_response_code(net::HTTP_NO_CONTENT); + fetcher->SetResponseString(""); + fetcher->delegate()->OnURLFetchComplete(fetcher); + + // Should have recorded one error, but back off multiplier is unchanged. + EXPECT_EQ(1ul, pm->update_error_count_); + EXPECT_EQ(1ul, pm->update_back_off_mult_); + EXPECT_TRUE(pm->IsUpdateScheduled()); + + // Retry, now no backoff. + expect_callback_to_be_called_ = true; + runner->RunPendingTasks(); + + fetcher = factory.GetFetcherByID(1); + DCHECK(fetcher); + fetcher->set_status(net::URLRequestStatus()); + fetcher->set_response_code(net::HTTP_OK); + fetcher->SetResponseString(GetExpectedV4UpdateResponse(expected_lurs)); + fetcher->delegate()->OnURLFetchComplete(fetcher); + + // No error, back off multiplier is unchanged. + EXPECT_EQ(0ul, pm->update_error_count_); + EXPECT_EQ(1ul, pm->update_back_off_mult_); + EXPECT_TRUE(pm->IsUpdateScheduled()); } } // namespace safe_browsing
diff --git a/components/scheduler/base/task_queue_impl.h b/components/scheduler/base/task_queue_impl.h index 4f02163..887bcbe8 100644 --- a/components/scheduler/base/task_queue_impl.h +++ b/components/scheduler/base/task_queue_impl.h
@@ -10,6 +10,7 @@ #include <set> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/pending_task.h" #include "base/threading/thread_checker.h" #include "base/trace_event/trace_event.h"
diff --git a/components/scheduler/base/task_queue_manager.cc b/components/scheduler/base/task_queue_manager.cc index fcbabe4..188413c 100644 --- a/components/scheduler/base/task_queue_manager.cc +++ b/components/scheduler/base/task_queue_manager.cc
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/metrics/histogram_macros.h" -#include "base/trace_event/trace_event.h" #include "components/scheduler/base/real_time_domain.h" #include "components/scheduler/base/task_queue_impl.h" #include "components/scheduler/base/task_queue_manager_delegate.h"
diff --git a/components/scheduler/base/task_queue_manager_delegate_for_test.h b/components/scheduler/base/task_queue_manager_delegate_for_test.h index 4693782..7a3dbf6 100644 --- a/components/scheduler/base/task_queue_manager_delegate_for_test.h +++ b/components/scheduler/base/task_queue_manager_delegate_for_test.h
@@ -6,6 +6,7 @@ #define COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_MANAGER_DELEGATE_FOR_TEST_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/time/tick_clock.h" #include "components/scheduler/base/task_queue_manager_delegate.h"
diff --git a/components/scheduler/base/time_domain.cc b/components/scheduler/base/time_domain.cc index 5932adca..61851c53 100644 --- a/components/scheduler/base/time_domain.cc +++ b/components/scheduler/base/time_domain.cc
@@ -17,26 +17,17 @@ TimeDomain::~TimeDomain() { DCHECK(main_thread_checker_.CalledOnValidThread()); -#if DCHECK_IS_ON() - DCHECK(registered_task_queues_.empty()); -#endif } void TimeDomain::RegisterQueue(internal::TaskQueueImpl* queue) { DCHECK(main_thread_checker_.CalledOnValidThread()); DCHECK_EQ(queue->GetTimeDomain(), this); -#if DCHECK_IS_ON() - registered_task_queues_.insert(queue); -#endif } void TimeDomain::UnregisterQueue(internal::TaskQueueImpl* queue) { DCHECK(main_thread_checker_.CalledOnValidThread()); DCHECK_EQ(queue->GetTimeDomain(), this); UnregisterAsUpdatableTaskQueue(queue); -#if DCHECK_IS_ON() - registered_task_queues_.erase(queue); -#endif // We need to remove |task_queue| from delayed_wakeup_multimap_ which is a // little awkward since it's keyed by time. O(n) running time. @@ -57,14 +48,6 @@ DCHECK_EQ(queue->GetTimeDomain(), this); DCHECK(destination_time_domain); UnregisterAsUpdatableTaskQueue(queue); -#if DCHECK_IS_ON() - DCHECK(registered_task_queues_.find(queue) != registered_task_queues_.end()); - registered_task_queues_.erase(queue); - - // NOTE it's the responsibility of the caller to make sure - // |queue->GetTimeDomain()| is updated. - destination_time_domain->registered_task_queues_.insert(queue); -#endif base::TimeTicks destination_now = destination_time_domain->Now(); // We need to remove |task_queue| from delayed_wakeup_multimap_ which is a @@ -86,9 +69,6 @@ base::TimeTicks delayed_run_time, base::TimeTicks now) { DCHECK(main_thread_checker_.CalledOnValidThread()); -#if DCHECK_IS_ON() - DCHECK(registered_task_queues_.find(queue) != registered_task_queues_.end()); -#endif if (delayed_wakeup_multimap_.empty() || delayed_run_time < delayed_wakeup_multimap_.begin()->first) { base::TimeDelta delay = std::max(base::TimeDelta(), delayed_run_time - now); @@ -101,9 +81,6 @@ } void TimeDomain::RegisterAsUpdatableTaskQueue(internal::TaskQueueImpl* queue) { -#if DCHECK_IS_ON() - DCHECK(registered_task_queues_.find(queue) != registered_task_queues_.end()); -#endif { base::AutoLock lock(newly_updatable_lock_); newly_updatable_.push_back(queue); @@ -114,9 +91,6 @@ void TimeDomain::UnregisterAsUpdatableTaskQueue( internal::TaskQueueImpl* queue) { -#if DCHECK_IS_ON() - DCHECK(registered_task_queues_.find(queue) != registered_task_queues_.end()); -#endif DCHECK(main_thread_checker_.CalledOnValidThread()); updatable_queue_set_.erase(queue);
diff --git a/components/scheduler/base/time_domain.h b/components/scheduler/base/time_domain.h index fa2e1de8..3938891 100644 --- a/components/scheduler/base/time_domain.h +++ b/components/scheduler/base/time_domain.h
@@ -151,10 +151,6 @@ // only be accessed from the main thread. std::set<internal::TaskQueueImpl*> updatable_queue_set_; -#if DCHECK_IS_ON() - std::set<internal::TaskQueueImpl*> registered_task_queues_; -#endif - Observer* observer_; // NOT OWNED. base::ThreadChecker main_thread_checker_;
diff --git a/components/scheduler/child/scheduler_tqm_delegate_for_test.h b/components/scheduler/child/scheduler_tqm_delegate_for_test.h index 1fc73414..5fd1487a 100644 --- a/components/scheduler/child/scheduler_tqm_delegate_for_test.h +++ b/components/scheduler/child/scheduler_tqm_delegate_for_test.h
@@ -6,6 +6,7 @@ #define CONTENT_RENDERER_SCHEDULER_TQM_DELEGATE_FOR_TEST_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/test/simple_test_tick_clock.h" #include "components/scheduler/child/scheduler_tqm_delegate.h"
diff --git a/components/scheduler/child/scheduler_tqm_delegate_impl.h b/components/scheduler/child/scheduler_tqm_delegate_impl.h index a41ac676..3f561a7 100644 --- a/components/scheduler/child/scheduler_tqm_delegate_impl.h +++ b/components/scheduler/child/scheduler_tqm_delegate_impl.h
@@ -6,6 +6,7 @@ #define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TQM_DELEGATE_IMPL_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/time/tick_clock.h" #include "components/scheduler/child/scheduler_tqm_delegate.h"
diff --git a/components/scheduler/child/worker_scheduler.h b/components/scheduler/child/worker_scheduler.h index b5bd250..0922eb6 100644 --- a/components/scheduler/child/worker_scheduler.h +++ b/components/scheduler/child/worker_scheduler.h
@@ -6,6 +6,7 @@ #define COMPONENTS_SCHEDULER_CHILD_WORKER_SCHEDULER_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "components/scheduler/child/child_scheduler.h" #include "components/scheduler/child/single_thread_idle_task_runner.h"
diff --git a/components/scheduler/renderer/renderer_scheduler.h b/components/scheduler/renderer/renderer_scheduler.h index 58c982e..50f21f6 100644 --- a/components/scheduler/renderer/renderer_scheduler.h +++ b/components/scheduler/renderer/renderer_scheduler.h
@@ -6,6 +6,7 @@ #define COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "components/scheduler/child/child_scheduler.h" #include "components/scheduler/child/single_thread_idle_task_runner.h"
diff --git a/components/scheduler/renderer/task_cost_estimator_unittest.cc b/components/scheduler/renderer/task_cost_estimator_unittest.cc index ec6fb1b..97247f0 100644 --- a/components/scheduler/renderer/task_cost_estimator_unittest.cc +++ b/components/scheduler/renderer/task_cost_estimator_unittest.cc
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/memory/scoped_ptr.h" #include "base/test/simple_test_tick_clock.h" #include "components/scheduler/base/test_time_source.h" #include "components/scheduler/renderer/task_cost_estimator.h" - #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h b/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h index 810b548..714cd235 100644 --- a/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h +++ b/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h
@@ -6,6 +6,7 @@ #define COMPONENTS_SCHEDULER_TEST_LAZY_SCHEDULER_MESSAGE_LOOP_DELEGATE_FOR_TESTS_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/time/tick_clock.h" #include "components/scheduler/child/scheduler_tqm_delegate.h"
diff --git a/components/search/search_unittest.cc b/components/search/search_unittest.cc index 76b8bce..e8cf6c09 100644 --- a/components/search/search_unittest.cc +++ b/components/search/search_unittest.cc
@@ -4,6 +4,7 @@ #include "components/search/search.h" +#include "base/memory/scoped_ptr.h" #include "base/metrics/field_trial.h" #include "base/metrics/statistics_recorder.h" #include "build/build_config.h"
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json index 9f7608d..27748953 100644 --- a/components/search_engines/prepopulated_engines.json +++ b/components/search_engines/prepopulated_engines.json
@@ -30,7 +30,7 @@ // Increment this if you change the data in ways that mean users with // existing data should get a new version. - "kCurrentDataVersion": 89 + "kCurrentDataVersion": 90 }, // The following engines are included in country lists and are added to the @@ -91,7 +91,9 @@ "favicon_url": "https://www.bing.com/s/a/bing_p.ico", "search_url": "https://www.bing.com/search?q={searchTerms}&PC=U316&FORM=CHROMN", "suggest_url": "https://www.bing.com/osjson.aspx?query={searchTerms}&language={language}&PC=U316", + "image_url": "https://www.bing.com/images/detail/search?iss=sbi&FORM=CHROMI#enterInsights", "new_tab_url": "https://www.bing.com/chrome/newtab", + "image_url_post_params": "imgurl={google:imageURL}", "type": "SEARCH_ENGINE_BING", "id": 3 },
diff --git a/components/signin/core/account_id/account_id.cc b/components/signin/core/account_id/account_id.cc index c2a8a39..7bd86ef 100644 --- a/components/signin/core/account_id/account_id.cc +++ b/components/signin/core/account_id/account_id.cc
@@ -8,6 +8,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/strings/string_util.h" #include "base/values.h"
diff --git a/components/sync_driver/local_device_info_provider.h b/components/sync_driver/local_device_info_provider.h index 464146f1..a192964 100644 --- a/components/sync_driver/local_device_info_provider.h +++ b/components/sync_driver/local_device_info_provider.h
@@ -6,7 +6,9 @@ #define COMPONENTS_SYNC_DRIVER_LOCAL_DEVICE_INFO_PROVIDER_H_ #include <string> + #include "base/callback_list.h" +#include "base/memory/scoped_ptr.h" namespace base { class TaskRunner;
diff --git a/components/test_runner/BUILD.gn b/components/test_runner/BUILD.gn index 8bfbeb5..6408e9c 100644 --- a/components/test_runner/BUILD.gn +++ b/components/test_runner/BUILD.gn
@@ -77,6 +77,8 @@ "web_ax_object_proxy.h", "web_content_settings.cc", "web_content_settings.h", + "web_frame_test_client.cc", + "web_frame_test_client.h", "web_frame_test_proxy.h", "web_task.cc", "web_task.h", @@ -109,8 +111,6 @@ "//ui/gfx/geometry", "//url", "//v8", - - #'copy_test_netscape_plugin', TODO(GYP) ] }
diff --git a/components/test_runner/mock_color_chooser.cc b/components/test_runner/mock_color_chooser.cc index 55d586b3..cccdf0d 100644 --- a/components/test_runner/mock_color_chooser.cc +++ b/components/test_runner/mock_color_chooser.cc
@@ -4,8 +4,8 @@ #include "components/test_runner/mock_color_chooser.h" +#include "components/test_runner/test_runner.h" #include "components/test_runner/web_test_delegate.h" -#include "components/test_runner/web_test_proxy.h" namespace test_runner { @@ -27,15 +27,13 @@ MockColorChooser::MockColorChooser(blink::WebColorChooserClient* client, WebTestDelegate* delegate, - WebTestProxyBase* proxy) - : client_(client), - delegate_(delegate), - proxy_(proxy) { - proxy_->DidOpenChooser(); + TestRunner* test_runner) + : client_(client), delegate_(delegate), test_runner_(test_runner) { + test_runner_->DidOpenChooser(); } MockColorChooser::~MockColorChooser() { - proxy_->DidCloseChooser(); + test_runner_->DidCloseChooser(); } void MockColorChooser::setSelectedColor(const blink::WebColor color) {}
diff --git a/components/test_runner/mock_color_chooser.h b/components/test_runner/mock_color_chooser.h index 0948aae8..7ff49201 100644 --- a/components/test_runner/mock_color_chooser.h +++ b/components/test_runner/mock_color_chooser.h
@@ -12,30 +12,34 @@ namespace test_runner { +class TestRunner; class WebTestDelegate; -class WebTestProxyBase; class MockColorChooser : public blink::WebColorChooser { -public: - MockColorChooser(blink::WebColorChooserClient* client, - WebTestDelegate* delegate, - WebTestProxyBase* proxy); - ~MockColorChooser() override; + public: + // Caller has to guarantee that |client| and |delegate| are alive + // until |WebColorChooserClient::didEndChooser| is called. + // Caller has to guarantee that |test_runner| lives longer + // than MockColorChooser. + MockColorChooser(blink::WebColorChooserClient* client, + WebTestDelegate* delegate, + TestRunner* test_runner); + ~MockColorChooser() override; - // blink::WebColorChooser implementation. - void setSelectedColor(const blink::WebColor color) override; - void endChooser() override; + // blink::WebColorChooser implementation. + void setSelectedColor(const blink::WebColor color) override; + void endChooser() override; - void InvokeDidEndChooser(); - WebTaskList* mutable_task_list() { return &task_list_; } + void InvokeDidEndChooser(); + WebTaskList* mutable_task_list() { return &task_list_; } -private: - blink::WebColorChooserClient* client_; - WebTestDelegate* delegate_; - WebTestProxyBase* proxy_; - WebTaskList task_list_; + private: + blink::WebColorChooserClient* client_; + WebTestDelegate* delegate_; + TestRunner* test_runner_; + WebTaskList task_list_; - DISALLOW_COPY_AND_ASSIGN(MockColorChooser); + DISALLOW_COPY_AND_ASSIGN(MockColorChooser); }; } // namespace test_runner
diff --git a/components/test_runner/test_common.cc b/components/test_runner/test_common.cc index c488b111..ecd58ea 100644 --- a/components/test_runner/test_common.cc +++ b/components/test_runner/test_common.cc
@@ -11,6 +11,7 @@ #include "base/rand_util.h" #include "third_party/WebKit/public/platform/Platform.h" #include "third_party/WebKit/public/web/WebKit.h" +#include "third_party/WebKit/public/web/WebNavigationPolicy.h" namespace test_runner { @@ -44,6 +45,15 @@ base::LazyInstance<MockBlinkPlatform>::Leaky g_mock_blink_platform = LAZY_INSTANCE_INITIALIZER; +const char* kIllegalString = "illegal value"; +const char* kPolicyIgnore = "Ignore"; +const char* kPolicyDownload = "download"; +const char* kPolicyCurrentTab = "current tab"; +const char* kPolicyNewBackgroundTab = "new background tab"; +const char* kPolicyNewForegroundTab = "new foreground tab"; +const char* kPolicyNewWindow = "new window"; +const char* kPolicyNewPopup = "new popup"; + } // namespace std::string NormalizeLayoutTestURL(const std::string& url) { @@ -61,6 +71,34 @@ return result; } +std::string URLDescription(const GURL& url) { + if (url.SchemeIs(url::kFileScheme)) + return url.ExtractFileName(); + return url.possibly_invalid_spec(); +} + +const char* WebNavigationPolicyToString( + const blink::WebNavigationPolicy& policy) { + switch (policy) { + case blink::WebNavigationPolicyIgnore: + return kPolicyIgnore; + case blink::WebNavigationPolicyDownload: + return kPolicyDownload; + case blink::WebNavigationPolicyCurrentTab: + return kPolicyCurrentTab; + case blink::WebNavigationPolicyNewBackgroundTab: + return kPolicyNewBackgroundTab; + case blink::WebNavigationPolicyNewForegroundTab: + return kPolicyNewForegroundTab; + case blink::WebNavigationPolicyNewWindow: + return kPolicyNewWindow; + case blink::WebNavigationPolicyNewPopup: + return kPolicyNewPopup; + default: + return kIllegalString; + } +} + void EnsureBlinkInitialized() { g_mock_blink_platform.Get(); }
diff --git a/components/test_runner/test_common.h b/components/test_runner/test_common.h index 429f969..d1e758b 100644 --- a/components/test_runner/test_common.h +++ b/components/test_runner/test_common.h
@@ -8,6 +8,9 @@ #include <string> #include "components/test_runner/test_runner_export.h" +#include "third_party/WebKit/public/web/WebNavigationPolicy.h" + +class GURL; namespace test_runner { @@ -21,6 +24,10 @@ TEST_RUNNER_EXPORT std::string NormalizeLayoutTestURL(const std::string& url); +std::string URLDescription(const GURL& url); +const char* WebNavigationPolicyToString( + const blink::WebNavigationPolicy& policy); + // Tests which depend on Blink must call this function on the main thread // before creating/calling any Blink objects/APIs. TEST_RUNNER_EXPORT void EnsureBlinkInitialized();
diff --git a/components/test_runner/test_plugin.cc b/components/test_runner/test_plugin.cc index 2efbb3f..2ac4634d 100644 --- a/components/test_runner/test_plugin.cc +++ b/components/test_runner/test_plugin.cc
@@ -24,6 +24,7 @@ #include "third_party/WebKit/public/platform/WebTaskRunner.h" #include "third_party/WebKit/public/platform/WebThread.h" #include "third_party/WebKit/public/platform/WebTraceLocation.h" +#include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/web/WebFrame.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "third_party/WebKit/public/web/WebKit.h" @@ -173,11 +174,14 @@ } bool TestPlugin::initialize(blink::WebPluginContainer* container) { - blink::WebGraphicsContext3D::Attributes attrs; + blink::Platform::ContextAttributes attrs; + DCHECK(!container->element().isNull()); + DCHECK(!container->element().document().isNull()); + blink::WebURL url = container->element().document().url(); blink::Platform::GraphicsInfo gl_info; context_provider_ = make_scoped_ptr( blink::Platform::current()->createOffscreenGraphicsContext3DProvider( - attrs, nullptr, &gl_info)); + attrs, url, nullptr, &gl_info)); context_ = context_provider_ ? context_provider_->context3d() : nullptr; gl_ = context_provider_ ? context_provider_->contextGL() : nullptr;
diff --git a/components/test_runner/test_plugin.h b/components/test_runner/test_plugin.h index f58adc7..8dba678b 100644 --- a/components/test_runner/test_plugin.h +++ b/components/test_runner/test_plugin.h
@@ -15,6 +15,8 @@ #include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h" #include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h" #include "third_party/WebKit/public/platform/WebLayer.h" +#include "third_party/WebKit/public/web/WebDocument.h" +#include "third_party/WebKit/public/web/WebElement.h" #include "third_party/WebKit/public/web/WebPlugin.h" #include "third_party/WebKit/public/web/WebPluginContainer.h" #include "third_party/khronos/GLES2/gl2.h"
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc index 41a7f15..9780b1e 100644 --- a/components/test_runner/test_runner.cc +++ b/components/test_runner/test_runner.cc
@@ -19,6 +19,7 @@ #include "components/test_runner/mock_credential_manager_client.h" #include "components/test_runner/mock_screen_orientation_client.h" #include "components/test_runner/mock_web_speech_recognizer.h" +#include "components/test_runner/mock_web_user_media_client.h" #include "components/test_runner/test_interfaces.h" #include "components/test_runner/test_preferences.h" #include "components/test_runner/web_content_settings.h" @@ -1669,6 +1670,7 @@ web_view_(nullptr), web_content_settings_(new WebContentSettings()), mock_screen_orientation_client_(new MockScreenOrientationClient), + chooser_count_(0), weak_factory_(this) {} TestRunner::~TestRunner() {} @@ -2520,6 +2522,12 @@ return mock_screen_orientation_client_.get(); } +MockWebUserMediaClient* TestRunner::getMockWebUserMediaClient() { + if (!user_media_client_.get()) + user_media_client_.reset(new MockWebUserMediaClient(delegate_)); + return user_media_client_.get(); +} + void TestRunner::SetMockScreenOrientation(const std::string& orientation_str) { blink::WebScreenOrientationType orientation; @@ -2544,6 +2552,15 @@ mock_screen_orientation_client_->SetDisabled(true); } +void TestRunner::DidOpenChooser() { + chooser_count_++; +} + +void TestRunner::DidCloseChooser() { + chooser_count_--; + DCHECK_LE(0, chooser_count_); +} + void TestRunner::DidAcquirePointerLock() { DidAcquirePointerLockInternal(); } @@ -2853,7 +2870,7 @@ } bool TestRunner::IsChooserShown() { - return proxy_->IsChooserShown(); + return 0 < chooser_count_; } void TestRunner::EvaluateInWebInspector(int call_id,
diff --git a/components/test_runner/test_runner.gyp b/components/test_runner/test_runner.gyp index 1d3e9d8e..e3777fef 100644 --- a/components/test_runner/test_runner.gyp +++ b/components/test_runner/test_runner.gyp
@@ -104,6 +104,8 @@ 'web_ax_object_proxy.h', 'web_content_settings.cc', 'web_content_settings.h', + 'web_frame_test_client.cc', + 'web_frame_test_client.h', 'web_frame_test_proxy.h', 'web_task.cc', 'web_task.h',
diff --git a/components/test_runner/test_runner.h b/components/test_runner/test_runner.h index 81a5ef0..73202506 100644 --- a/components/test_runner/test_runner.h +++ b/components/test_runner/test_runner.h
@@ -42,6 +42,7 @@ class InvokeCallbackTask; class MockScreenOrientationClient; +class MockWebUserMediaClient; class TestInterfaces; class WebContentSettings; class WebTestDelegate; @@ -81,9 +82,10 @@ bool ShouldDumpBackForwardList() const override; blink::WebContentSettingsClient* GetWebContentSettings() const override; - // Methods used by WebTestProxyBase. + // Methods used by WebTestProxyBase and WebFrameTestClient. bool shouldStayOnPageAfterHandlingBeforeUnload() const; MockScreenOrientationClient* getMockScreenOrientationClient(); + MockWebUserMediaClient* getMockWebUserMediaClient(); bool shouldDumpSelectionRect() const; bool isPrinting() const; bool shouldDumpAsTextWithPixelResults(); @@ -131,6 +133,10 @@ bool midiAccessorResult(); + // Methods used by MockColorChooser: + void DidOpenChooser(); + void DidCloseChooser(); + // A single item in the work queue. class WorkItem { public: @@ -806,6 +812,10 @@ bool use_mock_theme_; scoped_ptr<MockScreenOrientationClient> mock_screen_orientation_client_; + scoped_ptr<MockWebUserMediaClient> user_media_client_; + + // Number of currently active color choosers. + int chooser_count_; base::WeakPtrFactory<TestRunner> weak_factory_;
diff --git a/components/test_runner/web_frame_test_client.cc b/components/test_runner/web_frame_test_client.cc new file mode 100644 index 0000000..b70dfae8 --- /dev/null +++ b/components/test_runner/web_frame_test_client.cc
@@ -0,0 +1,765 @@ +// 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. + +#include "components/test_runner/web_frame_test_client.h" + +#include "base/memory/scoped_ptr.h" +#include "base/strings/string_piece.h" +#include "base/strings/string_util.h" +#include "base/strings/stringprintf.h" +#include "components/test_runner/accessibility_controller.h" +#include "components/test_runner/event_sender.h" +#include "components/test_runner/mock_color_chooser.h" +#include "components/test_runner/mock_screen_orientation_client.h" +#include "components/test_runner/mock_web_user_media_client.h" +#include "components/test_runner/test_common.h" +#include "components/test_runner/test_plugin.h" +#include "components/test_runner/test_runner.h" +#include "components/test_runner/web_test_delegate.h" +#include "third_party/WebKit/public/platform/WebString.h" +#include "third_party/WebKit/public/platform/WebURL.h" +#include "third_party/WebKit/public/platform/WebURLRequest.h" +#include "third_party/WebKit/public/platform/WebURLResponse.h" +#include "third_party/WebKit/public/web/WebConsoleMessage.h" +#include "third_party/WebKit/public/web/WebElement.h" +#include "third_party/WebKit/public/web/WebFrame.h" +#include "third_party/WebKit/public/web/WebLocalFrame.h" +#include "third_party/WebKit/public/web/WebNavigationPolicy.h" +#include "third_party/WebKit/public/web/WebPluginParams.h" +#include "third_party/WebKit/public/web/WebUserGestureIndicator.h" +#include "third_party/WebKit/public/web/WebView.h" +#include "url/gurl.h" +#include "url/url_constants.h" + +namespace test_runner { + +namespace { + +void PrintFrameDescription(WebTestDelegate* delegate, blink::WebFrame* frame) { + std::string name8 = frame->uniqueName().utf8(); + if (frame == frame->view()->mainFrame()) { + if (!name8.length()) { + delegate->PrintMessage("main frame"); + return; + } + delegate->PrintMessage(std::string("main frame \"") + name8 + "\""); + return; + } + if (!name8.length()) { + delegate->PrintMessage("frame (anonymous)"); + return; + } + delegate->PrintMessage(std::string("frame \"") + name8 + "\""); +} + +void PrintFrameuserGestureStatus(WebTestDelegate* delegate, + blink::WebFrame* frame, + const char* msg) { + bool is_user_gesture = + blink::WebUserGestureIndicator::isProcessingUserGesture(); + delegate->PrintMessage(std::string("Frame with user gesture \"") + + (is_user_gesture ? "true" : "false") + "\"" + msg); +} + +// Used to write a platform neutral file:/// URL by taking the +// filename and its directory. (e.g., converts +// "file:///tmp/foo/bar.txt" to just "bar.txt"). +std::string DescriptionSuitableForTestResult(const std::string& url) { + if (url.empty() || std::string::npos == url.find("file://")) + return url; + + size_t pos = url.rfind('/'); + if (pos == std::string::npos || !pos) + return "ERROR:" + url; + pos = url.rfind('/', pos - 1); + if (pos == std::string::npos) + return "ERROR:" + url; + + return url.substr(pos + 1); +} + +void PrintResponseDescription(WebTestDelegate* delegate, + const blink::WebURLResponse& response) { + if (response.isNull()) { + delegate->PrintMessage("(null)"); + return; + } + delegate->PrintMessage(base::StringPrintf( + "<NSURLResponse %s, http status code %d>", + DescriptionSuitableForTestResult(response.url().string().utf8()).c_str(), + response.httpStatusCode())); +} + +std::string PriorityDescription( + const blink::WebURLRequest::Priority& priority) { + switch (priority) { + case blink::WebURLRequest::PriorityVeryLow: + return "VeryLow"; + case blink::WebURLRequest::PriorityLow: + return "Low"; + case blink::WebURLRequest::PriorityMedium: + return "Medium"; + case blink::WebURLRequest::PriorityHigh: + return "High"; + case blink::WebURLRequest::PriorityVeryHigh: + return "VeryHigh"; + case blink::WebURLRequest::PriorityUnresolved: + default: + return "Unresolved"; + } +} + +void BlockRequest(blink::WebURLRequest& request) { + request.setURL(GURL("255.255.255.255")); +} + +bool IsLocalHost(const std::string& host) { + return host == "127.0.0.1" || host == "localhost"; +} + +bool IsTestHost(const std::string& host) { + return base::EndsWith(host, ".test", base::CompareCase::INSENSITIVE_ASCII); +} + +bool HostIsUsedBySomeTestsToGenerateError(const std::string& host) { + return host == "255.255.255.255"; +} + +// Used to write a platform neutral file:/// URL by only taking the filename +// (e.g., converts "file:///tmp/foo.txt" to just "foo.txt"). +std::string URLSuitableForTestResult(const std::string& url) { + if (url.empty() || std::string::npos == url.find("file://")) + return url; + + size_t pos = url.rfind('/'); + if (pos == std::string::npos) { +#ifdef WIN32 + pos = url.rfind('\\'); + if (pos == std::string::npos) + pos = 0; +#else + pos = 0; +#endif + } + std::string filename = url.substr(pos + 1); + if (filename.empty()) + return "file:"; // A WebKit test has this in its expected output. + return filename; +} + +// WebNavigationType debugging strings taken from PolicyDelegate.mm. +const char* kLinkClickedString = "link clicked"; +const char* kFormSubmittedString = "form submitted"; +const char* kBackForwardString = "back/forward"; +const char* kReloadString = "reload"; +const char* kFormResubmittedString = "form resubmitted"; +const char* kOtherString = "other"; +const char* kIllegalString = "illegal value"; + +// Get a debugging string from a WebNavigationType. +const char* WebNavigationTypeToString(blink::WebNavigationType type) { + switch (type) { + case blink::WebNavigationTypeLinkClicked: + return kLinkClickedString; + case blink::WebNavigationTypeFormSubmitted: + return kFormSubmittedString; + case blink::WebNavigationTypeBackForward: + return kBackForwardString; + case blink::WebNavigationTypeReload: + return kReloadString; + case blink::WebNavigationTypeFormResubmitted: + return kFormResubmittedString; + case blink::WebNavigationTypeOther: + return kOtherString; + } + return kIllegalString; +} + +enum CheckDoneReason { + LoadFinished, + MainResourceLoadFailed, + ResourceLoadCompleted +}; +void CheckDone(blink::WebLocalFrame* frame, + CheckDoneReason reason, + TestRunner* test_runner) { + if (frame != test_runner->topLoadingFrame()) + return; + if (reason != MainResourceLoadFailed && + (frame->isResourceLoadInProgress() || frame->isLoading())) + return; + test_runner->setTopLoadingFrame(frame, true); +} + +} // namespace + +WebFrameTestClient::WebFrameTestClient( + TestRunner* test_runner, + WebTestDelegate* delegate, + AccessibilityController* accessibility_controller, + EventSender* event_sender) + : test_runner_(test_runner), + delegate_(delegate), + accessibility_controller_(accessibility_controller), + event_sender_(event_sender) {} + +WebFrameTestClient::~WebFrameTestClient() {} + +blink::WebColorChooser* WebFrameTestClient::createColorChooser( + blink::WebColorChooserClient* client, + const blink::WebColor& color, + const blink::WebVector<blink::WebColorSuggestion>& suggestions) { + // This instance is deleted by WebCore::ColorInputType + return new MockColorChooser(client, delegate_, test_runner_); +} + +void WebFrameTestClient::runModalAlertDialog(const blink::WebString& message) { + delegate_->PrintMessage(std::string("ALERT: ") + message.utf8().data() + + "\n"); +} + +bool WebFrameTestClient::runModalConfirmDialog( + const blink::WebString& message) { + delegate_->PrintMessage(std::string("CONFIRM: ") + message.utf8().data() + + "\n"); + return true; +} + +bool WebFrameTestClient::runModalPromptDialog( + const blink::WebString& message, + const blink::WebString& default_value, + blink::WebString* actual_value) { + delegate_->PrintMessage(std::string("PROMPT: ") + message.utf8().data() + + ", default text: " + default_value.utf8().data() + + "\n"); + return true; +} + +bool WebFrameTestClient::runModalBeforeUnloadDialog(bool is_reload) { + delegate_->PrintMessage(std::string("CONFIRM NAVIGATION\n")); + return !test_runner_->shouldStayOnPageAfterHandlingBeforeUnload(); +} + +blink::WebScreenOrientationClient* +WebFrameTestClient::webScreenOrientationClient() { + return test_runner_->getMockScreenOrientationClient(); +} + +void WebFrameTestClient::postAccessibilityEvent(const blink::WebAXObject& obj, + blink::WebAXEvent event) { + // Only hook the accessibility events occured during the test run. + // This check prevents false positives in WebLeakDetector. + // The pending tasks in browser/renderer message queue may trigger + // accessibility events, + // and AccessibilityController will hold on to their target nodes if we don't + // ignore them here. + if (!test_runner_->TestIsRunning()) + return; + + const char* event_name = NULL; + switch (event) { + case blink::WebAXEventActiveDescendantChanged: + event_name = "ActiveDescendantChanged"; + break; + case blink::WebAXEventAlert: + event_name = "Alert"; + break; + case blink::WebAXEventAriaAttributeChanged: + event_name = "AriaAttributeChanged"; + break; + case blink::WebAXEventAutocorrectionOccured: + event_name = "AutocorrectionOccured"; + break; + case blink::WebAXEventBlur: + event_name = "Blur"; + break; + case blink::WebAXEventCheckedStateChanged: + event_name = "CheckedStateChanged"; + break; + case blink::WebAXEventChildrenChanged: + event_name = "ChildrenChanged"; + break; + case blink::WebAXEventClicked: + event_name = "Clicked"; + break; + case blink::WebAXEventDocumentSelectionChanged: + event_name = "DocumentSelectionChanged"; + break; + case blink::WebAXEventFocus: + event_name = "Focus"; + break; + case blink::WebAXEventHide: + event_name = "Hide"; + break; + case blink::WebAXEventHover: + event_name = "Hover"; + break; + case blink::WebAXEventInvalidStatusChanged: + event_name = "InvalidStatusChanged"; + break; + case blink::WebAXEventLayoutComplete: + event_name = "LayoutComplete"; + break; + case blink::WebAXEventLiveRegionChanged: + event_name = "LiveRegionChanged"; + break; + case blink::WebAXEventLoadComplete: + event_name = "LoadComplete"; + break; + case blink::WebAXEventLocationChanged: + event_name = "LocationChanged"; + break; + case blink::WebAXEventMenuListItemSelected: + event_name = "MenuListItemSelected"; + break; + case blink::WebAXEventMenuListItemUnselected: + event_name = "MenuListItemUnselected"; + break; + case blink::WebAXEventMenuListValueChanged: + event_name = "MenuListValueChanged"; + break; + case blink::WebAXEventRowCollapsed: + event_name = "RowCollapsed"; + break; + case blink::WebAXEventRowCountChanged: + event_name = "RowCountChanged"; + break; + case blink::WebAXEventRowExpanded: + event_name = "RowExpanded"; + break; + case blink::WebAXEventScrollPositionChanged: + event_name = "ScrollPositionChanged"; + break; + case blink::WebAXEventScrolledToAnchor: + event_name = "ScrolledToAnchor"; + break; + case blink::WebAXEventSelectedChildrenChanged: + event_name = "SelectedChildrenChanged"; + break; + case blink::WebAXEventSelectedTextChanged: + event_name = "SelectedTextChanged"; + break; + case blink::WebAXEventShow: + event_name = "Show"; + break; + case blink::WebAXEventTextChanged: + event_name = "TextChanged"; + break; + case blink::WebAXEventTextInserted: + event_name = "TextInserted"; + break; + case blink::WebAXEventTextRemoved: + event_name = "TextRemoved"; + break; + case blink::WebAXEventValueChanged: + event_name = "ValueChanged"; + break; + default: + event_name = "Unknown"; + break; + } + + accessibility_controller_->NotificationReceived(obj, event_name); + if (accessibility_controller_->ShouldLogAccessibilityEvents()) { + std::string message("AccessibilityNotification - "); + message += event_name; + + blink::WebNode node = obj.node(); + if (!node.isNull() && node.isElementNode()) { + blink::WebElement element = node.to<blink::WebElement>(); + if (element.hasAttribute("id")) { + message += " - id:"; + message += element.getAttribute("id").utf8().data(); + } + } + + delegate_->PrintMessage(message + "\n"); + } +} + +void WebFrameTestClient::didChangeSelection(bool is_empty_callback) { + if (test_runner_->shouldDumpEditingCallbacks()) + delegate_->PrintMessage( + "EDITING DELEGATE: " + "webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n"); +} + +blink::WebPlugin* WebFrameTestClient::createPlugin( + blink::WebLocalFrame* frame, + const blink::WebPluginParams& params) { + if (TestPlugin::IsSupportedMimeType(params.mimeType)) + return TestPlugin::create(frame, params, delegate_); + return delegate_->CreatePluginPlaceholder(frame, params); +} + +void WebFrameTestClient::showContextMenu( + const blink::WebContextMenuData& context_menu_data) { + event_sender_->SetContextMenuData(context_menu_data); +} + +blink::WebUserMediaClient* WebFrameTestClient::userMediaClient() { + return test_runner_->getMockWebUserMediaClient(); +} + +void WebFrameTestClient::loadURLExternally( + const blink::WebURLRequest& request, + blink::WebNavigationPolicy policy, + const blink::WebString& suggested_name, + bool replaces_current_history_item) { + if (test_runner_->shouldWaitUntilExternalURLLoad()) { + if (policy == blink::WebNavigationPolicyDownload) { + delegate_->PrintMessage( + std::string("Downloading URL with suggested filename \"") + + suggested_name.utf8() + "\"\n"); + } else { + delegate_->PrintMessage(std::string("Loading URL externally - \"") + + URLDescription(request.url()) + "\"\n"); + } + delegate_->TestFinished(); + } +} + +void WebFrameTestClient::didStartProvisionalLoad(blink::WebLocalFrame* frame, + double trigering_event_time) { + if (!test_runner_->topLoadingFrame()) + test_runner_->setTopLoadingFrame(frame, false); + + if (test_runner_->shouldDumpFrameLoadCallbacks()) { + PrintFrameDescription(delegate_, frame); + delegate_->PrintMessage(" - didStartProvisionalLoadForFrame\n"); + } + + if (test_runner_->shouldDumpUserGestureInFrameLoadCallbacks()) { + PrintFrameuserGestureStatus(delegate_, frame, + " - in didStartProvisionalLoadForFrame\n"); + } +} + +void WebFrameTestClient::didReceiveServerRedirectForProvisionalLoad( + blink::WebLocalFrame* frame) { + if (test_runner_->shouldDumpFrameLoadCallbacks()) { + PrintFrameDescription(delegate_, frame); + delegate_->PrintMessage( + " - didReceiveServerRedirectForProvisionalLoadForFrame\n"); + } +} + +void WebFrameTestClient::didFailProvisionalLoad( + blink::WebLocalFrame* frame, + const blink::WebURLError& error, + blink::WebHistoryCommitType commit_type) { + if (test_runner_->shouldDumpFrameLoadCallbacks()) { + PrintFrameDescription(delegate_, frame); + delegate_->PrintMessage(" - didFailProvisionalLoadWithError\n"); + } + CheckDone(frame, MainResourceLoadFailed, test_runner_); +} + +void WebFrameTestClient::didCommitProvisionalLoad( + blink::WebLocalFrame* frame, + const blink::WebHistoryItem& history_item, + blink::WebHistoryCommitType history_type) { + if (test_runner_->shouldDumpFrameLoadCallbacks()) { + PrintFrameDescription(delegate_, frame); + delegate_->PrintMessage(" - didCommitLoadForFrame\n"); + } +} + +void WebFrameTestClient::didReceiveTitle(blink::WebLocalFrame* frame, + const blink::WebString& title, + blink::WebTextDirection direction) { + if (test_runner_->shouldDumpFrameLoadCallbacks()) { + PrintFrameDescription(delegate_, frame); + delegate_->PrintMessage(std::string(" - didReceiveTitle: ") + title.utf8() + + "\n"); + } + + if (test_runner_->shouldDumpTitleChanges()) + delegate_->PrintMessage(std::string("TITLE CHANGED: '") + title.utf8() + + "'\n"); +} + +void WebFrameTestClient::didChangeIcon(blink::WebLocalFrame* frame, + blink::WebIconURL::Type icon_type) { + if (test_runner_->shouldDumpIconChanges()) { + PrintFrameDescription(delegate_, frame); + delegate_->PrintMessage(std::string(" - didChangeIcons\n")); + } +} + +void WebFrameTestClient::didFinishDocumentLoad(blink::WebLocalFrame* frame) { + if (test_runner_->shouldDumpFrameLoadCallbacks()) { + PrintFrameDescription(delegate_, frame); + delegate_->PrintMessage(" - didFinishDocumentLoadForFrame\n"); + } +} + +void WebFrameTestClient::didHandleOnloadEvents(blink::WebLocalFrame* frame) { + if (test_runner_->shouldDumpFrameLoadCallbacks()) { + PrintFrameDescription(delegate_, frame); + delegate_->PrintMessage(" - didHandleOnloadEventsForFrame\n"); + } +} + +void WebFrameTestClient::didFailLoad(blink::WebLocalFrame* frame, + const blink::WebURLError& error, + blink::WebHistoryCommitType commit_type) { + if (test_runner_->shouldDumpFrameLoadCallbacks()) { + PrintFrameDescription(delegate_, frame); + delegate_->PrintMessage(" - didFailLoadWithError\n"); + } + CheckDone(frame, MainResourceLoadFailed, test_runner_); +} + +void WebFrameTestClient::didFinishLoad(blink::WebLocalFrame* frame) { + if (test_runner_->shouldDumpFrameLoadCallbacks()) { + PrintFrameDescription(delegate_, frame); + delegate_->PrintMessage(" - didFinishLoadForFrame\n"); + } + CheckDone(frame, LoadFinished, test_runner_); +} + +void WebFrameTestClient::didDetectXSS(const blink::WebURL& insecure_url, + bool did_block_entire_page) { + if (test_runner_->shouldDumpFrameLoadCallbacks()) + delegate_->PrintMessage("didDetectXSS\n"); +} + +void WebFrameTestClient::didDispatchPingLoader(const blink::WebURL& url) { + if (test_runner_->shouldDumpPingLoaderCallbacks()) + delegate_->PrintMessage(std::string("PingLoader dispatched to '") + + URLDescription(url).c_str() + "'.\n"); +} + +void WebFrameTestClient::willSendRequest( + blink::WebLocalFrame* frame, + unsigned identifier, + blink::WebURLRequest& request, + const blink::WebURLResponse& redirect_response) { + // Need to use GURL for host() and SchemeIs() + GURL url = request.url(); + std::string request_url = url.possibly_invalid_spec(); + + GURL main_document_url = request.firstPartyForCookies(); + + if (redirect_response.isNull() && + (test_runner_->shouldDumpResourceLoadCallbacks() || + test_runner_->shouldDumpResourcePriorities())) { + DCHECK(resource_identifier_map_.find(identifier) == + resource_identifier_map_.end()); + resource_identifier_map_[identifier] = + DescriptionSuitableForTestResult(request_url); + } + + if (test_runner_->shouldDumpResourceLoadCallbacks()) { + if (resource_identifier_map_.find(identifier) == + resource_identifier_map_.end()) + delegate_->PrintMessage("<unknown>"); + else + delegate_->PrintMessage(resource_identifier_map_[identifier]); + delegate_->PrintMessage(" - willSendRequest <NSURLRequest URL "); + delegate_->PrintMessage( + DescriptionSuitableForTestResult(request_url).c_str()); + delegate_->PrintMessage(", main document URL "); + delegate_->PrintMessage(URLDescription(main_document_url).c_str()); + delegate_->PrintMessage(", http method "); + delegate_->PrintMessage(request.httpMethod().utf8().data()); + delegate_->PrintMessage("> redirectResponse "); + PrintResponseDescription(delegate_, redirect_response); + delegate_->PrintMessage("\n"); + } + + if (test_runner_->shouldDumpResourcePriorities()) { + delegate_->PrintMessage( + DescriptionSuitableForTestResult(request_url).c_str()); + delegate_->PrintMessage(" has priority "); + delegate_->PrintMessage(PriorityDescription(request.getPriority())); + delegate_->PrintMessage("\n"); + } + + if (test_runner_->httpHeadersToClear()) { + const std::set<std::string>* clearHeaders = + test_runner_->httpHeadersToClear(); + for (std::set<std::string>::const_iterator header = clearHeaders->begin(); + header != clearHeaders->end(); ++header) + request.clearHTTPHeaderField(blink::WebString::fromUTF8(*header)); + } + + std::string host = url.host(); + if (!host.empty() && + (url.SchemeIs(url::kHttpScheme) || url.SchemeIs(url::kHttpsScheme))) { + if (!IsLocalHost(host) && !IsTestHost(host) && + !HostIsUsedBySomeTestsToGenerateError(host) && + ((!main_document_url.SchemeIs(url::kHttpScheme) && + !main_document_url.SchemeIs(url::kHttpsScheme)) || + IsLocalHost(main_document_url.host())) && + !delegate_->AllowExternalPages()) { + delegate_->PrintMessage(std::string("Blocked access to external URL ") + + request_url + "\n"); + BlockRequest(request); + return; + } + } + + // Set the new substituted URL. + request.setURL( + delegate_->RewriteLayoutTestsURL(request.url().string().utf8())); +} + +void WebFrameTestClient::didReceiveResponse( + unsigned identifier, + const blink::WebURLResponse& response) { + if (test_runner_->shouldDumpResourceLoadCallbacks()) { + if (resource_identifier_map_.find(identifier) == + resource_identifier_map_.end()) + delegate_->PrintMessage("<unknown>"); + else + delegate_->PrintMessage(resource_identifier_map_[identifier]); + delegate_->PrintMessage(" - didReceiveResponse "); + PrintResponseDescription(delegate_, response); + delegate_->PrintMessage("\n"); + } + if (test_runner_->shouldDumpResourceResponseMIMETypes()) { + GURL url = response.url(); + blink::WebString mime_type = response.mimeType(); + delegate_->PrintMessage(url.ExtractFileName()); + delegate_->PrintMessage(" has MIME type "); + // Simulate NSURLResponse's mapping of empty/unknown MIME types to + // application/octet-stream + delegate_->PrintMessage(mime_type.isEmpty() ? "application/octet-stream" + : mime_type.utf8().data()); + delegate_->PrintMessage("\n"); + } +} + +void WebFrameTestClient::didChangeResourcePriority( + unsigned identifier, + const blink::WebURLRequest::Priority& priority, + int intra_priority_value) { + if (test_runner_->shouldDumpResourcePriorities()) { + if (resource_identifier_map_.find(identifier) == + resource_identifier_map_.end()) + delegate_->PrintMessage("<unknown>"); + else + delegate_->PrintMessage(resource_identifier_map_[identifier]); + delegate_->PrintMessage(base::StringPrintf( + " changed priority to %s, intra_priority %d\n", + PriorityDescription(priority).c_str(), intra_priority_value)); + } +} + +void WebFrameTestClient::didFinishResourceLoad(blink::WebLocalFrame* frame, + unsigned identifier) { + if (test_runner_->shouldDumpResourceLoadCallbacks()) { + if (resource_identifier_map_.find(identifier) == + resource_identifier_map_.end()) + delegate_->PrintMessage("<unknown>"); + else + delegate_->PrintMessage(resource_identifier_map_[identifier]); + delegate_->PrintMessage(" - didFinishLoading\n"); + } + resource_identifier_map_.erase(identifier); + CheckDone(frame, ResourceLoadCompleted, test_runner_); +} + +void WebFrameTestClient::didAddMessageToConsole( + const blink::WebConsoleMessage& message, + const blink::WebString& source_name, + unsigned source_line, + const blink::WebString& stack_trace) { + std::string level; + switch (message.level) { + case blink::WebConsoleMessage::LevelDebug: + level = "DEBUG"; + break; + case blink::WebConsoleMessage::LevelLog: + level = "MESSAGE"; + break; + case blink::WebConsoleMessage::LevelInfo: + level = "INFO"; + break; + case blink::WebConsoleMessage::LevelWarning: + level = "WARNING"; + break; + case blink::WebConsoleMessage::LevelError: + level = "ERROR"; + break; + default: + level = "MESSAGE"; + } + delegate_->PrintMessage(std::string("CONSOLE ") + level + ": "); + if (source_line) { + delegate_->PrintMessage(base::StringPrintf("line %d: ", source_line)); + } + if (!message.text.isEmpty()) { + std::string new_message; + new_message = message.text.utf8(); + size_t file_protocol = new_message.find("file://"); + if (file_protocol != std::string::npos) { + new_message = new_message.substr(0, file_protocol) + + URLSuitableForTestResult(new_message.substr(file_protocol)); + } + delegate_->PrintMessage(new_message); + } + delegate_->PrintMessage(std::string("\n")); +} + +blink::WebNavigationPolicy WebFrameTestClient::decidePolicyForNavigation( + const blink::WebFrameClient::NavigationPolicyInfo& info) { + if (test_runner_->shouldDumpNavigationPolicy()) { + delegate_->PrintMessage("Default policy for navigation to '" + + URLDescription(info.urlRequest.url()) + "' is '" + + WebNavigationPolicyToString(info.defaultPolicy) + + "'\n"); + } + + blink::WebNavigationPolicy result; + if (!test_runner_->policyDelegateEnabled()) + return info.defaultPolicy; + + delegate_->PrintMessage( + std::string("Policy delegate: attempt to load ") + + URLDescription(info.urlRequest.url()) + " with navigation type '" + + WebNavigationTypeToString(info.navigationType) + "'\n"); + if (test_runner_->policyDelegateIsPermissive()) + result = blink::WebNavigationPolicyCurrentTab; + else + result = blink::WebNavigationPolicyIgnore; + + if (test_runner_->policyDelegateShouldNotifyDone()) { + test_runner_->policyDelegateDone(); + result = blink::WebNavigationPolicyIgnore; + } + + return result; +} + +bool WebFrameTestClient::willCheckAndDispatchMessageEvent( + blink::WebLocalFrame* source_frame, + blink::WebFrame* target_frame, + blink::WebSecurityOrigin target, + blink::WebDOMMessageEvent event) { + if (test_runner_->shouldInterceptPostMessage()) { + delegate_->PrintMessage("intercepted postMessage\n"); + return true; + } + + return false; +} + +void WebFrameTestClient::checkIfAudioSinkExistsAndIsAuthorized( + const blink::WebString& sink_id, + const blink::WebSecurityOrigin& security_origin, + blink::WebSetSinkIdCallbacks* web_callbacks) { + scoped_ptr<blink::WebSetSinkIdCallbacks> callback(web_callbacks); + std::string device_id = sink_id.utf8(); + if (device_id == "valid" || device_id.empty()) + callback->onSuccess(); + else if (device_id == "unauthorized") + callback->onError(blink::WebSetSinkIdError::NotAuthorized); + else + callback->onError(blink::WebSetSinkIdError::NotFound); +} + +} // namespace test_runner
diff --git a/components/test_runner/web_frame_test_client.h b/components/test_runner/web_frame_test_client.h new file mode 100644 index 0000000..ce7ae93 --- /dev/null +++ b/components/test_runner/web_frame_test_client.h
@@ -0,0 +1,129 @@ +// 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. + +#ifndef COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_CLIENT_H_ +#define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_CLIENT_H_ + +#include <map> +#include <string> + +#include "base/macros.h" +#include "third_party/WebKit/public/web/WebFrameClient.h" + +namespace test_runner { + +class AccessibilityController; +class EventSender; +class TestRunner; +class WebTestDelegate; + +// WebFrameTestClient implements WebFrameClient interface, providing behavior +// expected by tests. WebFrameTestClient ends up used by WebFrameTestProxy +// which coordinates forwarding WebFrameClient calls either to +// WebFrameTestClient or to the product code (i.e. to RenderFrameImpl). +class WebFrameTestClient : public blink::WebFrameClient { + public: + // Caller has to ensure that all arguments (|test_runner|, |delegate| and so + // forth) live longer than |this|. + WebFrameTestClient(TestRunner* test_runner, + WebTestDelegate* delegate, + AccessibilityController* accessibility_controller, + EventSender* event_sender); + + ~WebFrameTestClient() override; + + // WebFrameClient overrides needed by WebFrameTestProxy. + blink::WebColorChooser* createColorChooser( + blink::WebColorChooserClient* client, + const blink::WebColor& initial_color, + const blink::WebVector<blink::WebColorSuggestion>& suggestions) override; + void runModalAlertDialog(const blink::WebString& message) override; + bool runModalConfirmDialog(const blink::WebString& message) override; + bool runModalPromptDialog(const blink::WebString& message, + const blink::WebString& default_value, + blink::WebString* actual_value) override; + bool runModalBeforeUnloadDialog(bool is_reload) override; + blink::WebScreenOrientationClient* webScreenOrientationClient() override; + void postAccessibilityEvent(const blink::WebAXObject& object, + blink::WebAXEvent event) override; + void didChangeSelection(bool is_selection_empty) override; + blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, + const blink::WebPluginParams& params) override; + void showContextMenu( + const blink::WebContextMenuData& context_menu_data) override; + blink::WebUserMediaClient* userMediaClient() override; + void didAddMessageToConsole(const blink::WebConsoleMessage& message, + const blink::WebString& source_name, + unsigned source_line, + const blink::WebString& stack_trace) override; + void loadURLExternally(const blink::WebURLRequest& request, + blink::WebNavigationPolicy policy, + const blink::WebString& suggested_name, + bool replaces_current_history_item) override; + void didStartProvisionalLoad(blink::WebLocalFrame* frame, + double trigering_event_time) override; + void didReceiveServerRedirectForProvisionalLoad( + blink::WebLocalFrame* frame) override; + void didFailProvisionalLoad(blink::WebLocalFrame* frame, + const blink::WebURLError& error, + blink::WebHistoryCommitType commit_type) override; + void didCommitProvisionalLoad( + blink::WebLocalFrame* frame, + const blink::WebHistoryItem& history_item, + blink::WebHistoryCommitType history_type) override; + void didReceiveTitle(blink::WebLocalFrame* frame, + const blink::WebString& title, + blink::WebTextDirection direction) override; + void didChangeIcon(blink::WebLocalFrame* frame, + blink::WebIconURL::Type icon_type) override; + void didFinishDocumentLoad(blink::WebLocalFrame* frame) override; + void didHandleOnloadEvents(blink::WebLocalFrame* frame) override; + void didFailLoad(blink::WebLocalFrame* frame, + const blink::WebURLError& error, + blink::WebHistoryCommitType commit_type) override; + void didFinishLoad(blink::WebLocalFrame* frame) override; + void didDetectXSS(const blink::WebURL& insecure_url, + bool did_block_entire_page) override; + void didDispatchPingLoader(const blink::WebURL& url) override; + void willSendRequest(blink::WebLocalFrame* frame, + unsigned identifier, + blink::WebURLRequest& request, + const blink::WebURLResponse& redirect_response) override; + void didReceiveResponse(unsigned identifier, + const blink::WebURLResponse& response) override; + void didChangeResourcePriority(unsigned identifier, + const blink::WebURLRequest::Priority& priority, + int intra_priority_value) override; + void didFinishResourceLoad(blink::WebLocalFrame* frame, + unsigned identifier) override; + blink::WebNavigationPolicy decidePolicyForNavigation( + const blink::WebFrameClient::NavigationPolicyInfo& info) override; + bool willCheckAndDispatchMessageEvent( + blink::WebLocalFrame* source_frame, + blink::WebFrame* target_frame, + blink::WebSecurityOrigin target, + blink::WebDOMMessageEvent event) override; + void checkIfAudioSinkExistsAndIsAuthorized( + const blink::WebString& sink_id, + const blink::WebSecurityOrigin& security_origin, + blink::WebSetSinkIdCallbacks* web_callbacks) override; + + private: + // Borrowed pointers to other parts of Layout Tests state. + TestRunner* test_runner_; + WebTestDelegate* delegate_; + AccessibilityController* accessibility_controller_; + EventSender* event_sender_; + + // Map from request identifier into resource url description. The map is used + // to track resource requests spanning willSendRequest, didReceiveResponse, + // didChangeResourcePriority, didFinishResourceLoad. + std::map<unsigned, std::string> resource_identifier_map_; + + DISALLOW_COPY_AND_ASSIGN(WebFrameTestClient); +}; + +} // namespace test_runner + +#endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_CLIENT_H_
diff --git a/components/test_runner/web_frame_test_proxy.h b/components/test_runner/web_frame_test_proxy.h index 7f90583..ce58447b 100644 --- a/components/test_runner/web_frame_test_proxy.h +++ b/components/test_runner/web_frame_test_proxy.h
@@ -5,79 +5,92 @@ #ifndef COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ #define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ +#include "base/logging.h" #include "base/macros.h" -#include "components/test_runner/mock_screen_orientation_client.h" -#include "components/test_runner/web_test_delegate.h" -#include "components/test_runner/web_test_interfaces.h" -#include "components/test_runner/web_test_proxy.h" -#include "components/test_runner/web_test_runner.h" #include "third_party/WebKit/public/platform/WebString.h" +#include "third_party/WebKit/public/web/WebFrameClient.h" +#include "third_party/WebKit/public/web/WebLocalFrame.h" namespace test_runner { -// Templetized wrapper around RenderFrameImpl objects, which implement -// the WebFrameClient interface. -template <class Base, typename P> -class WebFrameTestProxy : public Base { +class WebFrameTestProxyBase { public: - explicit WebFrameTestProxy(P p) : Base(p), base_proxy_(NULL) {} + void set_test_client(blink::WebFrameClient* client) { + DCHECK(client); + DCHECK(!test_client_); + test_client_ = client; + } + + protected: + WebFrameTestProxyBase() : test_client_(nullptr) {} + blink::WebFrameClient* test_client() { return test_client_; } + + private: + blink::WebFrameClient* test_client_; + + DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxyBase); +}; + +// WebTestProxy is used during LayoutTests and always instantiated, at time of +// writing with Base=RenderFrameImpl. It does not directly inherit from it for +// layering purposes. +template <class Base, typename P> +class WebFrameTestProxy : public Base, public WebFrameTestProxyBase { + public: + explicit WebFrameTestProxy(P p) : Base(p) {} virtual ~WebFrameTestProxy() {} - void set_base_proxy(WebTestProxyBase* proxy) { base_proxy_ = proxy; } - // WebFrameClient implementation. blink::WebPlugin* createPlugin( blink::WebLocalFrame* frame, const blink::WebPluginParams& params) override { - blink::WebPlugin* plugin = base_proxy_->CreatePlugin(frame, params); + blink::WebPlugin* plugin = test_client()->createPlugin(frame, params); if (plugin) return plugin; return Base::createPlugin(frame, params); } blink::WebScreenOrientationClient* webScreenOrientationClient() override { - return base_proxy_->GetScreenOrientationClientMock(); + return test_client()->webScreenOrientationClient(); } void didAddMessageToConsole(const blink::WebConsoleMessage& message, const blink::WebString& source_name, unsigned source_line, const blink::WebString& stack_trace) override { - base_proxy_->DidAddMessageToConsole(message, source_name, source_line); + test_client()->didAddMessageToConsole(message, source_name, source_line, + stack_trace); Base::didAddMessageToConsole( message, source_name, source_line, stack_trace); } bool canCreatePluginWithoutRenderer( const blink::WebString& mime_type) override { - using blink::WebString; - - const CR_DEFINE_STATIC_LOCAL( - WebString, suffix, ("-can-create-without-renderer")); - return mime_type.utf8().find(suffix.utf8()) != std::string::npos; + const char suffix[] = "-can-create-without-renderer"; + return mime_type.utf8().find(suffix) != std::string::npos; } void loadURLExternally(const blink::WebURLRequest& request, blink::WebNavigationPolicy policy, const blink::WebString& suggested_name, bool replaces_current_history_item) override { - base_proxy_->LoadURLExternally(request, policy, suggested_name, - replaces_current_history_item); + test_client()->loadURLExternally(request, policy, suggested_name, + replaces_current_history_item); Base::loadURLExternally(request, policy, suggested_name, replaces_current_history_item); } void didStartProvisionalLoad(blink::WebLocalFrame* frame, double triggeringEventTime) override { - base_proxy_->DidStartProvisionalLoad(frame); + test_client()->didStartProvisionalLoad(frame, triggeringEventTime); Base::didStartProvisionalLoad( frame, triggeringEventTime); } void didReceiveServerRedirectForProvisionalLoad( blink::WebLocalFrame* frame) override { - base_proxy_->DidReceiveServerRedirectForProvisionalLoad(frame); + test_client()->didReceiveServerRedirectForProvisionalLoad(frame); Base::didReceiveServerRedirectForProvisionalLoad(frame); } @@ -85,9 +98,10 @@ blink::WebLocalFrame* frame, const blink::WebURLError& error, blink::WebHistoryCommitType commit_type) override { + test_client()->didFailProvisionalLoad(frame, error, commit_type); // If the test finished, don't notify the embedder of the failed load, // as we already destroyed the document loader. - if (base_proxy_->DidFailProvisionalLoad(frame, error, commit_type)) + if (!frame->provisionalDataSource()) return; Base::didFailProvisionalLoad(frame, error, commit_type); } @@ -96,47 +110,47 @@ blink::WebLocalFrame* frame, const blink::WebHistoryItem& item, blink::WebHistoryCommitType commit_type) override { - base_proxy_->DidCommitProvisionalLoad(frame, item, commit_type); + test_client()->didCommitProvisionalLoad(frame, item, commit_type); Base::didCommitProvisionalLoad(frame, item, commit_type); } void didReceiveTitle(blink::WebLocalFrame* frame, const blink::WebString& title, blink::WebTextDirection direction) override { - base_proxy_->DidReceiveTitle(frame, title, direction); + test_client()->didReceiveTitle(frame, title, direction); Base::didReceiveTitle(frame, title, direction); } void didChangeIcon(blink::WebLocalFrame* frame, blink::WebIconURL::Type icon_type) override { - base_proxy_->DidChangeIcon(frame, icon_type); + test_client()->didChangeIcon(frame, icon_type); Base::didChangeIcon(frame, icon_type); } void didFinishDocumentLoad(blink::WebLocalFrame* frame) override { - base_proxy_->DidFinishDocumentLoad(frame); + test_client()->didFinishDocumentLoad(frame); Base::didFinishDocumentLoad(frame); } void didHandleOnloadEvents(blink::WebLocalFrame* frame) override { - base_proxy_->DidHandleOnloadEvents(frame); + test_client()->didHandleOnloadEvents(frame); Base::didHandleOnloadEvents(frame); } void didFailLoad(blink::WebLocalFrame* frame, const blink::WebURLError& error, blink::WebHistoryCommitType commit_type) override { - base_proxy_->DidFailLoad(frame, error, commit_type); + test_client()->didFailLoad(frame, error, commit_type); Base::didFailLoad(frame, error, commit_type); } void didFinishLoad(blink::WebLocalFrame* frame) override { Base::didFinishLoad(frame); - base_proxy_->DidFinishLoad(frame); + test_client()->didFinishLoad(frame); } void didChangeSelection(bool is_selection_empty) override { - base_proxy_->DidChangeSelection(is_selection_empty); + test_client()->didChangeSelection(is_selection_empty); Base::didChangeSelection(is_selection_empty); } @@ -144,31 +158,32 @@ blink::WebColorChooserClient* client, const blink::WebColor& initial_color, const blink::WebVector<blink::WebColorSuggestion>& suggestions) override { - return base_proxy_->CreateColorChooser(client, initial_color, suggestions); + return test_client()->createColorChooser(client, initial_color, + suggestions); } void runModalAlertDialog(const blink::WebString& message) override { - base_proxy_->RunModalAlertDialog(message); + test_client()->runModalAlertDialog(message); } bool runModalConfirmDialog(const blink::WebString& message) override { - return base_proxy_->RunModalConfirmDialog(message); + return test_client()->runModalConfirmDialog(message); } bool runModalPromptDialog(const blink::WebString& message, const blink::WebString& default_value, blink::WebString* actual_value) override { - return base_proxy_->RunModalPromptDialog(message, default_value, - actual_value); + return test_client()->runModalPromptDialog(message, default_value, + actual_value); } bool runModalBeforeUnloadDialog(bool is_reload) override { - return base_proxy_->RunModalBeforeUnloadDialog(is_reload); + return test_client()->runModalBeforeUnloadDialog(is_reload); } void showContextMenu( const blink::WebContextMenuData& context_menu_data) override { - base_proxy_->ShowContextMenu(context_menu_data); + test_client()->showContextMenu(context_menu_data); Base::showContextMenu(context_menu_data); } @@ -176,34 +191,30 @@ bool did_block_entire_page) override { // This is not implemented in RenderFrameImpl, so need to explicitly call // into the base proxy. - base_proxy_->DidDetectXSS(insecure_url, did_block_entire_page); + test_client()->didDetectXSS(insecure_url, did_block_entire_page); Base::didDetectXSS(insecure_url, did_block_entire_page); } void didDispatchPingLoader(const blink::WebURL& url) override { // This is not implemented in RenderFrameImpl, so need to explicitly call // into the base proxy. - base_proxy_->DidDispatchPingLoader(url); + test_client()->didDispatchPingLoader(url); Base::didDispatchPingLoader(url); } - void didCreateDataSource(blink::WebLocalFrame* frame, - blink::WebDataSource* ds) override { - Base::didCreateDataSource(frame, ds); - } - void willSendRequest( blink::WebLocalFrame* frame, unsigned identifier, blink::WebURLRequest& request, const blink::WebURLResponse& redirect_response) override { Base::willSendRequest(frame, identifier, request, redirect_response); - base_proxy_->WillSendRequest(frame, identifier, request, redirect_response); + test_client()->willSendRequest(frame, identifier, request, + redirect_response); } void didReceiveResponse(unsigned identifier, const blink::WebURLResponse& response) override { - base_proxy_->DidReceiveResponse(identifier, response); + test_client()->didReceiveResponse(identifier, response); Base::didReceiveResponse(identifier, response); } @@ -212,21 +223,21 @@ int intra_priority_value) override { // This is not implemented in RenderFrameImpl, so need to explicitly call // into the base proxy. - base_proxy_->DidChangeResourcePriority( - identifier, priority, intra_priority_value); + test_client()->didChangeResourcePriority(identifier, priority, + intra_priority_value); Base::didChangeResourcePriority( identifier, priority, intra_priority_value); } void didFinishResourceLoad(blink::WebLocalFrame* frame, unsigned identifier) override { - base_proxy_->DidFinishResourceLoad(frame, identifier); + test_client()->didFinishResourceLoad(frame, identifier); } blink::WebNavigationPolicy decidePolicyForNavigation( const blink::WebFrameClient::NavigationPolicyInfo& info) override { - blink::WebNavigationPolicy policy = base_proxy_->DecidePolicyForNavigation( - info); + blink::WebNavigationPolicy policy = + test_client()->decidePolicyForNavigation(info); if (policy == blink::WebNavigationPolicyIgnore) return policy; @@ -240,7 +251,7 @@ } blink::WebUserMediaClient* userMediaClient() override { - return base_proxy_->GetUserMediaClient(); + return test_client()->userMediaClient(); } bool willCheckAndDispatchMessageEvent( @@ -248,7 +259,7 @@ blink::WebFrame* target_frame, blink::WebSecurityOrigin target, blink::WebDOMMessageEvent event) override { - if (base_proxy_->WillCheckAndDispatchMessageEvent( + if (test_client()->willCheckAndDispatchMessageEvent( source_frame, target_frame, target, event)) return true; return Base::willCheckAndDispatchMessageEvent( @@ -257,7 +268,7 @@ void postAccessibilityEvent(const blink::WebAXObject& object, blink::WebAXEvent event) override { - base_proxy_->PostAccessibilityEvent(object, event); + test_client()->postAccessibilityEvent(object, event); Base::postAccessibilityEvent(object, event); } @@ -265,13 +276,11 @@ const blink::WebString& sink_id, const blink::WebSecurityOrigin& security_origin, blink::WebSetSinkIdCallbacks* web_callbacks) override { - base_proxy_->CheckIfAudioSinkExistsAndIsAuthorized(sink_id, security_origin, - web_callbacks); + test_client()->checkIfAudioSinkExistsAndIsAuthorized( + sink_id, security_origin, web_callbacks); } private: - WebTestProxyBase* base_proxy_; - DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); };
diff --git a/components/test_runner/web_test_interfaces.cc b/components/test_runner/web_test_interfaces.cc index ce6cc878..78758042 100644 --- a/components/test_runner/web_test_interfaces.cc +++ b/components/test_runner/web_test_interfaces.cc
@@ -14,6 +14,7 @@ #include "components/test_runner/mock_webrtc_peer_connection_handler.h" #include "components/test_runner/test_interfaces.h" #include "components/test_runner/test_runner.h" +#include "components/test_runner/web_frame_test_client.h" using namespace blink; @@ -97,4 +98,15 @@ return interfaces_->GetAppBannerClient(); } +blink::WebFrameClient* WebTestInterfaces::GetWebFrameTestClient() { + if (!web_frame_test_client_) { + web_frame_test_client_.reset(new WebFrameTestClient( + interfaces_->GetTestRunner(), + interfaces_->GetDelegate(), + interfaces_->GetAccessibilityController(), + interfaces_->GetEventSender())); + } + return web_frame_test_client_.get(); +} + } // namespace test_runner
diff --git a/components/test_runner/web_test_interfaces.h b/components/test_runner/web_test_interfaces.h index a163c44..481c426 100644 --- a/components/test_runner/web_test_interfaces.h +++ b/components/test_runner/web_test_interfaces.h
@@ -13,6 +13,7 @@ class WebAppBannerClient; class WebAudioDevice; class WebFrame; +class WebFrameClient; class WebMediaStreamCenter; class WebMediaStreamCenterClient; class WebMIDIAccessor; @@ -28,6 +29,7 @@ class AppBannerClient; class TestInterfaces; +class WebFrameTestClient; class WebTestDelegate; class WebTestProxyBase; class WebTestRunner; @@ -64,8 +66,15 @@ TestInterfaces* GetTestInterfaces(); + // Gets a borrowed pointer to a WebFrameClient implementation providing + // test behavior (i.e. forwarding javascript console output to the test + // harness). The caller should guarantee that the returned pointer + // won't be used beyond the lifetime of WebTestInterfaces. + blink::WebFrameClient* GetWebFrameTestClient(); + private: scoped_ptr<TestInterfaces> interfaces_; + scoped_ptr<WebFrameTestClient> web_frame_test_client_; DISALLOW_COPY_AND_ASSIGN(WebTestInterfaces); };
diff --git a/components/test_runner/web_test_proxy.cc b/components/test_runner/web_test_proxy.cc index 5a163ee..39da5755 100644 --- a/components/test_runner/web_test_proxy.cc +++ b/components/test_runner/web_test_proxy.cc
@@ -19,15 +19,12 @@ #include "base/thread_task_runner_handle.h" #include "base/time/time.h" #include "base/trace_event/trace_event.h" -#include "components/test_runner/accessibility_controller.h" #include "components/test_runner/event_sender.h" -#include "components/test_runner/layout_dump.h" -#include "components/test_runner/mock_color_chooser.h" #include "components/test_runner/mock_credential_manager_client.h" #include "components/test_runner/mock_screen_orientation_client.h" #include "components/test_runner/mock_web_speech_recognizer.h" -#include "components/test_runner/mock_web_user_media_client.h" #include "components/test_runner/spell_check_client.h" +#include "components/test_runner/test_common.h" #include "components/test_runner/test_interfaces.h" #include "components/test_runner/test_plugin.h" #include "components/test_runner/test_runner.h" @@ -45,8 +42,6 @@ #include "third_party/WebKit/public/platform/WebURLResponse.h" #include "third_party/WebKit/public/web/WebAXEnums.h" #include "third_party/WebKit/public/web/WebAXObject.h" -#include "third_party/WebKit/public/web/WebConsoleMessage.h" -#include "third_party/WebKit/public/web/WebDataSource.h" #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebElement.h" #include "third_party/WebKit/public/web/WebHistoryItem.h" @@ -114,181 +109,6 @@ CallbackMethodType callback_; }; -void PrintFrameDescription(WebTestDelegate* delegate, blink::WebFrame* frame) { - std::string name8 = frame->uniqueName().utf8(); - if (frame == frame->view()->mainFrame()) { - if (!name8.length()) { - delegate->PrintMessage("main frame"); - return; - } - delegate->PrintMessage(std::string("main frame \"") + name8 + "\""); - return; - } - if (!name8.length()) { - delegate->PrintMessage("frame (anonymous)"); - return; - } - delegate->PrintMessage(std::string("frame \"") + name8 + "\""); -} - -void PrintFrameuserGestureStatus(WebTestDelegate* delegate, - blink::WebFrame* frame, - const char* msg) { - bool is_user_gesture = - blink::WebUserGestureIndicator::isProcessingUserGesture(); - delegate->PrintMessage(std::string("Frame with user gesture \"") + - (is_user_gesture ? "true" : "false") + "\"" + msg); -} - -// Used to write a platform neutral file:/// URL by taking the -// filename and its directory. (e.g., converts -// "file:///tmp/foo/bar.txt" to just "bar.txt"). -std::string DescriptionSuitableForTestResult(const std::string& url) { - if (url.empty() || std::string::npos == url.find("file://")) - return url; - - size_t pos = url.rfind('/'); - if (pos == std::string::npos || !pos) - return "ERROR:" + url; - pos = url.rfind('/', pos - 1); - if (pos == std::string::npos) - return "ERROR:" + url; - - return url.substr(pos + 1); -} - -void PrintResponseDescription(WebTestDelegate* delegate, - const blink::WebURLResponse& response) { - if (response.isNull()) { - delegate->PrintMessage("(null)"); - return; - } - delegate->PrintMessage(base::StringPrintf( - "<NSURLResponse %s, http status code %d>", - DescriptionSuitableForTestResult(response.url().string().utf8()).c_str(), - response.httpStatusCode())); -} - -std::string URLDescription(const GURL& url) { - if (url.SchemeIs(url::kFileScheme)) - return url.ExtractFileName(); - return url.possibly_invalid_spec(); -} - -std::string PriorityDescription( - const blink::WebURLRequest::Priority& priority) { - switch (priority) { - case blink::WebURLRequest::PriorityVeryLow: - return "VeryLow"; - case blink::WebURLRequest::PriorityLow: - return "Low"; - case blink::WebURLRequest::PriorityMedium: - return "Medium"; - case blink::WebURLRequest::PriorityHigh: - return "High"; - case blink::WebURLRequest::PriorityVeryHigh: - return "VeryHigh"; - case blink::WebURLRequest::PriorityUnresolved: - default: - return "Unresolved"; - } -} - -void BlockRequest(blink::WebURLRequest& request) { - request.setURL(GURL("255.255.255.255")); -} - -bool IsLocalHost(const std::string& host) { - return host == "127.0.0.1" || host == "localhost"; -} - -bool IsTestHost(const std::string& host) { - return base::EndsWith(host, ".test", base::CompareCase::INSENSITIVE_ASCII); -} - -bool HostIsUsedBySomeTestsToGenerateError(const std::string& host) { - return host == "255.255.255.255"; -} - -// Used to write a platform neutral file:/// URL by only taking the filename -// (e.g., converts "file:///tmp/foo.txt" to just "foo.txt"). -std::string URLSuitableForTestResult(const std::string& url) { - if (url.empty() || std::string::npos == url.find("file://")) - return url; - - size_t pos = url.rfind('/'); - if (pos == std::string::npos) { -#ifdef WIN32 - pos = url.rfind('\\'); - if (pos == std::string::npos) - pos = 0; -#else - pos = 0; -#endif - } - std::string filename = url.substr(pos + 1); - if (filename.empty()) - return "file:"; // A WebKit test has this in its expected output. - return filename; -} - -// WebNavigationType debugging strings taken from PolicyDelegate.mm. -const char* kLinkClickedString = "link clicked"; -const char* kFormSubmittedString = "form submitted"; -const char* kBackForwardString = "back/forward"; -const char* kReloadString = "reload"; -const char* kFormResubmittedString = "form resubmitted"; -const char* kOtherString = "other"; -const char* kIllegalString = "illegal value"; - -// Get a debugging string from a WebNavigationType. -const char* WebNavigationTypeToString(blink::WebNavigationType type) { - switch (type) { - case blink::WebNavigationTypeLinkClicked: - return kLinkClickedString; - case blink::WebNavigationTypeFormSubmitted: - return kFormSubmittedString; - case blink::WebNavigationTypeBackForward: - return kBackForwardString; - case blink::WebNavigationTypeReload: - return kReloadString; - case blink::WebNavigationTypeFormResubmitted: - return kFormResubmittedString; - case blink::WebNavigationTypeOther: - return kOtherString; - } - return kIllegalString; -} - -const char* kPolicyIgnore = "Ignore"; -const char* kPolicyDownload = "download"; -const char* kPolicyCurrentTab = "current tab"; -const char* kPolicyNewBackgroundTab = "new background tab"; -const char* kPolicyNewForegroundTab = "new foreground tab"; -const char* kPolicyNewWindow = "new window"; -const char* kPolicyNewPopup = "new popup"; - -const char* WebNavigationPolicyToString(blink::WebNavigationPolicy policy) { - switch (policy) { - case blink::WebNavigationPolicyIgnore: - return kPolicyIgnore; - case blink::WebNavigationPolicyDownload: - return kPolicyDownload; - case blink::WebNavigationPolicyCurrentTab: - return kPolicyCurrentTab; - case blink::WebNavigationPolicyNewBackgroundTab: - return kPolicyNewBackgroundTab; - case blink::WebNavigationPolicyNewForegroundTab: - return kPolicyNewForegroundTab; - case blink::WebNavigationPolicyNewWindow: - return kPolicyNewWindow; - case blink::WebNavigationPolicyNewPopup: - return kPolicyNewPopup; - default: - return kIllegalString; - } -} - std::string DumpAllBackForwardLists(TestInterfaces* interfaces, WebTestDelegate* delegate) { std::string result; @@ -304,8 +124,7 @@ : test_interfaces_(NULL), delegate_(NULL), web_widget_(NULL), - spellcheck_(new SpellCheckClient(this)), - chooser_count_(0) { + spellcheck_(new SpellCheckClient(this)) { Reset(); } @@ -335,8 +154,6 @@ void WebTestProxyBase::Reset() { drag_image_.reset(); animate_scheduled_ = false; - resource_identifier_map_.clear(); - log_console_output_ = true; accept_languages_ = ""; } @@ -344,14 +161,6 @@ return spellcheck_.get(); } -blink::WebColorChooser* WebTestProxyBase::CreateColorChooser( - blink::WebColorChooserClient* client, - const blink::WebColor& color, - const blink::WebVector<blink::WebColorSuggestion>& suggestions) { - // This instance is deleted by WebCore::ColorInputType - return new MockColorChooser(client, delegate_, this); -} - bool WebTestProxyBase::RunFileChooser( const blink::WebFileChooserParams& params, blink::WebFileChooserCompletion* completion) { @@ -390,33 +199,6 @@ base::UTF16ToUTF8(wrapped_sub_text) + "\n"); } -void WebTestProxyBase::RunModalAlertDialog(const blink::WebString& message) { - delegate_->PrintMessage(std::string("ALERT: ") + message.utf8().data() + - "\n"); -} - -bool WebTestProxyBase::RunModalConfirmDialog(const blink::WebString& message) { - delegate_->PrintMessage(std::string("CONFIRM: ") + message.utf8().data() + - "\n"); - return true; -} - -bool WebTestProxyBase::RunModalPromptDialog( - const blink::WebString& message, - const blink::WebString& default_value, - blink::WebString* actual_value) { - delegate_->PrintMessage(std::string("PROMPT: ") + message.utf8().data() + - ", default text: " + default_value.utf8().data() + - "\n"); - return true; -} - -bool WebTestProxyBase::RunModalBeforeUnloadDialog(bool is_reload) { - delegate_->PrintMessage(std::string("CONFIRM NAVIGATION\n")); - return !test_interfaces_->GetTestRunner() - ->shouldStayOnPageAfterHandlingBeforeUnload(); -} - std::string WebTestProxyBase::DumpBackForwardLists() { return DumpAllBackForwardLists(test_interfaces_, delegate_); } @@ -577,10 +359,6 @@ callback.Run(bitmap); } -void WebTestProxyBase::SetLogConsoleOutput(bool enabled) { - log_console_output_ = enabled; -} - void LayoutAndPaintCallback::didLayoutAndPaint() { TRACE_EVENT0("shell", "LayoutAndPaintCallback::didLayoutAndPaint"); if (wait_for_popup_) { @@ -607,7 +385,8 @@ void WebTestProxyBase::GetScreenOrientationForTesting( blink::WebScreenInfo& screen_info) { - MockScreenOrientationClient* mock_client = GetScreenOrientationClientMock(); + MockScreenOrientationClient* mock_client = + test_interfaces_->GetTestRunner()->getMockScreenOrientationClient(); if (mock_client->IsDisabled()) return; // Override screen orientation information with mock data. @@ -615,11 +394,6 @@ screen_info.orientationAngle = mock_client->CurrentOrientationAngle(); } -MockScreenOrientationClient* -WebTestProxyBase::GetScreenOrientationClientMock() { - return test_interfaces_->GetTestRunner()->getMockScreenOrientationClient(); -} - MockWebSpeechRecognizer* WebTestProxyBase::GetSpeechRecognizerMock() { if (!speech_recognizer_.get()) { speech_recognizer_.reset(new MockWebSpeechRecognizer()); @@ -659,141 +433,6 @@ } } -void WebTestProxyBase::PostAccessibilityEvent(const blink::WebAXObject& obj, - blink::WebAXEvent event) { - // Only hook the accessibility events occured during the test run. - // This check prevents false positives in WebLeakDetector. - // The pending tasks in browser/renderer message queue may trigger - // accessibility events, - // and AccessibilityController will hold on to their target nodes if we don't - // ignore them here. - if (!test_interfaces_->GetTestRunner()->TestIsRunning()) - return; - - const char* event_name = NULL; - switch (event) { - case blink::WebAXEventActiveDescendantChanged: - event_name = "ActiveDescendantChanged"; - break; - case blink::WebAXEventAlert: - event_name = "Alert"; - break; - case blink::WebAXEventAriaAttributeChanged: - event_name = "AriaAttributeChanged"; - break; - case blink::WebAXEventAutocorrectionOccured: - event_name = "AutocorrectionOccured"; - break; - case blink::WebAXEventBlur: - event_name = "Blur"; - break; - case blink::WebAXEventCheckedStateChanged: - event_name = "CheckedStateChanged"; - break; - case blink::WebAXEventChildrenChanged: - event_name = "ChildrenChanged"; - break; - case blink::WebAXEventClicked: - event_name = "Clicked"; - break; - case blink::WebAXEventDocumentSelectionChanged: - event_name = "DocumentSelectionChanged"; - break; - case blink::WebAXEventFocus: - event_name = "Focus"; - break; - case blink::WebAXEventHide: - event_name = "Hide"; - break; - case blink::WebAXEventHover: - event_name = "Hover"; - break; - case blink::WebAXEventInvalidStatusChanged: - event_name = "InvalidStatusChanged"; - break; - case blink::WebAXEventLayoutComplete: - event_name = "LayoutComplete"; - break; - case blink::WebAXEventLiveRegionChanged: - event_name = "LiveRegionChanged"; - break; - case blink::WebAXEventLoadComplete: - event_name = "LoadComplete"; - break; - case blink::WebAXEventLocationChanged: - event_name = "LocationChanged"; - break; - case blink::WebAXEventMenuListItemSelected: - event_name = "MenuListItemSelected"; - break; - case blink::WebAXEventMenuListItemUnselected: - event_name = "MenuListItemUnselected"; - break; - case blink::WebAXEventMenuListValueChanged: - event_name = "MenuListValueChanged"; - break; - case blink::WebAXEventRowCollapsed: - event_name = "RowCollapsed"; - break; - case blink::WebAXEventRowCountChanged: - event_name = "RowCountChanged"; - break; - case blink::WebAXEventRowExpanded: - event_name = "RowExpanded"; - break; - case blink::WebAXEventScrollPositionChanged: - event_name = "ScrollPositionChanged"; - break; - case blink::WebAXEventScrolledToAnchor: - event_name = "ScrolledToAnchor"; - break; - case blink::WebAXEventSelectedChildrenChanged: - event_name = "SelectedChildrenChanged"; - break; - case blink::WebAXEventSelectedTextChanged: - event_name = "SelectedTextChanged"; - break; - case blink::WebAXEventShow: - event_name = "Show"; - break; - case blink::WebAXEventTextChanged: - event_name = "TextChanged"; - break; - case blink::WebAXEventTextInserted: - event_name = "TextInserted"; - break; - case blink::WebAXEventTextRemoved: - event_name = "TextRemoved"; - break; - case blink::WebAXEventValueChanged: - event_name = "ValueChanged"; - break; - default: - event_name = "Unknown"; - break; - } - - test_interfaces_->GetAccessibilityController()->NotificationReceived( - obj, event_name); - - if (test_interfaces_->GetAccessibilityController() - ->ShouldLogAccessibilityEvents()) { - std::string message("AccessibilityNotification - "); - message += event_name; - - blink::WebNode node = obj.node(); - if (!node.isNull() && node.isElementNode()) { - blink::WebElement element = node.to<blink::WebElement>(); - if (element.hasAttribute("id")) { - message += " - id:"; - message += element.getAttribute("id").utf8().data(); - } - } - - delegate_->PrintMessage(message + "\n"); - } -} - void WebTestProxyBase::StartDragging(blink::WebLocalFrame* frame, const blink::WebDragData& data, blink::WebDragOperationsMask mask, @@ -811,13 +450,6 @@ // The output from these methods in layout test mode should match that // expected by the layout tests. See EditingDelegate.m in DumpRenderTree. -void WebTestProxyBase::DidChangeSelection(bool is_empty_callback) { - if (test_interfaces_->GetTestRunner()->shouldDumpEditingCallbacks()) - delegate_->PrintMessage( - "EDITING DELEGATE: " - "webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n"); -} - void WebTestProxyBase::DidChangeContents() { if (test_interfaces_->GetTestRunner()->shouldDumpEditingCallbacks()) delegate_->PrintMessage( @@ -844,14 +476,6 @@ return true; } -blink::WebPlugin* WebTestProxyBase::CreatePlugin( - blink::WebLocalFrame* frame, - const blink::WebPluginParams& params) { - if (TestPlugin::IsSupportedMimeType(params.mimeType)) - return TestPlugin::create(frame, params, delegate_); - return delegate_->CreatePluginPlaceholder(frame, params); -} - void WebTestProxyBase::SetStatusText(const blink::WebString& text) { if (!test_interfaces_->GetTestRunner()->shouldDumpStatusCallbacks()) return; @@ -860,17 +484,6 @@ text.utf8().data() + "\n"); } -void WebTestProxyBase::ShowContextMenu( - const blink::WebContextMenuData& context_menu_data) { - test_interfaces_->GetEventSender()->SetContextMenuData(context_menu_data); -} - -blink::WebUserMediaClient* WebTestProxyBase::GetUserMediaClient() { - if (!user_media_client_.get()) - user_media_client_.reset(new MockWebUserMediaClient(delegate_)); - return user_media_client_.get(); -} - // Simulate a print by going into print mode and then exit straight away. void WebTestProxyBase::PrintPage(blink::WebLocalFrame* frame) { blink::WebSize page_size_in_pixels = web_widget_->size(); @@ -906,380 +519,6 @@ test_interfaces_->GetTestRunner()->setToolTipText(text); } -void WebTestProxyBase::DidOpenChooser() { - chooser_count_++; -} - -void WebTestProxyBase::DidCloseChooser() { - chooser_count_--; -} - -bool WebTestProxyBase::IsChooserShown() { - return 0 < chooser_count_; -} - -void WebTestProxyBase::LoadURLExternally(const blink::WebURLRequest& request, - blink::WebNavigationPolicy policy, - const blink::WebString& suggested_name, - bool replaces_current_history_item) { - if (test_interfaces_->GetTestRunner()->shouldWaitUntilExternalURLLoad()) { - if (policy == blink::WebNavigationPolicyDownload) { - delegate_->PrintMessage( - std::string("Downloading URL with suggested filename \"") + - suggested_name.utf8() + "\"\n"); - } else { - delegate_->PrintMessage(std::string("Loading URL externally - \"") + - URLDescription(request.url()) + "\"\n"); - } - delegate_->TestFinished(); - } -} - -void WebTestProxyBase::DidStartProvisionalLoad(blink::WebLocalFrame* frame) { - if (!test_interfaces_->GetTestRunner()->topLoadingFrame()) - test_interfaces_->GetTestRunner()->setTopLoadingFrame(frame, false); - - if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { - PrintFrameDescription(delegate_, frame); - delegate_->PrintMessage(" - didStartProvisionalLoadForFrame\n"); - } - - if (test_interfaces_->GetTestRunner() - ->shouldDumpUserGestureInFrameLoadCallbacks()) { - PrintFrameuserGestureStatus( - delegate_, frame, " - in didStartProvisionalLoadForFrame\n"); - } -} - -void WebTestProxyBase::DidReceiveServerRedirectForProvisionalLoad( - blink::WebLocalFrame* frame) { - if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { - PrintFrameDescription(delegate_, frame); - delegate_->PrintMessage( - " - didReceiveServerRedirectForProvisionalLoadForFrame\n"); - } -} - -bool WebTestProxyBase::DidFailProvisionalLoad( - blink::WebLocalFrame* frame, - const blink::WebURLError& error, - blink::WebHistoryCommitType commit_type) { - DCHECK(frame->provisionalDataSource()); - if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { - PrintFrameDescription(delegate_, frame); - delegate_->PrintMessage(" - didFailProvisionalLoadWithError\n"); - } - CheckDone(frame, MainResourceLoadFailed); - return !frame->provisionalDataSource(); -} - -void WebTestProxyBase::DidCommitProvisionalLoad( - blink::WebLocalFrame* frame, - const blink::WebHistoryItem& history_item, - blink::WebHistoryCommitType history_type) { - if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { - PrintFrameDescription(delegate_, frame); - delegate_->PrintMessage(" - didCommitLoadForFrame\n"); - } -} - -void WebTestProxyBase::DidReceiveTitle(blink::WebLocalFrame* frame, - const blink::WebString& title, - blink::WebTextDirection direction) { - if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { - PrintFrameDescription(delegate_, frame); - delegate_->PrintMessage(std::string(" - didReceiveTitle: ") + title.utf8() + - "\n"); - } - - if (test_interfaces_->GetTestRunner()->shouldDumpTitleChanges()) - delegate_->PrintMessage(std::string("TITLE CHANGED: '") + title.utf8() + - "'\n"); -} - -void WebTestProxyBase::DidChangeIcon(blink::WebLocalFrame* frame, - blink::WebIconURL::Type icon_type) { - if (test_interfaces_->GetTestRunner()->shouldDumpIconChanges()) { - PrintFrameDescription(delegate_, frame); - delegate_->PrintMessage(std::string(" - didChangeIcons\n")); - } -} - -void WebTestProxyBase::DidFinishDocumentLoad(blink::WebLocalFrame* frame) { - if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { - PrintFrameDescription(delegate_, frame); - delegate_->PrintMessage(" - didFinishDocumentLoadForFrame\n"); - } -} - -void WebTestProxyBase::DidHandleOnloadEvents(blink::WebLocalFrame* frame) { - if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { - PrintFrameDescription(delegate_, frame); - delegate_->PrintMessage(" - didHandleOnloadEventsForFrame\n"); - } -} - -void WebTestProxyBase::DidFailLoad(blink::WebLocalFrame* frame, - const blink::WebURLError& error, - blink::WebHistoryCommitType commit_type) { - if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { - PrintFrameDescription(delegate_, frame); - delegate_->PrintMessage(" - didFailLoadWithError\n"); - } - CheckDone(frame, MainResourceLoadFailed); -} - -void WebTestProxyBase::DidFinishLoad(blink::WebLocalFrame* frame) { - if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { - PrintFrameDescription(delegate_, frame); - delegate_->PrintMessage(" - didFinishLoadForFrame\n"); - } - CheckDone(frame, LoadFinished); -} - -void WebTestProxyBase::DidDetectXSS(const blink::WebURL& insecure_url, - bool did_block_entire_page) { - if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) - delegate_->PrintMessage("didDetectXSS\n"); -} - -void WebTestProxyBase::DidDispatchPingLoader(const blink::WebURL& url) { - if (test_interfaces_->GetTestRunner()->shouldDumpPingLoaderCallbacks()) - delegate_->PrintMessage(std::string("PingLoader dispatched to '") + - URLDescription(url).c_str() + "'.\n"); -} - -void WebTestProxyBase::WillSendRequest( - blink::WebLocalFrame* frame, - unsigned identifier, - blink::WebURLRequest& request, - const blink::WebURLResponse& redirect_response) { - // Need to use GURL for host() and SchemeIs() - GURL url = request.url(); - std::string request_url = url.possibly_invalid_spec(); - - GURL main_document_url = request.firstPartyForCookies(); - - if (redirect_response.isNull() && - (test_interfaces_->GetTestRunner()->shouldDumpResourceLoadCallbacks() || - test_interfaces_->GetTestRunner()->shouldDumpResourcePriorities())) { - DCHECK(resource_identifier_map_.find(identifier) == - resource_identifier_map_.end()); - resource_identifier_map_[identifier] = - DescriptionSuitableForTestResult(request_url); - } - - if (test_interfaces_->GetTestRunner()->shouldDumpResourceLoadCallbacks()) { - if (resource_identifier_map_.find(identifier) == - resource_identifier_map_.end()) - delegate_->PrintMessage("<unknown>"); - else - delegate_->PrintMessage(resource_identifier_map_[identifier]); - delegate_->PrintMessage(" - willSendRequest <NSURLRequest URL "); - delegate_->PrintMessage( - DescriptionSuitableForTestResult(request_url).c_str()); - delegate_->PrintMessage(", main document URL "); - delegate_->PrintMessage(URLDescription(main_document_url).c_str()); - delegate_->PrintMessage(", http method "); - delegate_->PrintMessage(request.httpMethod().utf8().data()); - delegate_->PrintMessage("> redirectResponse "); - PrintResponseDescription(delegate_, redirect_response); - delegate_->PrintMessage("\n"); - } - - if (test_interfaces_->GetTestRunner()->shouldDumpResourcePriorities()) { - delegate_->PrintMessage( - DescriptionSuitableForTestResult(request_url).c_str()); - delegate_->PrintMessage(" has priority "); - delegate_->PrintMessage(PriorityDescription(request.getPriority())); - delegate_->PrintMessage("\n"); - } - - if (test_interfaces_->GetTestRunner()->httpHeadersToClear()) { - const std::set<std::string>* clearHeaders = - test_interfaces_->GetTestRunner()->httpHeadersToClear(); - for (std::set<std::string>::const_iterator header = clearHeaders->begin(); - header != clearHeaders->end(); - ++header) - request.clearHTTPHeaderField(blink::WebString::fromUTF8(*header)); - } - - std::string host = url.host(); - if (!host.empty() && - (url.SchemeIs(url::kHttpScheme) || url.SchemeIs(url::kHttpsScheme))) { - if (!IsLocalHost(host) && !IsTestHost(host) && - !HostIsUsedBySomeTestsToGenerateError(host) && - ((!main_document_url.SchemeIs(url::kHttpScheme) && - !main_document_url.SchemeIs(url::kHttpsScheme)) || - IsLocalHost(main_document_url.host())) && - !delegate_->AllowExternalPages()) { - delegate_->PrintMessage(std::string("Blocked access to external URL ") + - request_url + "\n"); - BlockRequest(request); - return; - } - } - - // Set the new substituted URL. - request.setURL( - delegate_->RewriteLayoutTestsURL(request.url().string().utf8())); -} - -void WebTestProxyBase::DidReceiveResponse( - unsigned identifier, - const blink::WebURLResponse& response) { - if (test_interfaces_->GetTestRunner()->shouldDumpResourceLoadCallbacks()) { - if (resource_identifier_map_.find(identifier) == - resource_identifier_map_.end()) - delegate_->PrintMessage("<unknown>"); - else - delegate_->PrintMessage(resource_identifier_map_[identifier]); - delegate_->PrintMessage(" - didReceiveResponse "); - PrintResponseDescription(delegate_, response); - delegate_->PrintMessage("\n"); - } - if (test_interfaces_->GetTestRunner() - ->shouldDumpResourceResponseMIMETypes()) { - GURL url = response.url(); - blink::WebString mime_type = response.mimeType(); - delegate_->PrintMessage(url.ExtractFileName()); - delegate_->PrintMessage(" has MIME type "); - // Simulate NSURLResponse's mapping of empty/unknown MIME types to - // application/octet-stream - delegate_->PrintMessage(mime_type.isEmpty() ? "application/octet-stream" - : mime_type.utf8().data()); - delegate_->PrintMessage("\n"); - } -} - -void WebTestProxyBase::DidChangeResourcePriority( - unsigned identifier, - const blink::WebURLRequest::Priority& priority, - int intra_priority_value) { - if (test_interfaces_->GetTestRunner()->shouldDumpResourcePriorities()) { - if (resource_identifier_map_.find(identifier) == - resource_identifier_map_.end()) - delegate_->PrintMessage("<unknown>"); - else - delegate_->PrintMessage(resource_identifier_map_[identifier]); - delegate_->PrintMessage( - base::StringPrintf(" changed priority to %s, intra_priority %d\n", - PriorityDescription(priority).c_str(), - intra_priority_value)); - } -} - -void WebTestProxyBase::DidFinishResourceLoad(blink::WebLocalFrame* frame, - unsigned identifier) { - if (test_interfaces_->GetTestRunner()->shouldDumpResourceLoadCallbacks()) { - if (resource_identifier_map_.find(identifier) == - resource_identifier_map_.end()) - delegate_->PrintMessage("<unknown>"); - else - delegate_->PrintMessage(resource_identifier_map_[identifier]); - delegate_->PrintMessage(" - didFinishLoading\n"); - } - resource_identifier_map_.erase(identifier); - CheckDone(frame, ResourceLoadCompleted); -} - -void WebTestProxyBase::DidAddMessageToConsole( - const blink::WebConsoleMessage& message, - const blink::WebString& source_name, - unsigned source_line) { - // This matches win DumpRenderTree's UIDelegate.cpp. - if (!log_console_output_) - return; - std::string level; - switch (message.level) { - case blink::WebConsoleMessage::LevelDebug: - level = "DEBUG"; - break; - case blink::WebConsoleMessage::LevelLog: - level = "MESSAGE"; - break; - case blink::WebConsoleMessage::LevelInfo: - level = "INFO"; - break; - case blink::WebConsoleMessage::LevelWarning: - level = "WARNING"; - break; - case blink::WebConsoleMessage::LevelError: - level = "ERROR"; - break; - default: - level = "MESSAGE"; - } - delegate_->PrintMessage(std::string("CONSOLE ") + level + ": "); - if (source_line) { - delegate_->PrintMessage(base::StringPrintf("line %d: ", source_line)); - } - if (!message.text.isEmpty()) { - std::string new_message; - new_message = message.text.utf8(); - size_t file_protocol = new_message.find("file://"); - if (file_protocol != std::string::npos) { - new_message = new_message.substr(0, file_protocol) + - URLSuitableForTestResult(new_message.substr(file_protocol)); - } - delegate_->PrintMessage(new_message); - } - delegate_->PrintMessage(std::string("\n")); -} - -void WebTestProxyBase::CheckDone(blink::WebLocalFrame* frame, - CheckDoneReason reason) { - if (frame != test_interfaces_->GetTestRunner()->topLoadingFrame()) - return; - if (reason != MainResourceLoadFailed && - (frame->isResourceLoadInProgress() || frame->isLoading())) - return; - test_interfaces_->GetTestRunner()->setTopLoadingFrame(frame, true); -} - -blink::WebNavigationPolicy WebTestProxyBase::DecidePolicyForNavigation( - const blink::WebFrameClient::NavigationPolicyInfo& info) { - if (test_interfaces_->GetTestRunner()->shouldDumpNavigationPolicy()) { - delegate_->PrintMessage("Default policy for navigation to '" + - URLDescription(info.urlRequest.url()) + "' is '" + - WebNavigationPolicyToString(info.defaultPolicy) + - "'\n"); - } - - blink::WebNavigationPolicy result; - if (!test_interfaces_->GetTestRunner()->policyDelegateEnabled()) - return info.defaultPolicy; - - delegate_->PrintMessage( - std::string("Policy delegate: attempt to load ") + - URLDescription(info.urlRequest.url()) + " with navigation type '" + - WebNavigationTypeToString(info.navigationType) + "'\n"); - if (test_interfaces_->GetTestRunner()->policyDelegateIsPermissive()) - result = blink::WebNavigationPolicyCurrentTab; - else - result = blink::WebNavigationPolicyIgnore; - - if (test_interfaces_->GetTestRunner()->policyDelegateShouldNotifyDone()) { - test_interfaces_->GetTestRunner()->policyDelegateDone(); - result = blink::WebNavigationPolicyIgnore; - } - - return result; -} - -bool WebTestProxyBase::WillCheckAndDispatchMessageEvent( - blink::WebLocalFrame* source_frame, - blink::WebFrame* target_frame, - blink::WebSecurityOrigin target, - blink::WebDOMMessageEvent event) { - if (test_interfaces_->GetTestRunner()->shouldInterceptPostMessage()) { - delegate_->PrintMessage("intercepted postMessage\n"); - return true; - } - - return false; -} - void WebTestProxyBase::PostSpellCheckEvent(const blink::WebString& event_name) { if (test_interfaces_->GetTestRunner()->shouldDumpSpellCheckCallbacks()) { delegate_->PrintMessage(std::string("SpellCheckEvent: ") + @@ -1294,20 +533,6 @@ web_widget_->confirmComposition(); } -void WebTestProxyBase::CheckIfAudioSinkExistsAndIsAuthorized( - const blink::WebString& sink_id, - const blink::WebSecurityOrigin& security_origin, - blink::WebSetSinkIdCallbacks* web_callbacks) { - scoped_ptr<blink::WebSetSinkIdCallbacks> callback(web_callbacks); - std::string device_id = sink_id.utf8(); - if (device_id == "valid" || device_id.empty()) - callback->onSuccess(); - else if (device_id == "unauthorized") - callback->onError(blink::WebSetSinkIdError::NotAuthorized); - else - callback->onError(blink::WebSetSinkIdError::NotFound); -} - blink::WebString WebTestProxyBase::acceptLanguages() { return blink::WebString::fromUTF8(accept_languages_); }
diff --git a/components/test_runner/web_test_proxy.h b/components/test_runner/web_test_proxy.h index f9e9ef8..3c7746b7 100644 --- a/components/test_runner/web_test_proxy.h +++ b/components/test_runner/web_test_proxy.h
@@ -5,8 +5,6 @@ #ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ #define COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ -#include <deque> -#include <map> #include <string> #include "base/callback.h" @@ -18,67 +16,35 @@ #include "third_party/WebKit/public/platform/WebImage.h" #include "third_party/WebKit/public/platform/WebRect.h" #include "third_party/WebKit/public/platform/WebScreenInfo.h" -#include "third_party/WebKit/public/platform/WebSecurityOrigin.h" -#include "third_party/WebKit/public/platform/WebSetSinkIdCallbacks.h" #include "third_party/WebKit/public/platform/WebURLError.h" #include "third_party/WebKit/public/platform/WebURLRequest.h" -#include "third_party/WebKit/public/web/WebAXEnums.h" #include "third_party/WebKit/public/web/WebDOMMessageEvent.h" -#include "third_party/WebKit/public/web/WebDataSource.h" #include "third_party/WebKit/public/web/WebDragOperation.h" -#include "third_party/WebKit/public/web/WebFrame.h" -#include "third_party/WebKit/public/web/WebFrameClient.h" #include "third_party/WebKit/public/web/WebHistoryCommitType.h" -#include "third_party/WebKit/public/web/WebIconURL.h" #include "third_party/WebKit/public/web/WebNavigationPolicy.h" -#include "third_party/WebKit/public/web/WebNavigationType.h" #include "third_party/WebKit/public/web/WebTextDirection.h" class SkBitmap; class SkCanvas; namespace blink { -class WebAXObject; -class WebAudioDevice; -class WebColorChooser; -class WebColorChooserClient; -class WebDataSource; class WebDragData; class WebFileChooserCompletion; -class WebFrame; class WebLocalFrame; -class WebMIDIAccessor; -class WebMIDIAccessorClient; -class WebNode; -class WebPlugin; -class WebRange; -class WebSerializedScriptValue; class WebSpeechRecognizer; class WebSpellCheckClient; class WebString; -class WebURL; -class WebURLResponse; -class WebUserMediaClient; class WebView; class WebWidget; -struct WebColorSuggestion; -struct WebConsoleMessage; -struct WebContextMenuData; struct WebFileChooserParams; -struct WebPluginParams; struct WebPoint; -struct WebSize; struct WebWindowFeatures; -typedef unsigned WebColor; } namespace test_runner { class MockCredentialManagerClient; -class MockScreenOrientationClient; class MockWebSpeechRecognizer; -class MockWebUserMediaClient; -class RenderFrame; class SpellCheckClient; class TestInterfaces; class WebTestDelegate; @@ -98,10 +64,6 @@ void Reset(); blink::WebSpellCheckClient* GetSpellCheckClient() const; - blink::WebColorChooser* CreateColorChooser( - blink::WebColorChooserClient* client, - const blink::WebColor& color, - const blink::WebVector<blink::WebColorSuggestion>& suggestions); bool RunFileChooser(const blink::WebFileChooserParams& params, blink::WebFileChooserCompletion* completion); void ShowValidationMessage(const blink::WebString& main_message, @@ -109,13 +71,6 @@ const blink::WebString& sub_message, blink::WebTextDirection sub_message_hint); - void RunModalAlertDialog(const blink::WebString& message); - bool RunModalConfirmDialog(const blink::WebString& message); - bool RunModalPromptDialog(const blink::WebString& message, - const blink::WebString& default_value, - blink::WebString* actual_value); - bool RunModalBeforeUnloadDialog(bool is_reload); - std::string DumpBackForwardLists(); void CapturePixelsForPrinting( const base::Callback<void(const SkBitmap&)>& callback); @@ -124,16 +79,9 @@ void CapturePixelsAsync( const base::Callback<void(const SkBitmap&)>& callback); - void SetLogConsoleOutput(bool enabled); - - void DidOpenChooser(); - void DidCloseChooser(); - bool IsChooserShown(); - void LayoutAndPaintAsyncThen(const base::Closure& callback); void GetScreenOrientationForTesting(blink::WebScreenInfo&); - MockScreenOrientationClient* GetScreenOrientationClientMock(); MockWebSpeechRecognizer* GetSpeechRecognizerMock(); MockCredentialManagerClient* GetCredentialManagerClientMock(); @@ -145,8 +93,6 @@ void SetAcceptLanguages(const std::string& accept_languages); - void PostAccessibilityEvent(const blink::WebAXObject&, blink::WebAXEvent); - bool AnimationScheduled() { return animate_scheduled_; } protected: @@ -159,7 +105,6 @@ blink::WebDragOperationsMask mask, const blink::WebImage& image, const blink::WebPoint& point); - void DidChangeSelection(bool isEmptySelection); void DidChangeContents(); void DidEndEditing(); bool CreateView(blink::WebLocalFrame* creator, @@ -168,11 +113,7 @@ const blink::WebString& frame_name, blink::WebNavigationPolicy policy, bool suppress_opener); - blink::WebPlugin* CreatePlugin(blink::WebLocalFrame* frame, - const blink::WebPluginParams& params); void SetStatusText(const blink::WebString& text); - void ShowContextMenu(const blink::WebContextMenuData& data); - blink::WebUserMediaClient* GetUserMediaClient(); void PrintPage(blink::WebLocalFrame* frame); blink::WebSpeechRecognizer* GetSpeechRecognizer(); bool RequestPointerLock(); @@ -181,70 +122,12 @@ void DidFocus(); void SetToolTipText(const blink::WebString& text, blink::WebTextDirection direction); - void DidAddMessageToConsole(const blink::WebConsoleMessage& text, - const blink::WebString& source_name, - unsigned source_line); - void LoadURLExternally(const blink::WebURLRequest& request, - blink::WebNavigationPolicy policy, - const blink::WebString& suggested_name, - bool replaces_current_history_item); - void DidStartProvisionalLoad(blink::WebLocalFrame*); - void DidReceiveServerRedirectForProvisionalLoad(blink::WebLocalFrame* frame); - bool DidFailProvisionalLoad(blink::WebLocalFrame* frame, - const blink::WebURLError& error, - blink::WebHistoryCommitType commit_type); - void DidCommitProvisionalLoad(blink::WebLocalFrame* frame, - const blink::WebHistoryItem& history_item, - blink::WebHistoryCommitType history_type); - void DidReceiveTitle(blink::WebLocalFrame* frame, - const blink::WebString& title, - blink::WebTextDirection text_direction); - void DidChangeIcon(blink::WebLocalFrame* frame, - blink::WebIconURL::Type icon_type); - void DidFinishDocumentLoad(blink::WebLocalFrame* frame); - void DidHandleOnloadEvents(blink::WebLocalFrame* frame); - void DidFailLoad(blink::WebLocalFrame* frame, - const blink::WebURLError& error, - blink::WebHistoryCommitType commit_type); - void DidFinishLoad(blink::WebLocalFrame* frame); void DidChangeLocationWithinPage(blink::WebLocalFrame* frame); - void DidDetectXSS(const blink::WebURL& insecure_url, - bool did_block_entire_page); - void DidDispatchPingLoader(const blink::WebURL& url); - void WillSendRequest(blink::WebLocalFrame* frame, - unsigned identifier, - blink::WebURLRequest& request, - const blink::WebURLResponse& redirect_response); - void DidReceiveResponse(unsigned identifier, - const blink::WebURLResponse& response); - void DidChangeResourcePriority(unsigned identifier, - const blink::WebURLRequest::Priority& priority, - int intra_priority_value); - void DidFinishResourceLoad(blink::WebLocalFrame* frame, unsigned identifier); - blink::WebNavigationPolicy DecidePolicyForNavigation( - const blink::WebFrameClient::NavigationPolicyInfo& info); - bool WillCheckAndDispatchMessageEvent(blink::WebLocalFrame* source_frame, - blink::WebFrame* target_frame, - blink::WebSecurityOrigin target, - blink::WebDOMMessageEvent event); void ResetInputMethod(); - void CheckIfAudioSinkExistsAndIsAuthorized( - const blink::WebString& sink_id, - const blink::WebSecurityOrigin& security_origin, - blink::WebSetSinkIdCallbacks* web_callbacks); blink::WebString acceptLanguages(); private: - template <class, typename> - friend class WebFrameTestProxy; - - enum CheckDoneReason { - LoadFinished, - MainResourceLoadFailed, - ResourceLoadCompleted - }; - void CheckDone(blink::WebLocalFrame* frame, CheckDoneReason reason); void AnimateNow(); void DrawSelectionRect(SkCanvas* canvas); void DidCapturePixelsAsync( @@ -260,13 +143,8 @@ blink::WebImage drag_image_; scoped_ptr<SpellCheckClient> spellcheck_; - scoped_ptr<MockWebUserMediaClient> user_media_client_; bool animate_scheduled_; - std::map<unsigned, std::string> resource_identifier_map_; - - bool log_console_output_; - int chooser_count_; scoped_ptr<MockCredentialManagerClient> credential_manager_client_; scoped_ptr<MockWebSpeechRecognizer> speech_recognizer_;
diff --git a/components/tracing/trace_config_file.cc b/components/tracing/trace_config_file.cc index 56e3ea5c..a19b66f5 100644 --- a/components/tracing/trace_config_file.cc +++ b/components/tracing/trace_config_file.cc
@@ -12,6 +12,7 @@ #include "base/files/file_util.h" #include "base/json/json_reader.h" #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/values.h" #include "build/build_config.h"
diff --git a/components/translate/core/language_detection/language_detection_util.cc b/components/translate/core/language_detection/language_detection_util.cc index 3b8bda76..ddd8a9f 100644 --- a/components/translate/core/language_detection/language_detection_util.cc +++ b/components/translate/core/language_detection/language_detection_util.cc
@@ -8,6 +8,7 @@ #include "base/logging.h" #include "base/macros.h" +#include "base/metrics/histogram_macros.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -136,6 +137,12 @@ // Choose top language. cld_language = language3[0]; + UMA_HISTOGRAM_ENUMERATION("Translate.CLD2.LanguageDetected", + cld_language, CLD2::NUM_LANGUAGES); + if (is_valid_language) + UMA_HISTOGRAM_PERCENTAGE("Translate.CLD2.LanguageAccuracy", percent3[0]); + + #else # error "CLD_VERSION must be 1 or 2" #endif @@ -152,7 +159,7 @@ if (is_reliable && num_bytes_evaluated >= 100 && is_valid_language) { // We should not use LanguageCode_ISO_639_1 because it does not cover all // the languages CLD can detect. As a result, it'll return the invalid - // language code for tradtional Chinese among others. + // language code for traditional Chinese among others. // |LanguageCodeWithDialect| will go through ISO 639-1, ISO-639-2 and // 'other' tables to do the 'right' thing. In addition, it'll return zh-CN // for Simplified Chinese.
diff --git a/components/variations/variations_seed_processor_unittest.cc b/components/variations/variations_seed_processor_unittest.cc index 693ccf9..cac84dc6 100644 --- a/components/variations/variations_seed_processor_unittest.cc +++ b/components/variations/variations_seed_processor_unittest.cc
@@ -15,6 +15,7 @@ #include "base/feature_list.h" #include "base/format_macros.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/string_split.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h"
diff --git a/components/visitedlink/browser/visitedlink_master.h b/components/visitedlink/browser/visitedlink_master.h index ebdcf41..40b721b0 100644 --- a/components/visitedlink/browser/visitedlink_master.h +++ b/components/visitedlink/browser/visitedlink_master.h
@@ -17,6 +17,7 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/shared_memory.h" #include "base/memory/weak_ptr.h" #include "base/threading/sequenced_worker_pool.h"
diff --git a/components/webcrypto/jwk.h b/components/webcrypto/jwk.h index 67d271d..9cba0edb 100644 --- a/components/webcrypto/jwk.h +++ b/components/webcrypto/jwk.h
@@ -6,8 +6,10 @@ #define COMPONENTS_WEBCRYPTO_JWK_H_ #include <stdint.h> + #include <vector> +#include "base/memory/scoped_ptr.h" #include "base/values.h" #include "third_party/WebKit/public/platform/WebCrypto.h"
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 7188165..b0b38b6 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -297,6 +297,9 @@ if (use_x11) { configs += [ "//build/config/linux:x11" ] + if (!is_chromeos) { + configs += [ "//build/config/linux:xscrnsaver" ] + } deps += [ "//ui/gfx/x" ] }
diff --git a/content/browser/accessibility/browser_accessibility_state_impl.cc b/content/browser/accessibility/browser_accessibility_state_impl.cc index 8fb3442..4038d66 100644 --- a/content/browser/accessibility/browser_accessibility_state_impl.cc +++ b/content/browser/accessibility/browser_accessibility_state_impl.cc
@@ -122,7 +122,7 @@ switches::kForceRendererAccessibility)); } -#if !defined(OS_WIN) +#if !defined(OS_WIN) && !defined(OS_MACOSX) void BrowserAccessibilityStateImpl::UpdatePlatformSpecificHistograms() { } #endif
diff --git a/content/browser/accessibility/browser_accessibility_state_impl_mac.mm b/content/browser/accessibility/browser_accessibility_state_impl_mac.mm new file mode 100644 index 0000000..863627f --- /dev/null +++ b/content/browser/accessibility/browser_accessibility_state_impl_mac.mm
@@ -0,0 +1,44 @@ +// 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. + +#include "content/browser/accessibility/browser_accessibility_state_impl.h" + +#import <Cocoa/Cocoa.h> + +#include "base/metrics/histogram.h" + +@interface NSWorkspace (Partials) + +@property(readonly) BOOL accessibilityDisplayShouldDifferentiateWithoutColor; +@property(readonly) BOOL accessibilityDisplayShouldIncreaseContrast; +@property(readonly) BOOL accessibilityDisplayShouldReduceTransparency; + +@end + +namespace content { + +void BrowserAccessibilityStateImpl::UpdatePlatformSpecificHistograms() { + // NOTE: This function is running on the file thread. + NSWorkspace* workspace = [NSWorkspace sharedWorkspace]; + + SEL sel = @selector(accessibilityDisplayShouldIncreaseContrast); + if (![workspace respondsToSelector:sel]) + return; + + UMA_HISTOGRAM_BOOLEAN( + "Accessibility.Mac.DifferentiateWithoutColor", + workspace.accessibilityDisplayShouldDifferentiateWithoutColor); + UMA_HISTOGRAM_BOOLEAN( + "Accessibility.Mac.IncreaseContrast", + workspace.accessibilityDisplayShouldIncreaseContrast); + UMA_HISTOGRAM_BOOLEAN( + "Accessibility.Mac.ReduceTransparency", + workspace.accessibilityDisplayShouldReduceTransparency); + + UMA_HISTOGRAM_BOOLEAN( + "Accessibility.Mac.FullKeyboardAccessEnabled", + static_cast<NSApplication*>(NSApp).fullKeyboardAccessEnabled); +} + +} // namespace content
diff --git a/content/browser/android/in_process/synchronous_compositor_impl.cc b/content/browser/android/in_process/synchronous_compositor_impl.cc index 1b06e510..aa0a23b 100644 --- a/content/browser/android/in_process/synchronous_compositor_impl.cc +++ b/content/browser/android/in_process/synchronous_compositor_impl.cc
@@ -253,6 +253,10 @@ begin_frame_source_->SetBeginFrameSourcePaused(!is_active_); } +void SynchronousCompositorImpl::SynchronizeWithRenderer() { + // Intentional no-op. Nothing to synchronize. +} + void SynchronousCompositorImpl::OnComputeScroll( base::TimeTicks animation_time) { if (need_animate_input_) {
diff --git a/content/browser/android/in_process/synchronous_compositor_impl.h b/content/browser/android/in_process/synchronous_compositor_impl.h index 4f3155a..fdb2700 100644 --- a/content/browser/android/in_process/synchronous_compositor_impl.h +++ b/content/browser/android/in_process/synchronous_compositor_impl.h
@@ -75,6 +75,7 @@ void DidChangeRootLayerScrollOffset( const gfx::ScrollOffset& root_offset) override; void SetIsActive(bool is_active) override; + void SynchronizeWithRenderer() override; void OnComputeScroll(base::TimeTicks animation_time) override; // SynchronousCompositorBase overrides.
diff --git a/content/browser/android/synchronous_compositor_host.cc b/content/browser/android/synchronous_compositor_host.cc index 2d937c5..127124b 100644 --- a/content/browser/android/synchronous_compositor_host.cc +++ b/content/browser/android/synchronous_compositor_host.cc
@@ -337,6 +337,17 @@ SendAsyncCompositorStateIfNeeded(); } +void SynchronousCompositorHost::SynchronizeWithRenderer() { + SyncCompositorCommonBrowserParams common_browser_params; + PopulateCommonParams(&common_browser_params); + SyncCompositorCommonRendererParams common_renderer_params; + if (!sender_->Send(new SyncCompositorMsg_SynchronousUpdateState( + routing_id_, common_browser_params, &common_renderer_params))) { + return; + } + ProcessCommonParams(common_renderer_params); +} + void SynchronousCompositorHost::OnComputeScroll( base::TimeTicks animation_time) { if (!need_animate_scroll_)
diff --git a/content/browser/android/synchronous_compositor_host.h b/content/browser/android/synchronous_compositor_host.h index 6c0001b..e3a49ef 100644 --- a/content/browser/android/synchronous_compositor_host.h +++ b/content/browser/android/synchronous_compositor_host.h
@@ -47,6 +47,7 @@ void DidChangeRootLayerScrollOffset( const gfx::ScrollOffset& root_offset) override; void SetIsActive(bool is_active) override; + void SynchronizeWithRenderer() override; void OnComputeScroll(base::TimeTicks animation_time) override; // SynchronousCompositorBase overrides.
diff --git a/content/browser/background_sync/background_sync_manager_unittest.cc b/content/browser/background_sync/background_sync_manager_unittest.cc index 02961f44..dbe81cd 100644 --- a/content/browser/background_sync/background_sync_manager_unittest.cc +++ b/content/browser/background_sync/background_sync_manager_unittest.cc
@@ -136,7 +136,7 @@ storage_partition_impl_.reset(new StoragePartitionImpl( helper_->browser_context(), base::FilePath(), nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr)); + nullptr, nullptr, nullptr)); helper_->context_wrapper()->set_storage_partition( storage_partition_impl_.get());
diff --git a/content/browser/background_sync/background_sync_service_impl_unittest.cc b/content/browser/background_sync/background_sync_service_impl_unittest.cc index 5927f05..8f413508 100644 --- a/content/browser/background_sync/background_sync_service_impl_unittest.cc +++ b/content/browser/background_sync/background_sync_service_impl_unittest.cc
@@ -134,7 +134,7 @@ storage_partition_impl_.reset(new StoragePartitionImpl( embedded_worker_helper_->browser_context(), base::FilePath(), nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)); + nullptr, nullptr, nullptr, nullptr, nullptr)); embedded_worker_helper_->context_wrapper()->set_storage_partition( storage_partition_impl_.get()); }
diff --git a/content/browser/browser_main.cc b/content/browser/browser_main.cc index d0897f1d..459bde0 100644 --- a/content/browser/browser_main.cc +++ b/content/browser/browser_main.cc
@@ -4,6 +4,7 @@ #include "content/browser/browser_main.h" +#include "base/memory/scoped_ptr.h" #include "base/trace_event/trace_event.h" #include "content/common/content_constants_internal.h" #include "content/public/browser/browser_main_runner.h"
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index 007c977..fd0c173e 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -740,15 +740,10 @@ void BrowserPluginGuest::OnWillAttachComplete( WebContentsImpl* embedder_web_contents, const BrowserPluginHostMsg_Attach_Params& params) { - bool use_cross_process_frames = - BrowserPluginGuestMode::UseCrossProcessFramesForGuests(); // If a RenderView has already been created for this new window, then we need // to initialize the browser-side state now so that the RenderFrameHostManager // does not create a new RenderView on navigation. - // TODO(wjmaclean): this pathway doesn't seem to ever get hit when using - // cross-process-frames ... should it be removed? Or am I just missing a - // use case? - if (!use_cross_process_frames && has_render_view_) { + if (has_render_view_) { // This will trigger a callback to RenderViewReady after a round-trip IPC. static_cast<RenderViewHostImpl*>(GetWebContents()->GetRenderViewHost()) ->GetWidget() @@ -772,9 +767,7 @@ RenderWidgetHostViewGuest* rwhv = static_cast<RenderWidgetHostViewGuest*>( web_contents()->GetRenderWidgetHostView()); rwhv->RegisterSurfaceNamespaceId(); - - if (!use_cross_process_frames) - has_render_view_ = true; + has_render_view_ = true; RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached")); }
diff --git a/content/browser/browser_process_sub_thread.h b/content/browser/browser_process_sub_thread.h index 2276d6d..aded0cb 100644 --- a/content/browser/browser_process_sub_thread.h +++ b/content/browser/browser_process_sub_thread.h
@@ -6,6 +6,7 @@ #define CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "build/build_config.h" #include "content/browser/browser_thread_impl.h" #include "content/common/content_export.h"
diff --git a/content/browser/cache_storage/cache_storage.cc b/content/browser/cache_storage/cache_storage.cc index 1a5cb22..c5a7b1e 100644 --- a/content/browser/cache_storage/cache_storage.cc +++ b/content/browser/cache_storage/cache_storage.cc
@@ -303,27 +303,24 @@ base::FilePath index_path = origin_path_.AppendASCII(CacheStorage::kIndexFileName); - cache_task_runner_->PostTask( - FROM_HERE, base::Bind(&SimpleCacheLoader::WriteIndexWriteToFileInPool, - tmp_path, index_path, serialized, callback, - base::ThreadTaskRunnerHandle::Get())); + PostTaskAndReplyWithResult( + cache_task_runner_.get(), FROM_HERE, + base::Bind(&SimpleCacheLoader::WriteIndexWriteToFileInPool, tmp_path, + index_path, serialized), + callback); } - static void WriteIndexWriteToFileInPool( - const base::FilePath& tmp_path, - const base::FilePath& index_path, - const std::string& data, - const BoolCallback& callback, - scoped_refptr<base::SingleThreadTaskRunner> original_task_runner) { + static bool WriteIndexWriteToFileInPool(const base::FilePath& tmp_path, + const base::FilePath& index_path, + const std::string& data) { int bytes_written = base::WriteFile(tmp_path, data.c_str(), data.size()); if (bytes_written != base::checked_cast<int>(data.size())) { base::DeleteFile(tmp_path, /* recursive */ false); - original_task_runner->PostTask(FROM_HERE, base::Bind(callback, false)); + return false; } // Atomically rename the temporary index file to become the real one. - bool rv = base::ReplaceFile(tmp_path, index_path, NULL); - original_task_runner->PostTask(FROM_HERE, base::Bind(callback, rv)); + return base::ReplaceFile(tmp_path, index_path, NULL); } void LoadIndex(scoped_ptr<std::vector<std::string>> names,
diff --git a/content/browser/cache_storage/cache_storage_dispatcher_host.cc b/content/browser/cache_storage/cache_storage_dispatcher_host.cc index b53495c..f371be94 100644 --- a/content/browser/cache_storage/cache_storage_dispatcher_host.cc +++ b/content/browser/cache_storage/cache_storage_dispatcher_host.cc
@@ -22,6 +22,8 @@ #include "content/public/common/origin_util.h" #include "storage/browser/blob/blob_data_handle.h" #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerCacheError.h" +#include "url/gurl.h" +#include "url/origin.h" namespace content { @@ -52,8 +54,8 @@ return blink::WebServiceWorkerCacheErrorNotImplemented; } -bool OriginCanAccessCacheStorage(const GURL& url) { - return IsOriginSecure(url); +bool OriginCanAccessCacheStorage(const url::Origin& origin) { + return !origin.unique() && IsOriginSecure(GURL(origin.Serialize())); } } // namespace @@ -114,7 +116,7 @@ void CacheStorageDispatcherHost::OnCacheStorageHas( int thread_id, int request_id, - const GURL& origin, + const url::Origin& origin, const base::string16& cache_name) { TRACE_EVENT0("CacheStorage", "CacheStorageDispatcherHost::OnCacheStorageHas"); if (!OriginCanAccessCacheStorage(origin)) { @@ -122,7 +124,7 @@ return; } context_->cache_manager()->HasCache( - origin, base::UTF16ToUTF8(cache_name), + GURL(origin.Serialize()), base::UTF16ToUTF8(cache_name), base::Bind(&CacheStorageDispatcherHost::OnCacheStorageHasCallback, this, thread_id, request_id)); } @@ -130,7 +132,7 @@ void CacheStorageDispatcherHost::OnCacheStorageOpen( int thread_id, int request_id, - const GURL& origin, + const url::Origin& origin, const base::string16& cache_name) { TRACE_EVENT0("CacheStorage", "CacheStorageDispatcherHost::OnCacheStorageOpen"); @@ -139,7 +141,7 @@ return; } context_->cache_manager()->OpenCache( - origin, base::UTF16ToUTF8(cache_name), + GURL(origin.Serialize()), base::UTF16ToUTF8(cache_name), base::Bind(&CacheStorageDispatcherHost::OnCacheStorageOpenCallback, this, thread_id, request_id)); } @@ -147,7 +149,7 @@ void CacheStorageDispatcherHost::OnCacheStorageDelete( int thread_id, int request_id, - const GURL& origin, + const url::Origin& origin, const base::string16& cache_name) { TRACE_EVENT0("CacheStorage", "CacheStorageDispatcherHost::OnCacheStorageDelete"); @@ -156,14 +158,14 @@ return; } context_->cache_manager()->DeleteCache( - origin, base::UTF16ToUTF8(cache_name), + GURL(origin.Serialize()), base::UTF16ToUTF8(cache_name), base::Bind(&CacheStorageDispatcherHost::OnCacheStorageDeleteCallback, this, thread_id, request_id)); } void CacheStorageDispatcherHost::OnCacheStorageKeys(int thread_id, int request_id, - const GURL& origin) { + const url::Origin& origin) { TRACE_EVENT0("CacheStorage", "CacheStorageDispatcherHost::OnCacheStorageKeys"); if (!OriginCanAccessCacheStorage(origin)) { @@ -171,7 +173,7 @@ return; } context_->cache_manager()->EnumerateCaches( - origin, + GURL(origin.Serialize()), base::Bind(&CacheStorageDispatcherHost::OnCacheStorageKeysCallback, this, thread_id, request_id)); } @@ -179,7 +181,7 @@ void CacheStorageDispatcherHost::OnCacheStorageMatch( int thread_id, int request_id, - const GURL& origin, + const url::Origin& origin, const ServiceWorkerFetchRequest& request, const CacheStorageCacheQueryParams& match_params) { TRACE_EVENT0("CacheStorage", @@ -195,13 +197,13 @@ if (match_params.cache_name.empty()) { context_->cache_manager()->MatchAllCaches( - origin, std::move(scoped_request), + GURL(origin.Serialize()), std::move(scoped_request), base::Bind(&CacheStorageDispatcherHost::OnCacheStorageMatchCallback, this, thread_id, request_id)); return; } context_->cache_manager()->MatchCache( - origin, base::UTF16ToUTF8(match_params.cache_name), + GURL(origin.Serialize()), base::UTF16ToUTF8(match_params.cache_name), std::move(scoped_request), base::Bind(&CacheStorageDispatcherHost::OnCacheStorageMatchCallback, this, thread_id, request_id));
diff --git a/content/browser/cache_storage/cache_storage_dispatcher_host.h b/content/browser/cache_storage/cache_storage_dispatcher_host.h index 3ae680b..14cfe30 100644 --- a/content/browser/cache_storage/cache_storage_dispatcher_host.h +++ b/content/browser/cache_storage/cache_storage_dispatcher_host.h
@@ -13,6 +13,10 @@ #include "content/browser/cache_storage/cache_storage.h" #include "content/public/browser/browser_message_filter.h" +namespace url { +class Origin; +} + namespace content { class CacheStorageContextImpl; @@ -49,20 +53,22 @@ // The message receiver functions for the CacheStorage API: void OnCacheStorageHas(int thread_id, int request_id, - const GURL& origin, + const url::Origin& origin, const base::string16& cache_name); void OnCacheStorageOpen(int thread_id, int request_id, - const GURL& origin, + const url::Origin& origin, const base::string16& cache_name); void OnCacheStorageDelete(int thread_id, int request_id, - const GURL& origin, + const url::Origin& origin, const base::string16& cache_name); - void OnCacheStorageKeys(int thread_id, int request_id, const GURL& origin); + void OnCacheStorageKeys(int thread_id, + int request_id, + const url::Origin& origin); void OnCacheStorageMatch(int thread_id, int request_id, - const GURL& origin, + const url::Origin& origin, const ServiceWorkerFetchRequest& request, const CacheStorageCacheQueryParams& match_params);
diff --git a/content/browser/cocoa/system_hotkey_map.mm b/content/browser/cocoa/system_hotkey_map.mm index da04fa8..6ee4057 100644 --- a/content/browser/cocoa/system_hotkey_map.mm +++ b/content/browser/cocoa/system_hotkey_map.mm
@@ -4,6 +4,10 @@ #import "content/browser/cocoa/system_hotkey_map.h" +#import <Carbon/Carbon.h> + +#include "base/mac/scoped_nsobject.h" + #pragma mark - NSDictionary Helper Functions namespace { @@ -75,11 +79,32 @@ if (!dictionary) return false; - NSDictionary* hotkey_dictionaries = + NSDictionary* user_hotkey_dictionaries = DictionaryForKey(dictionary, @"AppleSymbolicHotKeys"); - if (!hotkey_dictionaries) + if (!user_hotkey_dictionaries) return false; + // Start with a dictionary of default OS X hotkeys that are not necessarily + // listed in com.apple.symbolichotkeys.plist, but should still be handled as + // reserved. + // If the user has overridden or disabled any of these hotkeys, + // -NSMutableDictionary addEntriesFromDictionary:] will ensure that the new + // values are used. + // See https://crbug.com/145062#c8 + base::scoped_nsobject<NSMutableDictionary> hotkey_dictionaries([@{ + // Default Window switch key binding: Command + ` + // Note: The first parameter @96 is not used by |SystemHotkeyMap|. + @"27" : @{ + @"enabled" : @YES, + @"value" : @{ + @"type" : @"standard", + @"parameters" : + @[ @96 /* unused */, @(kVK_ANSI_Grave), @(NSCommandKeyMask) ], + } + } + } mutableCopy]); + [hotkey_dictionaries addEntriesFromDictionary:user_hotkey_dictionaries]; + for (NSString* hotkey_system_effect in [hotkey_dictionaries allKeys]) { if (![hotkey_system_effect isKindOfClass:[NSString class]]) continue;
diff --git a/content/browser/cocoa/system_hotkey_map_unittest.mm b/content/browser/cocoa/system_hotkey_map_unittest.mm index 37638d47..a0798bec 100644 --- a/content/browser/cocoa/system_hotkey_map_unittest.mm +++ b/content/browser/cocoa/system_hotkey_map_unittest.mm
@@ -134,13 +134,13 @@ bool result = map.ParseDictionary(dictionary); EXPECT_TRUE(result); - // Command + ` is a common key binding. It is missing. - // TODO(erikchen): OSX uses the default value when the keybinding is missing, - // so the hotkey should still be reserved. - // http://crbug.com/383558 + // Command + ` is a common key binding. It is missing, but since OS X uses the + // default value the hotkey should still be reserved. + // https://crbug.com/383558 + // https://crbug.com/145062 unsigned short key_code = kVK_ANSI_Grave; NSUInteger modifiers = NSCommandKeyMask; - EXPECT_FALSE(map.IsHotkeyReserved(key_code, modifiers)); + EXPECT_TRUE(map.IsHotkeyReserved(key_code, modifiers)); // There is a mouse keybinding for 0x08. It should not apply to keyboard // hotkeys.
diff --git a/content/browser/devtools/devtools_frame_trace_recorder.h b/content/browser/devtools/devtools_frame_trace_recorder.h index 1d02667..79c6f16 100644 --- a/content/browser/devtools/devtools_frame_trace_recorder.h +++ b/content/browser/devtools/devtools_frame_trace_recorder.h
@@ -7,6 +7,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" namespace cc {
diff --git a/content/browser/devtools/devtools_manager.h b/content/browser/devtools/devtools_manager.h index 57b9ea02..f803c13 100644 --- a/content/browser/devtools/devtools_manager.h +++ b/content/browser/devtools/devtools_manager.h
@@ -7,6 +7,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "content/common/content_export.h" #include "content/public/browser/devtools_manager_delegate.h"
diff --git a/content/browser/devtools/protocol/devtools_protocol_client.h b/content/browser/devtools/protocol/devtools_protocol_client.h index fe17c99..ba1a0d7 100644 --- a/content/browser/devtools/protocol/devtools_protocol_client.h +++ b/content/browser/devtools/protocol/devtools_protocol_client.h
@@ -7,6 +7,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/values.h" namespace content {
diff --git a/content/browser/devtools/protocol/tethering_handler.cc b/content/browser/devtools/protocol/tethering_handler.cc index a58b534c..1718261 100644 --- a/content/browser/devtools/protocol/tethering_handler.cc +++ b/content/browser/devtools/protocol/tethering_handler.cc
@@ -7,6 +7,7 @@ #include "base/stl_util.h" #include "content/public/browser/browser_thread.h" #include "net/base/io_buffer.h" +#include "net/base/ip_address.h" #include "net/base/net_errors.h" #include "net/socket/server_socket.h" #include "net/socket/stream_socket.h" @@ -18,8 +19,6 @@ namespace { -const char kLocalhost[] = "127.0.0.1"; - const int kListenBacklog = 5; const int kBufferSize = 16 * 1024; @@ -171,11 +170,7 @@ bool Listen(uint16_t port) { port_ = port; - net::IPAddressNumber ip_number; - if (!net::ParseIPLiteralToNumber(kLocalhost, &ip_number)) - return false; - - net::IPEndPoint end_point(ip_number, port); + net::IPEndPoint end_point(net::IPAddress::IPv4Localhost(), port); int result = socket_->Listen(end_point, kListenBacklog); if (result < 0) return false;
diff --git a/content/browser/fileapi/native_file_util_unittest.cc b/content/browser/fileapi/native_file_util_unittest.cc index 210f8b9c..5a91454 100644 --- a/content/browser/fileapi/native_file_util_unittest.cc +++ b/content/browser/fileapi/native_file_util_unittest.cc
@@ -11,6 +11,7 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "storage/browser/fileapi/native_file_util.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/content/browser/frame_host/cross_process_frame_connector.cc b/content/browser/frame_host/cross_process_frame_connector.cc index cd7d64f..b5e415c 100644 --- a/content/browser/frame_host/cross_process_frame_connector.cc +++ b/content/browser/frame_host/cross_process_frame_connector.cc
@@ -116,20 +116,10 @@ } void CrossProcessFrameConnector::GetScreenInfo(blink::WebScreenInfo* results) { - // Inner WebContents's root FrameTreeNode does not have a parent(), so - // GetRenderWidgetHostView() call below will fail. - // TODO(lazyboy): Fix this. - if (frame_proxy_in_parent_renderer_->frame_tree_node() - ->render_manager() - ->ForInnerDelegate()) { - DCHECK(frame_proxy_in_parent_renderer_->frame_tree_node()->IsMainFrame()); - return; + auto parent_view = GetParentRenderWidgetHostView(); + if (parent_view) { + parent_view->GetScreenInfo(results); } - - RenderWidgetHostView* rwhv = - frame_proxy_in_parent_renderer_->GetRenderWidgetHostView(); - if (rwhv) - static_cast<RenderWidgetHostViewBase*>(rwhv)->GetScreenInfo(results); } void CrossProcessFrameConnector::UpdateCursor(const WebCursor& cursor) {
diff --git a/content/browser/frame_host/navigation_controller_android.cc b/content/browser/frame_host/navigation_controller_android.cc index 8174517..96aceac 100644 --- a/content/browser/frame_host/navigation_controller_android.cc +++ b/content/browser/frame_host/navigation_controller_android.cc
@@ -159,11 +159,11 @@ navigation_controller_->ReloadToRefreshContent(check_for_repost); } -void NavigationControllerAndroid::ReloadIgnoringCache( +void NavigationControllerAndroid::ReloadBypassingCache( JNIEnv* env, const JavaParamRef<jobject>& obj, jboolean check_for_repost) { - navigation_controller_->ReloadIgnoringCache(check_for_repost); + navigation_controller_->ReloadBypassingCache(check_for_repost); } void NavigationControllerAndroid::ReloadDisableLoFi(
diff --git a/content/browser/frame_host/navigation_controller_android.h b/content/browser/frame_host/navigation_controller_android.h index e22eb88..f2ec905 100644 --- a/content/browser/frame_host/navigation_controller_android.h +++ b/content/browser/frame_host/navigation_controller_android.h
@@ -57,9 +57,9 @@ void ReloadToRefreshContent(JNIEnv* env, jobject obj, jboolean check_for_repost); - void ReloadIgnoringCache(JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj, - jboolean check_for_repost); + void ReloadBypassingCache(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jboolean check_for_repost); void ReloadDisableLoFi(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, jboolean check_for_repost);
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc index 9507855..ac57709 100644 --- a/content/browser/frame_host/navigation_controller_impl.cc +++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -309,8 +309,8 @@ } ReloadInternal(check_for_repost, RELOAD); } -void NavigationControllerImpl::ReloadIgnoringCache(bool check_for_repost) { - ReloadInternal(check_for_repost, RELOAD_IGNORING_CACHE); +void NavigationControllerImpl::ReloadBypassingCache(bool check_for_repost) { + ReloadInternal(check_for_repost, RELOAD_BYPASSING_CACHE); } void NavigationControllerImpl::ReloadOriginalRequestURL(bool check_for_repost) { ReloadInternal(check_for_repost, RELOAD_ORIGINAL_REQUEST_URL);
diff --git a/content/browser/frame_host/navigation_controller_impl.h b/content/browser/frame_host/navigation_controller_impl.h index 8c6cf5437..a0067f4 100644 --- a/content/browser/frame_host/navigation_controller_impl.h +++ b/content/browser/frame_host/navigation_controller_impl.h
@@ -87,7 +87,7 @@ bool IsInitialBlankNavigation() const override; void Reload(bool check_for_repost) override; void ReloadToRefreshContent(bool check_for_repost) override; - void ReloadIgnoringCache(bool check_for_repost) override; + void ReloadBypassingCache(bool check_for_repost) override; void ReloadOriginalRequestURL(bool check_for_repost) override; void ReloadDisableLoFi(bool check_for_repost) override; void NotifyEntryChanged(const NavigationEntry* entry) override; @@ -299,7 +299,8 @@ RenderFrameHostImpl* rfh, const FrameHostMsg_DidCommitProvisionalLoad_Params& params); - // Helper function for code shared between Reload() and ReloadIgnoringCache(). + // Helper function for code shared between Reload() and + // ReloadBypassingCache(). void ReloadInternal(bool check_for_repost, ReloadType reload_type); // Actually issues the navigation held in pending_entry. @@ -433,7 +434,7 @@ // The maximum number of entries that a navigation controller can store. static size_t max_entry_count_for_testing_; - // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), + // If a repost is pending, its type (RELOAD or RELOAD_BYPASSING_CACHE), // NO_RELOAD otherwise. ReloadType pending_reload_;
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc index 1afe15ad..77f5ebe 100644 --- a/content/browser/frame_host/navigation_request.cc +++ b/content/browser/frame_host/navigation_request.cc
@@ -43,7 +43,7 @@ case FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL: load_flags |= net::LOAD_VALIDATE_CACHE; break; - case FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE: + case FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE: load_flags |= net::LOAD_BYPASS_CACHE; break; case FrameMsg_Navigate_Type::RESTORE:
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc index 60a884845..bce9b8b 100644 --- a/content/browser/frame_host/navigator_impl.cc +++ b/content/browser/frame_host/navigator_impl.cc
@@ -54,9 +54,9 @@ switch (reload_type) { case NavigationControllerImpl::RELOAD: return FrameMsg_Navigate_Type::RELOAD; - case NavigationControllerImpl::RELOAD_IGNORING_CACHE: + case NavigationControllerImpl::RELOAD_BYPASSING_CACHE: case NavigationControllerImpl::RELOAD_DISABLE_LOFI_MODE: - return FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE; + return FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE; case NavigationControllerImpl::RELOAD_ORIGINAL_REQUEST_URL: return FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL; case NavigationControllerImpl::NO_RELOAD:
diff --git a/content/browser/frame_host/navigator_impl_unittest.cc b/content/browser/frame_host/navigator_impl_unittest.cc index 5b6993e..97ae80f6 100644 --- a/content/browser/frame_host/navigator_impl_unittest.cc +++ b/content/browser/frame_host/navigator_impl_unittest.cc
@@ -848,11 +848,11 @@ EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); // Now do a shift+reload. - controller().ReloadIgnoringCache(false); + controller().ReloadBypassingCache(false); // A NavigationRequest should have been generated. main_request = node->navigation_request(); ASSERT_TRUE(main_request != NULL); - EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE, + EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE, main_request->common_params().navigation_type); main_test_rfh()->PrepareForCommit(); EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc index cc13e26..a24d736 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1919,7 +1919,7 @@ } } - // TODO(alexmos): These CHECKs are temporary to track down + // TODO(alexmos): These crash keys are temporary to track down // https://crbug.com/591478. Verify that the parent routing ID // points to a live RenderFrameProxy when this is not a remote-to-local // navigation (i.e., when there's no |existing_proxy|). @@ -1929,10 +1929,54 @@ if (!parent_proxy || !parent_proxy->is_render_frame_proxy_live()) { base::debug::SetCrashKeyValue("initrf_parent_proxy_exists", parent_proxy ? "yes" : "no"); + + SiteInstance* parent_instance = + frame_tree_node_->parent()->current_frame_host()->GetSiteInstance(); + base::debug::SetCrashKeyValue( + "initrf_parent_is_in_same_site_instance", + site_instance == parent_instance ? "yes" : "no"); + base::debug::SetCrashKeyValue("initrf_parent_process_is_live", + frame_tree_node_->parent() + ->current_frame_host() + ->GetProcess() + ->HasConnection() + ? "yes" + : "no"); base::debug::SetCrashKeyValue( "initrf_render_view_is_live", render_frame_host->render_view_host()->IsRenderViewLive() ? "yes" : "no"); + + // Collect some additional information for root's proxy if it's different + // from the parent. + FrameTreeNode* root = frame_tree_node_->frame_tree()->root(); + if (root != frame_tree_node_->parent()) { + SiteInstance* root_instance = + root->current_frame_host()->GetSiteInstance(); + base::debug::SetCrashKeyValue( + "initrf_root_is_in_same_site_instance", + site_instance == root_instance ? "yes" : "no"); + base::debug::SetCrashKeyValue( + "initrf_root_is_in_same_site_instance_as_parent", + parent_instance == root_instance ? "yes" : "no"); + base::debug::SetCrashKeyValue("initrf_root_process_is_live", + frame_tree_node_->frame_tree() + ->root() + ->current_frame_host() + ->GetProcess() + ->HasConnection() + ? "yes" + : "no"); + + RenderFrameProxyHost* top_proxy = + root->render_manager()->GetRenderFrameProxyHost(site_instance); + if (top_proxy) { + base::debug::SetCrashKeyValue( + "initrf_root_proxy_is_live", + top_proxy->is_render_frame_proxy_live() ? "yes" : "no"); + } + } + base::debug::DumpWithoutCrashing(); } }
diff --git a/content/browser/frame_host/render_frame_host_manager.h b/content/browser/frame_host/render_frame_host_manager.h index 31547488..59434d0 100644 --- a/content/browser/frame_host/render_frame_host_manager.h +++ b/content/browser/frame_host/render_frame_host_manager.h
@@ -505,6 +505,13 @@ void ActiveFrameCountIsZero(SiteInstanceImpl* site_instance) override; void RenderProcessGone(SiteInstanceImpl* site_instance) override; + // Sets up the necessary state for a new RenderViewHost. If |proxy| is not + // null, it creates a RenderFrameProxy in the target renderer process which is + // used to route IPC messages when in swapped out state. Returns early if the + // RenderViewHost has already been initialized for another RenderFrameHost. + bool InitRenderView(RenderViewHostImpl* render_view_host, + RenderFrameProxyHost* proxy); + private: friend class NavigatorTestWithBrowserSideNavigation; friend class RenderFrameHostManagerTest; @@ -667,13 +674,6 @@ bool CreateSpeculativeRenderFrameHost(SiteInstance* old_instance, SiteInstance* new_instance); - // Sets up the necessary state for a new RenderViewHost. If |proxy| is not - // null, it creates a RenderFrameProxy in the target renderer process which is - // used to route IPC messages when in swapped out state. Returns early if the - // RenderViewHost has already been initialized for another RenderFrameHost. - bool InitRenderView(RenderViewHostImpl* render_view_host, - RenderFrameProxyHost* proxy); - // Initialization for RenderFrameHost uses the same sequence as InitRenderView // above. bool InitRenderFrame(RenderFrameHostImpl* render_frame_host);
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc index 2df0d57..59155ca0 100644 --- a/content/browser/frame_host/render_widget_host_view_child_frame.cc +++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc
@@ -121,6 +121,27 @@ return rect; } +gfx::Size RenderWidgetHostViewChildFrame::GetVisibleViewportSize() const { + // For subframes, the visual viewport corresponds to the main frame size, so + // this bubbles up to the parent until it hits the main frame's + // RenderWidgetHostView. + // + // Currently this excludes webview guests, since they expect the visual + // viewport to return the guest's size rather than the page's; one reason why + // is that Blink ends up using the visual viewport to calculate things like + // window.innerWidth/innerHeight for main frames, and a guest is considered + // to be a main frame. This should be cleaned up eventually. + bool is_guest = BrowserPluginGuest::IsGuest(RenderViewHostImpl::From(host_)); + if (frame_connector_ && !is_guest) { + RenderWidgetHostView* parent_view = + frame_connector_->GetParentRenderWidgetHostView(); + // The parent_view can be null in unit tests when using a TestWebContents. + if (parent_view) + return parent_view->GetVisibleViewportSize(); + } + return GetViewBounds().size(); +} + gfx::Vector2dF RenderWidgetHostViewChildFrame::GetLastScrollOffset() const { return last_scroll_offset_; }
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.h b/content/browser/frame_host/render_widget_host_view_child_frame.h index 1a84f9f..4c4a74f3 100644 --- a/content/browser/frame_host/render_widget_host_view_child_frame.h +++ b/content/browser/frame_host/render_widget_host_view_child_frame.h
@@ -83,6 +83,7 @@ void Hide() override; bool IsShowing() override; gfx::Rect GetViewBounds() const override; + gfx::Size GetVisibleViewportSize() const override; gfx::Vector2dF GetLastScrollOffset() const override; gfx::NativeView GetNativeView() const override; gfx::NativeViewId GetNativeViewId() const override;
diff --git a/content/browser/media/capture/window_activity_tracker.h b/content/browser/media/capture/window_activity_tracker.h index 7bdef1e..f1a90d6 100644 --- a/content/browser/media/capture/window_activity_tracker.h +++ b/content/browser/media/capture/window_activity_tracker.h
@@ -7,6 +7,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "content/common/content_export.h" #include "ui/gfx/native_widget_types.h"
diff --git a/content/browser/media/media_canplaytype_browsertest.cc b/content/browser/media/media_canplaytype_browsertest.cc index 084f925..afacf0d 100644 --- a/content/browser/media/media_canplaytype_browsertest.cc +++ b/content/browser/media/media_canplaytype_browsertest.cc
@@ -190,10 +190,12 @@ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"avc1.4D401E, 1\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"avc3.64001F, 1\"'")); - // Restore this check and remove the individual checks in the calling tests - // when https://crbug.com/592889 is fixed. - // if (mime != "audio/mpeg") - // EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"mp3\"'")); + // Remove all but "audio/mpeg" when https://crbug.com/592889 is fixed. + if (mime != "audio/mpeg" && mime != "audio/mp4" && mime != "video/mp4" && + mime != "application/x-mpegurl" && + mime != "application/vnd.apple.mpegurl" && mime != "video/mp2t") { + EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"mp3\"'")); + } EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vorbis\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"avc1, vorbis\"'")); @@ -755,8 +757,8 @@ EXPECT_EQ(kPropProbably, CanPlay("'video/x-m4v; codecs=\"mp4a.66\"'")); EXPECT_EQ(kPropProbably, CanPlay("'video/x-m4v; codecs=\"mp4a.67\"'")); EXPECT_EQ(kPropProbably, CanPlay("'video/x-m4v; codecs=\"mp4a.68\"'")); - EXPECT_EQ(kPropProbably, CanPlay("'video/x-m4v; codecs=\"mp4a.69\"'")); - EXPECT_EQ(kPropProbably, CanPlay("'video/x-m4v; codecs=\"mp4a.6B\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"mp4a.69\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"mp4a.6B\"'")); EXPECT_EQ(kPropProbably, CanPlay("'video/x-m4v; codecs=\"mp4a.40.2\"'")); EXPECT_EQ(kPropProbably, CanPlay("'video/x-m4v; codecs=\"mp4a.40.02\"'")); @@ -780,37 +782,27 @@ EXPECT_EQ(kPropMaybe, CanPlay("'video/x-m4v; codecs=\"avc3.42E01E, mp4a.40\"'")); - EXPECT_EQ(kHevcSupported, - CanPlay("'video/x-m4v; codecs=\"hev1.1.6.L93.B0\"'")); - EXPECT_EQ(kHevcSupported, - CanPlay("'video/x-m4v; codecs=\"hvc1.1.6.L93.B0\"'")); - EXPECT_EQ(kHevcSupported, + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"hev1.1.6.L93.B0\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"hvc1.1.6.L93.B0\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"hev1.1.6.L93.B0, mp4a.40.5\"'")); - EXPECT_EQ(kHevcSupported, + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"hvc1.1.6.L93.B0, mp4a.40.5\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'video/x-m4v; codecs=\"ac-3\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'video/x-m4v; codecs=\"mp4a.a5\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'video/x-m4v; codecs=\"mp4a.A5\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'video/x-m4v; codecs=\"ec-3\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'video/x-m4v; codecs=\"mp4a.a6\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'video/x-m4v; codecs=\"mp4a.A6\"'")); - EXPECT_EQ(kAc3Eac3Probably, - CanPlay("'video/x-m4v; codecs=\"avc1.640028,ac-3\"'")); - EXPECT_EQ(kAc3Eac3Probably, - CanPlay("'video/x-m4v; codecs=\"avc1.640028,mp4a.a5\"'")); - EXPECT_EQ(kAc3Eac3Probably, - CanPlay("'video/x-m4v; codecs=\"avc1.640028,mp4a.A5\"'")); - EXPECT_EQ(kAc3Eac3Probably, - CanPlay("'video/x-m4v; codecs=\"avc1.640028,ec-3\"'")); - EXPECT_EQ(kAc3Eac3Probably, - CanPlay("'video/x-m4v; codecs=\"avc1.640028,mp4a.a6\"'")); - EXPECT_EQ(kAc3Eac3Probably, - CanPlay("'video/x-m4v; codecs=\"avc1.640028,mp4a.A6\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"ac-3\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"mp4a.a5\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"mp4a.A5\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"ec-3\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"mp4a.a6\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"mp4a.A6\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"avc1.640028,ac-3\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"avc1.640028,mp4a.a5\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"avc1.640028,mp4a.A5\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"avc1.640028,ec-3\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"avc1.640028,mp4a.a6\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"avc1.640028,mp4a.A6\"'")); TestMPEGUnacceptableCombinations("video/x-m4v"); - // This result is incorrect. See https://crbug.com/592889. - EXPECT_EQ(kPropProbably, CanPlay("'video/x-m4v; codecs=\"mp3\"'")); EXPECT_EQ(kPropMaybe, CanPlay("'audio/mp4'")); EXPECT_EQ(kPropProbably, CanPlay("'audio/mp4; codecs=\"mp4a.66\"'")); @@ -855,8 +847,8 @@ EXPECT_EQ(kPropProbably, CanPlay("'audio/x-m4a; codecs=\"mp4a.66\"'")); EXPECT_EQ(kPropProbably, CanPlay("'audio/x-m4a; codecs=\"mp4a.67\"'")); EXPECT_EQ(kPropProbably, CanPlay("'audio/x-m4a; codecs=\"mp4a.68\"'")); - EXPECT_EQ(kPropProbably, CanPlay("'audio/x-m4a; codecs=\"mp4a.69\"'")); - EXPECT_EQ(kPropProbably, CanPlay("'audio/x-m4a; codecs=\"mp4a.6B\"'")); + EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"mp4a.69\"'")); + EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"mp4a.6B\"'")); EXPECT_EQ(kPropMaybe, CanPlay("'audio/x-m4a; codecs=\"mp4a.40\"'")); EXPECT_EQ(kPropProbably, CanPlay("'audio/x-m4a; codecs=\"mp4a.40.2\"'")); @@ -880,16 +872,14 @@ EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"hvc1.1.6.L93.B0, mp4a.40.5\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'audio/x-m4a; codecs=\"ac-3\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'audio/x-m4a; codecs=\"mp4a.a5\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'audio/x-m4a; codecs=\"mp4a.A5\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'audio/x-m4a; codecs=\"ec-3\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'audio/x-m4a; codecs=\"mp4a.a6\"'")); - EXPECT_EQ(kAc3Eac3Probably, CanPlay("'audio/x-m4a; codecs=\"mp4a.A6\"'")); + EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"ac-3\"'")); + EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"mp4a.a5\"'")); + EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"mp4a.A5\"'")); + EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"ec-3\"'")); + EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"mp4a.a6\"'")); + EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"mp4a.A6\"'")); TestMPEGUnacceptableCombinations("audio/x-m4a"); - // This result is incorrect. See https://crbug.com/592889. - EXPECT_EQ(kPropProbably, CanPlay("'audio/x-m4a; codecs=\"mp3\"'")); } // When modifying this test, also change CodecSupportTest_Avc3Variants.
diff --git a/content/browser/media/session/media_session.cc b/content/browser/media/session/media_session.cc index 0d4ed1e..e31f53a 100644 --- a/content/browser/media/session/media_session.cc +++ b/content/browser/media/session/media_session.cc
@@ -209,6 +209,12 @@ audio_focus_type_ == Type::Content; } +scoped_ptr<base::CallbackList<void(MediaSession::State)>::Subscription> +MediaSession::RegisterMediaSessionStateChangedCallbackForTest( + const StateChangedCallback& cb) { + return media_session_state_listeners_.Add(cb); +} + void MediaSession::SetDelegateForTests( scoped_ptr<MediaSessionDelegate> delegate) { delegate_ = std::move(delegate); @@ -317,6 +323,7 @@ } void MediaSession::UpdateWebContents() { + media_session_state_listeners_.Notify(audio_focus_state_); static_cast<WebContentsImpl*>(web_contents())->OnMediaSessionStateChanged(); }
diff --git a/content/browser/media/session/media_session.h b/content/browser/media/session/media_session.h index 2553c6d7..9a00a75 100644 --- a/content/browser/media/session/media_session.h +++ b/content/browser/media/session/media_session.h
@@ -7,6 +7,7 @@ #include <stddef.h> +#include "base/callback_list.h" #include "base/id_map.h" #include "base/macros.h" #include "content/browser/media/session/media_session_uma_helper.h" @@ -21,6 +22,8 @@ class MediaSessionDelegate; class MediaSessionObserver; +class MediaSessionStateObserver; +class MediaSessionVisibilityBrowserTest; // MediaSession manages the media session and audio focus for a given // WebContents. It is requesting the audio focus, pausing when requested by the @@ -123,6 +126,8 @@ private: friend class content::WebContentsUserData<MediaSession>; friend class ::MediaSessionBrowserTest; + friend class content::MediaSessionVisibilityBrowserTest; + friend class content::MediaSessionStateObserver; CONTENT_EXPORT void SetDelegateForTests( scoped_ptr<MediaSessionDelegate> delegate); @@ -154,6 +159,7 @@ int player_id; }; using PlayersMap = base::hash_set<PlayerIdentifier, PlayerIdentifier::Hash>; + using StateChangedCallback = base::Callback<void(State)>; CONTENT_EXPORT explicit MediaSession(WebContents* web_contents); @@ -177,6 +183,11 @@ // It sets audio_focus_state_ and notifies observers about the state change. void SetAudioFocusState(State audio_focus_state); + // Registers a MediaSession state change callback. + CONTENT_EXPORT scoped_ptr<base::CallbackList<void(State)>::Subscription> + RegisterMediaSessionStateChangedCallbackForTest( + const StateChangedCallback& cb); + scoped_ptr<MediaSessionDelegate> delegate_; PlayersMap players_; @@ -191,6 +202,7 @@ double volume_multiplier_; MediaMetadata metadata_; + base::CallbackList<void(State)> media_session_state_listeners_; DISALLOW_COPY_AND_ASSIGN(MediaSession); };
diff --git a/content/browser/media/session/media_session_visibility_browsertest.cc b/content/browser/media/session/media_session_visibility_browsertest.cc new file mode 100644 index 0000000..3fc4a274 --- /dev/null +++ b/content/browser/media/session/media_session_visibility_browsertest.cc
@@ -0,0 +1,266 @@ +// 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. + +#include "base/command_line.h" +#include "content/browser/media/session/media_session.h" +#include "content/public/browser/web_contents.h" +#include "content/public/common/content_switches.h" +#include "content/public/test/browser_test_utils.h" +#include "content/public/test/content_browser_test.h" +#include "content/public/test/content_browser_test_utils.h" +#include "content/public/test/test_navigation_observer.h" +#include "content/shell/browser/shell.h" +#include "media/base/media_switches.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace content { +namespace { +static const char kStartPlayerScript[] = + "document.getElementById('long-video').play()"; +static const char kPausePlayerScript[] = + "document.getElementById('long-video').pause()"; +} + + +// Base class of MediaSession visibility tests. The class is intended +// to be used to run tests under different configurations. Tests +// should inheret from this class, set up their own command line per +// their configuration, and use macro INCLUDE_TEST_FROM_BASE_CLASS to +// include required tests. See +// media_session_visibility_browsertest_instances.cc for examples. +class MediaSessionVisibilityBrowserTest + : public ContentBrowserTest { + public: + MediaSessionVisibilityBrowserTest() = default; + ~MediaSessionVisibilityBrowserTest() override = default; + + void SetUpOnMainThread() override { + ContentBrowserTest::SetUpOnMainThread(); + web_contents_ = shell()->web_contents(); + media_session_ = MediaSession::Get(web_contents_); + + media_session_state_loop_runners_[MediaSession::State::ACTIVE] = + new MessageLoopRunner(); + media_session_state_loop_runners_[MediaSession::State::SUSPENDED] = + new MessageLoopRunner(); + media_session_state_loop_runners_[MediaSession::State::INACTIVE] = + new MessageLoopRunner(); + media_session_state_callback_subscription_ = + media_session_->RegisterMediaSessionStateChangedCallbackForTest( + base::Bind(&MediaSessionVisibilityBrowserTest:: + OnMediaSessionStateChanged, + base::Unretained(this))); + } + + void TearDownOnMainThread() override { + // Unsubscribe the callback subscription before tearing down, so that the + // CallbackList in MediaSession will be empty when it is destroyed. + media_session_state_callback_subscription_.reset(); + } + + void SetUpCommandLine(base::CommandLine* command_line) override { + command_line->AppendSwitch( + switches::kDisableGestureRequirementForMediaPlayback); +#if !defined(OS_ANDROID) + command_line->AppendSwitch( + switches::kEnableDefaultMediaSession); +#endif // !defined(OS_ANDROID) + } + + void LoadTestPage() { + TestNavigationObserver navigation_observer(shell()->web_contents(), 1); + shell()->LoadURL(GetTestUrl("android/media", "media-session.html")); + navigation_observer.Wait(); + } + + void RunScript(const std::string& script) { + ASSERT_TRUE(ExecuteScript(web_contents_->GetMainFrame(), script)); + } + + void ClearMediaSessionStateLoopRunners() { + for (auto& state_loop_runner : media_session_state_loop_runners_) + state_loop_runner.second = new MessageLoopRunner(); + } + + void OnMediaSessionStateChanged(MediaSession::State state) { + ASSERT_TRUE(media_session_state_loop_runners_.count(state)); + media_session_state_loop_runners_[state]->Quit(); + } + + // TODO(zqzhang): This method is shared with + // MediaRouterIntegrationTests. Move it into a general place. + void Wait(base::TimeDelta timeout) { + base::RunLoop run_loop; + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, run_loop.QuitClosure(), timeout); + run_loop.Run(); + } + + void WaitForMediaSessionState(MediaSession::State state) { + ASSERT_TRUE(media_session_state_loop_runners_.count(state)); + media_session_state_loop_runners_[state]->Run(); + } + + protected: + void TestSessionInactiveWhenHiddenAfterContentPause() { + LoadTestPage(); + + ClearMediaSessionStateLoopRunners(); + RunScript(kStartPlayerScript); + WaitForMediaSessionState(MediaSession::State::ACTIVE); + + ClearMediaSessionStateLoopRunners(); + RunScript(kPausePlayerScript); + WaitForMediaSessionState(MediaSession::State::SUSPENDED); + + ClearMediaSessionStateLoopRunners(); + web_contents_->WasHidden(); + WaitForMediaSessionState(MediaSession::State::INACTIVE); + } + + void TestSessionInactiveWhenHiddenWhilePlaying() { + LoadTestPage(); + + ClearMediaSessionStateLoopRunners(); + RunScript(kStartPlayerScript); + WaitForMediaSessionState(MediaSession::State::ACTIVE); + + ClearMediaSessionStateLoopRunners(); + web_contents_->WasHidden(); + WaitForMediaSessionState(MediaSession::State::INACTIVE); + } + + void TestSessionSuspendedWhenHiddenAfterContentPause() { + LoadTestPage(); + + ClearMediaSessionStateLoopRunners(); + RunScript(kStartPlayerScript); + WaitForMediaSessionState(MediaSession::State::ACTIVE); + + ClearMediaSessionStateLoopRunners(); + RunScript(kPausePlayerScript); + WaitForMediaSessionState(MediaSession::State::SUSPENDED); + + // Wait for 1 second and check the MediaSession state. + // No better solution till now. + web_contents_->WasHidden(); + Wait(base::TimeDelta::FromSeconds(1)); + ASSERT_EQ(media_session_->audio_focus_state_, + MediaSession::State::SUSPENDED); + } + + void TestSessionActiveWhenHiddenWhilePlaying() { + LoadTestPage(); + + ClearMediaSessionStateLoopRunners(); + RunScript(kStartPlayerScript); + WaitForMediaSessionState(MediaSession::State::ACTIVE); + + // Wait for 1 second and check the MediaSession state. + // No better solution till now. + web_contents_->WasHidden(); + Wait(base::TimeDelta::FromSeconds(1)); + ASSERT_EQ(media_session_->audio_focus_state_, + MediaSession::State::ACTIVE); + } + + WebContents* web_contents_; + MediaSession* media_session_; + // MessageLoopRunners for waiting MediaSession state to change. Note that the + // MessageLoopRunners can accept Quit() before calling Run(), thus the state + // change can still be captured before waiting. For example, the MediaSession + // might go active immediately after calling HTMLMediaElement.play(). A test + // can listen to the state change before calling play(), and then wait for the + // state change after play(). + std::map<MediaSession::State, scoped_refptr<MessageLoopRunner> > + media_session_state_loop_runners_; + scoped_ptr<base::CallbackList<void(MediaSession::State)>::Subscription> + media_session_state_callback_subscription_; + + private: + DISALLOW_COPY_AND_ASSIGN(MediaSessionVisibilityBrowserTest); +}; + +// Helper macro to include tests from the base class. +#define INCLUDE_TEST_FROM_BASE_CLASS(test_fixture, test_name) \ + IN_PROC_BROWSER_TEST_F(test_fixture, test_name) { \ + test_name(); \ + } + +/////////////////////////////////////////////////////////////////////////////// +// Configuration instances. + +// UnifiedPipeline + SuspendOnHide +class MediaSessionVisibilityBrowserTest_UnifiedPipeline_SuspendOnHide : + public MediaSessionVisibilityBrowserTest { + void SetUpCommandLine(base::CommandLine* command_line) override { + MediaSessionVisibilityBrowserTest::SetUpCommandLine(command_line); +#if !defined(OS_ANDROID) + command_line->AppendSwitch(switches::kEnableMediaSuspend); +#endif // defined(OS_ANDROID) + } +}; + +INCLUDE_TEST_FROM_BASE_CLASS( + MediaSessionVisibilityBrowserTest_UnifiedPipeline_SuspendOnHide, + TestSessionInactiveWhenHiddenAfterContentPause) +INCLUDE_TEST_FROM_BASE_CLASS( + MediaSessionVisibilityBrowserTest_UnifiedPipeline_SuspendOnHide, + TestSessionInactiveWhenHiddenWhilePlaying) + +// UnifiedPipeline + NosuspendOnHide +class MediaSessionVisibilityBrowserTest_UnifiedPipeline_NosuspendOnHide : + public MediaSessionVisibilityBrowserTest { + void SetUpCommandLine(base::CommandLine* command_line) override { + MediaSessionVisibilityBrowserTest::SetUpCommandLine(command_line); +#if defined(OS_ANDROID) + command_line->AppendSwitch(switches::kDisableMediaSuspend); +#endif // defined(OS_ANDROID) + } +}; + +INCLUDE_TEST_FROM_BASE_CLASS( + MediaSessionVisibilityBrowserTest_UnifiedPipeline_NosuspendOnHide, + TestSessionSuspendedWhenHiddenAfterContentPause) +INCLUDE_TEST_FROM_BASE_CLASS( + MediaSessionVisibilityBrowserTest_UnifiedPipeline_NosuspendOnHide, + TestSessionActiveWhenHiddenWhilePlaying) + +#if defined(OS_ANDROID) +// AndroidPipeline + SuspendOnHide +class MediaSessionVisibilityBrowserTest_AndroidPipeline_SuspendOnHide : + public MediaSessionVisibilityBrowserTest { + void SetUpCommandLine(base::CommandLine* command_line) override { + MediaSessionVisibilityBrowserTest::SetUpCommandLine(command_line); + command_line->AppendSwitch(switches::kDisableUnifiedMediaPipeline); + } +}; + +INCLUDE_TEST_FROM_BASE_CLASS( + MediaSessionVisibilityBrowserTest_AndroidPipeline_SuspendOnHide, + TestSessionInactiveWhenHiddenAfterContentPause) +INCLUDE_TEST_FROM_BASE_CLASS( + MediaSessionVisibilityBrowserTest_AndroidPipeline_SuspendOnHide, + TestSessionInactiveWhenHiddenWhilePlaying) + +// AndroidPipeline + NosuspendOnHide +class MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide : + public MediaSessionVisibilityBrowserTest { + void SetUpCommandLine(base::CommandLine* command_line) override { + MediaSessionVisibilityBrowserTest::SetUpCommandLine(command_line); + command_line->AppendSwitch(switches::kDisableUnifiedMediaPipeline); + command_line->AppendSwitch(switches::kDisableMediaSuspend); + } +}; + +INCLUDE_TEST_FROM_BASE_CLASS( + MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide, + TestSessionSuspendedWhenHiddenAfterContentPause) +INCLUDE_TEST_FROM_BASE_CLASS( + MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide, + TestSessionActiveWhenHiddenWhilePlaying) + +#endif // defined(OS_ANDROID) + +} // namespace content
diff --git a/content/browser/navigator_connect/OWNERS b/content/browser/navigator_connect/OWNERS deleted file mode 100644 index 1b10b343..0000000 --- a/content/browser/navigator_connect/OWNERS +++ /dev/null
@@ -1 +0,0 @@ -mek@chromium.org
diff --git a/content/browser/navigator_connect/navigator_connect_context_impl.cc b/content/browser/navigator_connect/navigator_connect_context_impl.cc deleted file mode 100644 index 93873d3..0000000 --- a/content/browser/navigator_connect/navigator_connect_context_impl.cc +++ /dev/null
@@ -1,270 +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. - -#include "content/browser/navigator_connect/navigator_connect_context_impl.h" - -#include <stdint.h> -#include <vector> - -#include "base/stl_util.h" -#include "content/browser/message_port_service.h" -#include "content/browser/navigator_connect/service_port_service_impl.h" -#include "content/browser/service_worker/service_worker_context_wrapper.h" -#include "content/common/service_worker/service_worker_utils.h" -#include "content/public/browser/browser_thread.h" -#include "content/public/browser/navigator_connect_service_factory.h" -#include "content/public/common/navigator_connect_client.h" -#include "mojo/common/url_type_converters.h" - -namespace content { - -struct NavigatorConnectContextImpl::Port { - // ID of this port. - int id; - // ID of the port this port is connected to. - int entangled_id; - - // Service url and client origin describing this connection. These fields will - // always be the same as the same fields for the entangled port. - GURL target_url; - GURL client_origin; - - // Set to nullptr when the mojom::ServicePortService goes away. - ServicePortServiceImpl* service = nullptr; - - // If this port is associated with a service worker, these fields store that - // information. - int64_t service_worker_registration_id = kInvalidServiceWorkerRegistrationId; - GURL service_worker_registration_origin; -}; - -NavigatorConnectContextImpl::NavigatorConnectContextImpl( - const scoped_refptr<ServiceWorkerContextWrapper>& service_worker_context) - : service_worker_context_(service_worker_context), next_port_id_(0) {} - -NavigatorConnectContextImpl::~NavigatorConnectContextImpl() { -} - -void NavigatorConnectContextImpl::AddFactory( - scoped_ptr<NavigatorConnectServiceFactory> factory) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::Bind(&NavigatorConnectContextImpl::AddFactoryOnIOThread, this, - base::Passed(&factory))); -} - -void NavigatorConnectContextImpl::AddFactoryOnIOThread( - scoped_ptr<NavigatorConnectServiceFactory> factory) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - service_factories_.push_back(factory.release()); -} - -void NavigatorConnectContextImpl::Connect( - const GURL& target_url, - const GURL& origin, - ServicePortServiceImpl* service_port_service, - const ConnectCallback& callback) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - // Create a new message channel. - int client_port_id = next_port_id_++; - int service_port_id = next_port_id_++; - - Port& client_port = ports_[client_port_id]; - client_port.id = client_port_id; - client_port.entangled_id = service_port_id; - client_port.target_url = target_url; - client_port.client_origin = origin; - client_port.service = service_port_service; - - Port& service_port = ports_[service_port_id]; - service_port.id = service_port_id; - service_port.entangled_id = client_port_id; - service_port.target_url = target_url; - service_port.client_origin = origin; - - // Find the right service worker to service this connection. - service_worker_context_->FindReadyRegistrationForDocument( - target_url, - base::Bind(&NavigatorConnectContextImpl::GotServiceWorkerRegistration, - this, callback, client_port_id, service_port_id)); -} - -void NavigatorConnectContextImpl::PostMessage( - int sender_port_id, - const MessagePortMessage& message, - const std::vector<TransferredMessagePort>& sent_message_ports) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK(ports_.find(sender_port_id) != ports_.end()); - DCHECK(message.message_as_value.empty()); - - const Port& sender_port = ports_[sender_port_id]; - DCHECK(ports_.find(sender_port.entangled_id) != ports_.end()); - const Port& port = ports_[sender_port.entangled_id]; - - if (port.service_worker_registration_id != - kInvalidServiceWorkerRegistrationId) { - // Port is associated with service worker, dispatch message event via - // ServiceWorkerVersion. - - // Hold messages on transferred message ports. Actual delivery of the - // message by the service can be asynchronous. When a message is delivered, - // WebMessagePortChannelImpl instances will be constructed which send - // MessagePortHostMsg_ReleaseMessages to release messages. - for (const auto& sent_port : sent_message_ports) - MessagePortService::GetInstance()->HoldMessages(sent_port.id); - - service_worker_context_->FindReadyRegistrationForId( - port.service_worker_registration_id, - port.service_worker_registration_origin, - base::Bind(&NavigatorConnectContextImpl::DeliverMessage, this, port.id, - message.message_as_string, sent_message_ports)); - return; - } - - if (!port.service) { - // TODO(mek): Figure out what to do in this situation. - return; - } - port.service->PostMessageToClient(port.id, message, sent_message_ports); -} - -void NavigatorConnectContextImpl::GotServiceWorkerRegistration( - const ConnectCallback& callback, - int client_port_id, - int service_port_id, - ServiceWorkerStatusCode status, - const scoped_refptr<ServiceWorkerRegistration>& registration) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK(ports_.find(client_port_id) != ports_.end()); - DCHECK(ports_.find(service_port_id) != ports_.end()); - - if (status != SERVICE_WORKER_OK) { - // No service worker found, reject connection attempt. - OnConnectError(callback, client_port_id, service_port_id, status); - return; - } - - ServiceWorkerVersion* active_version = registration->active_version(); - DCHECK(active_version); - - Port& service_port = ports_[service_port_id]; - service_port.service_worker_registration_id = registration->id(); - service_port.service_worker_registration_origin = - registration->pattern().GetOrigin(); - - active_version->RunAfterStartWorker( - ServiceWorkerMetrics::EventType::SERVICE_PORT_CONNECT, - base::Bind(&NavigatorConnectContextImpl::DispatchConnectEvent, this, - callback, client_port_id, service_port_id, registration, - make_scoped_refptr(active_version)), - base::Bind(&NavigatorConnectContextImpl::OnConnectError, this, callback, - client_port_id, service_port_id)); -} - -void NavigatorConnectContextImpl::DispatchConnectEvent( - const ConnectCallback& callback, - int client_port_id, - int service_port_id, - const scoped_refptr<ServiceWorkerRegistration>& service_worker_registration, - const scoped_refptr<ServiceWorkerVersion>& worker) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK(ContainsKey(ports_, client_port_id)); - DCHECK(ContainsKey(ports_, service_port_id)); - - const Port& service_port = ports_[service_port_id]; - int request_id = worker->StartRequest( - ServiceWorkerMetrics::EventType::SERVICE_PORT_CONNECT, - base::Bind(&NavigatorConnectContextImpl::OnConnectError, this, callback, - client_port_id, service_port_id)); - base::WeakPtr<mojom::ServicePortDispatcher> dispatcher = - worker->GetMojoServiceForRequest<mojom::ServicePortDispatcher>( - request_id); - dispatcher->Connect( - mojo::String::From(service_port.target_url), - mojo::String::From(service_port.client_origin), service_port_id, - base::Bind(&NavigatorConnectContextImpl::OnConnectResult, this, callback, - client_port_id, service_port_id, service_worker_registration, - worker, request_id)); -} - -void NavigatorConnectContextImpl::ServicePortServiceDestroyed( - ServicePortServiceImpl* service_port_service) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - for (auto& port : ports_) { - if (port.second.service != service_port_service) - continue; - port.second.service = nullptr; - // TODO(mek): Should actually inform other side of connections that the - // connection was closed, or in the case of service workers somehow keep - // track of the connection. - } -} - -void NavigatorConnectContextImpl::OnConnectError( - const ConnectCallback& callback, - int client_port_id, - int service_port_id, - ServiceWorkerStatusCode status) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - // Destroy ports since connection failed. - ports_.erase(service_port_id); - ports_.erase(client_port_id); - callback.Run(MSG_ROUTING_NONE, false); -} - -void NavigatorConnectContextImpl::OnConnectResult( - const ConnectCallback& callback, - int client_port_id, - int service_port_id, - const scoped_refptr<ServiceWorkerRegistration>& service_worker_registration, - const scoped_refptr<ServiceWorkerVersion>& worker, - int request_id, - mojom::ServicePortConnectResult result, - const mojo::String& name, - const mojo::String& data) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - - if (!worker->FinishRequest(request_id, - result == mojom::ServicePortConnectResult::ACCEPT)) - return; - - if (result != mojom::ServicePortConnectResult::ACCEPT) { - OnConnectError(callback, client_port_id, service_port_id, - SERVICE_WORKER_ERROR_FAILED); - return; - } - - // TODO(mek): Might have to do something else if the client connection got - // severed while the service side connection was being set up. - callback.Run(client_port_id, true); -} - -void NavigatorConnectContextImpl::DeliverMessage( - int port_id, - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - ServiceWorkerStatusCode service_worker_status, - const scoped_refptr<ServiceWorkerRegistration>& - service_worker_registration) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK(ports_.find(port_id) != ports_.end()); - - if (service_worker_status != SERVICE_WORKER_OK) { - // TODO(mek): Do something when no service worker was found. - return; - } - - ServiceWorkerVersion* active_version = - service_worker_registration->active_version(); - DCHECK(active_version); - - const Port& port = ports_[port_id]; - NavigatorConnectClient client(port.target_url, port.client_origin, port_id); - active_version->DispatchCrossOriginMessageEvent( - client, message, sent_message_ports, - base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); -} - -} // namespace content
diff --git a/content/browser/navigator_connect/navigator_connect_context_impl.h b/content/browser/navigator_connect/navigator_connect_context_impl.h deleted file mode 100644 index d2a25c98..0000000 --- a/content/browser/navigator_connect/navigator_connect_context_impl.h +++ /dev/null
@@ -1,133 +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. - -#ifndef CONTENT_BROWSER_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_CONTEXT_IMPL_H_ -#define CONTENT_BROWSER_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_CONTEXT_IMPL_H_ - -#include <map> -#include "base/callback_forward.h" -#include "base/memory/scoped_vector.h" -#include "base/strings/string16.h" -#include "content/common/service_port_service.mojom.h" -#include "content/common/service_worker/service_worker_status_code.h" -#include "content/public/browser/navigator_connect_context.h" - -class GURL; - -namespace content { - -struct MessagePortMessage; -class NavigatorConnectService; -class NavigatorConnectServiceFactory; -struct NavigatorConnectClient; -class ServicePortServiceImpl; -class ServiceWorkerContextWrapper; -class ServiceWorkerRegistration; -class ServiceWorkerVersion; -struct TransferredMessagePort; - -// Tracks all active navigator.services connections, as well as available -// service factories. Delegates connection requests to the correct factory and -// passes messages on to the correct service. -// One instance of this class exists per StoragePartition. -// TODO(mek): Clean up connections, fire of closed events when connections die. -// TODO(mek): Update service side API to be fully ServicePort based. -// TODO(mek): Make ServicePorts that live in a service worker be able to survive -// the worker being restarted. -// TODO(mek): Add back ability for service ports to be backed by native code. -class NavigatorConnectContextImpl : public NavigatorConnectContext { - public: - using ConnectCallback = - base::Callback<void(int message_port_id, bool success)>; - - explicit NavigatorConnectContextImpl( - const scoped_refptr<ServiceWorkerContextWrapper>& service_worker_context); - - // Called when a new connection request comes in from a client. Finds the - // correct service factory and passes the connection request off to there. - // Can call the callback before this method call returns. - void Connect(const GURL& target_url, - const GURL& origin, - ServicePortServiceImpl* service_port_service, - const ConnectCallback& callback); - - // Called when a message is sent to a ServicePort. The |sender_port_id| is the - // id of the port the message is sent from, this will look up what other port - // the port is entangled with and deliver the message to that port. - void PostMessage( - int sender_port_id, - const MessagePortMessage& message, - const std::vector<TransferredMessagePort>& sent_message_ports); - - // Called by a ServicePortServiceImpl instance when it is about to be - // destroyed to inform this class that all its connections are no longer - // valid. - void ServicePortServiceDestroyed( - ServicePortServiceImpl* service_port_service); - - // NavigatorConnectContext implementation. - void AddFactory(scoped_ptr<NavigatorConnectServiceFactory> factory) override; - - private: - ~NavigatorConnectContextImpl() override; - - void AddFactoryOnIOThread(scoped_ptr<NavigatorConnectServiceFactory> factory); - - // Callback called when a ServiceWorkerRegistration has been located (or - // has failed to be located) for a connection attempt. - void GotServiceWorkerRegistration( - const ConnectCallback& callback, - int client_port_id, - int service_port_id, - ServiceWorkerStatusCode status, - const scoped_refptr<ServiceWorkerRegistration>& registration); - - void DispatchConnectEvent(const ConnectCallback& callback, - int client_port_id, - int service_port_id, - const scoped_refptr<ServiceWorkerRegistration>& - service_worker_registration, - const scoped_refptr<ServiceWorkerVersion>& worker); - - // Callback called when dispatching a connect event failed. - void OnConnectError(const ConnectCallback& calback, - int client_port_id, - int service_port_id, - ServiceWorkerStatusCode status); - - // Callback called with the response to a connect event. - void OnConnectResult(const ConnectCallback& callback, - int client_port_id, - int service_port_id, - const scoped_refptr<ServiceWorkerRegistration>& - service_worker_registration, - const scoped_refptr<ServiceWorkerVersion>& worker, - int request_id, - mojom::ServicePortConnectResult result, - const mojo::String& name, - const mojo::String& data); - - // Callback called when a ServiceWorkerRegistration has been located to - // deliver a message to. - void DeliverMessage( - int port_id, - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - ServiceWorkerStatusCode status, - const scoped_refptr<ServiceWorkerRegistration>& registration); - - scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; - - // List of factories to try to handle URLs. - ScopedVector<NavigatorConnectServiceFactory> service_factories_; - - // List of currently active ServicePorts. - struct Port; - std::map<int, Port> ports_; - int next_port_id_; -}; - -} // namespace content - -#endif // CONTENT_BROWSER_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_CONTEXT_IMPL_H_
diff --git a/content/browser/navigator_connect/service_port_service_impl.cc b/content/browser/navigator_connect/service_port_service_impl.cc deleted file mode 100644 index c7d3db4..0000000 --- a/content/browser/navigator_connect/service_port_service_impl.cc +++ /dev/null
@@ -1,134 +0,0 @@ -// 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. - -#include "content/browser/navigator_connect/service_port_service_impl.h" - -#include <utility> - -#include "content/browser/message_port_message_filter.h" -#include "content/browser/message_port_service.h" -#include "content/browser/navigator_connect/navigator_connect_context_impl.h" -#include "content/common/service_port_type_converters.h" -#include "content/public/browser/browser_thread.h" -#include "content/public/common/message_port_types.h" -#include "mojo/common/common_type_converters.h" -#include "url/gurl.h" - -namespace content { - -// static -void ServicePortServiceImpl::Create( - const scoped_refptr<NavigatorConnectContextImpl>& navigator_connect_context, - const scoped_refptr<MessagePortMessageFilter>& message_port_message_filter, - mojo::InterfaceRequest<mojom::ServicePortService> request) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::Bind(&ServicePortServiceImpl::CreateOnIOThread, - navigator_connect_context, message_port_message_filter, - base::Passed(&request))); -} - -ServicePortServiceImpl::~ServicePortServiceImpl() { - // Should always be destroyed on the IO thread, but can't check that with - // DCHECK_CURRENTLY_ON because this class could be destroyed during thread - // shutdown, at which point that check doesn't work. - navigator_connect_context_->ServicePortServiceDestroyed(this); -} - -void ServicePortServiceImpl::PostMessageToClient( - int port_id, - const MessagePortMessage& message, - const std::vector<TransferredMessagePort>& sent_message_ports) { - DCHECK(client_.get()); - // Hold messages on transferred message ports. Normally this wouldn't be - // needed, but since MessagePort uses regular IPC while this class uses mojo, - // without holding messages mojo IPC might overtake regular IPC resulting in a - // non-functional port. When WebMessagePortChannelImpl instances are - // constructed in the renderer, they will send - // MessagePortHostMsg_ReleaseMessages to release messages. - for (const auto& port : sent_message_ports) - MessagePortService::GetInstance()->HoldMessages(port.id); - - std::vector<int> new_routing_ids; - message_port_message_filter_->UpdateMessagePortsWithNewRoutes( - sent_message_ports, &new_routing_ids); - client_->PostMessageToPort( - port_id, mojo::String::From(message.message_as_string), - mojo::Array<mojom::MojoTransferredMessagePortPtr>::From( - sent_message_ports), - mojo::Array<int32_t>::From(new_routing_ids)); -} - -// static -void ServicePortServiceImpl::CreateOnIOThread( - const scoped_refptr<NavigatorConnectContextImpl>& navigator_connect_context, - const scoped_refptr<MessagePortMessageFilter>& message_port_message_filter, - mojo::InterfaceRequest<mojom::ServicePortService> request) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - new ServicePortServiceImpl(navigator_connect_context, - message_port_message_filter, std::move(request)); -} - -ServicePortServiceImpl::ServicePortServiceImpl( - const scoped_refptr<NavigatorConnectContextImpl>& navigator_connect_context, - const scoped_refptr<MessagePortMessageFilter>& message_port_message_filter, - mojo::InterfaceRequest<mojom::ServicePortService> request) - : binding_(this, std::move(request)), - navigator_connect_context_(navigator_connect_context), - message_port_message_filter_(message_port_message_filter), - weak_ptr_factory_(this) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); -} - -void ServicePortServiceImpl::SetClient( - mojom::ServicePortServiceClientPtr client) { - DCHECK(!client_.get()); - // TODO(mek): Set ErrorHandler to listen for errors. - client_ = std::move(client); -} - -void ServicePortServiceImpl::Connect(const mojo::String& target_url, - const mojo::String& origin, - const ConnectCallback& callback) { - navigator_connect_context_->Connect( - GURL(target_url.get()), GURL(origin.get()), this, - base::Bind(&ServicePortServiceImpl::OnConnectResult, - weak_ptr_factory_.GetWeakPtr(), callback)); -} - -void ServicePortServiceImpl::PostMessageToPort( - int32_t port_id, - const mojo::String& message, - mojo::Array<mojom::MojoTransferredMessagePortPtr> ports) { - // TODO(mek): Similar to http://crbug.com/490222 this code should make sure - // port_id belongs to the process this IPC was received from. - std::vector<TransferredMessagePort> transferred_ports = - ports.To<std::vector<TransferredMessagePort>>(); - - MessagePortService* mps = MessagePortService::GetInstance(); - // First, call QueueMessages for all transferred ports, since the ports - // haven't sent their own IPC for that. - for (const TransferredMessagePort& port : transferred_ports) { - mps->QueueMessages(port.id); - } - - navigator_connect_context_->PostMessage( - port_id, MessagePortMessage(message.To<base::string16>()), - transferred_ports); -} - -void ServicePortServiceImpl::ClosePort(int32_t port_id) { - MessagePortService::GetInstance()->Destroy(port_id); -} - -void ServicePortServiceImpl::OnConnectResult(const ConnectCallback& callback, - int message_port_id, - bool success) { - callback.Run(success ? mojom::ServicePortConnectResult::ACCEPT - : mojom::ServicePortConnectResult::REJECT, - message_port_id); -} - -} // namespace content
diff --git a/content/browser/navigator_connect/service_port_service_impl.h b/content/browser/navigator_connect/service_port_service_impl.h deleted file mode 100644 index eec8139..0000000 --- a/content/browser/navigator_connect/service_port_service_impl.h +++ /dev/null
@@ -1,86 +0,0 @@ -// 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. - -#ifndef CONTENT_BROWSER_NAVIGATOR_CONNECT_SERVICE_PORT_SERVICE_IMPL_H_ -#define CONTENT_BROWSER_NAVIGATOR_CONNECT_SERVICE_PORT_SERVICE_IMPL_H_ - -#include <stdint.h> - -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/memory/weak_ptr.h" -#include "content/common/service_port_service.mojom.h" -#include "mojo/public/cpp/bindings/strong_binding.h" - -namespace content { -struct MessagePortMessage; -class MessagePortMessageFilter; -class NavigatorConnectContextImpl; -struct TransferredMessagePort; - -// Browser side class representing a ServicePortCollection in the renderer. One -// instance of this class is created for each ServicePortCollection, and is -// automatically destroyed when the ServicePortCollection in the renderer goes -// away. -class ServicePortServiceImpl : public mojom::ServicePortService { - public: - // Factory method called by mojo to create a new instance of this class to - // handle requests from a new ServicePortCollection. - static void Create(const scoped_refptr<NavigatorConnectContextImpl>& - navigator_connect_context, - const scoped_refptr<MessagePortMessageFilter>& - message_port_message_filter, - mojo::InterfaceRequest<mojom::ServicePortService> request); - ~ServicePortServiceImpl() override; - - // Called by NavigatorConnectContextImpl to post a message to a port that is - // owned by this ServicePortCollection. - void PostMessageToClient( - int port_id, - const MessagePortMessage& message, - const std::vector<TransferredMessagePort>& sent_message_ports); - - private: - static void CreateOnIOThread( - const scoped_refptr<NavigatorConnectContextImpl>& - navigator_connect_context, - const scoped_refptr<MessagePortMessageFilter>& - message_port_message_filter, - mojo::InterfaceRequest<mojom::ServicePortService> request); - ServicePortServiceImpl( - const scoped_refptr<NavigatorConnectContextImpl>& - navigator_connect_context, - const scoped_refptr<MessagePortMessageFilter>& - message_port_message_filter, - mojo::InterfaceRequest<mojom::ServicePortService> request); - - // mojom::ServicePortService methods: - void SetClient(mojom::ServicePortServiceClientPtr client) override; - void Connect(const mojo::String& target_url, - const mojo::String& origin, - const ConnectCallback& callback) override; - void PostMessageToPort( - int32_t port_id, - const mojo::String& message, - mojo::Array<mojom::MojoTransferredMessagePortPtr> ports) override; - void ClosePort(int32_t port_id) override; - - // Callback called when a connection to a service has been establised or - // rejected. - void OnConnectResult(const ConnectCallback& callback, - int message_port_id, - bool success); - - mojo::StrongBinding<mojom::ServicePortService> binding_; - scoped_refptr<NavigatorConnectContextImpl> navigator_connect_context_; - scoped_refptr<MessagePortMessageFilter> message_port_message_filter_; - mojom::ServicePortServiceClientPtr client_; - base::WeakPtrFactory<ServicePortServiceImpl> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(ServicePortServiceImpl); -}; - -} // namespace content - -#endif // CONTENT_BROWSER_NAVIGATOR_CONNECT_SERVICE_PORT_SERVICE_IMPL_H_
diff --git a/content/browser/notifications/notification_database.h b/content/browser/notifications/notification_database.h index 4f230a1..e5914e1a 100644 --- a/content/browser/notifications/notification_database.h +++ b/content/browser/notifications/notification_database.h
@@ -6,11 +6,13 @@ #define CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_H_ #include <stdint.h> + #include <set> #include <vector> #include "base/files/file_path.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/sequence_checker.h" #include "content/common/content_export.h"
diff --git a/content/browser/power_save_blocker_x11.cc b/content/browser/power_save_blocker_x11.cc index 97eefef..babc814 100644 --- a/content/browser/power_save_blocker_x11.cc +++ b/content/browser/power_save_blocker_x11.cc
@@ -7,6 +7,7 @@ #include <X11/Xlib.h> #include <stdint.h> #include <X11/extensions/dpms.h> +#include <X11/extensions/scrnsaver.h> // Xlib #defines Status, but we can't have that for some of our headers. #ifdef Status #undef Status @@ -108,12 +109,22 @@ void ApplyBlockFinished(dbus::Response* response); void RemoveBlockFinished(dbus::Response* response); + // Wrapper for XScreenSaverSuspend. Checks whether the X11 Screen Saver + // Extension is available first. If it isn't, this is a no-op. + // Must be called on the UI thread. + static void XSSSuspendSet(bool suspend); + // If DPMS (the power saving system in X11) is not enabled, then we don't want // to try to disable power saving, since on some desktop environments that may // enable DPMS with very poor default settings (e.g. turning off the display // after only 1 second). Must be called on the UI thread. static bool DPMSEnabled(); + // If no other method is available (i.e. not running under a Desktop + // Environment) check whether the X11 Screen Saver Extension can be used + // to disable the screen saver. Must be called on the UI thread. + static bool XSSAvailable(); + // Returns an appropriate D-Bus API to use based on the desktop environment. // Must be called on the UI thread, as it may call DPMSEnabled() above. static DBusAPI SelectAPI(); @@ -180,9 +191,14 @@ // initializing on the UI thread, then just cancel it. We don't need to // remove the block because we haven't even applied it yet. enqueue_apply_ = false; - } else if (ShouldBlock()) { - BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, - base::Bind(&Delegate::RemoveBlock, this)); + } else { + if (ShouldBlock()) { + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, + base::Bind(&Delegate::RemoveBlock, this)); + } + + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(&Delegate::XSSSuspendSet, false)); } } @@ -190,12 +206,17 @@ DCHECK_CURRENTLY_ON(BrowserThread::UI); base::AutoLock lock(lock_); api_ = SelectAPI(); - if (enqueue_apply_ && ShouldBlock()) { - // The thread we use here becomes the origin and D-Bus thread for the D-Bus - // library, so we need to use the same thread above for RemoveBlock(). It - // must be a thread that allows I/O operations, so we use the FILE thread. - BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, - base::Bind(&Delegate::ApplyBlock, this)); + + if (enqueue_apply_) { + if (ShouldBlock()) { + // The thread we use here becomes the origin and D-Bus thread for the + // D-Bus library, so we need to use the same thread above for + // RemoveBlock(). It must be a thread that allows I/O operations, so we + // use the FILE thread. + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, + base::Bind(&Delegate::ApplyBlock, this)); + } + XSSSuspendSet(true); } enqueue_apply_ = false; } @@ -384,6 +405,17 @@ } // static +void PowerSaveBlockerImpl::Delegate::XSSSuspendSet(bool suspend) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + if (!XSSAvailable()) + return; + + XDisplay* display = gfx::GetXDisplay(); + XScreenSaverSuspend(display, suspend); +} + +// static bool PowerSaveBlockerImpl::Delegate::DPMSEnabled() { DCHECK_CURRENTLY_ON(BrowserThread::UI); XDisplay* display = gfx::GetXDisplay(); @@ -397,6 +429,23 @@ } // static +bool PowerSaveBlockerImpl::Delegate::XSSAvailable() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + XDisplay* display = gfx::GetXDisplay(); + int dummy; + int major; + int minor; + + if (!XScreenSaverQueryExtension(display, &dummy, &dummy)) + return false; + + if (!XScreenSaverQueryVersion(display, &major, &minor)) + return false; + + return major > 1 || (major == 1 && minor >= 1); +} + +// static DBusAPI PowerSaveBlockerImpl::Delegate::SelectAPI() { DCHECK_CURRENTLY_ON(BrowserThread::UI); scoped_ptr<base::Environment> env(base::Environment::Create());
diff --git a/content/browser/renderer_host/input/synthetic_gesture.cc b/content/browser/renderer_host/input/synthetic_gesture.cc index ebe8712..a6aa6bd 100644 --- a/content/browser/renderer_host/input/synthetic_gesture.cc +++ b/content/browser/renderer_host/input/synthetic_gesture.cc
@@ -7,6 +7,7 @@ #include "base/logging.h" #include "content/browser/renderer_host/input/synthetic_gesture_target.h" #include "content/browser/renderer_host/input/synthetic_pinch_gesture.h" +#include "content/browser/renderer_host/input/synthetic_pointer_action.h" #include "content/browser/renderer_host/input/synthetic_smooth_drag_gesture.h" #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h" #include "content/browser/renderer_host/input/synthetic_tap_gesture.h" @@ -42,6 +43,9 @@ case SyntheticGestureParams::TAP_GESTURE: return CreateGesture<SyntheticTapGesture, SyntheticTapGestureParams>(gesture_params); + case SyntheticGestureParams::POINTER_ACTION: + return CreateGesture<SyntheticPointerAction, + SyntheticPointerActionParams>(gesture_params); } NOTREACHED() << "Invalid synthetic gesture type"; return scoped_ptr<SyntheticGesture>();
diff --git a/content/browser/renderer_host/input/synthetic_gesture.h b/content/browser/renderer_host/input/synthetic_gesture.h index 626bd15..4177b06 100644 --- a/content/browser/renderer_host/input/synthetic_gesture.h +++ b/content/browser/renderer_host/input/synthetic_gesture.h
@@ -41,8 +41,6 @@ GESTURE_RESULT_MAX = GESTURE_SOURCE_TYPE_NOT_IMPLEMENTED }; - enum PointerActionType { PRESS, MOVE, RELEASE }; - // Update the state of the gesture and forward the appropriate events to the // platform. This function is called repeatedly by the synthetic gesture // controller until it stops returning GESTURE_RUNNING.
diff --git a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc index 9369bfdf..c1e36823b 100644 --- a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc +++ b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc
@@ -1470,55 +1470,56 @@ TEST_F(SyntheticGestureControllerTest, PointerTouchAction) { CreateControllerAndTarget<MockSyntheticPointerTouchActionTarget>(); + SyntheticPointerActionParams params = SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::PRESS); + params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; + params.set_index(0); + params.set_position(gfx::PointF(54, 89)); SyntheticTouchPointer synthetic_pointer; - gfx::PointF position(54, 89); - scoped_ptr<SyntheticPointerAction> gesture(new SyntheticPointerAction( - SyntheticGestureParams::TOUCH_INPUT, SyntheticGesture::PRESS, - &synthetic_pointer, position)); + scoped_ptr<SyntheticPointerAction> gesture( + new SyntheticPointerAction(params, &synthetic_pointer)); QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); MockSyntheticPointerTouchActionTarget* pointer_touch_target = static_cast<MockSyntheticPointerTouchActionTarget*>(target_); EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchStart); - EXPECT_EQ(pointer_touch_target->positions(0), position); + EXPECT_EQ(pointer_touch_target->positions(0), params.position()); EXPECT_EQ(pointer_touch_target->states(0), WebTouchPoint::StatePressed); ASSERT_EQ(pointer_touch_target->touch_length(), 1U); - position.SetPoint(79, 132); - gesture.reset(new SyntheticPointerAction(SyntheticGestureParams::TOUCH_INPUT, - SyntheticGesture::PRESS, - &synthetic_pointer, position)); + params.set_index(1); + params.set_position(gfx::PointF(79, 132)); + gesture.reset(new SyntheticPointerAction(params, &synthetic_pointer)); QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); pointer_touch_target = static_cast<MockSyntheticPointerTouchActionTarget*>(target_); EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchStart); - EXPECT_EQ(pointer_touch_target->indexes(1), 1); - EXPECT_EQ(pointer_touch_target->positions(1), position); + EXPECT_EQ(pointer_touch_target->indexes(1), params.index()); + EXPECT_EQ(pointer_touch_target->positions(1), params.position()); EXPECT_EQ(pointer_touch_target->states(1), WebTouchPoint::StatePressed); ASSERT_EQ(pointer_touch_target->touch_length(), 2U); - int index = 1; - position.SetPoint(133, 156); - gesture.reset(new SyntheticPointerAction( - SyntheticGestureParams::TOUCH_INPUT, SyntheticGesture::MOVE, - &synthetic_pointer, position, index)); + params.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::MOVE); + params.set_position(gfx::PointF(133, 156)); + gesture.reset(new SyntheticPointerAction(params, &synthetic_pointer)); QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete(); pointer_touch_target = static_cast<MockSyntheticPointerTouchActionTarget*>(target_); EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchMove); - EXPECT_EQ(pointer_touch_target->positions(1), position); + EXPECT_EQ(pointer_touch_target->positions(1), params.position()); EXPECT_EQ(pointer_touch_target->states(1), WebTouchPoint::StateMoved); ASSERT_EQ(pointer_touch_target->touch_length(), 2U); - gesture.reset(new SyntheticPointerAction( - SyntheticGestureParams::TOUCH_INPUT, SyntheticGesture::RELEASE, - &synthetic_pointer, position, index)); + params.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::RELEASE); + gesture.reset(new SyntheticPointerAction(params, &synthetic_pointer)); QueueSyntheticGesture(std::move(gesture)); FlushInputUntilComplete();
diff --git a/content/browser/renderer_host/input/synthetic_pointer_action.cc b/content/browser/renderer_host/input/synthetic_pointer_action.cc index 2577e3f..6353f34 100644 --- a/content/browser/renderer_host/input/synthetic_pointer_action.cc +++ b/content/browser/renderer_host/input/synthetic_pointer_action.cc
@@ -11,26 +11,24 @@ namespace content { SyntheticPointerAction::SyntheticPointerAction( - SyntheticGestureParams::GestureSourceType gesture_source_type, - PointerActionType pointer_action_type, - SyntheticPointer* synthetic_pointer, - gfx::PointF position, - int index) - : gesture_source_type_(gesture_source_type), - pointer_action_type_(pointer_action_type), - position_(position), - index_(index), - synthetic_pointer_(synthetic_pointer) {} + const SyntheticPointerActionParams& params) + : params_(params) {} + +SyntheticPointerAction::SyntheticPointerAction( + const SyntheticPointerActionParams& params, + SyntheticPointer* synthetic_pointer) + : params_(params), synthetic_pointer_(synthetic_pointer) {} SyntheticPointerAction::~SyntheticPointerAction() {} SyntheticGesture::Result SyntheticPointerAction::ForwardInputEvents( const base::TimeTicks& timestamp, SyntheticGestureTarget* target) { - if (gesture_source_type_ == SyntheticGestureParams::DEFAULT_INPUT) - gesture_source_type_ = target->GetDefaultSyntheticGestureSourceType(); + if (params_.gesture_source_type == SyntheticGestureParams::DEFAULT_INPUT) + params_.gesture_source_type = + target->GetDefaultSyntheticGestureSourceType(); - DCHECK_NE(gesture_source_type_, SyntheticGestureParams::DEFAULT_INPUT); + DCHECK_NE(params_.gesture_source_type, SyntheticGestureParams::DEFAULT_INPUT); ForwardTouchOrMouseInputEvents(timestamp, target); return SyntheticGesture::GESTURE_FINISHED; @@ -39,17 +37,20 @@ void SyntheticPointerAction::ForwardTouchOrMouseInputEvents( const base::TimeTicks& timestamp, SyntheticGestureTarget* target) { - switch (pointer_action_type_) { - case SyntheticGesture::PRESS: - synthetic_pointer_->Press(position_.x(), position_.y(), target, - timestamp); + switch (params_.pointer_action_type()) { + case SyntheticPointerActionParams::PointerActionType::PRESS: + synthetic_pointer_->Press(params_.position().x(), params_.position().y(), + target, timestamp); break; - case SyntheticGesture::MOVE: - synthetic_pointer_->Move(index_, position_.x(), position_.y(), target, - timestamp); + case SyntheticPointerActionParams::PointerActionType::MOVE: + synthetic_pointer_->Move(params_.index(), params_.position().x(), + params_.position().y(), target, timestamp); break; - case SyntheticGesture::RELEASE: - synthetic_pointer_->Release(index_, target, timestamp); + case SyntheticPointerActionParams::PointerActionType::RELEASE: + synthetic_pointer_->Release(params_.index(), target, timestamp); + break; + default: + NOTREACHED(); break; } synthetic_pointer_->DispatchEvent(target, timestamp);
diff --git a/content/browser/renderer_host/input/synthetic_pointer_action.h b/content/browser/renderer_host/input/synthetic_pointer_action.h index d190776..23b23fa 100644 --- a/content/browser/renderer_host/input/synthetic_pointer_action.h +++ b/content/browser/renderer_host/input/synthetic_pointer_action.h
@@ -10,17 +10,15 @@ #include "content/browser/renderer_host/input/synthetic_gesture_target.h" #include "content/browser/renderer_host/input/synthetic_pointer.h" #include "content/common/content_export.h" +#include "content/common/input/synthetic_pointer_action_params.h" namespace content { class CONTENT_EXPORT SyntheticPointerAction : public SyntheticGesture { public: - SyntheticPointerAction( - SyntheticGestureParams::GestureSourceType gesture_source_type, - PointerActionType pointer_action_type, - SyntheticPointer* synthetic_pointer, - gfx::PointF position, - int index = 0); + explicit SyntheticPointerAction(const SyntheticPointerActionParams& params); + SyntheticPointerAction(const SyntheticPointerActionParams& params, + SyntheticPointer* synthetic_pointer); ~SyntheticPointerAction() override; SyntheticGesture::Result ForwardInputEvents( @@ -31,10 +29,7 @@ SyntheticGestureTarget* target); private: - SyntheticGestureParams::GestureSourceType gesture_source_type_; - PointerActionType pointer_action_type_; - gfx::PointF position_; - int index_; + SyntheticPointerActionParams params_; SyntheticPointer* synthetic_pointer_; DISALLOW_COPY_AND_ASSIGN(SyntheticPointerAction);
diff --git a/content/browser/renderer_host/media/audio_renderer_host.cc b/content/browser/renderer_host/media/audio_renderer_host.cc index ca96329..eadd484 100644 --- a/content/browser/renderer_host/media/audio_renderer_host.cc +++ b/content/browser/renderer_host/media/audio_renderer_host.cc
@@ -49,13 +49,6 @@ base::LazyInstance<media::AudioStreamsTracker> g_audio_streams_tracker = LAZY_INSTANCE_INITIALIZER; -media::AudioParameters DummyParams() { - return media::AudioParameters( - media::AudioParameters::AUDIO_FAKE, media::CHANNEL_LAYOUT_STEREO, - media::AudioParameters::kAudioCDSampleRate, 16, - media::AudioParameters::kAudioCDSampleRate / 10); -} - std::pair<int, std::pair<bool, std::string>> MakeAuthorizationData( int stream_id, bool authorized, @@ -124,7 +117,7 @@ // If hardware parameters are still invalid, use dummy parameters with // fake audio path and let the client handle the error. if (!params->IsValid()) - *params = DummyParams(); + *params = media::AudioParameters::UnavailableDeviceParams(); } } // namespace @@ -427,7 +420,8 @@ if (!IsValidDeviceId(device_id)) { Send(new AudioMsg_NotifyDeviceAuthorized( - stream_id, media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, DummyParams())); + stream_id, media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, + media::AudioParameters::UnavailableDeviceParams())); return; } @@ -482,7 +476,7 @@ authorizations_.erase(auth_data); Send(new AudioMsg_NotifyDeviceAuthorized( stream_id, media::OUTPUT_DEVICE_STATUS_ERROR_NOT_AUTHORIZED, - DummyParams())); + media::AudioParameters::UnavailableDeviceParams())); return; } @@ -521,7 +515,8 @@ if (!device_found) { authorizations_.erase(auth_data); Send(new AudioMsg_NotifyDeviceAuthorized( - stream_id, media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, DummyParams())); + stream_id, media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, + media::AudioParameters::UnavailableDeviceParams())); return; } @@ -817,8 +812,9 @@ } } DCHECK(!device_id.empty()); // Default device must always be found - AudioOutputDeviceInfo device_info = {std::string(), std::string(), - DummyParams()}; + AudioOutputDeviceInfo device_info = { + std::string(), std::string(), + media::AudioParameters::UnavailableDeviceParams()}; callback.Run(false, device_info); }
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc index 64d32f0..d2e6068 100644 --- a/content/browser/renderer_host/media/media_stream_manager.cc +++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -99,8 +99,8 @@ *audio_type = MEDIA_NO_SERVICE; *video_type = MEDIA_NO_SERVICE; const bool audio_support_flag_for_desktop_share = - base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableAudioSupportForDesktopShare); + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableAudioSupportForDesktopShare); if (controls.audio.requested) { if (!controls.audio.stream_source.empty()) { // This is tab or screen capture.
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 41a76d4..b3425b0 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -82,7 +82,6 @@ #include "content/browser/mime_registry_message_filter.h" #include "content/browser/mojo/mojo_application_host.h" #include "content/browser/mojo/mojo_child_connection.h" -#include "content/browser/navigator_connect/service_port_service_impl.h" #include "content/browser/notifications/notification_message_filter.h" #include "content/browser/permissions/permission_service_context.h" #include "content/browser/permissions/permission_service_impl.h" @@ -133,7 +132,6 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" -#include "content/public/browser/navigator_connect_context.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/render_process_host_factory.h" @@ -1083,11 +1081,6 @@ &BackgroundSyncContextImpl::CreateService, base::Unretained(storage_partition_impl_->GetBackgroundSyncContext()))); - mojo_application_host_->service_registry()->AddService(base::Bind( - &content::ServicePortServiceImpl::Create, - make_scoped_refptr(storage_partition_impl_->GetNavigatorConnectContext()), - message_port_message_filter_)); - mojo_application_host_->service_registry()->AddService( base::Bind(&RenderProcessHostImpl::CreateStoragePartitionService, base::Unretained(this)));
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index 48d00f74..2a4ad7f 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -348,6 +348,8 @@ void UnlockMouse() override; void WheelEventAck(const blink::WebMouseWheelEvent& event, InputEventAckState ack_result) override; + void GestureEventAck(const blink::WebGestureEvent& event, + InputEventAckState ack_result) override; scoped_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() override; @@ -588,6 +590,9 @@ // RenderWidgetHostViewGuest. bool is_guest_view_hack_; + // True if gestures are generated for mouse wheel events. + bool wheel_gestures_enabled_; + // selected text on the renderer. std::string selected_text_;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 8a76fb4..c1b56a5 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -21,6 +21,7 @@ #include "base/mac/scoped_cftyperef.h" #import "base/mac/scoped_nsobject.h" #include "base/mac/sdk_forward_declarations.h" +#include "base/memory/ref_counted.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram.h" #include "base/numerics/safe_conversions.h" @@ -53,6 +54,7 @@ #import "content/browser/renderer_host/text_input_client_mac.h" #include "content/common/accessibility_messages.h" #include "content/common/edit_command.h" +#include "content/common/input/input_event_utils.h" #include "content/common/input_messages.h" #include "content/common/site_isolation_policy.h" #include "content/common/view_messages.h" @@ -70,6 +72,7 @@ #include "third_party/WebKit/public/platform/WebScreenInfo.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #import "third_party/mozilla/ComplexTextInputPanel.h" +#import "ui/base/clipboard/clipboard_util_mac.h" #include "ui/base/cocoa/animation_utils.h" #include "ui/base/cocoa/cocoa_base_utils.h" #import "ui/base/cocoa/fullscreen_window_manager.h" @@ -176,6 +179,8 @@ - (id)initWithRenderWidgetHostViewMac:(RenderWidgetHostViewMac*)r; - (void)processedWheelEvent:(const blink::WebMouseWheelEvent&)event consumed:(BOOL)consumed; +- (void)processedGestureScrollEvent:(const blink::WebGestureEvent&)event + consumed:(BOOL)consumed; - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv; - (void)windowDidChangeBackingProperties:(NSNotification*)notification; @@ -523,6 +528,7 @@ is_loading_(false), allow_pause_for_resize_or_repaint_(true), is_guest_view_hack_(is_guest_view_hack), + wheel_gestures_enabled_(UseGestureBasedWheelScrolling()), fullscreen_parent_host_view_(NULL), weak_factory_(this) { // |cocoa_view_| owns us and we will be deleted when |cocoa_view_| @@ -1541,6 +1547,10 @@ void RenderWidgetHostViewMac::WheelEventAck( const blink::WebMouseWheelEvent& event, InputEventAckState ack_result) { + // TODO(dtapuska): Remove this handling of the wheel event ack + // once wheel gestures is enabled for a full release; see crbug.com/598798. + if (wheel_gestures_enabled_) + return; bool consumed = ack_result == INPUT_EVENT_ACK_STATE_CONSUMED; // Only record a wheel event as unhandled if JavaScript handlers got a chance // to see it (no-op wheel events are ignored by the event dispatcher) @@ -1548,6 +1558,23 @@ [cocoa_view_ processedWheelEvent:event consumed:consumed]; } +void RenderWidgetHostViewMac::GestureEventAck( + const blink::WebGestureEvent& event, + InputEventAckState ack_result) { + if (!wheel_gestures_enabled_) + return; + bool consumed = ack_result == INPUT_EVENT_ACK_STATE_CONSUMED; + switch (event.type) { + case blink::WebInputEvent::GestureScrollBegin: + case blink::WebInputEvent::GestureScrollUpdate: + case blink::WebInputEvent::GestureScrollEnd: + [cocoa_view_ processedGestureScrollEvent:event consumed:consumed]; + return; + default: + break; + } +} + scoped_ptr<SyntheticGestureTarget> RenderWidgetHostViewMac::CreateSyntheticGestureTarget() { RenderWidgetHostImpl* host = @@ -1855,6 +1882,12 @@ [responderDelegate_ rendererHandledWheelEvent:event consumed:consumed]; } +- (void)processedGestureScrollEvent:(const blink::WebGestureEvent&)event + consumed:(BOOL)consumed { + [responderDelegate_ rendererHandledGestureScrollEvent:event + consumed:consumed]; +} + - (BOOL)respondsToSelector:(SEL)selector { // Trickiness: this doesn't mean "does this object's superclass respond to // this selector" but rather "does the -respondsToSelector impl from the @@ -2425,11 +2458,11 @@ renderWidgetHostView_->selected_text()); if ([text length] == 0) return; - NSPasteboard* pasteboard = [NSPasteboard pasteboardWithUniqueName]; + scoped_refptr<ui::UniquePasteboard> pasteboard = new ui::UniquePasteboard; NSArray* types = [NSArray arrayWithObject:NSStringPboardType]; - [pasteboard declareTypes:types owner:nil]; - if ([pasteboard setString:text forType:NSStringPboardType]) - NSPerformService(@"Look Up in Dictionary", pasteboard); + [pasteboard->get() declareTypes:types owner:nil]; + if ([pasteboard->get() setString:text forType:NSStringPboardType]) + NSPerformService(@"Look Up in Dictionary", pasteboard->get()); return; } dispatch_async(dispatch_get_main_queue(), ^{
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm index a8f3dc02..5cc1841 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -79,6 +79,11 @@ if (!consumed) unhandledWheelEventReceived_ = true; } +- (void)rendererHandledGestureScrollEvent:(const blink::WebGestureEvent&)event + consumed:(BOOL)consumed { + if (!consumed && event.type == blink::WebInputEvent::GestureScrollUpdate) + unhandledWheelEventReceived_ = true; +} - (void)touchesBeganWithEvent:(NSEvent*)event {} - (void)touchesMovedWithEvent:(NSEvent*)event {} - (void)touchesCancelledWithEvent:(NSEvent*)event {} @@ -958,6 +963,12 @@ ASSERT_EQ(2U, process_host->sink().message_count()); process_host->sink().ClearMessages(); + InputEventAck unhandled_scroll_ack(blink::WebInputEvent::GestureScrollUpdate, + INPUT_EVENT_ACK_STATE_NOT_CONSUMED); + scoped_ptr<IPC::Message> scroll_response1( + new InputHostMsg_HandleInputEvent_ACK(0, unhandled_scroll_ack)); + host->OnMessageReceived(*scroll_response1); + // Check that the view delegate got an unhandled wheel event. ASSERT_EQ(YES, view_delegate.get().unhandledWheelEventReceived); view_delegate.get().unhandledWheelEventReceived = NO; @@ -965,7 +976,7 @@ // Send another wheel event, this time for scrolling by 0 lines (empty event). NSEvent* event2 = MockScrollWheelEventWithPhase(@selector(phaseChanged), 0); [view->cocoa_view() scrollWheel:event2]; - ASSERT_EQ(1U, process_host->sink().message_count()); + ASSERT_EQ(2U, process_host->sink().message_count()); // Indicate that the wheel event was also unhandled. scoped_ptr<IPC::Message> response2(
diff --git a/content/browser/service_worker/service_worker_database_task_manager.h b/content/browser/service_worker/service_worker_database_task_manager.h index dbe9aa2..f13472a5 100644 --- a/content/browser/service_worker/service_worker_database_task_manager.h +++ b/content/browser/service_worker/service_worker_database_task_manager.h
@@ -7,6 +7,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "content/common/content_export.h" namespace base {
diff --git a/content/browser/service_worker/service_worker_metrics.cc b/content/browser/service_worker/service_worker_metrics.cc index 2062d0a..6e8a1e25 100644 --- a/content/browser/service_worker/service_worker_metrics.cc +++ b/content/browser/service_worker/service_worker_metrics.cc
@@ -62,8 +62,6 @@ return "Push"; case EventType::GEOFENCING: return "Geofencing"; - case EventType::SERVICE_PORT_CONNECT: - return "Service Port Connect"; case EventType::MESSAGE: return "Message"; case EventType::FETCH_MAIN_FRAME: @@ -297,7 +295,6 @@ // For now event duration for these events is not recorded. case EventType::GEOFENCING: - case EventType::SERVICE_PORT_CONNECT: break; case EventType::DEPRECATED_FETCH:
diff --git a/content/browser/service_worker/service_worker_metrics.h b/content/browser/service_worker/service_worker_metrics.h index 6ca3203..75371f0 100644 --- a/content/browser/service_worker/service_worker_metrics.h +++ b/content/browser/service_worker/service_worker_metrics.h
@@ -81,7 +81,7 @@ NOTIFICATION_CLICK = 4, PUSH = 5, GEOFENCING = 6, - SERVICE_PORT_CONNECT = 7, + // SERVICE_PORT_CONNECT = 7, MESSAGE = 8, NOTIFICATION_CLOSE = 9, FETCH_MAIN_FRAME = 10,
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc index abbef7a..27e2319 100644 --- a/content/browser/service_worker/service_worker_version.cc +++ b/content/browser/service_worker/service_worker_version.cc
@@ -597,38 +597,6 @@ RunSoon(base::Bind(callback, status)); } -void ServiceWorkerVersion::DispatchCrossOriginMessageEvent( - const NavigatorConnectClient& client, - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - const StatusCallback& callback) { - OnBeginEvent(); - // Unlike in the case of DispatchMessageEvent, here the caller is assumed to - // have already put all the sent message ports on hold. So no need to do that - // here again. - - if (running_status() != RUNNING) { - // Schedule calling this method after starting the worker. - StartWorker(ServiceWorkerMetrics::EventType::MESSAGE, - base::Bind(&RunTaskAfterStartWorker, weak_factory_.GetWeakPtr(), - base::Bind(&RunErrorMessageCallback, - sent_message_ports, callback), - base::Bind(&self::DispatchCrossOriginMessageEvent, - weak_factory_.GetWeakPtr(), client, - message, sent_message_ports, callback))); - return; - } - - MessagePortMessageFilter* filter = - embedded_worker_->message_port_message_filter(); - std::vector<int> new_routing_ids; - filter->UpdateMessagePortsWithNewRoutes(sent_message_ports, &new_routing_ids); - ServiceWorkerStatusCode status = - embedded_worker_->SendMessage(ServiceWorkerMsg_CrossOriginMessageToWorker( - client, message, sent_message_ports, new_routing_ids)); - RunSoon(base::Bind(callback, status)); -} - void ServiceWorkerVersion::AddControllee( ServiceWorkerProviderHost* provider_host) { const std::string& uuid = provider_host->client_uuid();
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h index 2359edca7..1e83e3ed 100644 --- a/content/browser/service_worker/service_worker_version.h +++ b/content/browser/service_worker/service_worker_version.h
@@ -52,7 +52,6 @@ class ServiceWorkerProviderHost; class ServiceWorkerRegistration; class ServiceWorkerURLRequestJob; -struct NavigatorConnectClient; struct ServiceWorkerClientInfo; struct ServiceWorkerVersionInfo; struct TransferredMessagePort; @@ -254,20 +253,6 @@ const std::vector<TransferredMessagePort>& sent_message_ports, const StatusCallback& callback); - // Sends a cross origin message event to the associated embedded worker and - // asynchronously calls |callback| when the message was sent (or failed to - // sent). - // It is the responsibility of the code calling this method to make sure that - // any transferred message ports are put on hold while potentially a process - // for the service worker is spun up. - // - // This must be called when the status() is ACTIVATED. - void DispatchCrossOriginMessageEvent( - const NavigatorConnectClient& client, - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - const StatusCallback& callback); - // Adds and removes |provider_host| as a controllee of this ServiceWorker. // A potential controllee is a host having the version as its .installing // or .waiting version.
diff --git a/content/browser/ssl/ssl_client_auth_handler.h b/content/browser/ssl/ssl_client_auth_handler.h index 72c6cbd4..1deafbc 100644 --- a/content/browser/ssl/ssl_client_auth_handler.h +++ b/content/browser/ssl/ssl_client_auth_handler.h
@@ -8,6 +8,7 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "content/common/content_export.h" #include "content/public/browser/browser_thread.h"
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index e102445..604738b5 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc
@@ -18,7 +18,6 @@ #include "content/browser/geofencing/geofencing_manager.h" #include "content/browser/gpu/shader_disk_cache.h" #include "content/browser/host_zoom_map_impl.h" -#include "content/browser/navigator_connect/navigator_connect_context_impl.h" #include "content/browser/notifications/platform_notification_context_impl.h" #include "content/common/dom_storage/dom_storage_types.h" #include "content/public/browser/browser_context.h" @@ -349,7 +348,6 @@ storage::SpecialStoragePolicy* special_storage_policy, GeofencingManager* geofencing_manager, HostZoomLevelContext* host_zoom_level_context, - NavigatorConnectContextImpl* navigator_connect_context, PlatformNotificationContextImpl* platform_notification_context, BackgroundSyncContextImpl* background_sync_context) : partition_path_(partition_path), @@ -365,7 +363,6 @@ special_storage_policy_(special_storage_policy), geofencing_manager_(geofencing_manager), host_zoom_level_context_(host_zoom_level_context), - navigator_connect_context_(navigator_connect_context), platform_notification_context_(platform_notification_context), background_sync_context_(background_sync_context), browser_context_(browser_context) { @@ -491,9 +488,6 @@ new HostZoomLevelContext( context->CreateZoomLevelDelegate(partition_path))); - scoped_refptr<NavigatorConnectContextImpl> navigator_connect_context = - new NavigatorConnectContextImpl(service_worker_context); - scoped_refptr<PlatformNotificationContextImpl> platform_notification_context = new PlatformNotificationContextImpl(path, context, service_worker_context); @@ -510,8 +504,7 @@ cache_storage_context.get(), service_worker_context.get(), webrtc_identity_store.get(), special_storage_policy.get(), geofencing_manager.get(), host_zoom_level_context.get(), - navigator_connect_context.get(), platform_notification_context.get(), - background_sync_context.get()); + platform_notification_context.get(), background_sync_context.get()); service_worker_context->set_storage_partition(storage_partition); @@ -581,11 +574,6 @@ return host_zoom_level_context_->GetZoomLevelDelegate(); } -NavigatorConnectContextImpl* -StoragePartitionImpl::GetNavigatorConnectContext() { - return navigator_connect_context_.get(); -} - PlatformNotificationContextImpl* StoragePartitionImpl::GetPlatformNotificationContext() { return platform_notification_context_.get();
diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h index b80105b1e9..45efae4 100644 --- a/content/browser/storage_partition_impl.h +++ b/content/browser/storage_partition_impl.h
@@ -19,7 +19,6 @@ #include "content/browser/host_zoom_level_context.h" #include "content/browser/indexed_db/indexed_db_context_impl.h" #include "content/browser/media/webrtc/webrtc_identity_store.h" -#include "content/browser/navigator_connect/navigator_connect_context_impl.h" #include "content/browser/notifications/platform_notification_context_impl.h" #include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/common/content_export.h" @@ -60,7 +59,6 @@ HostZoomMap* GetHostZoomMap() override; HostZoomLevelContext* GetHostZoomLevelContext() override; ZoomLevelDelegate* GetZoomLevelDelegate() override; - NavigatorConnectContextImpl* GetNavigatorConnectContext() override; PlatformNotificationContextImpl* GetPlatformNotificationContext() override; BackgroundSyncContextImpl* GetBackgroundSyncContext() override; @@ -157,7 +155,6 @@ storage::SpecialStoragePolicy* special_storage_policy, GeofencingManager* geofencing_manager, HostZoomLevelContext* host_zoom_level_context, - NavigatorConnectContextImpl* navigator_connect_context, PlatformNotificationContextImpl* platform_notification_context, BackgroundSyncContextImpl* background_sync_context); @@ -202,7 +199,6 @@ scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; scoped_refptr<GeofencingManager> geofencing_manager_; scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; - scoped_refptr<NavigatorConnectContextImpl> navigator_connect_context_; scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; scoped_refptr<BackgroundSyncContextImpl> background_sync_context_;
diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc index 73947cf..56bf93d 100644 --- a/content/browser/storage_partition_impl_map.cc +++ b/content/browser/storage_partition_impl_map.cc
@@ -39,8 +39,6 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" -#include "content/public/browser/navigator_connect_context.h" -#include "content/public/browser/navigator_connect_service_factory.h" #include "content/public/browser/storage_partition.h" #include "content/public/common/content_constants.h" #include "content/public/common/content_switches.h" @@ -476,9 +474,6 @@ browser_context_->GetMediaRequestContextForStoragePartition( partition->GetPath(), in_memory)); - GetContentClient()->browser()->GetAdditionalNavigatorConnectServices( - partition->GetNavigatorConnectContext()); - PostCreateInitialization(partition, in_memory); return partition;
diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc index 86b0db3d3..06ef7c8f 100644 --- a/content/browser/tracing/tracing_controller_impl.cc +++ b/content/browser/tracing/tracing_controller_impl.cc
@@ -90,6 +90,24 @@ return "Unknown"; } +std::string GetClockString() { + switch (base::TimeTicks::GetClock()) { + case base::TimeTicks::Clock::LINUX_CLOCK_MONOTONIC: + return "LINUX_CLOCK_MONOTONIC"; + case base::TimeTicks::Clock::IOS_CF_ABSOLUTE_TIME_MINUS_KERN_BOOTTIME: + return "IOS_CF_ABSOLUTE_TIME_MINUS_KERN_BOOTTIME"; + case base::TimeTicks::Clock::MAC_MACH_ABSOLUTE_TIME: + return "MAC_MACH_ABSOLUTE_TIME"; + case base::TimeTicks::Clock::WIN_QPC: + return "WIN_QPC"; + case base::TimeTicks::Clock::WIN_ROLLOVER_PROTECTED_TIME_GET_TIME: + return "WIN_ROLLOVER_PROTECTED_TIME_GET_TIME"; + } + + NOTREACHED(); + return std::string(); +} + scoped_ptr<base::DictionaryValue> GenerateTracingMetadataDict() { scoped_ptr<base::DictionaryValue> metadata_dict(new base::DictionaryValue()); @@ -145,7 +163,7 @@ if (delegate) delegate->GenerateMetadataDict(metadata_dict.get()); - // Highres ticks. + metadata_dict->SetString("clock-domain", GetClockString()); metadata_dict->SetBoolean("highres-ticks", base::TimeTicks::IsHighResolution());
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 82638b4..4a747f4 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -890,7 +890,7 @@ // different parts of the page loaded using different user agents. NavigationEntry* entry = controller_.GetVisibleEntry(); if (IsLoading() && entry != NULL && entry->GetIsOverridingUserAgent()) - controller_.ReloadIgnoringCache(true); + controller_.ReloadBypassingCache(true); FOR_EACH_OBSERVER(WebContentsObserver, observers_, UserAgentOverrideSet(override)); @@ -1272,6 +1272,19 @@ WebContents* outer_web_contents, RenderFrameHost* outer_contents_frame) { CHECK(BrowserPluginGuestMode::UseCrossProcessFramesForGuests()); + RenderFrameHostManager* render_manager = GetRenderManager(); + + // When the WebContents being initialized has an opener, the browser side + // Render{View,Frame}Host must be initialized and the RenderWidgetHostView + // created. This is needed because the usual initialization happens during + // the first navigation, but when attaching a new window we don't navigate + // before attaching. If the browser side is already initialized, the calls + // below will just early return. + render_manager->InitRenderView(GetRenderViewHost(), nullptr); + GetMainFrame()->Init(); + if (!render_manager->GetRenderWidgetHostView()) + CreateRenderWidgetHostViewForRenderManager(GetRenderViewHost()); + // Create a link to our outer WebContents. node_.reset(new WebContentsTreeNode()); node_->ConnectToOuterWebContents( @@ -1283,15 +1296,15 @@ // Create a proxy in top-level RenderFrameHostManager, pointing to the // SiteInstance of the outer WebContents. The proxy will be used to send // postMessage to the inner WebContents. - GetRenderManager()->CreateOuterDelegateProxy( + render_manager->CreateOuterDelegateProxy( outer_contents_frame->GetSiteInstance(), static_cast<RenderFrameHostImpl*>(outer_contents_frame)); - GetRenderManager()->SetRWHViewForInnerContents( - GetRenderManager()->GetRenderWidgetHostView()); + render_manager->SetRWHViewForInnerContents( + render_manager->GetRenderWidgetHostView()); static_cast<RenderWidgetHostViewChildFrame*>( - GetRenderManager()->GetRenderWidgetHostView()) + render_manager->GetRenderWidgetHostView()) ->RegisterSurfaceNamespaceId(); } @@ -1804,12 +1817,6 @@ // SiteInstance in its own BrowsingInstance. bool is_guest = BrowserPluginGuest::IsGuest(this); - if (is_guest && BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { - // TODO(lazyboy): CreateNewWindow doesn't work for OOPIF-based <webview> - // yet. - NOTREACHED(); - } - // If the opener is to be suppressed, the new window can be in any process. // Since routing ids are process specific, we must not have one passed in // as argument here. @@ -4688,9 +4695,12 @@ last_dialog_suppressed_ = dialog_was_suppressed; if (is_showing_before_unload_dialog_ && !success) { - if (rfh) + // It is possible for the current RenderFrameHost to have changed in the + // meantime. Do not reset the navigation state in that case. + if (rfh && rfh == rfh->frame_tree_node()->current_frame_host()) { rfh->frame_tree_node()->BeforeUnloadCanceled(); - controller_.DiscardNonCommittedEntries(); + controller_.DiscardNonCommittedEntries(); + } FOR_EACH_OBSERVER(WebContentsObserver, observers_, BeforeUnloadDialogCancelled());
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index 61043a3..d52bfe5b 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -815,4 +815,50 @@ } } +// TODO(clamy): Make the test work on Windows and on Mac. On Mac and Windows, +// there seem to be an issue with the ShellJavascriptDialogManager. +#if defined(OS_WIN) || defined(OS_MACOSX) +#define MAYBE_NoResetOnBeforeUnloadCanceledOnCommit \ + DISABLED_NoResetOnBeforeUnloadCanceledOnCommit +#else +#define MAYBE_NoResetOnBeforeUnloadCanceledOnCommit \ + NoResetOnBeforeUnloadCanceledOnCommit +#endif +// Test that if a BeforeUnload dialog is destroyed due to the commit of a +// cross-site navigation, it will not reset the loading state. +IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, + MAYBE_NoResetOnBeforeUnloadCanceledOnCommit) { + ASSERT_TRUE(embedded_test_server()->Start()); + const GURL kStartURL( + embedded_test_server()->GetURL("/hang_before_unload.html")); + const GURL kCrossSiteURL( + embedded_test_server()->GetURL("bar.com", "/title1.html")); + + // Navigate to a first web page with a BeforeUnload event listener. + EXPECT_TRUE(NavigateToURL(shell(), kStartURL)); + + // Start a cross-site navigation that will not commit for the moment. + TestNavigationManager cross_site_delayer(shell()->web_contents(), + kCrossSiteURL); + shell()->LoadURL(kCrossSiteURL); + cross_site_delayer.WaitForWillStartRequest(); + + // Click on a link in the page. This will show the BeforeUnload dialog. + // Ensure the dialog is not dismissed, which will cause it to still be + // present when the cross-site navigation later commits. + // Note: the javascript function executed will not do the link click but + // schedule it for afterwards. Since the BeforeUnload event is synchronous, + // clicking on the link right away would cause the ExecuteScript to never + // return. + SetShouldProceedOnBeforeUnload(shell(), false); + EXPECT_TRUE(ExecuteScript(shell()->web_contents(), "clickLinkSoon()")); + WaitForAppModalDialog(shell()); + + // Have the cross-site navigation commit. The main RenderFrameHost should + // still be loading after that. + cross_site_delayer.ResumeNavigation(); + cross_site_delayer.WaitForNavigationFinished(); + EXPECT_TRUE(shell()->web_contents()->IsLoading()); +} + } // namespace content
diff --git a/content/browser/web_contents/web_drag_dest_mac_unittest.mm b/content/browser/web_contents/web_drag_dest_mac_unittest.mm index efa6452..b6a6946a 100644 --- a/content/browser/web_contents/web_drag_dest_mac_unittest.mm +++ b/content/browser/web_contents/web_drag_dest_mac_unittest.mm
@@ -5,6 +5,7 @@ #include "base/mac/mac_util.h" #include "base/mac/scoped_nsautorelease_pool.h" #import "base/mac/scoped_nsobject.h" +#include "base/memory/ref_counted.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #import "content/browser/web_contents/web_drag_dest_mac.h" @@ -13,6 +14,7 @@ #include "content/test/test_web_contents.h" #include "testing/gtest/include/gtest/gtest.h" #import "third_party/mozilla/NSPasteboard+Utils.h" +#import "ui/base/clipboard/clipboard_util_mac.h" #import "ui/base/dragdrop/cocoa_dnd_util.h" #import "ui/gfx/test/ui_cocoa_test_helper.h" @@ -82,88 +84,80 @@ } TEST_F(WebDragDestTest, URL) { - NSPasteboard* pboard = nil; NSString* url = nil; NSString* title = nil; GURL result_url; base::string16 result_title; // Put a URL on the pasteboard and check it. - pboard = [NSPasteboard pasteboardWithUniqueName]; + scoped_refptr<ui::UniquePasteboard> pboard = new ui::UniquePasteboard; url = @"http://www.google.com/"; - PutURLOnPasteboard(url, pboard); - EXPECT_TRUE(ui::PopulateURLAndTitleFromPasteboard( - &result_url, &result_title, pboard, NO)); + PutURLOnPasteboard(url, pboard->get()); + EXPECT_TRUE(ui::PopulateURLAndTitleFromPasteboard(&result_url, &result_title, + pboard->get(), NO)); EXPECT_EQ(base::SysNSStringToUTF8(url), result_url.spec()); - [pboard releaseGlobally]; // Put a 'url ' and 'urln' on the pasteboard and check it. - pboard = [NSPasteboard pasteboardWithUniqueName]; + pboard = new ui::UniquePasteboard; url = @"http://www.google.com/"; title = @"Title of Awesomeness!", - PutCoreURLAndTitleOnPasteboard(url, title, pboard); - EXPECT_TRUE(ui::PopulateURLAndTitleFromPasteboard( - &result_url, &result_title, pboard, NO)); + PutCoreURLAndTitleOnPasteboard(url, title, pboard->get()); + EXPECT_TRUE(ui::PopulateURLAndTitleFromPasteboard(&result_url, &result_title, + pboard->get(), NO)); EXPECT_EQ(base::SysNSStringToUTF8(url), result_url.spec()); EXPECT_EQ(base::SysNSStringToUTF16(title), result_title); - [pboard releaseGlobally]; // Also check that it passes file:// via 'url '/'urln' properly. - pboard = [NSPasteboard pasteboardWithUniqueName]; + pboard = new ui::UniquePasteboard; url = @"file:///tmp/dont_delete_me.txt"; title = @"very important"; - PutCoreURLAndTitleOnPasteboard(url, title, pboard); - EXPECT_TRUE(ui::PopulateURLAndTitleFromPasteboard( - &result_url, &result_title, pboard, NO)); + PutCoreURLAndTitleOnPasteboard(url, title, pboard->get()); + EXPECT_TRUE(ui::PopulateURLAndTitleFromPasteboard(&result_url, &result_title, + pboard->get(), NO)); EXPECT_EQ(base::SysNSStringToUTF8(url), result_url.spec()); EXPECT_EQ(base::SysNSStringToUTF16(title), result_title); - [pboard releaseGlobally]; // And javascript:. - pboard = [NSPasteboard pasteboardWithUniqueName]; + pboard = new ui::UniquePasteboard; url = @"javascript:open('http://www.youtube.com/')"; title = @"kill some time"; - PutCoreURLAndTitleOnPasteboard(url, title, pboard); - EXPECT_TRUE(ui::PopulateURLAndTitleFromPasteboard( - &result_url, &result_title, pboard, NO)); + PutCoreURLAndTitleOnPasteboard(url, title, pboard->get()); + EXPECT_TRUE(ui::PopulateURLAndTitleFromPasteboard(&result_url, &result_title, + pboard->get(), NO)); EXPECT_EQ(base::SysNSStringToUTF8(url), result_url.spec()); EXPECT_EQ(base::SysNSStringToUTF16(title), result_title); - [pboard releaseGlobally]; - pboard = [NSPasteboard pasteboardWithUniqueName]; + pboard = new ui::UniquePasteboard; url = @"/bin/sh"; - [pboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] - owner:nil]; - [pboard setPropertyList:[NSArray arrayWithObject:url] - forType:NSFilenamesPboardType]; - EXPECT_FALSE(ui::PopulateURLAndTitleFromPasteboard( - &result_url, &result_title, pboard, NO)); - EXPECT_TRUE(ui::PopulateURLAndTitleFromPasteboard( - &result_url, &result_title, pboard, YES)); + [pboard->get() declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] + owner:nil]; + [pboard->get() setPropertyList:[NSArray arrayWithObject:url] + forType:NSFilenamesPboardType]; + EXPECT_FALSE(ui::PopulateURLAndTitleFromPasteboard(&result_url, &result_title, + pboard->get(), NO)); + EXPECT_TRUE(ui::PopulateURLAndTitleFromPasteboard(&result_url, &result_title, + pboard->get(), YES)); base::scoped_nsobject<NSURL> expected_output( [[NSURL alloc] initFileURLWithPath:url isDirectory:NO]); EXPECT_EQ([[expected_output absoluteString] UTF8String], result_url.spec()); EXPECT_EQ("sh", base::UTF16ToUTF8(result_title)); - [pboard releaseGlobally]; } TEST_F(WebDragDestTest, Data) { DropData data; - NSPasteboard* pboard = [NSPasteboard pasteboardWithUniqueName]; + scoped_refptr<ui::UniquePasteboard> pboard = new ui::UniquePasteboard; - PutURLOnPasteboard(@"http://www.google.com", pboard); - [pboard addTypes:[NSArray arrayWithObjects:NSHTMLPboardType, - NSStringPboardType, nil] - owner:nil]; + PutURLOnPasteboard(@"http://www.google.com", pboard->get()); + [pboard->get() addTypes:[NSArray arrayWithObjects:NSHTMLPboardType, + NSStringPboardType, nil] + owner:nil]; NSString* htmlString = @"<html><body><b>hi there</b></body></html>"; NSString* textString = @"hi there"; - [pboard setString:htmlString forType:NSHTMLPboardType]; - [pboard setString:textString forType:NSStringPboardType]; - [drag_dest_ populateDropData:&data fromPasteboard:pboard]; + [pboard->get() setString:htmlString forType:NSHTMLPboardType]; + [pboard->get() setString:textString forType:NSStringPboardType]; + [drag_dest_ populateDropData:&data fromPasteboard:pboard->get()]; EXPECT_EQ(data.url.spec(), "http://www.google.com/"); EXPECT_EQ(base::SysNSStringToUTF16(textString), data.text.string()); EXPECT_EQ(base::SysNSStringToUTF16(htmlString), data.html.string()); - - [pboard releaseGlobally]; }
diff --git a/content/browser/web_contents/web_drag_source_mac_unittest.mm b/content/browser/web_contents/web_drag_source_mac_unittest.mm index 036c9268..edc1888 100644 --- a/content/browser/web_contents/web_drag_source_mac_unittest.mm +++ b/content/browser/web_contents/web_drag_source_mac_unittest.mm
@@ -4,10 +4,12 @@ #import "content/browser/web_contents/web_drag_source_mac.h" +#include "base/memory/ref_counted.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/common/drop_data.h" #include "content/public/test/test_renderer_host.h" #include "testing/gtest/include/gtest/gtest.h" +#import "ui/base/clipboard/clipboard_util_mac.h" #include "url/gurl.h" namespace content { @@ -23,19 +25,19 @@ dropData->url = GURL("javascript:%"); WebContentsImpl* contentsImpl = static_cast<WebContentsImpl*>(contents.get()); + scoped_refptr<ui::UniquePasteboard> pasteboard1 = new ui::UniquePasteboard; base::scoped_nsobject<WebDragSource> source([[WebDragSource alloc] - initWithContents:contentsImpl - view:view - dropData:dropData.get() - image:nil - offset:NSZeroPoint - pasteboard:[NSPasteboard pasteboardWithUniqueName] - dragOperationMask:NSDragOperationCopy]); + initWithContents:contentsImpl + view:view + dropData:dropData.get() + image:nil + offset:NSZeroPoint + pasteboard:pasteboard1->get() + dragOperationMask:NSDragOperationCopy]); // Test that this call doesn't throw any exceptions: http://crbug.com/128371 - base::scoped_nsobject<NSPasteboard> pasteboard( - [NSPasteboard pasteboardWithUniqueName]); - [source lazyWriteToPasteboard:pasteboard forType:NSURLPboardType]; + scoped_refptr<ui::UniquePasteboard> pasteboard2 = new ui::UniquePasteboard; + [source lazyWriteToPasteboard:pasteboard2->get() forType:NSURLPboardType]; } } // namespace content
diff --git a/content/browser/webui/web_ui_impl.h b/content/browser/webui/web_ui_impl.h index 26c051de..1c812a56 100644 --- a/content/browser/webui/web_ui_impl.h +++ b/content/browser/webui/web_ui_impl.h
@@ -10,6 +10,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" #include "content/public/browser/web_ui.h"
diff --git a/content/browser/zygote_host/zygote_communication_linux.h b/content/browser/zygote_host/zygote_communication_linux.h index 8950553..d3f4403 100644 --- a/content/browser/zygote_host/zygote_communication_linux.h +++ b/content/browser/zygote_host/zygote_communication_linux.h
@@ -8,6 +8,7 @@ #include <set> #include <vector> +#include "base/memory/scoped_ptr.h" #include "base/process/kill.h" #include "base/synchronization/lock.h" #include "content/common/content_export.h"
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc index 0cec76b7..59a73c2 100644 --- a/content/child/blink_platform_impl.cc +++ b/content/child/blink_platform_impl.cc
@@ -42,7 +42,6 @@ #include "content/child/child_thread_impl.h" #include "content/child/content_child_helpers.h" #include "content/child/geofencing/web_geofencing_provider_impl.h" -#include "content/child/navigator_connect/service_port_provider.h" #include "content/child/notifications/notification_dispatcher.h" #include "content/child/notifications/notification_manager.h" #include "content/child/permissions/permission_dispatcher.h" @@ -56,7 +55,7 @@ #include "content/child/worker_thread_registry.h" #include "content/public/common/content_client.h" #include "net/base/data_url.h" -#include "net/base/ip_address_number.h" +#include "net/base/ip_address.h" #include "net/base/net_errors.h" #include "net/base/port_util.h" #include "third_party/WebKit/public/platform/WebData.h" @@ -450,10 +449,10 @@ bool BlinkPlatformImpl::isReservedIPAddress( const blink::WebString& host) const { - net::IPAddressNumber address; - if (!net::ParseURLHostnameToNumber(host.utf8(), &address)) + net::IPAddress address; + if (!net::ParseURLHostnameToAddress(host.utf8(), &address)) return false; - return net::IsIPAddressReserved(address); + return address.IsReserved(); } bool BlinkPlatformImpl::portAllowed(const blink::WebURL& url) const { @@ -892,11 +891,6 @@ push_dispatcher_.get()); } -blink::WebServicePortProvider* BlinkPlatformImpl::createServicePortProvider( - blink::WebServicePortProviderClient* client) { - return new ServicePortProvider(client, main_thread_task_runner_); -} - blink::WebPermissionClient* BlinkPlatformImpl::permissionClient() { if (!permission_client_.get()) return nullptr;
diff --git a/content/child/blink_platform_impl.h b/content/child/blink_platform_impl.h index 9e2886a..5b2a40be5 100644 --- a/content/child/blink_platform_impl.h +++ b/content/child/blink_platform_impl.h
@@ -133,8 +133,6 @@ blink::WebGeofencingProvider* geofencingProvider() override; blink::WebNotificationManager* notificationManager() override; blink::WebPushProvider* pushProvider() override; - blink::WebServicePortProvider* createServicePortProvider( - blink::WebServicePortProviderClient*) override; blink::WebPermissionClient* permissionClient() override; blink::WebSyncProvider* backgroundSyncProvider() override;
diff --git a/content/child/font_warmup_win.cc b/content/child/font_warmup_win.cc index 33d1807..e3c0711 100644 --- a/content/child/font_warmup_win.cc +++ b/content/child/font_warmup_win.cc
@@ -22,12 +22,9 @@ #include "base/trace_event/trace_event.h" #include "base/win/iat_patch_function.h" #include "base/win/windows_version.h" -#include "content/public/common/dwrite_font_platform_win.h" #include "ppapi/shared_impl/proxy_lock.h" #include "skia/ext/fontmgr_default_win.h" #include "skia/ext/refptr.h" -#include "third_party/WebKit/public/web/win/WebFontRendering.h" -#include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/ports/SkFontMgr.h" #include "third_party/skia/include/ports/SkTypeface_win.h" @@ -99,36 +96,6 @@ return STATUS_ACCESS_DENIED; } -// Windows-only DirectWrite support. These warm up the DirectWrite paths -// before sandbox lock down to allow Skia access to the Font Manager service. -void CreateDirectWriteFactory(IDWriteFactory** factory) { - typedef decltype(DWriteCreateFactory)* DWriteCreateFactoryProc; - HMODULE dwrite_dll = LoadLibraryW(L"dwrite.dll"); - // TODO(scottmg): Temporary code to track crash in http://crbug.com/387867. - if (!dwrite_dll) { - DWORD load_library_get_last_error = GetLastError(); - base::debug::Alias(&dwrite_dll); - base::debug::Alias(&load_library_get_last_error); - CHECK(false); - } - - PatchServiceManagerCalls(); - - DWriteCreateFactoryProc dwrite_create_factory_proc = - reinterpret_cast<DWriteCreateFactoryProc>( - GetProcAddress(dwrite_dll, "DWriteCreateFactory")); - // TODO(scottmg): Temporary code to track crash in http://crbug.com/387867. - if (!dwrite_create_factory_proc) { - DWORD get_proc_address_get_last_error = GetLastError(); - base::debug::Alias(&dwrite_create_factory_proc); - base::debug::Alias(&get_proc_address_get_last_error); - CHECK(false); - } - CHECK(SUCCEEDED(dwrite_create_factory_proc( - DWRITE_FACTORY_TYPE_ISOLATED, __uuidof(IDWriteFactory), - reinterpret_cast<IUnknown**>(factory)))); -} - // Class to fake out a DC or a Font object. Maintains a reference to a // SkTypeFace to emulate the simple operation of a DC and Font. class FakeGdiObject : public base::RefCountedThreadSafe<FakeGdiObject> { @@ -446,30 +413,9 @@ DCHECK(patched == 0); } -void DoPreSandboxWarmupForTypeface(SkTypeface* typeface) { - SkPaint paint_warmup; - paint_warmup.setTypeface(typeface); - wchar_t glyph = L'S'; - paint_warmup.measureText(&glyph, 2); -} - -SkFontMgr* GetPreSandboxWarmupFontMgr() { - if (!g_warmup_fontmgr) { - IDWriteFactory* factory; - CreateDirectWriteFactory(&factory); - - g_warmup_fontmgr = - SkFontMgr_New_DirectWrite(factory, GetCustomFontCollection(factory)); - blink::WebFontRendering::setSkiaFontManager(g_warmup_fontmgr); - } - return g_warmup_fontmgr; -} - GdiFontPatchData* PatchGdiFontEnumeration(const base::FilePath& path) { - if (ShouldUseDirectWriteFontProxyFieldTrial() && !g_warmup_fontmgr) + if (!g_warmup_fontmgr) g_warmup_fontmgr = SkFontMgr_New_DirectWrite(); - // If not using the font proxy, we assume |g_warmup_fontmgr| is already - // initialized before this function is called. DCHECK(g_warmup_fontmgr); return new GdiFontPatchDataImpl(path); } @@ -486,19 +432,4 @@ g_warmup_fontmgr = fontmgr; } -void WarmupDirectWrite() { - TRACE_EVENT0("startup", "content::WarmupDirectWrite"); - - // The objects used here are intentionally not freed as we want the Skia - // code to use these objects after warmup. - SetDefaultSkiaFactory(GetPreSandboxWarmupFontMgr()); - - // We need to warm up *some* font for DirectWrite. Note that we don't use - // a monospace as would be nice in an attempt to avoid a small startup time - // regression, see http://crbug.com/463613. - skia::RefPtr<SkTypeface> hud_typeface = skia::AdoptRef( - GetPreSandboxWarmupFontMgr()->legacyCreateTypeface("Times New Roman", 0)); - DoPreSandboxWarmupForTypeface(hud_typeface.get()); -} - } // namespace content
diff --git a/content/child/font_warmup_win.h b/content/child/font_warmup_win.h index bd1ae696..9bbdaae 100644 --- a/content/child/font_warmup_win.h +++ b/content/child/font_warmup_win.h
@@ -16,14 +16,6 @@ namespace content { -// Make necessary calls to cache the data for a given font, used before -// sandbox lockdown. -CONTENT_EXPORT void DoPreSandboxWarmupForTypeface(SkTypeface* typeface); - -// Get the shared font manager used during pre-sandbox warmup for DirectWrite -// fonts. -CONTENT_EXPORT SkFontMgr* GetPreSandboxWarmupFontMgr(); - class GdiFontPatchData { public: virtual ~GdiFontPatchData() {} @@ -50,9 +42,6 @@ // for testing the implementation. CONTENT_EXPORT void SetPreSandboxWarmupFontMgrForTesting(SkFontMgr* fontmgr); -// Warmup the direct write font manager for content processes. -CONTENT_EXPORT void WarmupDirectWrite(); - // Directwrite connects to the font cache service to retrieve information about // fonts installed on the system etc. This works well outside the sandbox and // within the sandbox as long as the lpc connection maintained by the current
diff --git a/content/child/navigator_connect/OWNERS b/content/child/navigator_connect/OWNERS deleted file mode 100644 index 1b10b343..0000000 --- a/content/child/navigator_connect/OWNERS +++ /dev/null
@@ -1 +0,0 @@ -mek@chromium.org
diff --git a/content/child/navigator_connect/service_port_dispatcher_impl.cc b/content/child/navigator_connect/service_port_dispatcher_impl.cc deleted file mode 100644 index 7c96fa4d..0000000 --- a/content/child/navigator_connect/service_port_dispatcher_impl.cc +++ /dev/null
@@ -1,80 +0,0 @@ -// 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. - -#include "content/child/navigator_connect/service_port_dispatcher_impl.h" - -#include <utility> - -#include "base/trace_event/trace_event.h" -#include "mojo/common/common_type_converters.h" -#include "mojo/common/url_type_converters.h" -#include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h" - -namespace content { - -namespace { - -class WebConnectCallbacksImpl - : public blink::WebServicePortConnectEventCallbacks { - public: - WebConnectCallbacksImpl( - const mojom::ServicePortDispatcher::ConnectCallback& callback) - : callback_(callback) {} - - ~WebConnectCallbacksImpl() override {} - - void onSuccess(const blink::WebServicePort& port) override { - callback_.Run(mojom::ServicePortConnectResult::ACCEPT, - mojo::String::From<base::string16>(port.name), - mojo::String::From<base::string16>(port.data)); - } - - void onError() override { - callback_.Run(mojom::ServicePortConnectResult::REJECT, mojo::String(""), - mojo::String("")); - } - - private: - mojom::ServicePortDispatcher::ConnectCallback callback_; -}; - -} // namespace - -void ServicePortDispatcherImpl::Create( - base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy, - mojo::InterfaceRequest<mojom::ServicePortDispatcher> request) { - new ServicePortDispatcherImpl(proxy, std::move(request)); -} - -ServicePortDispatcherImpl::~ServicePortDispatcherImpl() { - WorkerThread::RemoveObserver(this); -} - -ServicePortDispatcherImpl::ServicePortDispatcherImpl( - base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy, - mojo::InterfaceRequest<mojom::ServicePortDispatcher> request) - : binding_(this, std::move(request)), proxy_(proxy) { - WorkerThread::AddObserver(this); -} - -void ServicePortDispatcherImpl::WillStopCurrentWorkerThread() { - delete this; -} - -void ServicePortDispatcherImpl::Connect(const mojo::String& target_url, - const mojo::String& origin, - int32_t port_id, - const ConnectCallback& callback) { - if (!proxy_) { - callback.Run(mojom::ServicePortConnectResult::REJECT, mojo::String(""), - mojo::String("")); - return; - } - TRACE_EVENT0("ServiceWorker", "ServicePortDispatcherImpl::Connect"); - proxy_->dispatchServicePortConnectEvent(new WebConnectCallbacksImpl(callback), - target_url.To<GURL>(), - origin.To<base::string16>(), port_id); -} - -} // namespace content
diff --git a/content/child/navigator_connect/service_port_dispatcher_impl.h b/content/child/navigator_connect/service_port_dispatcher_impl.h deleted file mode 100644 index 410df7b..0000000 --- a/content/child/navigator_connect/service_port_dispatcher_impl.h +++ /dev/null
@@ -1,58 +0,0 @@ -// 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. - -#ifndef CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_DISPATCHER_IMPL_H_ -#define CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_DISPATCHER_IMPL_H_ - -#include <stdint.h> - -#include "base/macros.h" -#include "base/memory/weak_ptr.h" -#include "content/common/service_port_service.mojom.h" -#include "content/public/child/worker_thread.h" -#include "mojo/public/cpp/bindings/strong_binding.h" - -namespace blink { -class WebServiceWorkerContextProxy; -} - -namespace content { - -// Mojo service that dispatches ServicePort related events to a service worker. -// Instances are always created on a worker thread, and all methods are only -// called on that same thread. Lifetime of this class is tied to both the mojo -// channel and the lifetime of the worker thread. If either the channel is -// disconnected or the worker thread stops the instance deletes itself. -class ServicePortDispatcherImpl : public mojom::ServicePortDispatcher, - public WorkerThread::Observer { - public: - static void Create( - base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy, - mojo::InterfaceRequest<mojom::ServicePortDispatcher> request); - - ~ServicePortDispatcherImpl() override; - - private: - ServicePortDispatcherImpl( - base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy, - mojo::InterfaceRequest<mojom::ServicePortDispatcher> request); - - // WorkerThread::Observer implementation. - void WillStopCurrentWorkerThread() override; - - // mojom::ServicePortDispatcher implementation. - void Connect(const mojo::String& target_url, - const mojo::String& origin, - int32_t port_id, - const ConnectCallback& callback) override; - - mojo::StrongBinding<mojom::ServicePortDispatcher> binding_; - base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy_; - - DISALLOW_COPY_AND_ASSIGN(ServicePortDispatcherImpl); -}; - -} // namespace content - -#endif // CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_DISPATCHER_IMPL_H_
diff --git a/content/child/navigator_connect/service_port_provider.cc b/content/child/navigator_connect/service_port_provider.cc deleted file mode 100644 index 7c16250..0000000 --- a/content/child/navigator_connect/service_port_provider.cc +++ /dev/null
@@ -1,132 +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. - -#include "content/child/navigator_connect/service_port_provider.h" - -#include <utility> - -#include "base/lazy_instance.h" -#include "base/single_thread_task_runner.h" -#include "base/task_runner_util.h" -#include "content/child/child_thread_impl.h" -#include "content/child/webmessageportchannel_impl.h" -#include "content/common/message_port_messages.h" -#include "content/common/service_port_type_converters.h" -#include "content/public/common/navigator_connect_client.h" -#include "mojo/common/common_type_converters.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/platform/modules/navigator_services/WebServicePortProviderClient.h" - -namespace content { - -namespace { - -void ConnectToServiceOnMainThread( - mojo::InterfaceRequest<mojom::ServicePortService> ptr) { - ChildThreadImpl::current()->service_registry()->ConnectToRemoteService( - std::move(ptr)); -} - -} // namespace - -ServicePortProvider::ServicePortProvider( - blink::WebServicePortProviderClient* client, - const scoped_refptr<base::SingleThreadTaskRunner>& main_loop) - : client_(client), binding_(this), main_loop_(main_loop) { - DCHECK(client_); - AddRef(); -} - -void ServicePortProvider::destroy() { - Release(); -} - -void ServicePortProvider::connect( - const blink::WebURL& target_url, - const blink::WebString& origin, - blink::WebServicePortConnectCallbacks* raw_callbacks) { - scoped_ptr<blink::WebServicePortConnectCallbacks> callbacks(raw_callbacks); - // base::Unretained is safe here, as the mojo channel will be deleted (and - // will wipe its callbacks) before 'this' is deleted. - GetServicePortServicePtr()->Connect( - target_url.string().utf8(), origin.utf8(), - base::Bind(&ServicePortProvider::OnConnectResult, base::Unretained(this), - base::Passed(&callbacks))); -} - -void ServicePortProvider::postMessage( - blink::WebServicePortID port_id, - const blink::WebString& message, - blink::WebMessagePortChannelArray* channels) { - // TODO(mek): If necesary, handle sending messages as values for system - // services. - - // Have to extract IDs for the transferred MessagePorts on the main thread - // to make sure all ports have been fully initialized. Actually sending the - // message can safely be done on this thread, and using mojo, since there - // shouldn't be any other IPCs where ordering matters. - scoped_ptr<blink::WebMessagePortChannelArray> channel_array(channels); - base::PostTaskAndReplyWithResult( - main_loop_.get(), FROM_HERE, - base::Bind( - &WebMessagePortChannelImpl::ExtractMessagePortIDsWithoutQueueing, - base::Passed(&channel_array)), - base::Bind(&ServicePortProvider::PostMessageToBrowser, this, port_id, - // We cast WebString to string16 before crossing threads. - // for thread-safety. - static_cast<base::string16>(message))); -} - -void ServicePortProvider::closePort(blink::WebServicePortID port_id) { - GetServicePortServicePtr()->ClosePort(port_id); -} - -void ServicePortProvider::PostMessageToPort( - int32_t port_id, - const mojo::String& message, - mojo::Array<mojom::MojoTransferredMessagePortPtr> ports, - mojo::Array<int32_t> new_routing_ids) { - client_->postMessage(port_id, message.To<base::string16>(), - WebMessagePortChannelImpl::CreatePorts( - ports.To<std::vector<TransferredMessagePort>>(), - new_routing_ids.To<std::vector<int>>(), main_loop_)); -} - -ServicePortProvider::~ServicePortProvider() { -} - -void ServicePortProvider::PostMessageToBrowser( - int port_id, - const base::string16& message, - const std::vector<TransferredMessagePort> ports) { - GetServicePortServicePtr()->PostMessageToPort( - port_id, mojo::String::From(message), - mojo::Array<mojom::MojoTransferredMessagePortPtr>::From(ports)); -} - -void ServicePortProvider::OnConnectResult( - scoped_ptr<blink::WebServicePortConnectCallbacks> callbacks, - mojom::ServicePortConnectResult result, - int32_t port_id) { - if (result == mojom::ServicePortConnectResult::ACCEPT) { - callbacks->onSuccess(port_id); - } else { - callbacks->onError(); - } -} - -mojom::ServicePortServicePtr& ServicePortProvider::GetServicePortServicePtr() { - if (!service_port_service_.get()) { - mojo::InterfaceRequest<mojom::ServicePortService> request = - mojo::GetProxy(&service_port_service_); - main_loop_->PostTask(FROM_HERE, base::Bind(&ConnectToServiceOnMainThread, - base::Passed(&request))); - - // Setup channel for browser to post events back to this class. - service_port_service_->SetClient(binding_.CreateInterfacePtrAndBind()); - } - return service_port_service_; -} - -} // namespace content
diff --git a/content/child/navigator_connect/service_port_provider.h b/content/child/navigator_connect/service_port_provider.h deleted file mode 100644 index 88e9107..0000000 --- a/content/child/navigator_connect/service_port_provider.h +++ /dev/null
@@ -1,102 +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. - -#ifndef CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_PROVIDER_H_ -#define CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_PROVIDER_H_ - -#include <stdint.h> - -#include "base/compiler_specific.h" -#include "base/id_map.h" -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "content/child/worker_thread_registry.h" -#include "content/common/service_port_service.mojom.h" -#include "mojo/public/cpp/bindings/binding.h" -#include "third_party/WebKit/public/platform/modules/navigator_services/WebServicePortProvider.h" - -class GURL; - -namespace base { -class SingleThreadTaskRunner; -} - -namespace blink { -class WebServicePortProviderClient; -class WebString; -} - -namespace IPC { -class Message; -} - -namespace content { -class ServiceRegistry; -struct TransferredMessagePort; - -// Main entry point for the navigator.services API in a child process. This -// implementes the blink API and passes calls on to the browser process, as -// well as receives events from the browser process to pass back on to blink. -// One instance of this class is created for each ServicePortCollection, the -// instance lives on the worker thread it is associated with, and is -// conceptually owned by the ServicePortCollection in blink. Refcounted because -// some operations might require asynchronous operations that require this class -// to potentially stick around for a bit longer after a ServicePortCollection is -// destroyed. -// Uses mojo to communicate with the browser process. -class ServicePortProvider - : public blink::WebServicePortProvider, - public mojom::ServicePortServiceClient, - public base::RefCountedThreadSafe<ServicePortProvider> { - public: - ServicePortProvider( - blink::WebServicePortProviderClient* client, - const scoped_refptr<base::SingleThreadTaskRunner>& main_loop); - - // WebServicePortProvider implementation. - void destroy() override; - void connect(const blink::WebURL& target_url, - const blink::WebString& origin, - blink::WebServicePortConnectCallbacks* callbacks) override; - void postMessage(blink::WebServicePortID port_id, - const blink::WebString& message, - blink::WebMessagePortChannelArray* channels) override; - void closePort(blink::WebServicePortID port_id) override; - - // mojom::ServicePortServiceClient implementation. - void PostMessageToPort( - int32_t port_id, - const mojo::String& message, - mojo::Array<mojom::MojoTransferredMessagePortPtr> ports, - mojo::Array<int32_t> new_routing_ids) override; - - private: - ~ServicePortProvider() override; - friend class base::RefCountedThreadSafe<ServicePortProvider>; - - void PostMessageToBrowser(int port_id, - const base::string16& message, - const std::vector<TransferredMessagePort> ports); - - void OnConnectResult( - scoped_ptr<blink::WebServicePortConnectCallbacks> callbacks, - mojom::ServicePortConnectResult result, - int32_t port_id); - - blink::WebServicePortProviderClient* client_; - - // Helper method that returns an initialized ServicePortServicePtr. - mojom::ServicePortServicePtr& GetServicePortServicePtr(); - mojo::Binding<mojom::ServicePortServiceClient> binding_; - - mojom::ServicePortServicePtr service_port_service_; - - scoped_refptr<base::SingleThreadTaskRunner> main_loop_; - - DISALLOW_COPY_AND_ASSIGN(ServicePortProvider); -}; - -} // namespace content - -#endif // CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_PROVIDER_H_
diff --git a/content/child/resource_scheduling_filter.h b/content/child/resource_scheduling_filter.h index 96eb81c76..9e89b11 100644 --- a/content/child/resource_scheduling_filter.h +++ b/content/child/resource_scheduling_filter.h
@@ -11,6 +11,7 @@ #include "base/containers/hash_tables.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" #include "content/common/content_export.h"
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 1776041..6a34831 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -185,6 +185,9 @@ if (base::FeatureList::IsEnabled(features::kNewMediaPlaybackUi)) WebRuntimeFeatures::enableNewMediaPlaybackUi(true); + if (base::FeatureList::IsEnabled(features::kDocumentWriteEvaluator)) + WebRuntimeFeatures::enableDocumentWriteEvaluator(true); + // Enable explicitly enabled features, and then disable explicitly disabled // ones. if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) {
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index 26eca00..119da20 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn
@@ -542,7 +542,6 @@ "process_control.mojom", "render_frame_setup.mojom", "render_widget_window_tree_client_factory.mojom", - "service_port_service.mojom", "service_worker/embedded_worker_setup.mojom", "storage_partition_service.mojom", "vr_service.mojom",
diff --git a/content/common/accessibility_messages.h b/content/common/accessibility_messages.h index d7d826a..2a300ea 100644 --- a/content/common/accessibility_messages.h +++ b/content/common/accessibility_messages.h
@@ -226,7 +226,7 @@ // Sent in response to AccessibilityMsg_HitTest. IPC_MESSAGE_ROUTED2(AccessibilityHostMsg_ChildFrameHitTestResult, gfx::Point /* location tested */, - int /* node id of result */); + int /* node id of result */) // Sent in response to AccessibilityMsg_SnapshotTree. The callback id that was // passed to the request will be returned in |callback_id|, along with
diff --git a/content/common/android/sync_compositor_messages.h b/content/common/android/sync_compositor_messages.h index 2e9af1a..d4556da 100644 --- a/content/common/android/sync_compositor_messages.h +++ b/content/common/android/sync_compositor_messages.h
@@ -139,6 +139,8 @@ IPC_STRUCT_TRAITS_END() // Messages sent from the browser to the renderer. +// Synchronous IPCs are allowed here to the renderer compositor thread. See +// design doc https://goo.gl/Tn81FW and crbug.com/526842 for details. IPC_SYNC_MESSAGE_ROUTED2_2(SyncCompositorMsg_HandleInputEvent, content::SyncCompositorCommonBrowserParams, @@ -180,6 +182,13 @@ IPC_MESSAGE_ROUTED1(SyncCompositorMsg_UpdateState, content::SyncCompositorCommonBrowserParams) +// The synchronous version is used to synchronize state from an earlier +// asynchronous call only. This should be needed rarely so should prefer the +// asynchronous version above in general. +IPC_SYNC_MESSAGE_ROUTED1_1(SyncCompositorMsg_SynchronousUpdateState, + content::SyncCompositorCommonBrowserParams, + content::SyncCompositorCommonRendererParams) + // ----------------------------------------------------------------------------- // Messages sent from the renderer to the browser.
diff --git a/content/common/cache_storage/cache_storage_messages.h b/content/common/cache_storage/cache_storage_messages.h index 277f960e..82fe755 100644 --- a/content/common/cache_storage/cache_storage_messages.h +++ b/content/common/cache_storage/cache_storage_messages.h
@@ -13,7 +13,7 @@ #include "ipc/ipc_message_macros.h" #include "ipc/ipc_param_traits.h" #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerCacheError.h" -#include "url/gurl.h" +#include "url/origin.h" #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT CONTENT_EXPORT @@ -51,30 +51,30 @@ IPC_MESSAGE_CONTROL4(CacheStorageHostMsg_CacheStorageHas, int /* thread_id */, int /* request_id */, - GURL /* origin */, + url::Origin /* origin */, base::string16 /* fetch_store_name */) IPC_MESSAGE_CONTROL4(CacheStorageHostMsg_CacheStorageOpen, int /* thread_id */, int /* request_id */, - GURL /* origin */, + url::Origin /* origin */, base::string16 /* fetch_store_name */) IPC_MESSAGE_CONTROL4(CacheStorageHostMsg_CacheStorageDelete, int /* thread_id */, int /* request_id */, - GURL /* origin */, + url::Origin /* origin */, base::string16 /* fetch_store_name */) IPC_MESSAGE_CONTROL3(CacheStorageHostMsg_CacheStorageKeys, int /* thread_id */, int /* request_id */, - GURL /* origin */) + url::Origin /* origin */) IPC_MESSAGE_CONTROL5(CacheStorageHostMsg_CacheStorageMatch, int /* thread_id */, int /* request_id */, - GURL /* origin */, + url::Origin /* origin */, content::ServiceWorkerFetchRequest, content::CacheStorageCacheQueryParams)
diff --git a/content/common/dwrite_font_platform_win.cc b/content/common/dwrite_font_platform_win.cc deleted file mode 100644 index 56140f4..0000000 --- a/content/common/dwrite_font_platform_win.cc +++ /dev/null
@@ -1,1282 +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. - -#include "content/public/common/dwrite_font_platform_win.h" - -#include <windows.h> -#include <stddef.h> -#include <stdint.h> - -#include <dwrite.h> -#include <wrl/implements.h> -#include <wrl/wrappers/corewrappers.h> - -#include <limits> -#include <map> -#include <string> -#include <utility> -#include <vector> - -#include "base/command_line.h" -#include "base/debug/alias.h" -#include "base/debug/crash_logging.h" -#include "base/files/file_enumerator.h" -#include "base/files/file_path.h" -#include "base/files/file_util.h" -#include "base/files/memory_mapped_file.h" -#include "base/macros.h" -#include "base/memory/scoped_ptr.h" -#include "base/memory/shared_memory.h" -#include "base/metrics/field_trial.h" -#include "base/metrics/histogram.h" -#include "base/path_service.h" -#include "base/process/process_handle.h" -#include "base/stl_util.h" -#include "base/strings/string_number_conversions.h" -#include "base/strings/string_util.h" -#include "base/strings/utf_string_conversions.h" -#include "base/synchronization/lock.h" -#include "base/time/time.h" -#include "base/trace_event/trace_event.h" -#include "base/win/registry.h" -#include "base/win/scoped_comptr.h" -#include "content/public/common/content_switches.h" - -namespace { - -// Font Cache implementation short story: -// Due to our sandboxing restrictions, we cannot connect to Windows font cache -// service from Renderer and need to use DirectWrite isolated font loading -// mechanism. -// DirectWrite needs to be initialized before any of the API could be used. -// During initialization DirectWrite loads all font files and populates -// internal cache, we refer this phase as enumeration and we are trying -// to optimize this phase in our cache approach. Using cache during -// initialization will help improve on startup latency in each renderer -// instance. -// During enumeration DirectWrite reads various fragments from .ttf/.ttc -// font files. Our assumption is that these fragments are being read to -// cache information such as font families, supported sizes etc. -// For reading fragments DirectWrite calls ReadFragment of our FontFileStream -// implementation with parameters start_offset and length. We cache these -// parameters along with associated data chunk. -// Here is small example of how segments are read -// start_offset: 0, length: 16 -// start_offset: 0, length: 12 -// start_offset: 0, length: 117 -// For better cache management we collapse segments if they overlap or are -// adjacent. - -namespace mswr = Microsoft::WRL; - -const char kFontKeyName[] = "font_key_name"; - -// We use this value to determine whether to cache file fragments -// or not. In our trials we observed that for some font files -// direct write ends up reading almost entire file during enumeration -// phase. If we don't use this percentile formula we will end up -// increasing significant cache size by caching entire file contents -// for some of the font files. -const double kMaxPercentileOfFontFileSizeToCache = 0.6; - -// With current implementation we map entire shared section into memory during -// renderer startup. This causes increase in working set of Chrome. As first -// step we want to see if caching is really improving any performance for our -// users, so we are putting arbitrary limit on cache file size. There are -// multiple ways we can tune our working size, like mapping only required part -// of section at any given time. -const double kArbitraryCacheFileSizeLimit = (30 * 1024 * 1024); - -// We have chosen current font file length arbitrarily. In our logic -// if we don't find file we are looking for in cache we end up loading -// that file directly from system fonts folder. -const unsigned int kMaxFontFileNameLength = 34; - -const DWORD kCacheFileVersion = 103; -const DWORD kFileSignature = 0x4D4F5243; // CROM -const DWORD kMagicCompletionSignature = 0x454E4F44; // DONE - -const DWORD kUndefinedDWORDS = 36; - -// Make sure that all structure sizes align with 8 byte boundary otherwise -// dr. memory test may complain. -#pragma pack(push, 8) -// Cache file header, includes signature, completion bits and version. -struct CacheFileHeader { - CacheFileHeader() { - file_signature = kFileSignature; - magic_completion_signature = 0; - version = kCacheFileVersion; - ::ZeroMemory(undefined, sizeof(undefined)); - } - - DWORD file_signature; - DWORD magic_completion_signature; - DWORD version; - BYTE undefined[kUndefinedDWORDS]; -}; - -// Entry for a particular font file within this cache. -struct CacheFileEntry { - CacheFileEntry() { - file_size = 0; - entry_count = 0; - ::ZeroMemory(file_name, sizeof(file_name)); - } - - UINT64 file_size; - DWORD entry_count; - wchar_t file_name[kMaxFontFileNameLength]; -}; - -// Offsets or data chunks that are cached for particular font file. -struct CacheFileOffsetEntry { - CacheFileOffsetEntry() { - start_offset = 0; - length = 0; - } - - UINT64 start_offset; - UINT64 length; - /* BYTE blob_[]; // Place holder for the blob that follows. */ -}; -#pragma pack(pop) - -bool ValidateFontCacheHeader(CacheFileHeader* header) { - return (header->file_signature == kFileSignature && - header->magic_completion_signature == kMagicCompletionSignature && - header->version == kCacheFileVersion); -} - -class FontCacheWriter; - -// This class implements main interface required for loading custom font -// collection as specified by DirectWrite. We also use this class for storing -// some state information as this is one of the centralized entity. -class FontCollectionLoader - : public mswr::RuntimeClass<mswr::RuntimeClassFlags<mswr::ClassicCom>, - IDWriteFontCollectionLoader> { - public: - FontCollectionLoader() - : in_collection_building_mode_(false), - create_static_cache_(false) {} - - ~FontCollectionLoader() override; - - HRESULT RuntimeClassInitialize() { - return S_OK; - } - - // IDWriteFontCollectionLoader methods. - HRESULT STDMETHODCALLTYPE - CreateEnumeratorFromKey(IDWriteFactory* factory, - void const* key, - UINT32 key_size, - IDWriteFontFileEnumerator** file_enumerator) override; - - // Does all the initialization for required loading fonts from registry. - static HRESULT Initialize(IDWriteFactory* factory); - - // Returns font cache map size. - UINT32 GetFontMapSize(); - - // Returns font name string when given font index. - base::string16 GetFontNameFromKey(UINT32 idx); - - // Loads internal structure with fonts from registry. - bool LoadFontListFromRegistry(); - - // Loads restricted web safe fonts as fallback method to registry fonts. - bool LoadRestrictedFontList(); - - // Puts class in collection building mode. In collection building mode - // we use static cache if it is available as a look aside buffer. - void EnableCollectionBuildingMode(bool enable); - - // Returns current state of collection building. - bool InCollectionBuildingMode(); - - // Loads static cache file. - bool LoadCacheFile(); - - // Unloads cache file and related data. - void UnloadCacheFile(); - - // Puts class in static cache creating mode. In this mode we record all - // direct write requests and store chunks of font data. - void EnterStaticCacheMode(const WCHAR* file_name); - - // Gets out of static cache building mode. - void LeaveStaticCacheMode(); - - // Returns if class is currently in static cache building mode. - bool IsBuildStaticCacheMode(); - - // Validates cache file for consistency. - bool ValidateCacheFile(base::File* file); - - private: - // Structure to represent each chunk within font file that we load in memory. - struct CacheTableOffsetEntry { - UINT64 start_offset; - UINT64 length; - BYTE* inside_file_ptr; - }; - - typedef std::vector<CacheTableOffsetEntry> OffsetVector; - - // Structure representing each font entry with cache. - struct CacheTableEntry { - UINT64 file_size; - OffsetVector offset_entries; - }; - - public: - // Returns whether file we have particular font entry within cache or not. - bool IsFileCached(UINT32 font_key); - // Returns cache fragment corresponding to specific font key. - void* GetCachedFragment(UINT32 font_key, UINT64 start_offset, UINT64 length); - // Returns actual font file size at the time of caching. - UINT64 GetCachedFileSize(UINT32 font_key); - - // Returns instance of font cache writer. This class manages actual font - // file format. - FontCacheWriter* GetFontCacheWriter(); - - private: - // Functions validates and loads cache into internal map. - bool ValidateAndLoadCacheMap(); - - mswr::ComPtr<IDWriteFontFileLoader> file_loader_; - - std::vector<base::string16> reg_fonts_; - bool in_collection_building_mode_; - bool create_static_cache_; - scoped_ptr<base::SharedMemory> cache_; - scoped_ptr<FontCacheWriter> cache_writer_; - - typedef std::map<base::string16, CacheTableEntry*> CacheMap; - CacheMap cache_map_; - - DISALLOW_COPY_AND_ASSIGN(FontCollectionLoader); -}; - -mswr::ComPtr<FontCollectionLoader> g_font_loader; -base::win::ScopedHandle g_shared_font_cache; - -// Class responsible for handling font cache file format details as well as -// tracking various cache region requests by direct write. -class FontCacheWriter { - public: - FontCacheWriter() : count_font_entries_ignored_(0), cookie_counter_(0) {} - - ~FontCacheWriter() { - if (static_cache_.get()) { - static_cache_->Close(); - } - } - - public: - // Holds data related to individual region as requested by direct write. - struct CacheRegion { - UINT64 start_offset; - UINT64 length; - const BYTE* ptr; - /* BYTE blob_[]; // Place holder for the blob that follows. */ - }; - - // Function to create static font cache file. - bool Create(const wchar_t* file_name) { - static_cache_.reset(new base::File(base::FilePath(file_name), - base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_WRITE | - base::File::FLAG_EXCLUSIVE_WRITE)); - if (!static_cache_->IsValid()) { - static_cache_.reset(); - return false; - } - CacheFileHeader header; - - // At offset 0 write cache version - static_cache_->Write(0, - reinterpret_cast<const char*>(&header), - sizeof(header)); - - static_cache_->Flush(); - return true; - } - - // Closes static font cache file. Also writes completion signature to mark - // it as completely written. - void Close() { - if (static_cache_.get()) { - CacheFileHeader header; - header.magic_completion_signature = kMagicCompletionSignature; - // At offset 0 write cache version - int bytes_written = static_cache_->Write(0, - reinterpret_cast<const char*>(&header), - sizeof(header)); - DCHECK_NE(bytes_written, -1); - - UMA_HISTOGRAM_MEMORY_KB("DirectWrite.Fonts.BuildCache.File.Size", - static_cache_->GetLength() / 1024); - - UMA_HISTOGRAM_COUNTS("DirectWrite.Fonts.BuildCache.Ignored", - count_font_entries_ignored_); - - static_cache_->Close(); - static_cache_.reset(NULL); - } - } - - private: - typedef std::vector<CacheRegion> RegionVector; - - // Structure to track various regions requested by direct write for particular - // font file. - struct FontEntryInternal { - FontEntryInternal(const wchar_t* name, UINT64 size) - : file_name(name), - file_size(size) { - } - - base::string16 file_name; - UINT64 file_size; - RegionVector regions; - }; - - public: - // Starts up new font entry to be tracked, returns cookie to identify this - // particular entry. - UINT NewFontEntry(const wchar_t* file_name, UINT64 file_size) { - base::AutoLock lock(lock_); - UINT old_counter = cookie_counter_; - FontEntryInternal* font_entry = new FontEntryInternal(file_name, file_size); - cookie_map_[cookie_counter_].reset(font_entry); - cookie_counter_++; - return old_counter; - } - - // AddRegion function lets caller add various regions to be cached for - // particular font file. Once enumerating that particular font file is done - // (based on uniquely identifying cookie) changes could be committed using - // CommitFontEntry - bool AddRegion(UINT64 cookie, UINT64 start, UINT64 length, const BYTE* ptr) { - base::AutoLock lock(lock_); - if (cookie_map_.find(cookie) == cookie_map_.end()) - return false; - RegionVector& regions = cookie_map_[cookie].get()->regions; - CacheRegion region; - region.start_offset = start; - region.length = length; - region.ptr = ptr; - regions.push_back(region); - return true; - } - - // Function which commits after merging all collected regions into cache file. - bool CommitFontEntry(UINT cookie) { - base::AutoLock lock(lock_); - if (cookie_map_.find(cookie) == cookie_map_.end()) - return false; - - // We will skip writing entries beyond allowed limit. Following condition - // doesn't enforce hard file size. We need to write complete font entry. - int64_t length = static_cache_->GetLength(); - if (length == -1 || length >= kArbitraryCacheFileSizeLimit) { - count_font_entries_ignored_++; - return false; - } - - FontEntryInternal* font_entry = cookie_map_[cookie].get(); - RegionVector& regions = font_entry->regions; - std::sort(regions.begin(), regions.end(), SortCacheRegions); - - // At this point, we have collected all regions to be cached. These regions - // are tuples of start, length, data for particular data segment. - // These tuples can overlap. - // e.g. (0, 12, data), (0, 117, data), (21, 314, data), (335, 15, data) - // In this case as you can see first three segments overlap and - // 4th is adjacent. If we cache them individually then we will end up - // caching duplicate data, so we merge these segments together to find - // superset for the cache. In above example our algorithm should - // produce (cache) single segment starting at offset 0 with length 350. - RegionVector merged_regions; - RegionVector::iterator iter; - int idx = 0; - for (iter = regions.begin(); iter != regions.end(); iter++) { - if (iter == regions.begin()) { - merged_regions.push_back(*iter); - continue; - } - CacheRegion& base_region = merged_regions[idx]; - if (IsOverlap(&base_region, &(*iter))) { - UINT64 end1 = base_region.start_offset + base_region.length; - UINT64 end2 = iter->start_offset + iter->length; - if (base_region.start_offset > iter->start_offset) { - base_region.start_offset = iter->start_offset; - base_region.ptr = iter->ptr; - } - base_region.length = std::max(end1, end2) - base_region.start_offset; - } else { - merged_regions.push_back(*iter); - idx++; - } - } - - UINT64 total_merged_cache_in_bytes = 0; - for (iter = merged_regions.begin(); iter != merged_regions.end(); iter++) { - total_merged_cache_in_bytes += iter->length; - } - - // We want to adjust following parameter based on experiments. But general - // logic here is that if we are going to end up caching most of the contents - // for a file (e.g. simsunb.ttf > 90%) then we should avoid caching that - // file. - double percentile = static_cast<double>(total_merged_cache_in_bytes) / - font_entry->file_size; - if (percentile > kMaxPercentileOfFontFileSizeToCache) { - count_font_entries_ignored_++; - return false; - } - - CacheFileEntry entry; - wcsncpy_s(entry.file_name, kMaxFontFileNameLength, - font_entry->file_name.c_str(), _TRUNCATE); - entry.file_size = font_entry->file_size; - entry.entry_count = merged_regions.size(); - static_cache_->WriteAtCurrentPos( - reinterpret_cast<const char*>(&entry), - sizeof(entry)); - for (iter = merged_regions.begin(); iter != merged_regions.end(); iter++) { - CacheFileOffsetEntry offset_entry; - offset_entry.start_offset = iter->start_offset; - offset_entry.length = iter->length; - static_cache_->WriteAtCurrentPos( - reinterpret_cast<const char*>(&offset_entry), - sizeof(offset_entry)); - static_cache_->WriteAtCurrentPos( - reinterpret_cast<const char*>(iter->ptr), - iter->length); - } - return true; - } - - private: - // This is the count of font entries that we reject based on size to be - // cached. - unsigned int count_font_entries_ignored_; - scoped_ptr<base::File> static_cache_; - std::map<UINT, scoped_ptr<FontEntryInternal>> cookie_map_; - UINT cookie_counter_; - - // Lock is required to protect internal data structures and access to file, - // According to MSDN documentation on ReadFileFragment and based on our - // experiments so far, there is possibility of ReadFileFragment getting called - // from multiple threads. - base::Lock lock_; - - // Function checks if two regions overlap or are adjacent. - bool IsOverlap(CacheRegion* region1, CacheRegion* region2) { - return - !((region1->start_offset + region1->length) < region2->start_offset || - region1->start_offset > (region2->start_offset + region2->length)); - } - - // Function to sort cached regions. - static bool SortCacheRegions(const CacheRegion& region1, - const CacheRegion& region2) { - return - region1.start_offset == region2.start_offset ? - region1.length < region2.length : - region1.start_offset < region2.start_offset; - } - - DISALLOW_COPY_AND_ASSIGN(FontCacheWriter); -}; - -// Class implements IDWriteFontFileStream interface as required by direct write. -class FontFileStream - : public mswr::RuntimeClass<mswr::RuntimeClassFlags<mswr::ClassicCom>, - IDWriteFontFileStream> { - public: - // IDWriteFontFileStream methods. - HRESULT STDMETHODCALLTYPE ReadFileFragment( - void const** fragment_start, - UINT64 file_offset, - UINT64 fragment_size, - void** context) override { - if (cached_data_) { - *fragment_start = g_font_loader->GetCachedFragment(font_key_, - file_offset, - fragment_size); - if (*fragment_start == NULL) { - DCHECK(false); - } - *context = NULL; - return *fragment_start != NULL ? S_OK : E_FAIL; - } - if (!memory_.get() || !memory_->IsValid() || - file_offset >= memory_->length() || - (file_offset + fragment_size) > memory_->length()) - return E_FAIL; - - *fragment_start = static_cast<BYTE const*>(memory_->data()) + - static_cast<size_t>(file_offset); - *context = NULL; - if (g_font_loader->IsBuildStaticCacheMode()) { - FontCacheWriter* cache_writer = g_font_loader->GetFontCacheWriter(); - cache_writer->AddRegion(writer_cookie_, - file_offset, - fragment_size, - static_cast<const BYTE*>(*fragment_start)); - } - return S_OK; - } - - void STDMETHODCALLTYPE ReleaseFileFragment(void* context) override {} - - HRESULT STDMETHODCALLTYPE GetFileSize(UINT64* file_size) override { - if (cached_data_) { - *file_size = g_font_loader->GetCachedFileSize(font_key_); - return S_OK; - } - - if (!memory_.get() || !memory_->IsValid()) - return E_FAIL; - - *file_size = memory_->length(); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetLastWriteTime(UINT64* last_write_time) override { - if (cached_data_) { - *last_write_time = 0; - return S_OK; - } - - if (!memory_.get() || !memory_->IsValid()) - return E_FAIL; - - // According to MSDN article http://goo.gl/rrSYzi the "last modified time" - // is used by DirectWrite font selection algorithms to determine whether - // one font resource is more up to date than another one. - // So by returning 0 we are assuming that it will treat all fonts to be - // equally up to date. - // TODO(shrikant): We should further investigate this. - *last_write_time = 0; - return S_OK; - } - - FontFileStream() : font_key_(0), cached_data_(false) {} - - HRESULT RuntimeClassInitialize(UINT32 font_key) { - if (g_font_loader->InCollectionBuildingMode() && - g_font_loader->IsFileCached(font_key)) { - cached_data_ = true; - font_key_ = font_key; - return S_OK; - } - - base::FilePath path; - PathService::Get(base::DIR_WINDOWS_FONTS, &path); - base::string16 font_key_name(g_font_loader->GetFontNameFromKey(font_key)); - path = path.Append(font_key_name.c_str()); - memory_.reset(new base::MemoryMappedFile()); - - // Put some debug information on stack. - WCHAR font_name[MAX_PATH]; - path.value().copy(font_name, arraysize(font_name)); - base::debug::Alias(font_name); - - if (!memory_->Initialize(path)) { - memory_.reset(); - return E_FAIL; - } - - font_key_ = font_key; - - base::debug::SetCrashKeyValue(kFontKeyName, - base::WideToUTF8(font_key_name)); - - if (g_font_loader->IsBuildStaticCacheMode()) { - FontCacheWriter* cache_writer = g_font_loader->GetFontCacheWriter(); - writer_cookie_ = cache_writer->NewFontEntry(font_key_name.c_str(), - memory_->length()); - } - return S_OK; - } - - ~FontFileStream() override { - if (g_font_loader->IsBuildStaticCacheMode()) { - FontCacheWriter* cache_writer = g_font_loader->GetFontCacheWriter(); - cache_writer->CommitFontEntry(writer_cookie_); - } - } - - private: - UINT32 font_key_; - scoped_ptr<base::MemoryMappedFile> memory_; - bool cached_data_; - UINT writer_cookie_; - - DISALLOW_COPY_AND_ASSIGN(FontFileStream); -}; - -// Implements IDWriteFontFileLoader as required by FontFileLoader. -class FontFileLoader - : public mswr::RuntimeClass<mswr::RuntimeClassFlags<mswr::ClassicCom>, - IDWriteFontFileLoader> { - public: - // IDWriteFontFileLoader methods. - HRESULT STDMETHODCALLTYPE - CreateStreamFromKey(void const* ref_key, - UINT32 ref_key_size, - IDWriteFontFileStream** stream) override { - if (ref_key_size != sizeof(UINT32)) - return E_FAIL; - - UINT32 font_key = *static_cast<const UINT32*>(ref_key); - mswr::ComPtr<FontFileStream> font_stream; - HRESULT hr = mswr::MakeAndInitialize<FontFileStream>(&font_stream, - font_key); - if (SUCCEEDED(hr)) { - *stream = font_stream.Detach(); - return S_OK; - } - return E_FAIL; - } - - FontFileLoader() {} - ~FontFileLoader() override {} - - private: - DISALLOW_COPY_AND_ASSIGN(FontFileLoader); -}; - -// Implements IDWriteFontFileEnumerator as required by direct write. -class FontFileEnumerator - : public mswr::RuntimeClass<mswr::RuntimeClassFlags<mswr::ClassicCom>, - IDWriteFontFileEnumerator> { - public: - // IDWriteFontFileEnumerator methods. - HRESULT STDMETHODCALLTYPE MoveNext(BOOL* has_current_file) override { - *has_current_file = FALSE; - - if (current_file_) - current_file_.ReleaseAndGetAddressOf(); - - if (font_idx_ < g_font_loader->GetFontMapSize()) { - HRESULT hr = - factory_->CreateCustomFontFileReference(&font_idx_, - sizeof(UINT32), - file_loader_.Get(), - current_file_.GetAddressOf()); - DCHECK(SUCCEEDED(hr)); - *has_current_file = TRUE; - font_idx_++; - } - return S_OK; - } - - HRESULT STDMETHODCALLTYPE - GetCurrentFontFile(IDWriteFontFile** font_file) override { - if (!current_file_) { - *font_file = NULL; - return E_FAIL; - } - - *font_file = current_file_.Detach(); - return S_OK; - } - - FontFileEnumerator(const void* keys, - UINT32 buffer_size, - IDWriteFactory* factory, - IDWriteFontFileLoader* file_loader) - : factory_(factory), file_loader_(file_loader), font_idx_(0) {} - - ~FontFileEnumerator() override {} - - mswr::ComPtr<IDWriteFactory> factory_; - mswr::ComPtr<IDWriteFontFile> current_file_; - mswr::ComPtr<IDWriteFontFileLoader> file_loader_; - UINT32 font_idx_; - - private: - DISALLOW_COPY_AND_ASSIGN(FontFileEnumerator); -}; - -// IDWriteFontCollectionLoader methods. -HRESULT STDMETHODCALLTYPE FontCollectionLoader::CreateEnumeratorFromKey( - IDWriteFactory* factory, - void const* key, - UINT32 key_size, - IDWriteFontFileEnumerator** file_enumerator) { - *file_enumerator = mswr::Make<FontFileEnumerator>( - key, key_size, factory, file_loader_.Get()).Detach(); - return S_OK; -} - -// static -HRESULT FontCollectionLoader::Initialize(IDWriteFactory* factory) { - DCHECK(g_font_loader == NULL); - - HRESULT result; - result = mswr::MakeAndInitialize<FontCollectionLoader>(&g_font_loader); - if (FAILED(result) || !g_font_loader) { - DCHECK(false); - return E_FAIL; - } - - CHECK(g_font_loader->LoadFontListFromRegistry()); - - g_font_loader->file_loader_ = mswr::Make<FontFileLoader>().Detach(); - - factory->RegisterFontFileLoader(g_font_loader->file_loader_.Get()); - factory->RegisterFontCollectionLoader(g_font_loader.Get()); - - return S_OK; -} - -FontCollectionLoader::~FontCollectionLoader() { - STLDeleteContainerPairSecondPointers(cache_map_.begin(), cache_map_.end()); -} - -UINT32 FontCollectionLoader::GetFontMapSize() { - return reg_fonts_.size(); -} - -base::string16 FontCollectionLoader::GetFontNameFromKey(UINT32 idx) { - DCHECK(idx < reg_fonts_.size()); - return reg_fonts_[idx]; -} - -const base::FilePath::CharType* kFontExtensionsToIgnore[] { - FILE_PATH_LITERAL(".FON"), // Bitmap or vector - FILE_PATH_LITERAL(".PFM"), // Adobe Type 1 - FILE_PATH_LITERAL(".PFB"), // Adobe Type 1 -}; - -const wchar_t* kFontsToIgnore[] = { - // "Gill Sans Ultra Bold" turns into an Ultra Bold weight "Gill Sans" in - // DirectWrite, but most users don't have any other weights. The regular - // weight font is named "Gill Sans MT", but that ends up in a different - // family with that name. On Mac, there's a "Gill Sans" with various weights, - // so CSS authors use { 'font-family': 'Gill Sans', 'Gill Sans MT', ... } and - // because of the DirectWrite family futzing, they end up with an Ultra Bold - // font, when they just wanted "Gill Sans". Mozilla implemented a more - // complicated hack where they effectively rename the Ultra Bold font to - // "Gill Sans MT Ultra Bold", but because the Ultra Bold font is so ugly - // anyway, we simply ignore it. See - // http://www.microsoft.com/typography/fonts/font.aspx?FMID=978 for a picture - // of the font, and the file name. We also ignore "Gill Sans Ultra Bold - // Condensed". - L"gilsanub.ttf", - L"gillubcd.ttf", -}; - -bool FontCollectionLoader::LoadFontListFromRegistry() { - const wchar_t kFontsRegistry[] = - L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"; - CHECK(reg_fonts_.empty()); - base::win::RegKey regkey; - if (regkey.Open(HKEY_LOCAL_MACHINE, kFontsRegistry, KEY_READ) != - ERROR_SUCCESS) { - return false; - } - - base::FilePath system_font_path; - PathService::Get(base::DIR_WINDOWS_FONTS, &system_font_path); - - base::string16 name; - base::string16 value; - for (DWORD idx = 0; idx < regkey.GetValueCount(); idx++) { - if (regkey.GetValueNameAt(idx, &name) == ERROR_SUCCESS && - regkey.ReadValue(name.c_str(), &value) == ERROR_SUCCESS) { - base::FilePath path(value.c_str()); - // We need to check if path in registry is absolute, if it is then - // we check if it is same as DIR_WINDOWS_FONTS otherwise we ignore. - bool absolute = path.IsAbsolute(); - if (absolute && - !base::FilePath::CompareEqualIgnoreCase(system_font_path.value(), - path.DirName().value())) { - continue; - } - - // Ignore if path ends with a separator. - if (path.EndsWithSeparator()) - continue; - - if (absolute) - value = path.BaseName().value(); - - bool should_ignore = false; - for (const auto& ignore : kFontsToIgnore) { - if (base::FilePath::CompareEqualIgnoreCase(value, ignore)) { - should_ignore = true; - break; - } - } - // DirectWrite doesn't support bitmap/vector fonts and Adobe type 1 - // fonts, we will ignore those font extensions. - // MSDN article: http://goo.gl/TfCOA - if (!should_ignore) { - for (const auto& ignore : kFontExtensionsToIgnore) { - if (path.MatchesExtension(ignore)) { - should_ignore = true; - break; - } - } - } - - if (!should_ignore) - reg_fonts_.push_back(value.c_str()); - } - } - UMA_HISTOGRAM_COUNTS("DirectWrite.Fonts.Loaded", reg_fonts_.size()); - UMA_HISTOGRAM_COUNTS("DirectWrite.Fonts.Ignored", - regkey.GetValueCount() - reg_fonts_.size()); - return true; -} - -// This list is mainly based on prefs/prefs_tab_helper.cc kFontDefaults. -const wchar_t* kRestrictedFontSet[] = { - // These are the "Web Safe" fonts. - L"times.ttf", // IDS_STANDARD_FONT_FAMILY - L"timesbd.ttf", // IDS_STANDARD_FONT_FAMILY - L"timesbi.ttf", // IDS_STANDARD_FONT_FAMILY - L"timesi.ttf", // IDS_STANDARD_FONT_FAMILY - L"cour.ttf", // IDS_FIXED_FONT_FAMILY - L"courbd.ttf", // IDS_FIXED_FONT_FAMILY - L"courbi.ttf", // IDS_FIXED_FONT_FAMILY - L"couri.ttf", // IDS_FIXED_FONT_FAMILY - L"consola.ttf", // IDS_FIXED_FONT_FAMILY_ALT_WIN - L"consolab.ttf", // IDS_FIXED_FONT_FAMILY_ALT_WIN - L"consolai.ttf", // IDS_FIXED_FONT_FAMILY_ALT_WIN - L"consolaz.ttf", // IDS_FIXED_FONT_FAMILY_ALT_WIN - L"arial.ttf", // IDS_SANS_SERIF_FONT_FAMILY - L"arialbd.ttf", // IDS_SANS_SERIF_FONT_FAMILY - L"arialbi.ttf", // IDS_SANS_SERIF_FONT_FAMILY - L"ariali.ttf", // IDS_SANS_SERIF_FONT_FAMILY - L"comic.ttf", // IDS_CURSIVE_FONT_FAMILY - L"comicbd.ttf", // IDS_CURSIVE_FONT_FAMILY - L"comici.ttf", // IDS_CURSIVE_FONT_FAMILY - L"comicz.ttf", // IDS_CURSIVE_FONT_FAMILY - L"impact.ttf", // IDS_FANTASY_FONT_FAMILY - L"georgia.ttf", - L"georgiab.ttf", - L"georgiai.ttf", - L"georgiaz.ttf", - L"trebuc.ttf", - L"trebucbd.ttf", - L"trebucbi.ttf", - L"trebucit.ttf", - L"verdana.ttf", - L"verdanab.ttf", - L"verdanai.ttf", - L"verdanaz.ttf", - L"segoeui.ttf", // IDS_PICTOGRAPH_FONT_FAMILY - L"segoeuib.ttf", // IDS_PICTOGRAPH_FONT_FAMILY - L"segoeuii.ttf", // IDS_PICTOGRAPH_FONT_FAMILY - L"msgothic.ttc", // IDS_STANDARD_FONT_FAMILY_JAPANESE - L"msmincho.ttc", // IDS_SERIF_FONT_FAMILY_JAPANESE - L"gulim.ttc", // IDS_FIXED_FONT_FAMILY_KOREAN - L"batang.ttc", // IDS_SERIF_FONT_FAMILY_KOREAN - L"simsun.ttc", // IDS_STANDARD_FONT_FAMILY_SIMPLIFIED_HAN - L"mingliu.ttc", // IDS_SERIF_FONT_FAMILY_TRADITIONAL_HAN - - // These are from the Blink fallback list. - L"david.ttf", // USCRIPT_HEBREW - L"davidbd.ttf", // USCRIPT_HEBREW - L"euphemia.ttf", // USCRIPT_CANADIAN_ABORIGINAL - L"gautami.ttf", // USCRIPT_TELUGU - L"gautamib.ttf", // USCRIPT_TELUGU - L"latha.ttf", // USCRIPT_TAMIL - L"lathab.ttf", // USCRIPT_TAMIL - L"mangal.ttf", // USCRIPT_DEVANAGARI - L"mangalb.ttf", // USCRIPT_DEVANAGARI - L"monbaiti.ttf", // USCRIPT_MONGOLIAN - L"mvboli.ttf", // USCRIPT_THAANA - L"plantc.ttf", // USCRIPT_CHEROKEE - L"raavi.ttf", // USCRIPT_GURMUKHI - L"raavib.ttf", // USCRIPT_GURMUKHI - L"shruti.ttf", // USCRIPT_GUJARATI - L"shrutib.ttf", // USCRIPT_GUJARATI - L"sylfaen.ttf", // USCRIPT_GEORGIAN and USCRIPT_ARMENIAN - L"tahoma.ttf", // USCRIPT_ARABIC, - L"tahomabd.ttf", // USCRIPT_ARABIC, - L"tunga.ttf", // USCRIPT_KANNADA - L"tungab.ttf", // USCRIPT_KANNADA - L"vrinda.ttf", // USCRIPT_BENGALI - L"vrindab.ttf", // USCRIPT_BENGALI -}; - -bool FontCollectionLoader::LoadRestrictedFontList() { - reg_fonts_.clear(); - reg_fonts_.assign(kRestrictedFontSet, - kRestrictedFontSet + _countof(kRestrictedFontSet)); - return true; -} - -void FontCollectionLoader::EnableCollectionBuildingMode(bool enable) { - in_collection_building_mode_ = enable; -} - -bool FontCollectionLoader::InCollectionBuildingMode() { - return in_collection_building_mode_; -} - -bool FontCollectionLoader::IsFileCached(UINT32 font_key) { - if (!cache_.get() || cache_->memory() == NULL) { - return false; - } - CacheMap::iterator iter = cache_map_.find( - GetFontNameFromKey(font_key).c_str()); - return iter != cache_map_.end(); -} - -bool FontCollectionLoader::LoadCacheFile() { - TRACE_EVENT0("startup", "FontCollectionLoader::LoadCacheFile"); - - std::string font_cache_handle_string = - base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - switches::kFontCacheSharedHandle); - if (font_cache_handle_string.empty()) - return false; - - unsigned int handle_uint; - base::StringToUint(font_cache_handle_string, &handle_uint); - DCHECK(handle_uint); - if (handle_uint > static_cast<unsigned int>(std::numeric_limits<long>::max())) - return false; - base::SharedMemoryHandle font_cache_handle(LongToHandle(handle_uint), - base::GetCurrentProcId()); - - base::SharedMemory* shared_mem = new base::SharedMemory( - font_cache_handle, true); - // Map the cache file into memory. - shared_mem->Map(0); - - cache_.reset(shared_mem); - - if (base::StartsWith(base::FieldTrialList::FindFullName("LightSpeed"), - "PrefetchDWriteFontCache", - base::CompareCase::SENSITIVE)) { - // Prefetch the cache, to avoid unordered IO when it is used. - // PrefetchVirtualMemory() is loaded dynamically because it is only - // available from Win8. - decltype(PrefetchVirtualMemory)* prefetch_virtual_memory = - reinterpret_cast<decltype(PrefetchVirtualMemory)*>(::GetProcAddress( - ::GetModuleHandle(L"kernel32.dll"), "PrefetchVirtualMemory")); - if (prefetch_virtual_memory != NULL) { - WIN32_MEMORY_RANGE_ENTRY memory_range; - memory_range.VirtualAddress = shared_mem->memory(); - memory_range.NumberOfBytes = shared_mem->mapped_size(); - prefetch_virtual_memory(::GetCurrentProcess(), 1, &memory_range, 0); - } - } - - if (!ValidateAndLoadCacheMap()) { - cache_.reset(); - return false; - } - - return true; -} - -void FontCollectionLoader::UnloadCacheFile() { - cache_.reset(); - STLDeleteContainerPairSecondPointers(cache_map_.begin(), cache_map_.end()); - cache_map_.clear(); -} - -void FontCollectionLoader::EnterStaticCacheMode(const WCHAR* file_name) { - cache_writer_.reset(new FontCacheWriter()); - if (cache_writer_->Create(file_name)) - create_static_cache_ = true; -} - -void FontCollectionLoader::LeaveStaticCacheMode() { - cache_writer_->Close(); - cache_writer_.reset(NULL); - create_static_cache_ = false; -} - -bool FontCollectionLoader::IsBuildStaticCacheMode() { - return create_static_cache_; -} - -bool FontCollectionLoader::ValidateAndLoadCacheMap() { - BYTE* mem_file_start = static_cast<BYTE*>(cache_->memory()); - BYTE* mem_file_end = mem_file_start + cache_->mapped_size(); - - BYTE* current_ptr = mem_file_start; - CacheFileHeader* file_header = - reinterpret_cast<CacheFileHeader*>(current_ptr); - if (!ValidateFontCacheHeader(file_header)) - return false; - - current_ptr = current_ptr + sizeof(CacheFileHeader); - if (current_ptr >= mem_file_end) - return false; - - while ((current_ptr + sizeof(CacheFileEntry)) < mem_file_end) { - CacheFileEntry* entry = reinterpret_cast<CacheFileEntry*>(current_ptr); - current_ptr += sizeof(CacheFileEntry); - WCHAR file_name[kMaxFontFileNameLength]; - wcsncpy_s(file_name, - kMaxFontFileNameLength, - entry->file_name, - _TRUNCATE); - CacheTableEntry* table_entry = NULL; - CacheMap::iterator iter = cache_map_.find(file_name); - if (iter == cache_map_.end()) { - table_entry = new CacheTableEntry(); - cache_map_[file_name] = table_entry; - } else { - table_entry = iter->second; - } - table_entry->file_size = entry->file_size; - for (DWORD idx = 0; - (current_ptr + sizeof(CacheFileOffsetEntry)) < mem_file_end && - idx < entry->entry_count; - idx++) { - CacheFileOffsetEntry* offset_entry = - reinterpret_cast<CacheFileOffsetEntry*>(current_ptr); - CacheTableOffsetEntry table_offset_entry; - table_offset_entry.start_offset = offset_entry->start_offset; - table_offset_entry.length = offset_entry->length; - table_offset_entry.inside_file_ptr = - current_ptr + sizeof(CacheFileOffsetEntry); - table_entry->offset_entries.push_back(table_offset_entry); - current_ptr += sizeof(CacheFileOffsetEntry); - current_ptr += offset_entry->length; - } - } - - return true; -} - -void* FontCollectionLoader::GetCachedFragment(UINT32 font_key, - UINT64 start_offset, - UINT64 length) { - UINT64 just_past_end = start_offset + length; - CacheMap::iterator iter = cache_map_.find( - GetFontNameFromKey(font_key).c_str()); - if (iter != cache_map_.end()) { - CacheTableEntry* entry = iter->second; - OffsetVector::iterator offset_iter = entry->offset_entries.begin(); - while (offset_iter != entry->offset_entries.end()) { - UINT64 available_just_past_end = - offset_iter->start_offset + offset_iter->length; - if (offset_iter->start_offset <= start_offset && - just_past_end <= available_just_past_end) { - return offset_iter->inside_file_ptr + - (start_offset - offset_iter->start_offset); - } - offset_iter++; - } - } - return NULL; -} - -UINT64 FontCollectionLoader::GetCachedFileSize(UINT32 font_key) { - CacheMap::iterator iter = cache_map_.find( - GetFontNameFromKey(font_key).c_str()); - if (iter != cache_map_.end()) { - return iter->second->file_size; - } - return 0; -} - -FontCacheWriter* FontCollectionLoader::GetFontCacheWriter() { - return cache_writer_.get(); -} - -} // namespace - -namespace content { - -const char kFontCacheSharedSectionName[] = "ChromeDWriteFontCache"; - -mswr::ComPtr<IDWriteFontCollection> g_font_collection; - -IDWriteFontCollection* GetCustomFontCollection(IDWriteFactory* factory) { - if (g_font_collection.Get() != NULL) - return g_font_collection.Get(); - - TRACE_EVENT0("startup", "content::GetCustomFontCollection"); - - base::TimeTicks start_tick = base::TimeTicks::Now(); - - FontCollectionLoader::Initialize(factory); - - bool cache_file_loaded = g_font_loader->LoadCacheFile(); - - // Arbitrary threshold to stop loading enormous number of fonts. Usual - // side effect of loading large number of fonts results in renderer getting - // killed as it appears to hang. - const UINT32 kMaxFontThreshold = 1750; - HRESULT hr = E_FAIL; - if (cache_file_loaded || - g_font_loader->GetFontMapSize() < kMaxFontThreshold) { - g_font_loader->EnableCollectionBuildingMode(true); - hr = factory->CreateCustomFontCollection( - g_font_loader.Get(), NULL, 0, g_font_collection.GetAddressOf()); - g_font_loader->UnloadCacheFile(); - g_font_loader->EnableCollectionBuildingMode(false); - } - bool loading_restricted = false; - if (FAILED(hr) || !g_font_collection.Get()) { - loading_restricted = true; - // We will try here just one more time with restricted font set. - g_font_loader->LoadRestrictedFontList(); - hr = factory->CreateCustomFontCollection( - g_font_loader.Get(), NULL, 0, g_font_collection.GetAddressOf()); - } - - base::TimeDelta time_delta = base::TimeTicks::Now() - start_tick; - int64_t delta = time_delta.ToInternalValue(); - base::debug::Alias(&delta); - UINT32 size = g_font_loader->GetFontMapSize(); - base::debug::Alias(&size); - base::debug::Alias(&loading_restricted); - - CHECK(SUCCEEDED(hr)); - CHECK(g_font_collection.Get() != NULL); - - if (cache_file_loaded) - UMA_HISTOGRAM_TIMES("DirectWrite.Fonts.LoadTime.Cached", time_delta); - else - UMA_HISTOGRAM_TIMES("DirectWrite.Fonts.LoadTime", time_delta); - - base::debug::ClearCrashKey(kFontKeyName); - - return g_font_collection.Get(); -} - -bool BuildFontCacheInternal(const WCHAR* file_name) { - typedef decltype(DWriteCreateFactory)* DWriteCreateFactoryProc; - HMODULE dwrite_dll = LoadLibraryW(L"dwrite.dll"); - if (!dwrite_dll) { - DWORD load_library_get_last_error = GetLastError(); - base::debug::Alias(&dwrite_dll); - base::debug::Alias(&load_library_get_last_error); - CHECK(false); - } - - DWriteCreateFactoryProc dwrite_create_factory_proc = - reinterpret_cast<DWriteCreateFactoryProc>( - GetProcAddress(dwrite_dll, "DWriteCreateFactory")); - - if (!dwrite_create_factory_proc) { - DWORD get_proc_address_get_last_error = GetLastError(); - base::debug::Alias(&dwrite_create_factory_proc); - base::debug::Alias(&get_proc_address_get_last_error); - CHECK(false); - } - - mswr::ComPtr<IDWriteFactory> factory; - - CHECK(SUCCEEDED( - dwrite_create_factory_proc( - DWRITE_FACTORY_TYPE_ISOLATED, - __uuidof(IDWriteFactory), - reinterpret_cast<IUnknown**>(factory.GetAddressOf())))); - - base::TimeTicks start_tick = base::TimeTicks::Now(); - - FontCollectionLoader::Initialize(factory.Get()); - - g_font_loader->EnterStaticCacheMode(file_name); - - mswr::ComPtr<IDWriteFontCollection> font_collection; - - HRESULT hr = E_FAIL; - g_font_loader->EnableCollectionBuildingMode(true); - hr = factory->CreateCustomFontCollection( - g_font_loader.Get(), NULL, 0, font_collection.GetAddressOf()); - g_font_loader->EnableCollectionBuildingMode(false); - - bool loading_restricted = false; - if (FAILED(hr) || !font_collection.Get()) { - loading_restricted = true; - // We will try here just one more time with restricted font set. - g_font_loader->LoadRestrictedFontList(); - hr = factory->CreateCustomFontCollection( - g_font_loader.Get(), NULL, 0, font_collection.GetAddressOf()); - } - - g_font_loader->LeaveStaticCacheMode(); - - base::TimeDelta time_delta = base::TimeTicks::Now() - start_tick; - int64_t delta = time_delta.ToInternalValue(); - base::debug::Alias(&delta); - UINT32 size = g_font_loader->GetFontMapSize(); - base::debug::Alias(&size); - base::debug::Alias(&loading_restricted); - - CHECK(SUCCEEDED(hr)); - CHECK(font_collection.Get() != NULL); - - base::debug::ClearCrashKey(kFontKeyName); - - return true; -} - -bool ValidateFontCacheFile(base::File* file) { - DCHECK(file != NULL); - CacheFileHeader file_header; - if (file->Read(0, reinterpret_cast<char*>(&file_header), sizeof(file_header)) - == -1) { - return false; - } - return ValidateFontCacheHeader(&file_header); -} - -bool LoadFontCache(const base::FilePath& path) { - scoped_ptr<base::File> file(new base::File(path, - base::File::FLAG_OPEN | base::File::FLAG_READ)); - if (!file->IsValid()) - return false; - - if (!ValidateFontCacheFile(file.get())) - return false; - - base::string16 name(base::ASCIIToUTF16(content::kFontCacheSharedSectionName)); - name.append(base::UintToString16(base::GetCurrentProcId())); - HANDLE mapping = ::CreateFileMapping( - file->GetPlatformFile(), - NULL, - PAGE_READONLY, - 0, - 0, - name.c_str()); - if (mapping == INVALID_HANDLE_VALUE) - return false; - - if (::GetLastError() == ERROR_ALREADY_EXISTS) { - CloseHandle(mapping); - // We crash here, as no one should have created this mapping except Chrome. - CHECK(false); - return false; - } - - DCHECK(!g_shared_font_cache.IsValid()); - g_shared_font_cache.Set(mapping); - - return true; -} - -bool BuildFontCache(const base::FilePath& file) { - return BuildFontCacheInternal(file.value().c_str()); -} - -bool ShouldUseDirectWriteFontProxyFieldTrial() { - return base::StartsWith( - base::FieldTrialList::FindFullName("DirectWriteFontProxy"), - "UseDirectWriteFontProxy", base::CompareCase::SENSITIVE); -} - -} // namespace content
diff --git a/content/common/dwrite_font_platform_win_unittest.cc b/content/common/dwrite_font_platform_win_unittest.cc deleted file mode 100644 index 4e517fee..0000000 --- a/content/common/dwrite_font_platform_win_unittest.cc +++ /dev/null
@@ -1,71 +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. - -#include "content/public/common/dwrite_font_platform_win.h" - -#include "base/files/file_util.h" -#include "base/files/scoped_temp_dir.h" -#include "base/logging.h" -#include "base/path_service.h" -#include "content/public/common/content_paths.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "ui/gfx/win/direct_write.h" - -namespace content { - -class DWriteFontCacheTest : public testing::Test { - public: - DWriteFontCacheTest() { } - - void SetUp() override { - base::FilePath data_path; - ASSERT_TRUE(PathService::Get(content::DIR_TEST_DATA, &data_path)); - arial_cache_path_ = - data_path.AppendASCII("font/dwrite_font_cache_arial.dat"); - - corrupt_cache_path_ = - data_path.AppendASCII("font/dwrite_font_cache_corrupt.dat"); - - ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - cache_file_path_ = temp_dir_.path().AppendASCII("dwrite_font_cache.dat"); - } - - protected: - base::FilePath arial_cache_path_; - base::FilePath corrupt_cache_path_; - base::ScopedTempDir temp_dir_; - base::FilePath cache_file_path_; -}; - -TEST_F(DWriteFontCacheTest, BuildCacheTest) { - if (gfx::win::ShouldUseDirectWrite()) { - DLOG(INFO) << __FUNCTION__ << ": " << cache_file_path_.value().c_str(); - EXPECT_TRUE(BuildFontCache(cache_file_path_)); - ASSERT_TRUE(base::PathExists(cache_file_path_)); - } -} - -TEST_F(DWriteFontCacheTest, ValidCacheTest) { - if (gfx::win::ShouldUseDirectWrite()) { - DLOG(INFO) << __FUNCTION__ << ": " << arial_cache_path_.value().c_str(); - scoped_ptr<base::File> file(new base::File(arial_cache_path_, - base::File::FLAG_OPEN | base::File::FLAG_READ)); - ASSERT_TRUE(file->IsValid()); - - EXPECT_TRUE(ValidateFontCacheFile(file.get())); - } -} - -TEST_F(DWriteFontCacheTest, CorruptCacheTest) { - if (gfx::win::ShouldUseDirectWrite()) { - DLOG(INFO) << __FUNCTION__ << ": " << corrupt_cache_path_.value().c_str(); - scoped_ptr<base::File> file(new base::File(corrupt_cache_path_, - base::File::FLAG_OPEN | base::File::FLAG_READ)); - ASSERT_TRUE(file->IsValid()); - - EXPECT_FALSE(ValidateFontCacheFile(file.get())); - } -} - -} // content
diff --git a/content/common/font_config_ipc_linux.cc b/content/common/font_config_ipc_linux.cc index bc216c0..294bcf8 100644 --- a/content/common/font_config_ipc_linux.cc +++ b/content/common/font_config_ipc_linux.cc
@@ -18,6 +18,7 @@ #include "base/files/file_util.h" #include "base/files/memory_mapped_file.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/pickle.h" #include "base/posix/unix_domain_socket_linux.h" #include "base/threading/thread_restrictions.h"
diff --git a/content/common/frame_message_enums.h b/content/common/frame_message_enums.h index b9312060..27e98433c 100644 --- a/content/common/frame_message_enums.h +++ b/content/common/frame_message_enums.h
@@ -10,11 +10,11 @@ struct FrameMsg_Navigate_Type { public: enum Value { - // Reload the page. + // Reload the page, validating cache entries. RELOAD, - // Reload the page, ignoring any cache entries. - RELOAD_IGNORING_CACHE, + // Reload the page, bypassing any cache entries. + RELOAD_BYPASSING_CACHE, // Reload the page using the original request URL. RELOAD_ORIGINAL_REQUEST_URL,
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator_win.cc b/content/common/gpu/media/dxva_video_decode_accelerator_win.cc index b58a6c2e..c15d7db9 100644 --- a/content/common/gpu/media/dxva_video_decode_accelerator_win.cc +++ b/content/common/gpu/media/dxva_video_decode_accelerator_win.cc
@@ -111,6 +111,11 @@ DEFINE_GUID(MF_XVP_PLAYBACK_MODE, 0x3c5d293f, 0xad67, 0x4e29, 0xaf, 0x12, 0xcf, 0x3e, 0x23, 0x8a, 0xcc, 0xe9); +// Defines the GUID for the Intel H264 DXVA device. +static const GUID DXVA2_Intel_ModeH264_E = { + 0x604F8E68, 0x4951, 0x4c54,{ 0x88, 0xFE, 0xAB, 0xD2, 0x5C, 0x15, 0xB3, 0xD6} +}; + // Provides scoped access to the underlying buffer in an IMFMediaBuffer // instance. class MediaBufferScopedPointer { @@ -320,50 +325,75 @@ base::win::ScopedComPtr<T> QueryDeviceObjectFromANGLE(int object_type) { base::win::ScopedComPtr<T> device_object; - EGLDisplay egl_display = gfx::GLSurfaceEGL::GetHardwareDisplay(); + EGLDisplay egl_display = nullptr; intptr_t egl_device = 0; intptr_t device = 0; + { + TRACE_EVENT0("gpu", "QueryDeviceObjectFromANGLE. GetHardwareDisplay"); + egl_display = gfx::GLSurfaceEGL::GetHardwareDisplay(); + } + RETURN_ON_FAILURE( gfx::GLSurfaceEGL::HasEGLExtension("EGL_EXT_device_query"), "EGL_EXT_device_query missing", device_object); - PFNEGLQUERYDISPLAYATTRIBEXTPROC QueryDisplayAttribEXT = - reinterpret_cast<PFNEGLQUERYDISPLAYATTRIBEXTPROC>(eglGetProcAddress( - "eglQueryDisplayAttribEXT")); + PFNEGLQUERYDISPLAYATTRIBEXTPROC QueryDisplayAttribEXT = nullptr; - RETURN_ON_FAILURE( - QueryDisplayAttribEXT, - "Failed to get the eglQueryDisplayAttribEXT function from ANGLE", - device_object); + { + TRACE_EVENT0("gpu", "QueryDeviceObjectFromANGLE. eglGetProcAddress"); - PFNEGLQUERYDEVICEATTRIBEXTPROC QueryDeviceAttribEXT = - reinterpret_cast<PFNEGLQUERYDEVICEATTRIBEXTPROC>(eglGetProcAddress( - "eglQueryDeviceAttribEXT")); + QueryDisplayAttribEXT = + reinterpret_cast<PFNEGLQUERYDISPLAYATTRIBEXTPROC>(eglGetProcAddress( + "eglQueryDisplayAttribEXT")); - RETURN_ON_FAILURE( - QueryDeviceAttribEXT, - "Failed to get the eglQueryDeviceAttribEXT function from ANGLE", - device_object); + RETURN_ON_FAILURE( + QueryDisplayAttribEXT, + "Failed to get the eglQueryDisplayAttribEXT function from ANGLE", + device_object); + } - RETURN_ON_FAILURE( - QueryDisplayAttribEXT(egl_display, EGL_DEVICE_EXT, &egl_device), - "The eglQueryDisplayAttribEXT function failed to get the EGL device", - device_object); + PFNEGLQUERYDEVICEATTRIBEXTPROC QueryDeviceAttribEXT = nullptr; + + { + TRACE_EVENT0("gpu", "QueryDeviceObjectFromANGLE. eglGetProcAddress"); + + QueryDeviceAttribEXT = + reinterpret_cast<PFNEGLQUERYDEVICEATTRIBEXTPROC>(eglGetProcAddress( + "eglQueryDeviceAttribEXT")); + + RETURN_ON_FAILURE( + QueryDeviceAttribEXT, + "Failed to get the eglQueryDeviceAttribEXT function from ANGLE", + device_object); + } + + { + TRACE_EVENT0("gpu", "QueryDeviceObjectFromANGLE. QueryDisplayAttribEXT"); + + RETURN_ON_FAILURE( + QueryDisplayAttribEXT(egl_display, EGL_DEVICE_EXT, &egl_device), + "The eglQueryDisplayAttribEXT function failed to get the EGL device", + device_object); + } RETURN_ON_FAILURE( egl_device, "Failed to get the EGL device", device_object); - RETURN_ON_FAILURE( - QueryDeviceAttribEXT( - reinterpret_cast<EGLDeviceEXT>(egl_device), object_type, &device), - "The eglQueryDeviceAttribEXT function failed to get the device", - device_object); + { + TRACE_EVENT0("gpu", "QueryDeviceObjectFromANGLE. QueryDisplayAttribEXT"); - RETURN_ON_FAILURE(device, "Failed to get the ANGLE device", device_object); + RETURN_ON_FAILURE( + QueryDeviceAttribEXT( + reinterpret_cast<EGLDeviceEXT>(egl_device), object_type, &device), + "The eglQueryDeviceAttribEXT function failed to get the device", + device_object); + + RETURN_ON_FAILURE(device, "Failed to get the ANGLE device", device_object); + } device_object = reinterpret_cast<T*>(device); return device_object; @@ -1345,17 +1375,19 @@ // static media::VideoDecodeAccelerator::SupportedProfiles DXVAVideoDecodeAccelerator::GetSupportedProfiles() { + TRACE_EVENT0("gpu,startup", + "DXVAVideoDecodeAccelerator::GetSupportedProfiles"); + // TODO(henryhsu): Need to ensure the profiles are actually supported. SupportedProfiles profiles; for (const auto& supported_profile : kSupportedProfiles) { + std::pair<int, int> min_resolution = GetMinResolution(supported_profile); + std::pair<int, int> max_resolution = GetMaxResolution(supported_profile); + SupportedProfile profile; profile.profile = supported_profile; - // Windows Media Foundation H.264 decoding does not support decoding videos - // with any dimension smaller than 48 pixels: - // http://msdn.microsoft.com/en-us/library/windows/desktop/dd797815 - profile.min_resolution.SetSize(48, 48); - // Use 1088 to account for 16x16 macroblocks. - profile.max_resolution.SetSize(1920, 1088); + profile.min_resolution.SetSize(min_resolution.first, min_resolution.second); + profile.max_resolution.SetSize(max_resolution.first, max_resolution.second); profiles.push_back(profile); } return profiles; @@ -1377,6 +1409,150 @@ } } +// static +std::pair<int, int> DXVAVideoDecodeAccelerator::GetMinResolution( + media::VideoCodecProfile profile) { + TRACE_EVENT0("gpu,startup", + "DXVAVideoDecodeAccelerator::GetMinResolution"); + std::pair<int, int> min_resolution; + if (profile >= media::H264PROFILE_BASELINE && + profile <= media::H264PROFILE_HIGH) { + // Windows Media Foundation H.264 decoding does not support decoding videos + // with any dimension smaller than 48 pixels: + // http://msdn.microsoft.com/en-us/library/windows/desktop/dd797815 + min_resolution = std::make_pair(48, 48); + } else { + // TODO(ananta) + // Detect this properly for VP8/VP9 profiles. + min_resolution = std::make_pair(16, 16); + } + return min_resolution; +} + +// static +std::pair<int, int> DXVAVideoDecodeAccelerator::GetMaxResolution( + const media::VideoCodecProfile profile) { + TRACE_EVENT0("gpu,startup", + "DXVAVideoDecodeAccelerator::GetMaxResolution"); + std::pair<int, int> max_resolution; + if (profile >= media::H264PROFILE_BASELINE && + profile <= media::H264PROFILE_HIGH) { + max_resolution = GetMaxH264Resolution(); + } else { + // TODO(ananta) + // Detect this properly for VP8/VP9 profiles. + max_resolution = std::make_pair(4096, 2160); + } + return max_resolution; +} + +std::pair<int, int> DXVAVideoDecodeAccelerator::GetMaxH264Resolution() { + TRACE_EVENT0("gpu,startup", + "DXVAVideoDecodeAccelerator::GetMaxH264Resolution"); + // The H.264 resolution detection operation is expensive. This static flag + // allows us to run the detection once. + static bool resolution_detected = false; + // Use 1088 to account for 16x16 macroblocks. + static std::pair<int, int> max_resolution = std::make_pair(1920, 1088); + if (resolution_detected) + return max_resolution; + + resolution_detected = true; + + // On Windows 7 the maximum resolution supported by media foundation is + // 1920 x 1088. + if (base::win::GetVersion() == base::win::VERSION_WIN7) + return max_resolution; + + // To detect if a driver supports the desired resolutions, we try and create + // a DXVA decoder instance for that resolution and profile. If that succeeds + // we assume that the driver supports H/W H.264 decoding for that resolution. + HRESULT hr = E_FAIL; + base::win::ScopedComPtr<ID3D11Device> device; + + { + TRACE_EVENT0("gpu,startup", + "GetMaxH264Resolution. QueryDeviceObjectFromANGLE"); + + device = QueryDeviceObjectFromANGLE<ID3D11Device>(EGL_D3D11_DEVICE_ANGLE); + if (!device.get()) + return max_resolution; + } + + base::win::ScopedComPtr<ID3D11VideoDevice> video_device; + hr = device.QueryInterface(IID_ID3D11VideoDevice, + video_device.ReceiveVoid()); + if (FAILED(hr)) + return max_resolution; + + GUID decoder_guid = {}; + + { + TRACE_EVENT0("gpu,startup", + "GetMaxH264Resolution. H.264 guid search begin"); + // Enumerate supported video profiles and look for the H264 profile. + bool found = false; + UINT profile_count = video_device->GetVideoDecoderProfileCount(); + for (UINT profile_idx = 0; profile_idx < profile_count; profile_idx++) { + GUID profile_id = {}; + hr = video_device->GetVideoDecoderProfile(profile_idx, &profile_id); + if (SUCCEEDED(hr) && + (profile_id == DXVA2_ModeH264_E || + profile_id == DXVA2_Intel_ModeH264_E)) { + decoder_guid = profile_id; + found = true; + break; + } + } + if (!found) + return max_resolution; + } + + // We look for the following resolutions in the driver. + // TODO(ananta) + // Look into whether this list needs to be expanded. + static std::pair<int, int> resolution_array[] = { + // Use 1088 to account for 16x16 macroblocks. + std::make_pair(1920, 1088), + std::make_pair(2560, 1440), + std::make_pair(3840, 2160), + std::make_pair(4096, 2160), + std::make_pair(4096, 2304), + }; + + { + TRACE_EVENT0("gpu,startup", + "GetMaxH264Resolution. Resolution search begin"); + + for (size_t res_idx = 0; res_idx < arraysize(resolution_array); + res_idx++) { + D3D11_VIDEO_DECODER_DESC desc = {}; + desc.Guid = decoder_guid; + desc.SampleWidth = resolution_array[res_idx].first; + desc.SampleHeight = resolution_array[res_idx].second; + desc.OutputFormat = DXGI_FORMAT_NV12; + UINT config_count = 0; + hr = video_device->GetVideoDecoderConfigCount(&desc, &config_count); + if (FAILED(hr) || config_count == 0) + return max_resolution; + + D3D11_VIDEO_DECODER_CONFIG config = {}; + hr = video_device->GetVideoDecoderConfig(&desc, 0, &config); + if (FAILED(hr)) + return max_resolution; + + base::win::ScopedComPtr<ID3D11VideoDecoder> video_decoder; + hr = video_device->CreateVideoDecoder(&desc, &config, + video_decoder.Receive()); + if (!video_decoder.get()) + return max_resolution; + + max_resolution = resolution_array[res_idx]; + } + } + return max_resolution; +} + bool DXVAVideoDecodeAccelerator::InitDecoder(media::VideoCodecProfile profile) { HMODULE decoder_dll = NULL; @@ -1744,7 +1920,6 @@ PendingSampleInfo* pending_sample = NULL; { base::AutoLock lock(decoder_lock_); - PendingSampleInfo& sample_info = pending_output_samples_.front(); if (sample_info.picture_buffer_id != -1) continue;
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator_win.h b/content/common/gpu/media/dxva_video_decode_accelerator_win.h index 950eda5a..0158e74 100644 --- a/content/common/gpu/media/dxva_video_decode_accelerator_win.h +++ b/content/common/gpu/media/dxva_video_decode_accelerator_win.h
@@ -7,6 +7,7 @@ #include <d3d11.h> #include <d3d9.h> +#include <initguid.h> #include <stdint.h> // Work around bug in this header by disabling the relevant warning for it. // https://connect.microsoft.com/VisualStudio/feedback/details/911260/dxva2api-h-in-win8-sdk-triggers-c4201-with-w4 @@ -127,6 +128,17 @@ typedef void* EGLConfig; typedef void* EGLSurface; + // Returns the minimum resolution for the |profile| passed in. + static std::pair<int, int> GetMinResolution( + const media::VideoCodecProfile profile); + + // Returns the maximum resolution for the |profile| passed in. + static std::pair<int, int> GetMaxResolution( + const media::VideoCodecProfile profile); + + // Returns the maximum resolution for H264 video. + static std::pair<int, int> GetMaxH264Resolution(); + // Creates and initializes an instance of the D3D device and the // corresponding device manager. The device manager instance is eventually // passed to the IMFTransform interface implemented by the decoder.
diff --git a/content/common/gpu/media/vt_video_decode_accelerator_mac.cc b/content/common/gpu/media/vt_video_decode_accelerator_mac.cc index 6e2d850..3c192ec 100644 --- a/content/common/gpu/media/vt_video_decode_accelerator_mac.cc +++ b/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
@@ -1036,39 +1036,29 @@ return false; } - IOSurfaceRef surface = CVPixelBufferGetIOSurface(frame.image.get()); + IOSurfaceRef io_surface = CVPixelBufferGetIOSurface(frame.image.get()); + + scoped_refptr<gl::GLImageIOSurface> gl_image( + new gl::GLImageIOSurface(frame.coded_size, GL_BGRA_EXT)); + if (!gl_image->Initialize(io_surface, gfx::GenericSharedMemoryId(), + gfx::BufferFormat::UYVY_422)) { + NOTIFY_STATUS("Failed to initialize GLImageIOSurface", PLATFORM_FAILURE, + SFT_PLATFORM_ERROR); + } + if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGLCoreProfile) glEnable(GL_TEXTURE_RECTANGLE_ARB); gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_RECTANGLE_ARB, picture_info->service_texture_id); - CGLContextObj cgl_context = - static_cast<CGLContextObj>(gfx::GLContext::GetCurrent()->GetHandle()); - CGLError status = CGLTexImageIOSurface2D( - cgl_context, // ctx - GL_TEXTURE_RECTANGLE_ARB, // target - GL_RGB, // internal_format - frame.coded_size.width(), // width - frame.coded_size.height(), // height - GL_YCBCR_422_APPLE, // format - GL_UNSIGNED_SHORT_8_8_APPLE, // type - surface, // io_surface - 0); // plane + bool bind_result = gl_image->BindTexImage(GL_TEXTURE_RECTANGLE_ARB); if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGLCoreProfile) glDisable(GL_TEXTURE_RECTANGLE_ARB); - if (status != kCGLNoError) { - NOTIFY_STATUS("CGLTexImageIOSurface2D()", status, SFT_PLATFORM_ERROR); + if (!bind_result) { + NOTIFY_STATUS("Failed BindTexImage on GLImageIOSurface", PLATFORM_FAILURE, + SFT_PLATFORM_ERROR); return false; } - bool allow_overlay = false; - scoped_refptr<gl::GLImageIOSurface> gl_image( - new gl::GLImageIOSurface(frame.coded_size, GL_BGRA_EXT)); - if (gl_image->Initialize(surface, gfx::GenericSharedMemoryId(), - gfx::BufferFormat::BGRA_8888)) { - allow_overlay = true; - } else { - gl_image = nullptr; - } bind_image_.Run(picture_info->client_texture_id, GL_TEXTURE_RECTANGLE_ARB, gl_image); @@ -1084,7 +1074,7 @@ // coded size and fix it. client_->PictureReady(media::Picture(picture_id, frame.bitstream_id, gfx::Rect(frame.coded_size), - allow_overlay)); + true)); return true; }
diff --git a/content/common/host_discardable_shared_memory_manager.h b/content/common/host_discardable_shared_memory_manager.h index 3965f1d4..834afe75 100644 --- a/content/common/host_discardable_shared_memory_manager.h +++ b/content/common/host_discardable_shared_memory_manager.h
@@ -18,6 +18,7 @@ #include "base/memory/discardable_shared_memory.h" #include "base/memory/memory_pressure_listener.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/shared_memory.h" #include "base/memory/weak_ptr.h" #include "base/process/process_handle.h"
diff --git a/content/common/input/input_param_traits.cc b/content/common/input/input_param_traits.cc index 80a68ad..076d54a 100644 --- a/content/common/input/input_param_traits.cc +++ b/content/common/input/input_param_traits.cc
@@ -8,6 +8,7 @@ #include "content/common/content_param_traits.h" #include "content/common/input/synthetic_pinch_gesture_params.h" +#include "content/common/input/synthetic_pointer_action_params.h" #include "content/common/input/synthetic_smooth_drag_gesture_params.h" #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" #include "content/common/input/web_input_event_traits.h" @@ -76,6 +77,10 @@ WriteParam(m, *content::SyntheticTapGestureParams::Cast( p.gesture_params())); break; + case content::SyntheticGestureParams::POINTER_ACTION: + WriteParam( + m, *content::SyntheticPointerActionParams::Cast(p.gesture_params())); + break; } } @@ -105,6 +110,11 @@ gesture_params = ReadGestureParams<content::SyntheticTapGestureParams>(m, iter); break; + case content::SyntheticGestureParams::POINTER_ACTION: { + gesture_params = + ReadGestureParams<content::SyntheticPointerActionParams>(m, iter); + break; + } default: return false; } @@ -138,6 +148,10 @@ *content::SyntheticTapGestureParams::Cast(p.gesture_params()), l); break; + case content::SyntheticGestureParams::POINTER_ACTION: + LogParam(*content::SyntheticPointerActionParams::Cast(p.gesture_params()), + l); + break; } }
diff --git a/content/common/input/input_param_traits_unittest.cc b/content/common/input/input_param_traits_unittest.cc index 0dd2b3d1..1935f9c 100644 --- a/content/common/input/input_param_traits_unittest.cc +++ b/content/common/input/input_param_traits_unittest.cc
@@ -10,6 +10,7 @@ #include "content/common/input/input_event.h" #include "content/common/input/synthetic_gesture_params.h" #include "content/common/input/synthetic_pinch_gesture_params.h" +#include "content/common/input/synthetic_pointer_action_params.h" #include "content/common/input/synthetic_smooth_drag_gesture_params.h" #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" #include "content/common/input_messages.h" @@ -77,6 +78,22 @@ EXPECT_EQ(a->duration_ms, b->duration_ms); } + static void Compare(const SyntheticPointerActionParams* a, + const SyntheticPointerActionParams* b) { + EXPECT_EQ(a->gesture_source_type, b->gesture_source_type); + EXPECT_EQ(a->pointer_action_type(), b->pointer_action_type()); + if (a->pointer_action_type() == + SyntheticPointerActionParams::PointerActionType::PRESS || + a->pointer_action_type() == + SyntheticPointerActionParams::PointerActionType::MOVE) { + EXPECT_EQ(a->position(), b->position()); + } + if (a->pointer_action_type() != + SyntheticPointerActionParams::PointerActionType::PROCESS) { + EXPECT_EQ(a->index(), b->index()); + } + } + static void Compare(const SyntheticGesturePacket* a, const SyntheticGesturePacket* b) { ASSERT_EQ(!!a, !!b); @@ -102,6 +119,10 @@ Compare(SyntheticTapGestureParams::Cast(a->gesture_params()), SyntheticTapGestureParams::Cast(b->gesture_params())); break; + case SyntheticGestureParams::POINTER_ACTION: + Compare(SyntheticPointerActionParams::Cast(a->gesture_params()), + SyntheticPointerActionParams::Cast(b->gesture_params())); + break; } } @@ -250,5 +271,44 @@ Verify(packet_in); } +TEST_F(InputParamTraitsTest, SyntheticPointerActionParamsMove) { + scoped_ptr<SyntheticPointerActionParams> gesture_params( + new SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::MOVE)); + gesture_params->gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; + gesture_params->set_position(gfx::PointF(356, 287)); + gesture_params->set_index(0); + ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION, + gesture_params->GetGestureType()); + SyntheticGesturePacket packet_in; + packet_in.set_gesture_params(std::move(gesture_params)); + Verify(packet_in); +} + +TEST_F(InputParamTraitsTest, SyntheticPointerActionParamsRelease) { + scoped_ptr<SyntheticPointerActionParams> gesture_params( + new SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::RELEASE)); + gesture_params->gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; + gesture_params->set_index(0); + ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION, + gesture_params->GetGestureType()); + SyntheticGesturePacket packet_in; + packet_in.set_gesture_params(std::move(gesture_params)); + Verify(packet_in); +} + +TEST_F(InputParamTraitsTest, SyntheticPointerActionParamsProcess) { + scoped_ptr<SyntheticPointerActionParams> gesture_params( + new SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::PROCESS)); + gesture_params->gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; + ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION, + gesture_params->GetGestureType()); + SyntheticGesturePacket packet_in; + packet_in.set_gesture_params(std::move(gesture_params)); + Verify(packet_in); +} + } // namespace } // namespace content
diff --git a/content/common/input/synthetic_gesture_params.h b/content/common/input/synthetic_gesture_params.h index 1c40ca98..5ece4db 100644 --- a/content/common/input/synthetic_gesture_params.h +++ b/content/common/input/synthetic_gesture_params.h
@@ -48,8 +48,10 @@ SMOOTH_DRAG_GESTURE, PINCH_GESTURE, TAP_GESTURE, - SYNTHETIC_GESTURE_TYPE_MAX = TAP_GESTURE + POINTER_ACTION, + SYNTHETIC_GESTURE_TYPE_MAX = POINTER_ACTION }; + virtual GestureType GetGestureType() const = 0; // Returns true if the specific gesture source type is supported on this
diff --git a/content/common/input/synthetic_pointer_action_params.cc b/content/common/input/synthetic_pointer_action_params.cc new file mode 100644 index 0000000..593413b --- /dev/null +++ b/content/common/input/synthetic_pointer_action_params.cc
@@ -0,0 +1,48 @@ +// 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. + +#include "content/common/input/synthetic_pointer_action_params.h" + +namespace content { + +SyntheticPointerActionParams::SyntheticPointerActionParams() + : pointer_action_type_(PointerActionType::NOT_INITIALIZED), index_(-1) {} + +SyntheticPointerActionParams::SyntheticPointerActionParams( + PointerActionType type) + : pointer_action_type_(type), index_(-1) {} + +SyntheticPointerActionParams::SyntheticPointerActionParams( + const SyntheticPointerActionParams& other) + : SyntheticGestureParams(other), + pointer_action_type_(other.pointer_action_type()) { + switch (other.pointer_action_type()) { + case PointerActionType::PRESS: + case PointerActionType::MOVE: + index_ = other.index(); + position_ = other.position(); + break; + case PointerActionType::RELEASE: + index_ = other.index(); + break; + default: + break; + } +} + +SyntheticPointerActionParams::~SyntheticPointerActionParams() {} + +SyntheticGestureParams::GestureType +SyntheticPointerActionParams::GetGestureType() const { + return POINTER_ACTION; +} + +const SyntheticPointerActionParams* SyntheticPointerActionParams::Cast( + const SyntheticGestureParams* gesture_params) { + DCHECK(gesture_params); + DCHECK_EQ(POINTER_ACTION, gesture_params->GetGestureType()); + return static_cast<const SyntheticPointerActionParams*>(gesture_params); +} + +} // namespace content
diff --git a/content/common/input/synthetic_pointer_action_params.h b/content/common/input/synthetic_pointer_action_params.h new file mode 100644 index 0000000..e5a9a9d --- /dev/null +++ b/content/common/input/synthetic_pointer_action_params.h
@@ -0,0 +1,80 @@ +// 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. + +#ifndef CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_ +#define CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_ + +#include "base/logging.h" +#include "content/common/content_export.h" +#include "content/common/input/input_param_traits.h" +#include "content/common/input/synthetic_gesture_params.h" +#include "ui/gfx/geometry/point_f.h" + +namespace content { + +struct CONTENT_EXPORT SyntheticPointerActionParams + : public SyntheticGestureParams { + public: + // Actions are queued up until we receive a PROCESS action, at which point + // we'll dispatch all queued events. + enum class PointerActionType { + NOT_INITIALIZED, + PRESS, + MOVE, + RELEASE, + PROCESS, + POINTER_ACTION_TYPE_MAX = PROCESS + }; + + SyntheticPointerActionParams(); + explicit SyntheticPointerActionParams(PointerActionType type); + SyntheticPointerActionParams(const SyntheticPointerActionParams& other); + ~SyntheticPointerActionParams() override; + + GestureType GetGestureType() const override; + + static const SyntheticPointerActionParams* Cast( + const SyntheticGestureParams* gesture_params); + + void set_pointer_action_type(PointerActionType pointer_action_type) { + pointer_action_type_ = pointer_action_type; + } + + void set_index(int index) { + DCHECK(pointer_action_type_ != PointerActionType::PROCESS); + index_ = index; + } + + void set_position(const gfx::PointF& position) { + DCHECK(pointer_action_type_ == PointerActionType::PRESS || + pointer_action_type_ == PointerActionType::MOVE); + position_ = position; + } + + PointerActionType pointer_action_type() const { return pointer_action_type_; } + + int index() const { + DCHECK(pointer_action_type_ != PointerActionType::PROCESS); + return index_; + } + + gfx::PointF position() const { + DCHECK(pointer_action_type_ == PointerActionType::PRESS || + pointer_action_type_ == PointerActionType::MOVE); + return position_; + } + + private: + friend struct IPC::ParamTraits<content::SyntheticPointerActionParams>; + + PointerActionType pointer_action_type_; + // Pass a position value when sending a press or move action. + gfx::PointF position_; + // Pass an index value except if the pointer_action_type_ is PROCESS. + int index_; +}; + +} // namespace content + +#endif // CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_
diff --git a/content/common/input_messages.h b/content/common/input_messages.h index 8f0d042..e83a77b 100644 --- a/content/common/input_messages.h +++ b/content/common/input_messages.h
@@ -20,6 +20,7 @@ #include "content/common/input/synthetic_gesture_packet.h" #include "content/common/input/synthetic_gesture_params.h" #include "content/common/input/synthetic_pinch_gesture_params.h" +#include "content/common/input/synthetic_pointer_action_params.h" #include "content/common/input/synthetic_smooth_drag_gesture_params.h" #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" #include "content/common/input/synthetic_tap_gesture_params.h" @@ -49,6 +50,10 @@ IPC_ENUM_TRAITS_MAX_VALUE( content::SyntheticGestureParams::GestureType, content::SyntheticGestureParams::SYNTHETIC_GESTURE_TYPE_MAX) +IPC_ENUM_TRAITS_MAX_VALUE( + content::SyntheticPointerActionParams::PointerActionType, + content::SyntheticPointerActionParams::PointerActionType:: + POINTER_ACTION_TYPE_MAX) IPC_ENUM_TRAITS_MAX_VALUE(content::InputEventDispatchType, content::InputEventDispatchType::DISPATCH_TYPE_MAX) IPC_ENUM_TRAITS_VALIDATE(content::TouchAction, ( @@ -108,6 +113,13 @@ IPC_STRUCT_TRAITS_MEMBER(duration_ms) IPC_STRUCT_TRAITS_END() +IPC_STRUCT_TRAITS_BEGIN(content::SyntheticPointerActionParams) + IPC_STRUCT_TRAITS_PARENT(content::SyntheticGestureParams) + IPC_STRUCT_TRAITS_MEMBER(pointer_action_type_) + IPC_STRUCT_TRAITS_MEMBER(index_) + IPC_STRUCT_TRAITS_MEMBER(position_) +IPC_STRUCT_TRAITS_END() + IPC_STRUCT_TRAITS_BEGIN(content::InputEventAck) IPC_STRUCT_TRAITS_MEMBER(type) IPC_STRUCT_TRAITS_MEMBER(state)
diff --git a/content/common/sandbox_mac_system_access_unittest.mm b/content/common/sandbox_mac_system_access_unittest.mm index 0298071..b37b967 100644 --- a/content/common/sandbox_mac_system_access_unittest.mm +++ b/content/common/sandbox_mac_system_access_unittest.mm
@@ -9,11 +9,13 @@ #include "base/files/file_util.h" #include "base/files/scoped_file.h" #include "base/logging.h" +#include "base/memory/ref_counted.h" #include "base/strings/sys_string_conversions.h" #include "content/common/sandbox_mac.h" #include "content/common/sandbox_mac_unittest_helper.h" #include "crypto/openssl_util.h" #include "testing/gtest/include/gtest/gtest.h" +#import "ui/base/clipboard/clipboard_util_mac.h" namespace content { @@ -69,15 +71,16 @@ } TEST_F(MacSandboxTest, ClipboardAccess) { - NSPasteboard* pb = [NSPasteboard pasteboardWithUniqueName]; - EXPECT_EQ([[pb types] count], 0U); + scoped_refptr<ui::UniquePasteboard> pb = new ui::UniquePasteboard; + ASSERT_TRUE(pb->get()); + EXPECT_EQ([[pb->get() types] count], 0U); - std::string pasteboard_name = base::SysNSStringToUTF8([pb name]); + std::string pasteboard_name = base::SysNSStringToUTF8([pb->get() name]); EXPECT_TRUE(RunTestInAllSandboxTypes("MacSandboxedClipboardTestCase", pasteboard_name.c_str())); // After executing the test, the clipboard should still be empty. - EXPECT_EQ([[pb types] count], 0U); + EXPECT_EQ([[pb->get() types] count], 0U); } //--------------------- File Access Sandboxing ----------------------
diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc index 86b0dcb..fe26622 100644 --- a/content/common/sandbox_win.cc +++ b/content/common/sandbox_win.cc
@@ -32,7 +32,6 @@ #include "content/common/content_switches_internal.h" #include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" -#include "content/public/common/dwrite_font_platform_win.h" #include "content/public/common/sandbox_init.h" #include "content/public/common/sandboxed_process_launcher_delegate.h" #include "sandbox/win/src/process_mitigations.h" @@ -414,6 +413,7 @@ // Prevents the renderers from manipulating low-integrity processes. policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_UNTRUSTED); policy->SetIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW); + policy->SetLockdownDefaultDacl(); if (sandbox::SBOX_ALL_OK != policy->SetAlternateDesktop(true)) { DLOG(WARNING) << "Failed to apply desktop security to the renderer"; @@ -757,24 +757,6 @@ true, sandbox::TargetPolicy::FILES_ALLOW_READONLY, policy); - - if (!ShouldUseDirectWriteFontProxyFieldTrial()) { - // If DirectWrite is enabled for font rendering then open the font - // cache section which is created by the browser and pass the handle to - // the renderer process. This is needed because renderer processes on - // Windows 8+ may be running in an AppContainer sandbox and hence their - // kernel object namespace may be partitioned. - std::string name(content::kFontCacheSharedSectionName); - name.append(base::UintToString(base::GetCurrentProcId())); - - if (direct_write_font_cache_section.Open(name, true)) { - HANDLE handle = direct_write_font_cache_section.handle().GetHandle(); - policy->AddHandleToShare(handle); - cmd_line->AppendSwitchASCII( - switches::kFontCacheSharedHandle, - base::UintToString(base::win::HandleToUint32(handle))); - } - } } } #endif
diff --git a/content/common/service_port_service.mojom b/content/common/service_port_service.mojom deleted file mode 100644 index d15a02c9..0000000 --- a/content/common/service_port_service.mojom +++ /dev/null
@@ -1,37 +0,0 @@ -// 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. - -module content.mojom; - -enum ServicePortConnectResult { - ACCEPT, - REJECT -}; - -struct MojoTransferredMessagePort { - int32 id; - bool send_messages_as_values; -}; - -interface ServicePortService { - SetClient(ServicePortServiceClient client); - - Connect(string target_url, string origin) - => (ServicePortConnectResult result, int32 port_id); - - PostMessageToPort(int32 port_id, string message, - array<MojoTransferredMessagePort> ports); - ClosePort(int32 port_id); -}; - -interface ServicePortServiceClient { - PostMessageToPort(int32 port_id, string message, - array<MojoTransferredMessagePort> ports, - array<int32> new_routing_ids); -}; - -interface ServicePortDispatcher { - Connect(string target_url, string origin, int32 port_id) - => (ServicePortConnectResult result, string name, string data); -};
diff --git a/content/common/service_port_type_converters.cc b/content/common/service_port_type_converters.cc deleted file mode 100644 index f824f35..0000000 --- a/content/common/service_port_type_converters.cc +++ /dev/null
@@ -1,32 +0,0 @@ -// 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. - -#include "content/common/service_port_type_converters.h" - -namespace mojo { - -// static -content::TransferredMessagePort -TypeConverter<content::TransferredMessagePort, - content::mojom::MojoTransferredMessagePortPtr>:: - Convert(const content::mojom::MojoTransferredMessagePortPtr& input) { - content::TransferredMessagePort output; - output.id = input->id; - output.send_messages_as_values = input->send_messages_as_values; - return output; -} - -// static -content::mojom::MojoTransferredMessagePortPtr -TypeConverter<content::mojom::MojoTransferredMessagePortPtr, - content::TransferredMessagePort>:: - Convert(const content::TransferredMessagePort& input) { - content::mojom::MojoTransferredMessagePortPtr output( - content::mojom::MojoTransferredMessagePort::New()); - output->id = input.id; - output->send_messages_as_values = input.send_messages_as_values; - return output; -} - -} // namespace mojo
diff --git a/content/common/service_port_type_converters.h b/content/common/service_port_type_converters.h deleted file mode 100644 index bb6b25ca..0000000 --- a/content/common/service_port_type_converters.h +++ /dev/null
@@ -1,33 +0,0 @@ -// 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. - -#ifndef CONTENT_COMMON_SERVICE_PORT_TYPE_CONVERTERS_H_ -#define CONTENT_COMMON_SERVICE_PORT_TYPE_CONVERTERS_H_ - -#include "content/common/content_export.h" -#include "content/common/service_port_service.mojom.h" -#include "content/public/common/message_port_types.h" -#include "mojo/public/cpp/bindings/type_converter.h" - -namespace mojo { - -template <> -struct CONTENT_EXPORT - TypeConverter<content::TransferredMessagePort, - content::mojom::MojoTransferredMessagePortPtr> { - static content::TransferredMessagePort Convert( - const content::mojom::MojoTransferredMessagePortPtr& input); -}; - -template <> -struct CONTENT_EXPORT - TypeConverter<content::mojom::MojoTransferredMessagePortPtr, - content::TransferredMessagePort> { - static content::mojom::MojoTransferredMessagePortPtr Convert( - const content::TransferredMessagePort& input); -}; - -} // namespace mojo - -#endif // CONTENT_COMMON_SERVICE_PORT_TYPE_CONVERTERS_H_
diff --git a/content/common/service_worker/service_worker_messages.h b/content/common/service_worker/service_worker_messages.h index cc58289a..41698cf 100644 --- a/content/common/service_worker/service_worker_messages.h +++ b/content/common/service_worker/service_worker_messages.h
@@ -14,7 +14,6 @@ #include "content/common/service_worker/service_worker_status_code.h" #include "content/common/service_worker/service_worker_types.h" #include "content/public/common/message_port_types.h" -#include "content/public/common/navigator_connect_client.h" #include "content/public/common/platform_notification_data.h" #include "content/public/common/push_event_payload.h" #include "ipc/ipc_message_macros.h" @@ -149,12 +148,6 @@ IPC_ENUM_TRAITS_MAX_VALUE(blink::WebGeofencingEventType, blink::WebGeofencingEventTypeLast) -IPC_STRUCT_TRAITS_BEGIN(content::NavigatorConnectClient) - IPC_STRUCT_TRAITS_MEMBER(target_url) - IPC_STRUCT_TRAITS_MEMBER(origin) - IPC_STRUCT_TRAITS_MEMBER(message_port_id) -IPC_STRUCT_TRAITS_END() - IPC_STRUCT_TRAITS_BEGIN(content::PushEventPayload) IPC_STRUCT_TRAITS_MEMBER(data) IPC_STRUCT_TRAITS_MEMBER(is_null) @@ -517,12 +510,6 @@ std::vector<content::TransferredMessagePort> /* sent_message_ports */, std::vector<int> /* new_routing_ids */) -IPC_MESSAGE_CONTROL4( - ServiceWorkerMsg_CrossOriginMessageToWorker, - content::NavigatorConnectClient /* client */, - base::string16 /* message */, - std::vector<content::TransferredMessagePort> /* sent_message_ports */, - std::vector<int> /* new_routing_ids */) IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidSkipWaiting, int /* request_id */) IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidClaimClients,
diff --git a/content/content_browser.gypi b/content/content_browser.gypi index e9670ca..5761e08 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi
@@ -227,8 +227,6 @@ 'public/browser/navigation_throttle.cc', 'public/browser/navigation_throttle.h', 'public/browser/navigation_type.h', - 'public/browser/navigator_connect_context.h', - 'public/browser/navigator_connect_service_factory.h', 'public/browser/notification_database_data.h', 'public/browser/notification_details.h', 'public/browser/notification_event_dispatcher.h', @@ -382,6 +380,7 @@ 'browser/accessibility/browser_accessibility_manager_win.h', 'browser/accessibility/browser_accessibility_state_impl.cc', 'browser/accessibility/browser_accessibility_state_impl.h', + 'browser/accessibility/browser_accessibility_state_impl_mac.mm', 'browser/accessibility/browser_accessibility_state_impl_win.cc', 'browser/accessibility/browser_accessibility_win.cc', 'browser/accessibility/browser_accessibility_win.h', @@ -1130,10 +1129,6 @@ 'browser/mojo/service_registrar_android.h', 'browser/mojo/service_registry_android.cc', 'browser/mojo/service_registry_android.h', - 'browser/navigator_connect/navigator_connect_context_impl.cc', - 'browser/navigator_connect/navigator_connect_context_impl.h', - 'browser/navigator_connect/service_port_service_impl.cc', - 'browser/navigator_connect/service_port_service_impl.h', 'browser/net/browser_online_state_observer.cc', 'browser/net/browser_online_state_observer.h', 'browser/net/network_errors_listing_ui.cc', @@ -2026,6 +2021,7 @@ '../build/linux/system.gyp:atk', '../build/linux/system.gyp:gconf', '../build/linux/system.gyp:glib', + '../build/linux/system.gyp:xscrnsaver', ], 'variables': { 'clang_warning_flags': [
diff --git a/content/content_browsertests.isolate b/content/content_browsertests.isolate index 575a558..e4583b5 100644 --- a/content/content_browsertests.isolate +++ b/content/content_browsertests.isolate
@@ -92,7 +92,6 @@ 'variables': { 'files': [ '<(PRODUCT_DIR)/Content Shell.app/', - '<(PRODUCT_DIR)/plugins/test_netscape_plugin.plugin/', '<(PRODUCT_DIR)/ppapi_tests.plugin/Contents/MacOS/ppapi_tests', ], }, @@ -105,7 +104,6 @@ '<(PRODUCT_DIR)/Content Shell.app.dSYM/', '<(PRODUCT_DIR)/content_browsertests.dSYM/', '<(PRODUCT_DIR)/ppapi_tests.plugin.dSYM/', - '<(PRODUCT_DIR)/test_netscape_plugin.plugin.dSYM/', ], }, }], @@ -113,7 +111,6 @@ 'variables': { 'files': [ '<(PRODUCT_DIR)/osmesa.dll', - '<(PRODUCT_DIR)/plugins/np_test_netscape_plugin.dll', '<(PRODUCT_DIR)/ppapi_tests.dll', ], },
diff --git a/content/content_child.gypi b/content/content_child.gypi index b327ba79..e6ac472 100644 --- a/content/content_child.gypi +++ b/content/content_child.gypi
@@ -137,10 +137,6 @@ 'child/mojo/mojo_application.cc', 'child/mojo/mojo_application.h', 'child/mojo/type_converters.h', - 'child/navigator_connect/service_port_dispatcher_impl.cc', - 'child/navigator_connect/service_port_dispatcher_impl.h', - 'child/navigator_connect/service_port_provider.cc', - 'child/navigator_connect/service_port_provider.h', 'child/notifications/notification_data_conversions.cc', 'child/notifications/notification_data_conversions.h', 'child/notifications/notification_dispatcher.cc',
diff --git a/content/content_common.gypi b/content/content_common.gypi index 9c3ebac..2e08940c 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi
@@ -123,7 +123,6 @@ 'public/common/context_menu_params.h', 'public/common/drop_data.cc', 'public/common/drop_data.h', - 'public/common/dwrite_font_platform_win.h', 'public/common/favicon_url.cc', 'public/common/favicon_url.h', 'public/common/file_chooser_file_info.cc', @@ -151,8 +150,6 @@ 'public/common/mojo_channel_switches.cc', 'public/common/mojo_channel_switches.h', 'public/common/mojo_shell_connection.h', - 'public/common/navigator_connect_client.cc', - 'public/common/navigator_connect_client.h', 'public/common/notification_resources.cc', 'public/common/notification_resources.h', 'public/common/origin_util.h', @@ -310,7 +307,6 @@ 'common/drag_event_source_info.h', 'common/drag_messages.h', 'common/drag_traits.h', - 'common/dwrite_font_platform_win.cc', 'common/dwrite_font_proxy_messages.h', 'common/edit_command.h', 'common/establish_channel_params.cc', @@ -450,6 +446,8 @@ 'common/input/synthetic_gesture_params.h', 'common/input/synthetic_pinch_gesture_params.cc', 'common/input/synthetic_pinch_gesture_params.h', + 'common/input/synthetic_pointer_action_params.cc', + 'common/input/synthetic_pointer_action_params.h', 'common/input/synthetic_smooth_drag_gesture_params.cc', 'common/input/synthetic_smooth_drag_gesture_params.h', 'common/input/synthetic_smooth_scroll_gesture_params.cc', @@ -589,8 +587,6 @@ 'common/savable_url_schemes.h', 'common/screen_orientation_messages.h', 'common/send_zygote_child_ping_linux.cc', - 'common/service_port_type_converters.cc', - 'common/service_port_type_converters.h', 'common/service_worker/embedded_worker_messages.h', 'common/service_worker/embedded_worker_settings.h', 'common/service_worker/service_worker_client_info.cc',
diff --git a/content/content_common_mojo_bindings.gyp b/content/content_common_mojo_bindings.gyp index f0ac87a..8063d23 100644 --- a/content/content_common_mojo_bindings.gyp +++ b/content/content_common_mojo_bindings.gyp
@@ -22,7 +22,6 @@ 'common/presentation/presentation_service.mojom', 'common/process_control.mojom', 'common/render_frame_setup.mojom', - 'common/service_port_service.mojom', 'common/service_worker/embedded_worker_setup.mojom', 'common/storage_partition_service.mojom', 'common/vr_service.mojom',
diff --git a/content/content_shell.gypi b/content/content_shell.gypi index b50b9e4..f6382115 100644 --- a/content/content_shell.gypi +++ b/content/content_shell.gypi
@@ -33,7 +33,6 @@ 'content_shell_resources', 'content_shell_mojo_bindings', 'content_test_mojo_bindings', - 'copy_test_netscape_plugin', 'layouttest_support_content', '../base/base.gyp:base', '../base/base.gyp:base_static', @@ -125,8 +124,6 @@ 'shell/browser/layout_test/layout_test_javascript_dialog_manager.h', 'shell/browser/layout_test/layout_test_message_filter.cc', 'shell/browser/layout_test/layout_test_message_filter.h', - 'shell/browser/layout_test/layout_test_navigator_connect_service_factory.cc', - 'shell/browser/layout_test/layout_test_navigator_connect_service_factory.h', 'shell/browser/layout_test/layout_test_notification_manager.cc', 'shell/browser/layout_test/layout_test_notification_manager.h', 'shell/browser/layout_test/layout_test_permission_manager.cc', @@ -551,104 +548,6 @@ ], }, { - 'target_name': 'test_netscape_plugin', - 'conditions': [ - ['OS != "win" and OS != "mac"', { - 'type': 'none', - }, { # OS=="win" or OS=="mac" - 'type': 'loadable_module', - 'sources': [ - 'shell/tools/plugin/PluginObject.cpp', - 'shell/tools/plugin/PluginObject.h', - 'shell/tools/plugin/PluginTest.cpp', - 'shell/tools/plugin/PluginTest.h', - 'shell/tools/plugin/TestObject.cpp', - 'shell/tools/plugin/Tests/EvaluateJSAfterRemovingPluginElement.cpp', - 'shell/tools/plugin/Tests/FormValue.cpp', - 'shell/tools/plugin/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp', - 'shell/tools/plugin/Tests/LeakWindowScriptableObject.cpp', - 'shell/tools/plugin/Tests/LogNPPSetWindow.cpp', - 'shell/tools/plugin/Tests/NPDeallocateCalledBeforeNPShutdown.cpp', - 'shell/tools/plugin/Tests/NPPNewFails.cpp', - 'shell/tools/plugin/Tests/NPRuntimeCallsWithNullNPP.cpp', - 'shell/tools/plugin/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp', - 'shell/tools/plugin/Tests/NPRuntimeRemoveProperty.cpp', - 'shell/tools/plugin/Tests/NullNPPGetValuePointer.cpp', - 'shell/tools/plugin/Tests/PassDifferentNPPStruct.cpp', - 'shell/tools/plugin/Tests/PluginScriptableNPObjectInvokeDefault.cpp', - 'shell/tools/plugin/Tests/PluginScriptableObjectOverridesAllProperties.cpp', - 'shell/tools/plugin/main.cpp', - 'shell/tools/plugin/test_object.h', - ], - 'include_dirs': [ - '<(DEPTH)', - '<(DEPTH)/content/shell/tools/plugin/', - ], - 'dependencies': [ - '../base/base.gyp:base', - '../third_party/npapi/npapi.gyp:npapi', - ], - 'conditions': [ - ['OS=="mac"', { - 'mac_bundle': 1, - 'product_extension': 'plugin', - 'link_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', - '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework', - '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', - ] - }, - 'xcode_settings': { - 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', - 'INFOPLIST_FILE': 'shell/tools/plugin/mac/Info.plist', - }, - }], - ['OS=="win"', { - 'conditions': [ - ['MSVS_VERSION < "2015"', { - 'defines': [ - # This seems like a hack, but this is what Safari Win does. - # Luckily it is no longer needed/allowed with VS 2015. - 'snprintf=_snprintf', - ], - }], - ], - 'sources': [ - 'shell/tools/plugin/win/TestNetscapePlugin.def', - 'shell/tools/plugin/win/TestNetscapePlugin.rc', - ], - # The .rc file requires that the name of the dll is np_test_netscape_plugin.dll. - 'product_name': 'np_test_netscape_plugin', - # Disable c4267 warnings until we fix size_t to int truncations. - 'msvs_disabled_warnings': [ 4267, ], - }], - ], - }], - ], - }, - { - 'target_name': 'copy_test_netscape_plugin', - 'type': 'none', - 'dependencies': [ - 'test_netscape_plugin', - ], - 'conditions': [ - ['OS=="win"', { - 'copies': [{ - 'destination': '<(PRODUCT_DIR)/plugins', - 'files': ['<(PRODUCT_DIR)/np_test_netscape_plugin.dll'], - }], - }], - ['OS=="mac"', { - 'copies': [{ - 'destination': '<(PRODUCT_DIR)/plugins/', - 'files': ['<(PRODUCT_DIR)/test_netscape_plugin.plugin/'], - }], - }], - ], - }, - { 'target_name': 'content_shell_mojo_bindings_mojom', 'type': 'none', 'variables': {
diff --git a/content/content_tests.gypi b/content/content_tests.gypi index 7415c43..c385b2341 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi
@@ -244,6 +244,7 @@ 'browser/media/media_source_browsertest.cc', 'browser/media/session/media_session_browsertest.cc', 'browser/media/session/media_session_delegate_default_browsertest.cc', + 'browser/media/session/media_session_visibility_browsertest.cc', 'browser/media/session/mock_media_session_observer.cc', 'browser/media/session/mock_media_session_observer.h', 'browser/memory/memory_pressure_controller_impl_browsertest.cc', @@ -671,7 +672,6 @@ 'common/database_identifier_unittest.cc', 'common/discardable_shared_memory_heap_unittest.cc', 'common/dom_storage/dom_storage_map_unittest.cc', - 'common/dwrite_font_platform_win_unittest.cc', 'common/fileapi/file_system_util_unittest.cc', 'common/gpu/ca_layer_tree_unittest_mac.mm', 'common/gpu/gpu_channel_manager_unittest.cc',
diff --git a/content/gpu/in_process_gpu_thread.h b/content/gpu/in_process_gpu_thread.h index 6124ba8..dbb6119ec2 100644 --- a/content/gpu/in_process_gpu_thread.h +++ b/content/gpu/in_process_gpu_thread.h
@@ -6,6 +6,7 @@ #define CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/threading/thread.h" #include "content/common/content_export.h" #include "content/common/in_process_child_thread_params.h"
diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc index 0b7effaa..fccb830 100644 --- a/content/ppapi_plugin/ppapi_plugin_main.cc +++ b/content/ppapi_plugin/ppapi_plugin_main.cc
@@ -29,8 +29,6 @@ #include "base/win/win_util.h" #include "base/win/windows_version.h" #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h" -#include "content/child/font_warmup_win.h" -#include "content/public/common/dwrite_font_platform_win.h" #include "sandbox/win/src/sandbox.h" #include "third_party/WebKit/public/web/win/WebFontRendering.h" #include "third_party/skia/include/ports/SkTypeface_win.h" @@ -142,11 +140,7 @@ gfx::win::MaybeInitializeDirectWrite(); bool use_direct_write = gfx::win::IsDirectWriteEnabled(); if (use_direct_write) { - if (ShouldUseDirectWriteFontProxyFieldTrial()) { - InitializeDWriteFontProxy(); - } else { - WarmupDirectWrite(); - } + InitializeDWriteFontProxy(); } else { SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); } @@ -158,8 +152,7 @@ main_message_loop.Run(); #if defined(OS_WIN) - if (ShouldUseDirectWriteFontProxyFieldTrial()) - UninitializeDWriteFontProxy(); + UninitializeDWriteFontProxy(); #endif return 0; }
diff --git a/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java b/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java index c3dca05..b6dc1958 100644 --- a/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java +++ b/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java
@@ -121,9 +121,9 @@ } @Override - public void reloadIgnoringCache(boolean checkForRepost) { + public void reloadBypassingCache(boolean checkForRepost) { if (mNativeNavigationControllerAndroid != 0) { - nativeReloadIgnoringCache(mNativeNavigationControllerAndroid, checkForRepost); + nativeReloadBypassingCache(mNativeNavigationControllerAndroid, checkForRepost); } } @@ -312,7 +312,7 @@ boolean checkForRepost); private native void nativeReloadToRefreshContent(long nativeNavigationControllerAndroid, boolean checkForRepost); - private native void nativeReloadIgnoringCache(long nativeNavigationControllerAndroid, + private native void nativeReloadBypassingCache(long nativeNavigationControllerAndroid, boolean checkForRepost); private native void nativeReloadDisableLoFi(long nativeNavigationControllerAndroid, boolean checkForRepost);
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/NavigationController.java b/content/public/android/java/src/org/chromium/content_public/browser/NavigationController.java index efa9216..73c5aba 100644 --- a/content/public/android/java/src/org/chromium/content_public/browser/NavigationController.java +++ b/content/public/android/java/src/org/chromium/content_public/browser/NavigationController.java
@@ -76,9 +76,9 @@ public void reloadToRefreshContent(boolean checkForRepost); /** - * Reload the current page, ignoring the contents of the cache. + * Reload the current page, bypassing the contents of the cache. */ - public void reloadIgnoringCache(boolean checkForRepost); + public void reloadBypassingCache(boolean checkForRepost); /** * Reload the current page with Lo-Fi off, ignoring the contents of the cache.
diff --git a/content/public/browser/android/synchronous_compositor.h b/content/public/browser/android/synchronous_compositor.h index 431e1e1c..57fdb13 100644 --- a/content/public/browser/android/synchronous_compositor.h +++ b/content/public/browser/android/synchronous_compositor.h
@@ -94,6 +94,9 @@ // starts off as inactive and needs a SetActive(true) call to begin. virtual void SetIsActive(bool is_active) = 0; + // Synchronize all renderer state to UI thread. This blocks the UI thread. + virtual void SynchronizeWithRenderer() = 0; + // Called by the embedder to notify that the OnComputeScroll step is happening // and if any input animation is active, it should tick now. virtual void OnComputeScroll(base::TimeTicks animation_time) = 0;
diff --git a/content/public/browser/background_tracing_config.h b/content/public/browser/background_tracing_config.h index 22d7885..b7af5bb 100644 --- a/content/public/browser/background_tracing_config.h +++ b/content/public/browser/background_tracing_config.h
@@ -5,6 +5,7 @@ #ifndef CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_CONFIG_H_ #define CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_CONFIG_H_ +#include "base/memory/scoped_ptr.h" #include "base/trace_event/trace_event_impl.h" #include "content/common/content_export.h"
diff --git a/content/public/browser/background_tracing_manager.h b/content/public/browser/background_tracing_manager.h index 652047e4..61258ed 100644 --- a/content/public/browser/background_tracing_manager.h +++ b/content/public/browser/background_tracing_manager.h
@@ -5,6 +5,7 @@ #ifndef CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_MANAGER_H_ #define CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_MANAGER_H_ +#include "base/memory/scoped_ptr.h" #include "base/trace_event/trace_event_impl.h" #include "base/values.h" #include "content/common/content_export.h"
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index d54ece5..721ec56 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h
@@ -110,8 +110,6 @@ class LocationProvider; class MediaObserver; class NavigationHandle; -class NavigatorConnectContext; -class NavigatorConnectServiceFactory; class PlatformNotificationService; class PresentationServiceDelegate; class QuotaPermissionContext; @@ -690,11 +688,6 @@ virtual void RegisterUnsandboxedOutOfProcessMojoApplications( OutOfProcessMojoApplicationMap* apps) {} - // Registers additional navigator.connect service factories available in a - // particular NavigatorConnectContext. - virtual void GetAdditionalNavigatorConnectServices( - const scoped_refptr<NavigatorConnectContext>& context) {} - // Allows to override the visibility state of a RenderFrameHost. // |visibility_state| should not be null. It will only be set if needed. virtual void OverridePageVisibilityState(
diff --git a/content/public/browser/desktop_media_id.cc b/content/public/browser/desktop_media_id.cc index 77e8208c..8a20598 100644 --- a/content/public/browser/desktop_media_id.cc +++ b/content/public/browser/desktop_media_id.cc
@@ -98,21 +98,25 @@ bool DesktopMediaID::operator<(const DesktopMediaID& other) const { #if defined(USE_AURA) - return std::tie(type, id, aura_id, web_contents_id) < - std::tie(other.type, other.id, other.aura_id, other.web_contents_id); + return std::tie(type, id, aura_id, web_contents_id, audio_share) < + std::tie(other.type, other.id, other.aura_id, other.web_contents_id, + other.audio_share); #else - return std::tie(type, id, web_contents_id) < - std::tie(other.type, other.id, other.web_contents_id); + return std::tie(type, id, web_contents_id, audio_share) < + std::tie(other.type, other.id, other.web_contents_id, + other.audio_share); #endif } bool DesktopMediaID::operator==(const DesktopMediaID& other) const { #if defined(USE_AURA) return type == other.type && id == other.id && aura_id == other.aura_id && - web_contents_id == other.web_contents_id; + web_contents_id == other.web_contents_id && + audio_share == other.audio_share; #else return type == other.type && id == other.id && - web_contents_id == other.web_contents_id; + web_contents_id == other.web_contents_id && + audio_share == other.audio_share; #endif }
diff --git a/content/public/browser/download_save_info.h b/content/public/browser/download_save_info.h index a186025b..bd901d3 100644 --- a/content/public/browser/download_save_info.h +++ b/content/public/browser/download_save_info.h
@@ -10,6 +10,7 @@ #include "base/files/file.h" #include "base/files/file_path.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "content/common/content_export.h" #include "crypto/secure_hash.h"
diff --git a/content/public/browser/navigation_controller.h b/content/public/browser/navigation_controller.h index 4c84b39..9e6cb60c 100644 --- a/content/public/browser/navigation_controller.h +++ b/content/public/browser/navigation_controller.h
@@ -48,7 +48,7 @@ enum ReloadType { NO_RELOAD, // Normal load, restore, or history navigation. RELOAD, // Normal (cache-validating) reload. - RELOAD_IGNORING_CACHE, // Reload bypassing the cache (shift-reload). + RELOAD_BYPASSING_CACHE, // Reload bypassing the cache (shift-reload). RELOAD_ORIGINAL_REQUEST_URL, // Reload using the original request URL. RELOAD_DISABLE_LOFI_MODE // Reload with Lo-Fi mode disabled. }; @@ -379,7 +379,7 @@ virtual void ReloadToRefreshContent(bool check_for_repost) = 0; // Like Reload(), but don't use caches (aka "shift-reload"). - virtual void ReloadIgnoringCache(bool check_for_repost) = 0; + virtual void ReloadBypassingCache(bool check_for_repost) = 0; // Reloads the current entry using the original URL used to create it. This // is used for cases where the user wants to refresh a page using a different
diff --git a/content/public/browser/navigator_connect_context.h b/content/public/browser/navigator_connect_context.h deleted file mode 100644 index 1c6dc7e..0000000 --- a/content/public/browser/navigator_connect_context.h +++ /dev/null
@@ -1,36 +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. - -#ifndef CONTENT_PUBLIC_BROWSER_NAVIGATOR_CONNECT_CONTEXT_H_ -#define CONTENT_PUBLIC_BROWSER_NAVIGATOR_CONNECT_CONTEXT_H_ - -#include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" - -namespace content { - -class NavigatorConnectServiceFactory; - -// Use this class to register additional navigator.connect service factories. -// One instance of this class exists per StoragePartition. -// TODO(mek): Add API so services can close a connection. -class NavigatorConnectContext - : public base::RefCountedThreadSafe<NavigatorConnectContext> { - public: - // Register a service factory. The most recently added factory that claims to - // handle a URL will be used to handle a connection request for that URL. - // This method must always be called on the UI thread. No guarantees are - // given as to on what thread the passed in factory will get destroyed. - virtual void AddFactory( - scoped_ptr<NavigatorConnectServiceFactory> factory) = 0; - - protected: - friend class base::RefCountedThreadSafe<NavigatorConnectContext>; - NavigatorConnectContext() {} - virtual ~NavigatorConnectContext() {} -}; - -} // namespace content - -#endif // CONTENT_PUBLIC_BROWSER_NAVIGATOR_CONNECT_CONTEXT_H_
diff --git a/content/public/browser/navigator_connect_service_factory.h b/content/public/browser/navigator_connect_service_factory.h deleted file mode 100644 index 4a71f27..0000000 --- a/content/public/browser/navigator_connect_service_factory.h +++ /dev/null
@@ -1,49 +0,0 @@ -// 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. - -#ifndef CONTENT_PUBLIC_BROWSER_NAVIGATOR_CONNECT_SERVICE_FACTORY_H_ -#define CONTENT_PUBLIC_BROWSER_NAVIGATOR_CONNECT_SERVICE_FACTORY_H_ - -#include "base/callback.h" - -class GURL; - -namespace content { - -struct NavigatorConnectClient; -class MessagePortDelegate; - -// Implement this interface to provide a new kind of navigator.connect -// accessible service. -// Instances of this class are owned by NavigatorConnectContext. Register new -// factories by calling NavigatorConnectContext::AddFactory. -class NavigatorConnectServiceFactory { - public: - // Call with nullptr to indicate connection failure. Ownership of the delegate - // remains with the factory. It is assumed that for the passed - // MessagePortDelegate implementation the route_id and message_port_id of a - // connection are the same. - // Pass true to |data_as_values| if the delegate expects to receive messages - // from the client encoded as base::Value instead of the normal serialization - // format. - using ConnectCallback = - base::Callback<void(MessagePortDelegate*, bool data_as_values)>; - - virtual ~NavigatorConnectServiceFactory() {} - - // Return true if this factory is responsible for handling connections to the - // |target_url|. The most recently added factory that returns true for a - // particular url is picked to handle the connection attempt. - virtual bool HandlesUrl(const GURL& target_url) = 0; - - // Called to try to establish a connection. Only called if this factory was - // the most recently added factory that returned true from |HandlesUrl| for - // the url being connected to. - virtual void Connect(const NavigatorConnectClient& client, - const ConnectCallback& callback) = 0; -}; - -} // namespace content - -#endif // CONTENT_PUBLIC_BROWSER_NAVIGATOR_CONNECT_SERVICE_FACTORY_H_
diff --git a/content/public/browser/render_widget_host_view_mac_delegate.h b/content/public/browser/render_widget_host_view_mac_delegate.h index c00d8bd..427f466f 100644 --- a/content/public/browser/render_widget_host_view_mac_delegate.h +++ b/content/public/browser/render_widget_host_view_mac_delegate.h
@@ -8,6 +8,7 @@ #import <Cocoa/Cocoa.h> namespace blink { +class WebGestureEvent; class WebMouseWheelEvent; } @@ -60,6 +61,8 @@ // |event|. - (void)rendererHandledWheelEvent:(const blink::WebMouseWheelEvent&)event consumed:(BOOL)consumed; +- (void)rendererHandledGestureScrollEvent:(const blink::WebGestureEvent&)event + consumed:(BOOL)consumed; @end #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_MAC_DELEGATE_H_
diff --git a/content/public/browser/storage_partition.h b/content/public/browser/storage_partition.h index b749378..5c4f707 100644 --- a/content/public/browser/storage_partition.h +++ b/content/public/browser/storage_partition.h
@@ -48,7 +48,6 @@ class HostZoomLevelContext; class HostZoomMap; class IndexedDBContext; -class NavigatorConnectContext; class PlatformNotificationContext; class ServiceWorkerContext; class ZoomLevelDelegate; @@ -76,7 +75,6 @@ virtual HostZoomMap* GetHostZoomMap() = 0; virtual HostZoomLevelContext* GetHostZoomLevelContext() = 0; virtual ZoomLevelDelegate* GetZoomLevelDelegate() = 0; - virtual NavigatorConnectContext* GetNavigatorConnectContext() = 0; virtual PlatformNotificationContext* GetPlatformNotificationContext() = 0; virtual BackgroundSyncContext* GetBackgroundSyncContext() = 0;
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index e88ca64..5fe9424 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -24,6 +24,12 @@ const base::Feature kDownloadResumption{"DownloadResumption", base::FEATURE_ENABLED_BY_DEFAULT}; +// Speculatively pre-evaluate Javascript which will likely use document.write to +// load an external script. The feature extracts the written markup and sends it +// to the preload scanner. +const base::Feature kDocumentWriteEvaluator{"DocumentWriteEvaluator", + base::FEATURE_DISABLED_BY_DEFAULT}; + // The Experimental Framework for controlling access to API experiments. const base::Feature kExperimentalFramework{"ExperimentalFramework", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 0e6bd0b..49e3ab2 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -19,6 +19,7 @@ CONTENT_EXPORT extern const base::Feature kBrotliEncoding; CONTENT_EXPORT extern const base::Feature kCredentialManagementAPI; CONTENT_EXPORT extern const base::Feature kDownloadResumption; +CONTENT_EXPORT extern const base::Feature kDocumentWriteEvaluator; CONTENT_EXPORT extern const base::Feature kExperimentalFramework; CONTENT_EXPORT extern const base::Feature kNewMediaPlaybackUi; CONTENT_EXPORT extern const base::Feature kNonValidatingReloadOnRefreshContent;
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index d38c8bd..1b09d22 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc
@@ -970,8 +970,8 @@ "enable-aggressive-domstorage-flushing"; // Enable audio for desktop share. -const char kEnableAudioSupportForDesktopShare[] = - "enable-audio-support-for-desktop-share"; +const char kDisableAudioSupportForDesktopShare[] = + "disable-audio-support-for-desktop-share"; #if defined(OS_CHROMEOS) // Disables panel fitting (used for mirror mode).
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index b907fcf..b69d6c88 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h
@@ -36,6 +36,7 @@ CONTENT_EXPORT extern const char kDisableAcceleratedJpegDecoding[]; CONTENT_EXPORT extern const char kDisableAcceleratedMjpegDecode[]; CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[]; +CONTENT_EXPORT extern const char kDisableAudioSupportForDesktopShare[]; extern const char kDisableBackingStoreLimit[]; CONTENT_EXPORT extern const char kDisableBackgroundingOccludedWindowsForTesting[]; @@ -103,7 +104,6 @@ CONTENT_EXPORT extern const char kDownloadProcess[]; extern const char kEnable2dCanvasClipAntialiasing[]; CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[]; -CONTENT_EXPORT extern const char kEnableAudioSupportForDesktopShare[]; CONTENT_EXPORT extern const char kEnablePreferCompositingToLCDText[]; CONTENT_EXPORT extern const char kEnableBlinkFeatures[]; CONTENT_EXPORT extern const char kEnableBrowserSideNavigation[];
diff --git a/content/public/common/dwrite_font_platform_win.h b/content/public/common/dwrite_font_platform_win.h deleted file mode 100644 index d049f28..0000000 --- a/content/public/common/dwrite_font_platform_win.h +++ /dev/null
@@ -1,47 +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. - -#ifndef CONTENT_PUBLIC_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ -#define CONTENT_PUBLIC_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ - -#include "base/files/file.h" -#include "content/common/content_export.h" - -struct IDWriteFactory; -struct IDWriteFontCollection; - -namespace content { - -// This is the shared section that is used between browser and renderer for -// loading font cache. Section name is suffixed with browser process id so that -// multiple instance chrome scenario works fine. -CONTENT_EXPORT extern const char kFontCacheSharedSectionName[]; - -// Function returns custom font collection in terms of IDWriteFontCollection. -// This function maintains singleton instance of font collection and returns -// it on repeated calls. -CONTENT_EXPORT IDWriteFontCollection* GetCustomFontCollection( - IDWriteFactory* factory); - -// Builds static font cache. As this function need to iterate through all -// available fonts in the system, it may take a while. -CONTENT_EXPORT bool BuildFontCache(const base::FilePath& file); - -// Loads font cache from file. This is supposed to be used from browser -// side where loading means creating readonly shared memory file mapping so that -// renderers can read from it. -CONTENT_EXPORT bool LoadFontCache(const base::FilePath& path); - -// Added in header mainly for unittest -CONTENT_EXPORT bool ValidateFontCacheFile(base::File* file); - -// Determines whether code should use the DirectWrite font proxy codepath. -// Note that this function only checks whether the field trial is enabled. -// Callers are still expected to take appropriate action based on the return -// value. -CONTENT_EXPORT bool ShouldUseDirectWriteFontProxyFieldTrial(); - -} // namespace content - -#endif // CONTENT_PUBLIC_COMMON_DWRITE_FONT_PLATFORM_WIN_H_
diff --git a/content/public/common/navigator_connect_client.cc b/content/public/common/navigator_connect_client.cc deleted file mode 100644 index bf21bc9..0000000 --- a/content/public/common/navigator_connect_client.cc +++ /dev/null
@@ -1,21 +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. - -#include "content/public/common/navigator_connect_client.h" - -namespace content { - -NavigatorConnectClient::NavigatorConnectClient() : message_port_id(-1) { -} - -NavigatorConnectClient::NavigatorConnectClient(const GURL& target_url, - const GURL& origin, - int message_port_id) - : target_url(target_url), origin(origin), message_port_id(message_port_id) { -} - -NavigatorConnectClient::~NavigatorConnectClient() { -} - -} // namespace content
diff --git a/content/public/common/navigator_connect_client.h b/content/public/common/navigator_connect_client.h deleted file mode 100644 index 9cc66ec..0000000 --- a/content/public/common/navigator_connect_client.h +++ /dev/null
@@ -1,33 +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. - -#ifndef CONTENT_PUBLIC_COMMON_NAVIGATOR_CONNECT_CLIENT_H_ -#define CONTENT_PUBLIC_COMMON_NAVIGATOR_CONNECT_CLIENT_H_ - -#include "url/gurl.h" - -namespace content { - -// This struct represents a connection to a navigator.connect exposed service. -struct NavigatorConnectClient { - NavigatorConnectClient(); - NavigatorConnectClient(const GURL& target_url, - const GURL& origin, - int message_port_id); - ~NavigatorConnectClient(); - - // The URL this client is connected to (or trying to connect to). - GURL target_url; - - // The origin of the client. - GURL origin; - - // Message port ID for the service side message port associated with this - // client. - int message_port_id; -}; - -} // namespace content - -#endif // CONTENT_PUBLIC_COMMON_NAVIGATOR_CONNECT_CLIENT_H_
diff --git a/content/public/renderer/media_stream_audio_renderer.h b/content/public/renderer/media_stream_audio_renderer.h index 5a5d68d3..3061d64 100644 --- a/content/public/renderer/media_stream_audio_renderer.h +++ b/content/public/renderer/media_stream_audio_renderer.h
@@ -10,8 +10,8 @@ #include "base/callback.h" #include "base/memory/ref_counted.h" #include "base/time/time.h" -#include "media/base/output_device.h" -#include "url/gurl.h" +#include "media/base/output_device_info.h" +#include "url/origin.h" namespace content { @@ -34,12 +34,24 @@ // Sets the output volume. virtual void SetVolume(float volume) = 0; - // Returns a pointer to the internal output device. - // The pointer is not to be owned by the caller and is valid only during - // the lifetime of the MediaStreamAudioRenderer. - // It can be null, which means that access to the output device is not - // supported. - virtual media::OutputDevice* GetOutputDevice() = 0; + // Returns current output device information. If the information is not + // available yet, this method may block until it becomes available. + // If the renderer is not associated with any output device, |device_status| + // of OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL. + // Must never be called on the IO thread. + virtual media::OutputDeviceInfo GetOutputDeviceInfo() = 0; + + // Attempts to switch the audio output device. + // Once the attempt is finished, |callback| is invoked with the result of the + // operation passed as a parameter. The result is a value from the + // media::OutputDeviceStatus enum. + // There is no guarantee about the thread where |callback| will be invoked. + // TODO(olka): make sure callback is always called on the client thread, + // update clients accordingly and fix the comment. + virtual void SwitchOutputDevice( + const std::string& device_id, + const url::Origin& security_origin, + const media::OutputDeviceStatusCB& callback) = 0; // Time stamp that reflects the current render time. Should not be updated // when paused.
diff --git a/content/public/test/layouttest_support.h b/content/public/test/layouttest_support.h index 402fd04..57517731 100644 --- a/content/public/test/layouttest_support.h +++ b/content/public/test/layouttest_support.h
@@ -32,6 +32,7 @@ } namespace test_runner { +class WebFrameTestProxyBase; class WebTestProxyBase; } @@ -51,12 +52,17 @@ // Turn a renderer into layout test mode. void EnableRendererLayoutTestMode(); -// Enable injecting of a WebTestProxy between WebViews and RenderViews. -// |callback| is invoked with a pointer to WebTestProxyBase for each created -// WebTestProxy. +// Enable injecting of a WebTestProxy between WebViews and RenderViews +// and WebFrameTestProxy between WebFrames and RenderFrames. +// |view_proxy_creation_callback| is invoked after creating WebTestProxy. +// |frame_proxy_creation_callback| is called after creating WebFrameTestProxy. +using ViewProxyCreationCallback = + base::Callback<void(RenderView*, test_runner::WebTestProxyBase*)>; +using FrameProxyCreationCallback = + base::Callback<void(RenderFrame*, test_runner::WebFrameTestProxyBase*)>; void EnableWebTestProxyCreation( - const base::Callback<void(RenderView*, test_runner::WebTestProxyBase*)>& - callback); + const ViewProxyCreationCallback& view_proxy_creation_callback, + const FrameProxyCreationCallback& frame_proxy_creation_callback); typedef base::Callback<void(const blink::WebURLResponse& response, const std::string& data)> FetchManifestCallback;
diff --git a/content/public/test/test_launcher.h b/content/public/test/test_launcher.h index 67b711b..c0d3824 100644 --- a/content/public/test/test_launcher.h +++ b/content/public/test/test_launcher.h
@@ -8,6 +8,7 @@ #include <string> #include "base/compiler_specific.h" +#include "base/memory/scoped_ptr.h" #include "base/test/launcher/test_launcher.h" namespace base {
diff --git a/content/public/test/test_synchronous_compositor_android.h b/content/public/test/test_synchronous_compositor_android.h index 613eda66..baa395d4 100644 --- a/content/public/test/test_synchronous_compositor_android.h +++ b/content/public/test/test_synchronous_compositor_android.h
@@ -39,6 +39,7 @@ void DidChangeRootLayerScrollOffset( const gfx::ScrollOffset& root_offset) override {} void SetIsActive(bool is_active) override {} + void SynchronizeWithRenderer() override {} void OnComputeScroll(base::TimeTicks animate_time) override {} void SetHardwareFrame(uint32_t output_surface_id,
diff --git a/content/public/test/test_web_contents_factory.h b/content/public/test/test_web_contents_factory.h index 92cdcae..e0caf326 100644 --- a/content/public/test/test_web_contents_factory.h +++ b/content/public/test/test_web_contents_factory.h
@@ -6,6 +6,7 @@ #define CONTENT_PUBLIC_TEST_TEST_WEB_CONTENTS_FACTORY_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" namespace content {
diff --git a/content/renderer/android/synchronous_compositor_proxy.cc b/content/renderer/android/synchronous_compositor_proxy.cc index 4ecfdff..0cdb1b0 100644 --- a/content/renderer/android/synchronous_compositor_proxy.cc +++ b/content/renderer/android/synchronous_compositor_proxy.cc
@@ -171,6 +171,8 @@ IPC_MESSAGE_HANDLER_DELAY_REPLY(SyncCompositorMsg_DemandDrawSw, DemandDrawSw) IPC_MESSAGE_HANDLER(SyncCompositorMsg_UpdateState, ProcessCommonParams) + IPC_MESSAGE_HANDLER(SyncCompositorMsg_SynchronousUpdateState, + SynchronousUpdateState) IPC_END_MESSAGE_MAP() } @@ -396,6 +398,15 @@ } } +void SynchronousCompositorProxy::SynchronousUpdateState( + const SyncCompositorCommonBrowserParams& common_params, + SyncCompositorCommonRendererParams* common_renderer_params) { + DCHECK(!inside_receive_); + base::AutoReset<bool> scoped_inside_receive(&inside_receive_, true); + ProcessCommonParams(common_params); + PopulateCommonParams(common_renderer_params); +} + void SynchronousCompositorProxy::DidOverscroll( const DidOverscrollParams& did_overscroll_params) { SyncCompositorCommonRendererParams params;
diff --git a/content/renderer/android/synchronous_compositor_proxy.h b/content/renderer/android/synchronous_compositor_proxy.h index 3bb4692..8b15859 100644 --- a/content/renderer/android/synchronous_compositor_proxy.h +++ b/content/renderer/android/synchronous_compositor_proxy.h
@@ -109,6 +109,9 @@ void DemandDrawSw(const SyncCompositorCommonBrowserParams& common_params, const SyncCompositorDemandDrawSwParams& params, IPC::Message* reply_message); + void SynchronousUpdateState( + const SyncCompositorCommonBrowserParams& common_params, + SyncCompositorCommonRendererParams* common_renderer_params); void SwapBuffersHw(uint32_t output_surface_id, cc::CompositorFrame* frame); void SendDemandDrawHwReply(cc::CompositorFrame* frame,
diff --git a/content/renderer/cache_storage/cache_storage_dispatcher.cc b/content/renderer/cache_storage/cache_storage_dispatcher.cc index 4654027..dd5b258 100644 --- a/content/renderer/cache_storage/cache_storage_dispatcher.cc +++ b/content/renderer/cache_storage/cache_storage_dispatcher.cc
@@ -23,6 +23,7 @@ #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerCache.h" #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerRequest.h" #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerResponse.h" +#include "url/origin.h" using base::TimeTicks; @@ -525,7 +526,7 @@ void CacheStorageDispatcher::dispatchHas( WebServiceWorkerCacheStorage::CacheStorageCallbacks* callbacks, - const GURL& origin, + const url::Origin& origin, const blink::WebString& cacheName) { int request_id = has_callbacks_.Add(callbacks); has_times_[request_id] = base::TimeTicks::Now(); @@ -535,7 +536,7 @@ void CacheStorageDispatcher::dispatchOpen( WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks* callbacks, - const GURL& origin, + const url::Origin& origin, const blink::WebString& cacheName) { int request_id = open_callbacks_.Add(callbacks); open_times_[request_id] = base::TimeTicks::Now(); @@ -545,7 +546,7 @@ void CacheStorageDispatcher::dispatchDelete( WebServiceWorkerCacheStorage::CacheStorageCallbacks* callbacks, - const GURL& origin, + const url::Origin& origin, const blink::WebString& cacheName) { int request_id = delete_callbacks_.Add(callbacks); delete_times_[request_id] = base::TimeTicks::Now(); @@ -555,7 +556,7 @@ void CacheStorageDispatcher::dispatchKeys( WebServiceWorkerCacheStorage::CacheStorageKeysCallbacks* callbacks, - const GURL& origin) { + const url::Origin& origin) { int request_id = keys_callbacks_.Add(callbacks); keys_times_[request_id] = base::TimeTicks::Now(); Send(new CacheStorageHostMsg_CacheStorageKeys(CurrentWorkerId(), request_id, @@ -564,7 +565,7 @@ void CacheStorageDispatcher::dispatchMatch( WebServiceWorkerCacheStorage::CacheStorageMatchCallbacks* callbacks, - const GURL& origin, + const url::Origin& origin, const blink::WebServiceWorkerRequest& request, const blink::WebServiceWorkerCache::QueryParams& query_params) { int request_id = match_callbacks_.Add(callbacks);
diff --git a/content/renderer/cache_storage/cache_storage_dispatcher.h b/content/renderer/cache_storage/cache_storage_dispatcher.h index a43757d..88a3933 100644 --- a/content/renderer/cache_storage/cache_storage_dispatcher.h +++ b/content/renderer/cache_storage/cache_storage_dispatcher.h
@@ -20,6 +20,10 @@ #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerCacheError.h" #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerCacheStorage.h" +namespace url { +class Origin; +} + namespace content { class ThreadSafeSender; @@ -105,24 +109,24 @@ // and should be renamed to match Chromium conventions. crbug.com/439389 void dispatchHas( blink::WebServiceWorkerCacheStorage::CacheStorageCallbacks* callbacks, - const GURL& origin, + const url::Origin& origin, const blink::WebString& cacheName); void dispatchOpen( blink::WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks* callbacks, - const GURL& origin, + const url::Origin& origin, const blink::WebString& cacheName); void dispatchDelete( blink::WebServiceWorkerCacheStorage::CacheStorageCallbacks* callbacks, - const GURL& origin, + const url::Origin& origin, const blink::WebString& cacheName); void dispatchKeys( blink::WebServiceWorkerCacheStorage::CacheStorageKeysCallbacks* callbacks, - const GURL& origin); + const url::Origin& origin); void dispatchMatch( blink::WebServiceWorkerCacheStorage::CacheStorageMatchCallbacks* callbacks, - const GURL& origin, + const url::Origin& origin, const blink::WebServiceWorkerRequest& request, const blink::WebServiceWorkerCache::QueryParams& query_params);
diff --git a/content/renderer/cache_storage/webserviceworkercachestorage_impl.cc b/content/renderer/cache_storage/webserviceworkercachestorage_impl.cc index 4febfca..2103c9cd 100644 --- a/content/renderer/cache_storage/webserviceworkercachestorage_impl.cc +++ b/content/renderer/cache_storage/webserviceworkercachestorage_impl.cc
@@ -17,9 +17,8 @@ WebServiceWorkerCacheStorageImpl::WebServiceWorkerCacheStorageImpl( ThreadSafeSender* thread_safe_sender, - const GURL& origin) - : thread_safe_sender_(thread_safe_sender), origin_(origin) { -} + const url::Origin& origin) + : thread_safe_sender_(thread_safe_sender), origin_(origin) {} WebServiceWorkerCacheStorageImpl::~WebServiceWorkerCacheStorageImpl() { }
diff --git a/content/renderer/cache_storage/webserviceworkercachestorage_impl.h b/content/renderer/cache_storage/webserviceworkercachestorage_impl.h index cc6d8e8..de77cad 100644 --- a/content/renderer/cache_storage/webserviceworkercachestorage_impl.h +++ b/content/renderer/cache_storage/webserviceworkercachestorage_impl.h
@@ -11,6 +11,7 @@ #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerCache.h" #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerCacheError.h" #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerCacheStorage.h" +#include "url/origin.h" namespace content { @@ -28,7 +29,7 @@ : public blink::WebServiceWorkerCacheStorage { public: WebServiceWorkerCacheStorageImpl(ThreadSafeSender* thread_safe_sender, - const GURL& origin); + const url::Origin& origin); ~WebServiceWorkerCacheStorageImpl() override; // From WebServiceWorkerCacheStorage: @@ -49,7 +50,7 @@ CacheStorageDispatcher* GetDispatcher() const; scoped_refptr<ThreadSafeSender> thread_safe_sender_; - const GURL origin_; + const url::Origin origin_; DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerCacheStorageImpl); };
diff --git a/content/renderer/devtools/v8_sampling_profiler.h b/content/renderer/devtools/v8_sampling_profiler.h index 84fa97d25..6d5b432 100644 --- a/content/renderer/devtools/v8_sampling_profiler.h +++ b/content/renderer/devtools/v8_sampling_profiler.h
@@ -6,6 +6,7 @@ #define CONTENT_RENDERER_DEVTOOLS_V8_SAMPLING_PROFILER_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/single_thread_task_runner.h" #include "base/synchronization/waitable_event.h" #include "base/trace_event/trace_log.h"
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index 5920e0bd..f085fd5 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -178,7 +178,7 @@ if (numTiles >= 40) default_tile_size = 512; } -#elif defined(OS_CHROMEOS) +#elif defined(OS_CHROMEOS) || defined(OS_MACOSX) // Use 512 for high DPI (dsf=2.0f) devices. if (initial_device_scale_factor >= 2.0f) default_tile_size = 512;
diff --git a/content/renderer/history_controller.cc b/content/renderer/history_controller.cc index e459d9a..0a6cd634 100644 --- a/content/renderer/history_controller.cc +++ b/content/renderer/history_controller.cc
@@ -187,7 +187,14 @@ case blink::WebBackForwardCommit: if (!provisional_entry_) return; - current_entry_.reset(provisional_entry_.release()); + // Commit the provisional entry, but only if this back/forward item + // matches it. Otherwise it could be a commit from an earlier attempt to + // go back/forward, and we should leave the provisional entry in place. + if (HistoryEntry::HistoryNode* node = + provisional_entry_->GetHistoryNodeForFrame(frame)) { + if (node->item().itemSequenceNumber() == item.itemSequenceNumber()) + current_entry_.reset(provisional_entry_.release()); + } if (HistoryEntry::HistoryNode* node = current_entry_->GetHistoryNodeForFrame(frame)) { node->set_item(item);
diff --git a/content/renderer/in_process_renderer_thread.h b/content/renderer/in_process_renderer_thread.h index ab256f4a..d7d0e718 100644 --- a/content/renderer/in_process_renderer_thread.h +++ b/content/renderer/in_process_renderer_thread.h
@@ -8,6 +8,7 @@ #include <string> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/threading/thread.h" #include "content/common/content_export.h" #include "content/common/in_process_child_thread_params.h"
diff --git a/content/renderer/media/audio_device_factory.cc b/content/renderer/media/audio_device_factory.cc index e2118fe..f36cf4b 100644 --- a/content/renderer/media/audio_device_factory.cc +++ b/content/renderer/media/audio_device_factory.cc
@@ -21,6 +21,19 @@ namespace { +scoped_refptr<media::AudioOutputDevice> NewOutputDevice( + int render_frame_id, + int session_id, + const std::string& device_id, + const url::Origin& security_origin) { + AudioMessageFilter* const filter = AudioMessageFilter::Get(); + scoped_refptr<media::AudioOutputDevice> device(new media::AudioOutputDevice( + filter->CreateAudioOutputIPC(render_frame_id), filter->io_task_runner(), + session_id, device_id, security_origin)); + device->RequestDeviceAuthorization(); + return device; +} + // This is where we decide which audio will go to mixers and which one to // AudioOutpuDevice directly. bool IsMixable(AudioDeviceFactory::SourceType source_type) { @@ -32,7 +45,7 @@ return false; } -scoped_refptr<media::RestartableAudioRendererSink> NewMixableSink( +scoped_refptr<media::SwitchableAudioRendererSink> NewMixableSink( int render_frame_id, const std::string& device_id, const url::Origin& security_origin) { @@ -47,31 +60,27 @@ int session_id, const std::string& device_id, const url::Origin& security_origin) { - return AudioDeviceFactory::NewOutputDevice(render_frame_id, session_id, - device_id, security_origin); + return NewOutputDevice(render_frame_id, session_id, device_id, + security_origin); } } // namespace -// static -scoped_refptr<media::AudioOutputDevice> AudioDeviceFactory::NewOutputDevice( +scoped_refptr<media::AudioRendererSink> +AudioDeviceFactory::NewAudioRendererMixerSink( int render_frame_id, int session_id, const std::string& device_id, const url::Origin& security_origin) { if (factory_) { - media::AudioOutputDevice* const device = factory_->CreateOutputDevice( - render_frame_id, session_id, device_id, security_origin); - if (device) - return device; + scoped_refptr<media::AudioRendererSink> sink = + factory_->CreateAudioRendererMixerSink(render_frame_id, session_id, + device_id, security_origin); + if (sink) + return sink; } - - AudioMessageFilter* const filter = AudioMessageFilter::Get(); - scoped_refptr<media::AudioOutputDevice> device = new media::AudioOutputDevice( - filter->CreateAudioOutputIPC(render_frame_id), filter->io_task_runner(), - session_id, device_id, security_origin); - device->RequestDeviceAuthorization(); - return device; + return NewOutputDevice(render_frame_id, session_id, device_id, + security_origin); } // static @@ -82,8 +91,10 @@ const std::string& device_id, const url::Origin& security_origin) { if (factory_) { - media::AudioRendererSink* const device = factory_->CreateAudioRendererSink( - source_type, render_frame_id, session_id, device_id, security_origin); + scoped_refptr<media::AudioRendererSink> device = + factory_->CreateAudioRendererSink(source_type, render_frame_id, + session_id, device_id, + security_origin); if (device) return device; } @@ -96,20 +107,20 @@ } // static -scoped_refptr<media::RestartableAudioRendererSink> -AudioDeviceFactory::NewRestartableAudioRendererSink( +scoped_refptr<media::SwitchableAudioRendererSink> +AudioDeviceFactory::NewSwitchableAudioRendererSink( SourceType source_type, int render_frame_id, int session_id, const std::string& device_id, const url::Origin& security_origin) { if (factory_) { - media::RestartableAudioRendererSink* const device = - factory_->CreateRestartableAudioRendererSink( - source_type, render_frame_id, session_id, device_id, - security_origin); - if (device) - return device; + scoped_refptr<media::SwitchableAudioRendererSink> sink = + factory_->CreateSwitchableAudioRendererSink(source_type, + render_frame_id, session_id, + device_id, security_origin); + if (sink) + return sink; } if (IsMixable(source_type)) @@ -122,13 +133,13 @@ } // static -scoped_refptr<media::AudioInputDevice> AudioDeviceFactory::NewInputDevice( - int render_frame_id) { +scoped_refptr<media::AudioCapturerSource> +AudioDeviceFactory::NewAudioCapturerSource(int render_frame_id) { if (factory_) { - media::AudioInputDevice* const device = - factory_->CreateInputDevice(render_frame_id); - if (device) - return device; + scoped_refptr<media::AudioCapturerSource> source = + factory_->CreateAudioCapturerSource(render_frame_id); + if (source) + return source; } AudioInputMessageFilter* const filter = AudioInputMessageFilter::Get(); @@ -139,17 +150,17 @@ // static // TODO(http://crbug.com/587461): Find a better way to check if device exists // and is authorized. -media::OutputDeviceStatus AudioDeviceFactory::GetOutputDeviceStatus( +media::OutputDeviceInfo AudioDeviceFactory::GetOutputDeviceInfo( int render_frame_id, int session_id, const std::string& device_id, const url::Origin& security_origin) { scoped_refptr<media::AudioOutputDevice> device = NewOutputDevice(render_frame_id, session_id, device_id, security_origin); - media::OutputDeviceStatus status = device->GetDeviceStatus(); + const media::OutputDeviceInfo& device_info = device->GetOutputDeviceInfo(); device->Stop(); // Must be stopped. - return status; + return device_info; } AudioDeviceFactory::AudioDeviceFactory() {
diff --git a/content/renderer/media/audio_device_factory.h b/content/renderer/media/audio_device_factory.h index 749888c..73ce7ee8 100644 --- a/content/renderer/media/audio_device_factory.h +++ b/content/renderer/media/audio_device_factory.h
@@ -11,11 +11,12 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" #include "content/common/content_export.h" -#include "media/base/audio_renderer_sink.h" +#include "media/base/output_device_info.h" namespace media { -class AudioInputDevice; -class AudioOutputDevice; +class AudioRendererSink; +class SwitchableAudioRendererSink; +class AudioCapturerSource; } namespace url { @@ -24,9 +25,11 @@ namespace content { -// A factory for creating AudioOutputDevices and AudioInputDevices. There is a -// global factory function that can be installed for the purposes of testing to -// provide specialized implementations. +// A factory for creating AudioRendererSinks and AudioCapturerSources. There is +// a global factory function that can be installed for the purposes of testing +// to provide specialized implementations. +// TODO(olka): rename it, probably split it into AudioRendererSinkFactory and +// AudioCapturerSourceFactory. class CONTENT_EXPORT AudioDeviceFactory { public: // Types of audio sources. @@ -39,7 +42,7 @@ kSourceLast = kSourceWebAudio // Only used for validation of format. }; - // Creates an AudioOutputDevice. + // Creates a sink for AudioRendererMixer. // |render_frame_id| refers to the RenderFrame containing the entity // producing the audio. If |session_id| is nonzero, it is used by the browser // to select the correct input device ID and its associated output device, if @@ -47,7 +50,7 @@ // identify the output device to use. // If |session_id| is zero and |device_id| and |security_origin| are empty, // the default output device will be selected. - static scoped_refptr<media::AudioOutputDevice> NewOutputDevice( + static scoped_refptr<media::AudioRendererSink> NewAudioRendererMixerSink( int render_frame_id, int session_id, const std::string& device_id, @@ -65,27 +68,27 @@ const std::string& device_id, const url::Origin& security_origin); - // Creates a RestartableAudioRendererSink bound to an AudioOutputDevice + // Creates a SwitchableAudioRendererSink bound to an AudioOutputDevice // Basing on |source_type| and build configuration, audio played out through // the sink goes to AOD directly or can be mixed with other audio before that. - static scoped_refptr<media::RestartableAudioRendererSink> - NewRestartableAudioRendererSink(SourceType source_type, - int render_frame_id, - int session_id, - const std::string& device_id, - const url::Origin& security_origin); + static scoped_refptr<media::SwitchableAudioRendererSink> + NewSwitchableAudioRendererSink(SourceType source_type, + int render_frame_id, + int session_id, + const std::string& device_id, + const url::Origin& security_origin); - // A helper to get HW device status in the absence of AudioOutputDevice. - static media::OutputDeviceStatus GetOutputDeviceStatus( + // A helper to get device info in the absence of AudioOutputDevice. + static media::OutputDeviceInfo GetOutputDeviceInfo( int render_frame_id, int session_id, const std::string& device_id, const url::Origin& security_origin); - // Creates an AudioInputDevice using the currently registered factory. + // Creates an AudioCapturerSource using the currently registered factory. // |render_frame_id| refers to the RenderFrame containing the entity // consuming the audio. - static scoped_refptr<media::AudioInputDevice> NewInputDevice( + static scoped_refptr<media::AudioCapturerSource> NewAudioCapturerSource( int render_frame_id); protected: @@ -96,27 +99,28 @@ // functions to provide alternate audio device implementations. // If the return value of either of these function is NULL, we fall back // on the default implementation. - virtual media::AudioOutputDevice* CreateOutputDevice( + virtual scoped_refptr<media::AudioRendererSink> CreateAudioRendererMixerSink( int render_frame_id, int sesssion_id, const std::string& device_id, const url::Origin& security_origin) = 0; - virtual media::AudioRendererSink* CreateAudioRendererSink( + virtual scoped_refptr<media::AudioRendererSink> CreateAudioRendererSink( SourceType source_type, int render_frame_id, int sesssion_id, const std::string& device_id, const url::Origin& security_origin) = 0; - virtual media::RestartableAudioRendererSink* - CreateRestartableAudioRendererSink(SourceType source_type, - int render_frame_id, - int sesssion_id, - const std::string& device_id, - const url::Origin& security_origin) = 0; + virtual scoped_refptr<media::SwitchableAudioRendererSink> + CreateSwitchableAudioRendererSink(SourceType source_type, + int render_frame_id, + int sesssion_id, + const std::string& device_id, + const url::Origin& security_origin) = 0; - virtual media::AudioInputDevice* CreateInputDevice(int render_frame_id) = 0; + virtual scoped_refptr<media::AudioCapturerSource> CreateAudioCapturerSource( + int render_frame_id) = 0; private: // The current globally registered factory. This is NULL when we should
diff --git a/content/renderer/media/audio_renderer_mixer_manager.cc b/content/renderer/media/audio_renderer_mixer_manager.cc index 309eaa84..14359b3 100644 --- a/content/renderer/media/audio_renderer_mixer_manager.cc +++ b/content/renderer/media/audio_renderer_mixer_manager.cc
@@ -17,8 +17,7 @@ namespace content { -AudioRendererMixerManager::AudioRendererMixerManager() - : sink_for_testing_(nullptr) {} +AudioRendererMixerManager::AudioRendererMixerManager() {} AudioRendererMixerManager::~AudioRendererMixerManager() { // References to AudioRendererMixers may be owned by garbage collected @@ -35,17 +34,10 @@ source_render_frame_id), base::Bind(&AudioRendererMixerManager::RemoveMixer, base::Unretained(this), source_render_frame_id), - base::Bind(&AudioRendererMixerManager::GetHardwareOutputParams, - source_render_frame_id, 0), // Session id is 0. device_id, security_origin); } -void AudioRendererMixerManager::SetAudioRendererSinkForTesting( - media::AudioRendererSink* sink) { - sink_for_testing_ = sink; -} - media::AudioRendererMixer* AudioRendererMixerManager::GetMixer( int source_render_frame_id, const media::AudioParameters& params, @@ -69,17 +61,13 @@ } scoped_refptr<media::AudioRendererSink> sink = - sink_for_testing_ - ? sink_for_testing_ - : AudioDeviceFactory::NewOutputDevice(source_render_frame_id, 0, - device_id, security_origin) - .get(); + AudioDeviceFactory::NewAudioRendererMixerSink(source_render_frame_id, 0, + device_id, security_origin); - media::OutputDeviceStatus new_device_status = - sink->GetOutputDevice()->GetDeviceStatus(); + const media::OutputDeviceInfo& device_info = sink->GetOutputDeviceInfo(); if (device_status) - *device_status = new_device_status; - if (new_device_status != media::OUTPUT_DEVICE_STATUS_OK) { + *device_status = device_info.device_status(); + if (device_info.device_status() != media::OUTPUT_DEVICE_STATUS_OK) { sink->Stop(); return nullptr; } @@ -91,8 +79,7 @@ media::AudioHardwareConfig::GetHighLatencyBufferSize(sample_rate, 0); #if !defined(OS_CHROMEOS) - media::AudioParameters hardware_params = - sink->GetOutputDevice()->GetOutputParameters(); + const media::AudioParameters& hardware_params = device_info.output_params(); // If we have valid, non-fake hardware parameters, use them. Otherwise, pass // on the input params and let the browser side handle automatic fallback. @@ -139,31 +126,6 @@ } } -// static -media::AudioParameters AudioRendererMixerManager::GetHardwareOutputParams( - int render_frame_id, - int session_id, - const std::string& device_id, - const url::Origin& security_origin) { - media::AudioParameters params; // Invalid parameters to return by default. - - // TODO(olka): First try to lookup an existing device (cached or belonging - // to some mixer) and reuse it. http://crbug.com/586161 - - // AudioOutputDevice is the only interface we have to communicate with output - // device via IPC. So, that's how we get the parameters when there is no - // AudioOutputDevice: - scoped_refptr<media::AudioOutputDevice> device = - AudioDeviceFactory::NewOutputDevice(render_frame_id, session_id, - device_id, security_origin); - - if (device->GetDeviceStatus() == media::OUTPUT_DEVICE_STATUS_OK) - params = device->GetOutputParameters(); - - device->Stop(); // TODO(olka): temporary cash for future reuse. - return params; -} - AudioRendererMixerManager::MixerKey::MixerKey( int source_render_frame_id, const media::AudioParameters& params,
diff --git a/content/renderer/media/audio_renderer_mixer_manager.h b/content/renderer/media/audio_renderer_mixer_manager.h index 8b13388..a245a102 100644 --- a/content/renderer/media/audio_renderer_mixer_manager.h +++ b/content/renderer/media/audio_renderer_mixer_manager.h
@@ -13,7 +13,7 @@ #include "base/synchronization/lock.h" #include "content/common/content_export.h" #include "media/audio/audio_parameters.h" -#include "media/base/output_device.h" +#include "media/base/output_device_info.h" #include "url/origin.h" namespace media { @@ -119,23 +119,10 @@ typedef std::map<MixerKey, AudioRendererMixerReference, MixerKeyCompare> AudioRendererMixerMap; - // Overrides the AudioRendererSink implementation for unit testing. - void SetAudioRendererSinkForTesting(media::AudioRendererSink* sink); - - // A helper to get hardware output parameters in the absence of - // AudioOutputDevice. - static media::AudioParameters GetHardwareOutputParams( - int render_frame_id, - int session_id, - const std::string& device_id, - const url::Origin& security_origin); - // Active mixers. AudioRendererMixerMap mixers_; base::Lock mixers_lock_; - media::AudioRendererSink* sink_for_testing_; - DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerManager); };
diff --git a/content/renderer/media/audio_renderer_mixer_manager_unittest.cc b/content/renderer/media/audio_renderer_mixer_manager_unittest.cc index b1371b22..ac2a815 100644 --- a/content/renderer/media/audio_renderer_mixer_manager_unittest.cc +++ b/content/renderer/media/audio_renderer_mixer_manager_unittest.cc
@@ -6,16 +6,18 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" +#include "content/renderer/media/audio_device_factory.h" #include "content/renderer/media/audio_renderer_mixer_manager.h" -#include "ipc/ipc_message.h" +#include "media/audio/audio_manager_base.h" #include "media/audio/audio_parameters.h" -#include "media/base/audio_hardware_config.h" +#include "media/base/audio_capturer_source.h" #include "media/base/audio_renderer_mixer.h" #include "media/base/audio_renderer_mixer_input.h" #include "media/base/fake_audio_render_callback.h" #include "media/base/mock_audio_renderer_sink.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" namespace content { @@ -25,24 +27,26 @@ static const media::ChannelLayout kChannelLayout = media::CHANNEL_LAYOUT_STEREO; static const media::ChannelLayout kAnotherChannelLayout = media::CHANNEL_LAYOUT_2_1; -static const std::string kDefaultDeviceId; -static const url::Origin kSecurityOrigin; +static const char* const kDefaultDeviceId = + media::AudioManagerBase::kDefaultDeviceId; +static const char kAnotherDeviceId[] = "another-device-id"; +static const char kNonexistentDeviceId[] = "nonexistent-device-id"; static const int kRenderFrameId = 124; static const int kAnotherRenderFrameId = 678; using media::AudioParameters; -class AudioRendererMixerManagerTest : public testing::Test { +class AudioRendererMixerManagerTest : public testing::Test, + public AudioDeviceFactory { public: - AudioRendererMixerManagerTest() { - manager_.reset(new AudioRendererMixerManager()); - - // We don't want to deal with instantiating a real AudioOutputDevice since - // it's not important to our testing, so we inject a mock. - mock_sink_ = new media::MockAudioRendererSink(); - manager_->SetAudioRendererSinkForTesting(mock_sink_.get()); - } + AudioRendererMixerManagerTest() + : manager_(new AudioRendererMixerManager()), + mock_sink_(new media::MockAudioRendererSink()), + mock_sink_no_device_(new media::MockAudioRendererSink( + kNonexistentDeviceId, + media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND)), + kSecurityOrigin2(GURL("http://localhost")) {} media::AudioRendererMixer* GetMixer( int source_render_frame_id, @@ -62,20 +66,55 @@ security_origin); } - void UseNonexistentSink() { - mock_sink_ = new media::MockAudioRendererSink( - media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND); - manager_->SetAudioRendererSinkForTesting(mock_sink_.get()); - } - // Number of instantiated mixers. int mixer_count() { return manager_->mixers_.size(); } protected: + MOCK_METHOD1(CreateAudioCapturerSource, + scoped_refptr<media::AudioCapturerSource>(int)); + MOCK_METHOD5( + CreateSwitchableAudioRendererSink, + scoped_refptr<media::SwitchableAudioRendererSink>(SourceType, + int, + int, + const std::string&, + const url::Origin&)); + MOCK_METHOD5(CreateAudioRendererSink, + scoped_refptr<media::AudioRendererSink>(SourceType, + int, + int, + const std::string&, + const url::Origin&)); + + scoped_refptr<media::AudioRendererSink> CreateAudioRendererMixerSink( + int render_frame_id, + int session_id, + const std::string& device_id, + const url::Origin& security_origin) { + if ((device_id == kDefaultDeviceId) || (device_id == kAnotherDeviceId)) { + // We don't care about separate sinks for these devices + return mock_sink_; + } + if (device_id == kNonexistentDeviceId) { + return mock_sink_no_device_; + } + if (device_id.empty()) { + return mock_sink_; + } + + NOTREACHED(); + return nullptr; + } + scoped_ptr<AudioRendererMixerManager> manager_; scoped_refptr<media::MockAudioRendererSink> mock_sink_; + scoped_refptr<media::MockAudioRendererSink> mock_sink_no_device_; + + // To avoid global/static non-POD constants. + const url::Origin kSecurityOrigin; + const url::Origin kSecurityOrigin2; private: DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerManagerTest); @@ -90,7 +129,7 @@ EXPECT_CALL(*mock_sink_.get(), Stop()).Times(2); // There should be no mixers outstanding to start with. - EXPECT_EQ(mixer_count(), 0); + EXPECT_EQ(0, mixer_count()); media::AudioParameters params1( AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, kSampleRate, @@ -99,16 +138,16 @@ media::AudioRendererMixer* mixer1 = GetMixer( kRenderFrameId, params1, kDefaultDeviceId, kSecurityOrigin, nullptr); ASSERT_TRUE(mixer1); - EXPECT_EQ(mixer_count(), 1); + EXPECT_EQ(1, mixer_count()); // The same parameters should return the same mixer1. EXPECT_EQ(mixer1, GetMixer(kRenderFrameId, params1, kDefaultDeviceId, kSecurityOrigin, nullptr)); - EXPECT_EQ(mixer_count(), 1); + EXPECT_EQ(1, mixer_count()); // Remove the extra mixer we just acquired. RemoveMixer(kRenderFrameId, params1, kDefaultDeviceId, kSecurityOrigin); - EXPECT_EQ(mixer_count(), 1); + EXPECT_EQ(1, mixer_count()); media::AudioParameters params2( AudioParameters::AUDIO_PCM_LINEAR, kAnotherChannelLayout, kSampleRate * 2, @@ -116,16 +155,16 @@ media::AudioRendererMixer* mixer2 = GetMixer( kRenderFrameId, params2, kDefaultDeviceId, kSecurityOrigin, nullptr); ASSERT_TRUE(mixer2); - EXPECT_EQ(mixer_count(), 2); + EXPECT_EQ(2, mixer_count()); // Different parameters should result in a different mixer1. EXPECT_NE(mixer1, mixer2); // Remove both outstanding mixers. RemoveMixer(kRenderFrameId, params1, kDefaultDeviceId, kSecurityOrigin); - EXPECT_EQ(mixer_count(), 1); + EXPECT_EQ(1, mixer_count()); RemoveMixer(kRenderFrameId, params2, kDefaultDeviceId, kSecurityOrigin); - EXPECT_EQ(mixer_count(), 0); + EXPECT_EQ(0, mixer_count()); } // Verify GetMixer() correctly deduplicates mixer with irrelevant AudioParameter @@ -143,7 +182,7 @@ media::AudioRendererMixer* mixer1 = GetMixer( kRenderFrameId, params1, kDefaultDeviceId, kSecurityOrigin, nullptr); ASSERT_TRUE(mixer1); - EXPECT_EQ(mixer_count(), 1); + EXPECT_EQ(1, mixer_count()); // Different sample rates, formats, bit depths, and buffer sizes should not // result in a different mixer. @@ -154,9 +193,9 @@ kBufferSize * 2); EXPECT_EQ(mixer1, GetMixer(kRenderFrameId, params2, kDefaultDeviceId, kSecurityOrigin, nullptr)); - EXPECT_EQ(mixer_count(), 1); + EXPECT_EQ(1, mixer_count()); RemoveMixer(kRenderFrameId, params2, kDefaultDeviceId, kSecurityOrigin); - EXPECT_EQ(mixer_count(), 1); + EXPECT_EQ(1, mixer_count()); // Modify some parameters that do matter: channel layout media::AudioParameters params3(AudioParameters::AUDIO_PCM_LOW_LATENCY, @@ -168,13 +207,13 @@ EXPECT_NE(mixer1, GetMixer(kRenderFrameId, params3, kDefaultDeviceId, kSecurityOrigin, nullptr)); - EXPECT_EQ(mixer_count(), 2); + EXPECT_EQ(2, mixer_count()); RemoveMixer(kRenderFrameId, params3, kDefaultDeviceId, kSecurityOrigin); - EXPECT_EQ(mixer_count(), 1); + EXPECT_EQ(1, mixer_count()); // Remove final mixer. RemoveMixer(kRenderFrameId, params1, kDefaultDeviceId, kSecurityOrigin); - EXPECT_EQ(mixer_count(), 0); + EXPECT_EQ(0, mixer_count()); } // Verify CreateInput() provides AudioRendererMixerInput with the appropriate @@ -192,33 +231,33 @@ kBitsPerChannel, kBufferSize); // Create two mixer inputs and ensure this doesn't instantiate any mixers yet. - EXPECT_EQ(mixer_count(), 0); + EXPECT_EQ(0, mixer_count()); media::FakeAudioRenderCallback callback(0); scoped_refptr<media::AudioRendererMixerInput> input( manager_->CreateInput(kRenderFrameId, kDefaultDeviceId, kSecurityOrigin)); input->Initialize(params, &callback); - EXPECT_EQ(mixer_count(), 0); + EXPECT_EQ(0, mixer_count()); media::FakeAudioRenderCallback another_callback(1); scoped_refptr<media::AudioRendererMixerInput> another_input( manager_->CreateInput(kAnotherRenderFrameId, kDefaultDeviceId, kSecurityOrigin)); another_input->Initialize(params, &another_callback); - EXPECT_EQ(mixer_count(), 0); + EXPECT_EQ(0, mixer_count()); // Implicitly test that AudioRendererMixerInput was provided with the expected // callbacks needed to acquire an AudioRendererMixer and remove it. input->Start(); - EXPECT_EQ(mixer_count(), 1); + EXPECT_EQ(1, mixer_count()); another_input->Start(); - EXPECT_EQ(mixer_count(), 2); + EXPECT_EQ(2, mixer_count()); // Destroying the inputs should destroy the mixers. input->Stop(); - input = NULL; - EXPECT_EQ(mixer_count(), 1); + input = nullptr; + EXPECT_EQ(1, mixer_count()); another_input->Stop(); - another_input = NULL; - EXPECT_EQ(mixer_count(), 0); + another_input = nullptr; + EXPECT_EQ(0, mixer_count()); } // Verify GetMixer() correctly creates different mixers with the same @@ -226,7 +265,7 @@ TEST_F(AudioRendererMixerManagerTest, MixerDevices) { EXPECT_CALL(*mock_sink_.get(), Start()).Times(3); EXPECT_CALL(*mock_sink_.get(), Stop()).Times(3); - EXPECT_EQ(mixer_count(), 0); + EXPECT_EQ(0, mixer_count()); media::AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, kSampleRate, kBitsPerChannel, @@ -234,48 +273,44 @@ media::AudioRendererMixer* mixer1 = GetMixer( kRenderFrameId, params, kDefaultDeviceId, kSecurityOrigin, nullptr); ASSERT_TRUE(mixer1); - EXPECT_EQ(mixer_count(), 1); + EXPECT_EQ(1, mixer_count()); - std::string device_id2("fake-device-id"); - media::AudioRendererMixer* mixer2 = - GetMixer(kRenderFrameId, params, device_id2, kSecurityOrigin, nullptr); + media::AudioRendererMixer* mixer2 = GetMixer( + kRenderFrameId, params, kAnotherDeviceId, kSecurityOrigin, nullptr); ASSERT_TRUE(mixer2); - EXPECT_EQ(mixer_count(), 2); + EXPECT_EQ(2, mixer_count()); EXPECT_NE(mixer1, mixer2); - url::Origin security_origin2(GURL("http://localhost")); media::AudioRendererMixer* mixer3 = GetMixer( - kRenderFrameId, params, kDefaultDeviceId, security_origin2, nullptr); + kRenderFrameId, params, kAnotherDeviceId, kSecurityOrigin2, nullptr); ASSERT_TRUE(mixer3); - EXPECT_EQ(mixer_count(), 3); + EXPECT_EQ(3, mixer_count()); EXPECT_NE(mixer1, mixer3); EXPECT_NE(mixer2, mixer3); RemoveMixer(kRenderFrameId, params, kDefaultDeviceId, kSecurityOrigin); - EXPECT_EQ(mixer_count(), 2); - RemoveMixer(kRenderFrameId, params, device_id2, kSecurityOrigin); - EXPECT_EQ(mixer_count(), 1); - RemoveMixer(kRenderFrameId, params, kDefaultDeviceId, security_origin2); - EXPECT_EQ(mixer_count(), 0); + EXPECT_EQ(2, mixer_count()); + RemoveMixer(kRenderFrameId, params, kAnotherDeviceId, kSecurityOrigin); + EXPECT_EQ(1, mixer_count()); + RemoveMixer(kRenderFrameId, params, kAnotherDeviceId, kSecurityOrigin2); + EXPECT_EQ(0, mixer_count()); } // Verify that GetMixer() correctly returns a null mixer and an appropriate // status code when a nonexistent device is requested. TEST_F(AudioRendererMixerManagerTest, NonexistentDevice) { - EXPECT_EQ(mixer_count(), 0); - UseNonexistentSink(); + EXPECT_EQ(0, mixer_count()); media::AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, kSampleRate, kBitsPerChannel, kBufferSize); - std::string nonexistent_device_id("nonexistent-device-id"); media::OutputDeviceStatus device_status = media::OUTPUT_DEVICE_STATUS_OK; - EXPECT_CALL(*mock_sink_.get(), Stop()); + EXPECT_CALL(*mock_sink_no_device_.get(), Stop()); media::AudioRendererMixer* mixer = - GetMixer(kRenderFrameId, params, nonexistent_device_id, kSecurityOrigin, + GetMixer(kRenderFrameId, params, kNonexistentDeviceId, kSecurityOrigin, &device_status); EXPECT_FALSE(mixer); - EXPECT_EQ(device_status, media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND); - EXPECT_EQ(mixer_count(), 0); + EXPECT_EQ(media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, device_status); + EXPECT_EQ(0, mixer_count()); } } // namespace content
diff --git a/content/renderer/media/audio_repetition_detector_unittest.cc b/content/renderer/media/audio_repetition_detector_unittest.cc index 487a7a0..f296750 100644 --- a/content/renderer/media/audio_repetition_detector_unittest.cc +++ b/content/renderer/media/audio_repetition_detector_unittest.cc
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/rand_util.h" #include "content/renderer/media/audio_repetition_detector.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/content/renderer/media/cdm/pepper_cdm_wrapper.h b/content/renderer/media/cdm/pepper_cdm_wrapper.h index db09bbc..6ee1294 100644 --- a/content/renderer/media/cdm/pepper_cdm_wrapper.h +++ b/content/renderer/media/cdm/pepper_cdm_wrapper.h
@@ -13,6 +13,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" class GURL;
diff --git a/content/renderer/media/media_recorder_handler.h b/content/renderer/media/media_recorder_handler.h index 1e31a5f..fb25deaf 100644 --- a/content/renderer/media/media_recorder_handler.h +++ b/content/renderer/media/media_recorder_handler.h
@@ -7,6 +7,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" #include "base/strings/string_piece.h"
diff --git a/content/renderer/media/renderer_webmediaplayer_delegate.h b/content/renderer/media/renderer_webmediaplayer_delegate.h index 0a7813e..711147b3 100644 --- a/content/renderer/media/renderer_webmediaplayer_delegate.h +++ b/content/renderer/media/renderer_webmediaplayer_delegate.h
@@ -9,6 +9,7 @@ #include "base/id_map.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/default_tick_clock.h" #include "base/timer/timer.h"
diff --git a/content/renderer/media/rtc_peer_connection_handler.h b/content/renderer/media/rtc_peer_connection_handler.h index 16bdfd9e..d4bfcdf 100644 --- a/content/renderer/media/rtc_peer_connection_handler.h +++ b/content/renderer/media/rtc_peer_connection_handler.h
@@ -13,6 +13,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread.h"
diff --git a/content/renderer/media/track_audio_renderer.cc b/content/renderer/media/track_audio_renderer.cc index 23f2dadd..c4ae69e 100644 --- a/content/renderer/media/track_audio_renderer.cc +++ b/content/renderer/media/track_audio_renderer.cc
@@ -137,7 +137,7 @@ TrackAudioRenderer::~TrackAudioRenderer() { DCHECK(task_runner_->BelongsToCurrentThread()); - DCHECK(!sink_.get()); + DCHECK(!sink_); DVLOG(1) << "TrackAudioRenderer::~TrackAudioRenderer()"; } @@ -149,7 +149,7 @@ // We get audio data from |audio_track_|... MediaStreamAudioSink::AddToAudioTrack(this, audio_track_); // ...and |sink_| will get audio data from us. - DCHECK(!sink_.get()); + DCHECK(!sink_); sink_ = AudioDeviceFactory::NewAudioRendererSink( AudioDeviceFactory::kSourceNonRtcAudioTrack, playout_render_frame_id_, session_id_, output_device_id_, security_origin_); @@ -168,7 +168,7 @@ // Stop the output audio stream, i.e, stop asking for data to render. // It is safer to call Stop() on the |sink_| to clean up the resources even // when the |sink_| is never started. - if (sink_.get()) { + if (sink_) { sink_->Stop(); sink_ = NULL; } @@ -187,7 +187,7 @@ DVLOG(1) << "TrackAudioRenderer::Play()"; DCHECK(task_runner_->BelongsToCurrentThread()); - if (!sink_.get()) + if (!sink_) return; playing_ = true; @@ -199,7 +199,7 @@ DVLOG(1) << "TrackAudioRenderer::Pause()"; DCHECK(task_runner_->BelongsToCurrentThread()); - if (!sink_.get()) + if (!sink_) return; playing_ = false; @@ -215,13 +215,13 @@ // Cache the volume. Whenever |sink_| is re-created, call SetVolume() with // this cached volume. volume_ = volume; - if (sink_.get()) + if (sink_) sink_->SetVolume(volume); } -media::OutputDevice* TrackAudioRenderer::GetOutputDevice() { +media::OutputDeviceInfo TrackAudioRenderer::GetOutputDeviceInfo() { DCHECK(task_runner_->BelongsToCurrentThread()); - return this; + return sink_ ? sink_->GetOutputDeviceInfo() : media::OutputDeviceInfo(); } base::TimeDelta TrackAudioRenderer::GetCurrentRenderTime() const { @@ -243,7 +243,7 @@ void TrackAudioRenderer::SwitchOutputDevice( const std::string& device_id, const url::Origin& security_origin, - const media::SwitchOutputDeviceCB& callback) { + const media::OutputDeviceStatusCB& callback) { DVLOG(1) << "TrackAudioRenderer::SwitchOutputDevice()"; DCHECK(task_runner_->BelongsToCurrentThread()); @@ -256,8 +256,9 @@ AudioDeviceFactory::NewAudioRendererSink( AudioDeviceFactory::kSourceNonRtcAudioTrack, playout_render_frame_id_, session_id_, device_id, security_origin); + media::OutputDeviceStatus new_sink_status = - new_sink->GetOutputDevice()->GetDeviceStatus(); + new_sink->GetOutputDeviceInfo().device_status(); if (new_sink_status != media::OUTPUT_DEVICE_STATUS_OK) { callback.Run(new_sink_status); return; @@ -267,7 +268,7 @@ security_origin_ = security_origin; bool was_sink_started = sink_started_; - if (sink_.get()) + if (sink_) sink_->Stop(); sink_started_ = false; @@ -278,35 +279,11 @@ callback.Run(media::OUTPUT_DEVICE_STATUS_OK); } -media::AudioParameters TrackAudioRenderer::GetOutputParameters() { - DCHECK(task_runner_->BelongsToCurrentThread()); - if (!sink_ || !source_params_.IsValid()) - return media::AudioParameters(); - - // Output parameters consist of the same channel layout and sample rate as the - // source, but having the buffer duration preferred by the hardware. - const media::AudioParameters& preferred_params = - sink_->GetOutputDevice()->GetOutputParameters(); - return media::AudioParameters( - preferred_params.format(), source_params_.channel_layout(), - source_params_.sample_rate(), source_params_.bits_per_sample(), - preferred_params.frames_per_buffer() * source_params_.sample_rate() / - preferred_params.sample_rate()); -} - -media::OutputDeviceStatus TrackAudioRenderer::GetDeviceStatus() { - DCHECK(task_runner_->BelongsToCurrentThread()); - if (!sink_.get()) - return media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL; - - return sink_->GetOutputDevice()->GetDeviceStatus(); -} - void TrackAudioRenderer::MaybeStartSink() { DCHECK(task_runner_->BelongsToCurrentThread()); DVLOG(1) << "TrackAudioRenderer::MaybeStartSink()"; - if (!sink_.get() || !source_params_.IsValid() || !playing_) + if (!sink_ || !source_params_.IsValid() || !playing_) return; // Re-create the AudioShifter to drop old audio data and reset to a starting @@ -315,17 +292,26 @@ // time-sync state is invalid. CreateAudioShifter(); - if (sink_started_ || - sink_->GetOutputDevice()->GetDeviceStatus() != - media::OUTPUT_DEVICE_STATUS_OK) { + if (sink_started_) return; - } + const media::OutputDeviceInfo& device_info = sink_->GetOutputDeviceInfo(); + if (device_info.device_status() != media::OUTPUT_DEVICE_STATUS_OK) + return; + + // Output parameters consist of the same channel layout and sample rate as the + // source, but having the buffer duration preferred by the hardware. + const media::AudioParameters& hardware_params = device_info.output_params(); + media::AudioParameters sink_params( + hardware_params.format(), source_params_.channel_layout(), + source_params_.sample_rate(), source_params_.bits_per_sample(), + hardware_params.frames_per_buffer() * source_params_.sample_rate() / + hardware_params.sample_rate()); DVLOG(1) << ("TrackAudioRenderer::MaybeStartSink() -- Starting sink. " "source_params_={") << source_params_.AsHumanReadableString() << "}, sink parameters={" - << GetOutputParameters().AsHumanReadableString() << '}'; - sink_->Initialize(GetOutputParameters(), this); + << sink_params.AsHumanReadableString() << '}'; + sink_->Initialize(sink_params, this); sink_->Start(); sink_->SetVolume(volume_); sink_->Play(); // Not all the sinks play on start. @@ -345,7 +331,7 @@ return; source_params_ = params; - if (!sink_.get()) + if (!sink_) return; // TrackAudioRenderer has not yet been started. // Stop |sink_| and re-create a new one to be initialized with different audio
diff --git a/content/renderer/media/track_audio_renderer.h b/content/renderer/media/track_audio_renderer.h index a938f98..609f357 100644 --- a/content/renderer/media/track_audio_renderer.h +++ b/content/renderer/media/track_audio_renderer.h
@@ -20,7 +20,6 @@ #include "content/public/renderer/media_stream_audio_renderer.h" #include "content/public/renderer/media_stream_audio_sink.h" #include "media/base/audio_renderer_sink.h" -#include "media/base/output_device.h" #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" namespace media { @@ -53,8 +52,7 @@ class CONTENT_EXPORT TrackAudioRenderer : NON_EXPORTED_BASE(public MediaStreamAudioRenderer), NON_EXPORTED_BASE(public MediaStreamAudioSink), - NON_EXPORTED_BASE(public media::AudioRendererSink::RenderCallback), - NON_EXPORTED_BASE(public media::OutputDevice) { + NON_EXPORTED_BASE(public media::AudioRendererSink::RenderCallback) { public: // Creates a renderer for the given |audio_track|. |playout_render_frame_id| // refers to the RenderFrame that owns this instance (e.g., it contains the @@ -76,16 +74,12 @@ void Play() override; void Pause() override; void SetVolume(float volume) override; - media::OutputDevice* GetOutputDevice() override; + media::OutputDeviceInfo GetOutputDeviceInfo() override; base::TimeDelta GetCurrentRenderTime() const override; bool IsLocalRenderer() const override; - - // media::OutputDevice implementation void SwitchOutputDevice(const std::string& device_id, const url::Origin& security_origin, - const media::SwitchOutputDeviceCB& callback) override; - media::AudioParameters GetOutputParameters() override; - media::OutputDeviceStatus GetDeviceStatus() override; + const media::OutputDeviceStatusCB& callback) override; protected: ~TrackAudioRenderer() override;
diff --git a/content/renderer/media/video_track_recorder.h b/content/renderer/media/video_track_recorder.h index 63be64a..9b47758 100644 --- a/content/renderer/media/video_track_recorder.h +++ b/content/renderer/media/video_track_recorder.h
@@ -7,6 +7,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/threading/thread_checker.h" #include "content/public/renderer/media_stream_video_sink.h" #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
diff --git a/content/renderer/media/webmediaplayer_ms.cc b/content/renderer/media/webmediaplayer_ms.cc index dca8fce9..c5174b5 100644 --- a/content/renderer/media/webmediaplayer_ms.cc +++ b/content/renderer/media/webmediaplayer_ms.cc
@@ -233,11 +233,11 @@ blink::WebSetSinkIdCallbacks* web_callback) { DVLOG(1) << __FUNCTION__; DCHECK(thread_checker_.CalledOnValidThread()); - const media::SwitchOutputDeviceCB callback = - media::ConvertToSwitchOutputDeviceCB(web_callback); - if (audio_renderer_ && audio_renderer_->GetOutputDevice()) { - audio_renderer_->GetOutputDevice()->SwitchOutputDevice( - sink_id.utf8(), security_origin, callback); + const media::OutputDeviceStatusCB callback = + media::ConvertToOutputDeviceStatusCB(web_callback); + if (audio_renderer_) { + audio_renderer_->SwitchOutputDevice(sink_id.utf8(), security_origin, + callback); } else { callback.Run(media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL); }
diff --git a/content/renderer/media/webrtc_audio_capturer.cc b/content/renderer/media/webrtc_audio_capturer.cc index 9337756..0533ce7 100644 --- a/content/renderer/media/webrtc_audio_capturer.cc +++ b/content/renderer/media/webrtc_audio_capturer.cc
@@ -175,8 +175,8 @@ // Create and configure the default audio capturing source. SetCapturerSourceInternal( - AudioDeviceFactory::NewInputDevice(render_frame_id_), channel_layout, - device_info_.device.input.sample_rate); + AudioDeviceFactory::NewAudioCapturerSource(render_frame_id_), + channel_layout, device_info_.device.input.sample_rate); // Add the capturer to the WebRtcAudioDeviceImpl since it needs some hardware // information from the capturer. @@ -351,9 +351,9 @@ // Create a new audio stream as source which will open the hardware using // WebRtc native buffer size. - SetCapturerSourceInternal(AudioDeviceFactory::NewInputDevice(render_frame_id), - input_params.channel_layout(), - input_params.sample_rate()); + SetCapturerSourceInternal( + AudioDeviceFactory::NewAudioCapturerSource(render_frame_id), + input_params.channel_layout(), input_params.sample_rate()); } void WebRtcAudioCapturer::Start() {
diff --git a/content/renderer/media/webrtc_audio_renderer.cc b/content/renderer/media/webrtc_audio_renderer.cc index 39d71b48..6f3308b 100644 --- a/content/renderer/media/webrtc_audio_renderer.cc +++ b/content/renderer/media/webrtc_audio_renderer.cc
@@ -20,6 +20,7 @@ #include "content/renderer/render_frame_impl.h" #include "media/audio/audio_parameters.h" #include "media/audio/sample_rates.h" +#include "media/base/audio_capturer_source.h" #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" #include "third_party/webrtc/api/mediastreaminterface.h" #include "third_party/webrtc/media/base/audiorenderer.h" @@ -118,9 +119,17 @@ on_play_state_changed_.Run(media_stream_, &playing_state_); } - media::OutputDevice* GetOutputDevice() override { + media::OutputDeviceInfo GetOutputDeviceInfo() override { DCHECK(thread_checker_.CalledOnValidThread()); - return delegate_->GetOutputDevice(); + return delegate_->GetOutputDeviceInfo(); + } + + void SwitchOutputDevice( + const std::string& device_id, + const url::Origin& security_origin, + const media::OutputDeviceStatusCB& callback) override { + DCHECK(thread_checker_.CalledOnValidThread()); + return delegate_->SwitchOutputDevice(device_id, security_origin, callback); } base::TimeDelta GetCurrentRenderTime() const override { @@ -224,7 +233,7 @@ AudioDeviceFactory::kSourceWebRtc, source_render_frame_id_, session_id_, output_device_id_, security_origin_); - if (sink_->GetOutputDevice()->GetDeviceStatus() != + if (sink_->GetOutputDeviceInfo().device_status() != media::OUTPUT_DEVICE_STATUS_OK) { return false; } @@ -355,9 +364,9 @@ OnPlayStateChanged(media_stream_, &playing_state_); } -media::OutputDevice* WebRtcAudioRenderer::GetOutputDevice() { +media::OutputDeviceInfo WebRtcAudioRenderer::GetOutputDeviceInfo() { DCHECK(thread_checker_.CalledOnValidThread()); - return this; + return sink_ ? sink_->GetOutputDeviceInfo() : media::OutputDeviceInfo(); } base::TimeDelta WebRtcAudioRenderer::GetCurrentRenderTime() const { @@ -373,7 +382,7 @@ void WebRtcAudioRenderer::SwitchOutputDevice( const std::string& device_id, const url::Origin& security_origin, - const media::SwitchOutputDeviceCB& callback) { + const media::OutputDeviceStatusCB& callback) { DVLOG(1) << "WebRtcAudioRenderer::SwitchOutputDevice()"; DCHECK(thread_checker_.CalledOnValidThread()); DCHECK_GE(session_id_, 0); @@ -387,9 +396,10 @@ AudioDeviceFactory::NewAudioRendererSink( AudioDeviceFactory::kSourceWebRtc, source_render_frame_id_, session_id_, device_id, security_origin); - if (new_sink->GetOutputDevice()->GetDeviceStatus() != - media::OUTPUT_DEVICE_STATUS_OK) { - callback.Run(new_sink->GetOutputDevice()->GetDeviceStatus()); + media::OutputDeviceStatus status = + new_sink->GetOutputDeviceInfo().device_status(); + if (status != media::OUTPUT_DEVICE_STATUS_OK) { + callback.Run(status); return; } @@ -411,22 +421,6 @@ callback.Run(media::OUTPUT_DEVICE_STATUS_OK); } -media::AudioParameters WebRtcAudioRenderer::GetOutputParameters() { - DCHECK(thread_checker_.CalledOnValidThread()); - if (!sink_.get()) - return media::AudioParameters(); - - return sink_->GetOutputDevice()->GetOutputParameters(); -} - -media::OutputDeviceStatus WebRtcAudioRenderer::GetDeviceStatus() { - DCHECK(thread_checker_.CalledOnValidThread()); - if (!sink_.get()) - return media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL; - - return sink_->GetOutputDevice()->GetDeviceStatus(); -} - int WebRtcAudioRenderer::Render(media::AudioBus* audio_bus, uint32_t frames_delayed, uint32_t frames_skipped) { @@ -627,14 +621,17 @@ base::AutoLock lock(lock_); new_sink_params = sink_params_; } + + const media::OutputDeviceInfo& device_info = sink_->GetOutputDeviceInfo(); + DCHECK_EQ(device_info.device_status(), media::OUTPUT_DEVICE_STATUS_OK); + // WebRTC does not yet support higher rates than 96000 on the client side // and 48000 is the preferred sample rate. Therefore, if 192000 is detected, // we change the rate to 48000 instead. The consequence is that the native // layer will be opened up at 192kHz but WebRTC will provide data at 48kHz // which will then be resampled by the audio converted on the browser side // to match the native audio layer. - int sample_rate = - sink_->GetOutputDevice()->GetOutputParameters().sample_rate(); + int sample_rate = device_info.output_params().sample_rate(); DVLOG(1) << "Audio output hardware sample rate: " << sample_rate; if (sample_rate >= 192000) { DVLOG(1) << "Resampling from 48000 to " << sample_rate << " is required"; @@ -656,8 +653,7 @@ // Setup sink parameters. const int sink_frames_per_buffer = GetOptimalBufferSize( - sample_rate, - sink_->GetOutputDevice()->GetOutputParameters().frames_per_buffer()); + sample_rate, device_info.output_params().frames_per_buffer()); new_sink_params.set_sample_rate(sample_rate); new_sink_params.set_frames_per_buffer(sink_frames_per_buffer);
diff --git a/content/renderer/media/webrtc_audio_renderer.h b/content/renderer/media/webrtc_audio_renderer.h index 164b8f1f..970cdf2 100644 --- a/content/renderer/media/webrtc_audio_renderer.h +++ b/content/renderer/media/webrtc_audio_renderer.h
@@ -22,7 +22,6 @@ #include "media/base/audio_pull_fifo.h" #include "media/base/audio_renderer_sink.h" #include "media/base/channel_layout.h" -#include "media/base/output_device.h" #include "third_party/WebKit/public/platform/WebMediaStream.h" namespace webrtc { @@ -37,8 +36,7 @@ // for connecting WebRtc MediaStream with the audio pipeline. class CONTENT_EXPORT WebRtcAudioRenderer : NON_EXPORTED_BASE(public media::AudioRendererSink::RenderCallback), - NON_EXPORTED_BASE(public MediaStreamAudioRenderer), - NON_EXPORTED_BASE(public media::OutputDevice) { + NON_EXPORTED_BASE(public MediaStreamAudioRenderer) { public: // This is a little utility class that holds the configured state of an audio // stream. @@ -119,16 +117,12 @@ void Pause() override; void Stop() override; void SetVolume(float volume) override; - media::OutputDevice* GetOutputDevice() override; + media::OutputDeviceInfo GetOutputDeviceInfo() override; base::TimeDelta GetCurrentRenderTime() const override; bool IsLocalRenderer() const override; - - // media::OutputDevice implementation void SwitchOutputDevice(const std::string& device_id, const url::Origin& security_origin, - const media::SwitchOutputDeviceCB& callback) override; - media::AudioParameters GetOutputParameters() override; - media::OutputDeviceStatus GetDeviceStatus() override; + const media::OutputDeviceStatusCB& callback) override; // Called when an audio renderer, either the main or a proxy, starts playing. // Here we maintain a reference count of how many renderers are currently
diff --git a/content/renderer/media/webrtc_audio_renderer_unittest.cc b/content/renderer/media/webrtc_audio_renderer_unittest.cc index 084f9172..f1a5ed26 100644 --- a/content/renderer/media/webrtc_audio_renderer_unittest.cc +++ b/content/renderer/media/webrtc_audio_renderer_unittest.cc
@@ -14,8 +14,7 @@ #include "content/public/renderer/media_stream_audio_renderer.h" #include "content/renderer/media/audio_device_factory.h" #include "content/renderer/media/webrtc_audio_device_impl.h" -#include "media/base/audio_renderer_sink.h" -#include "media/base/output_device.h" +#include "media/base/mock_audio_renderer_sink.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/platform/WebMediaStream.h" @@ -36,45 +35,6 @@ const char kOtherOutputDeviceId[] = "other-output-device"; const char kInvalidOutputDeviceId[] = "invalid-device"; -class FakeAudioOutputDevice - : NON_EXPORTED_BASE(public media::AudioRendererSink), - NON_EXPORTED_BASE(public media::OutputDevice) { - public: - FakeAudioOutputDevice(const std::string& device_id) : device_id_(device_id) {} - MOCK_METHOD2(Initialize, - void(const media::AudioParameters&, RenderCallback*)); - MOCK_METHOD0(Start, void()); - MOCK_METHOD0(Stop, void()); - MOCK_METHOD0(Pause, void()); - MOCK_METHOD0(Play, void()); - MOCK_METHOD1(SetVolume, bool(double volume)); - OutputDevice* GetOutputDevice() { return this; } - MOCK_METHOD3(SwitchOutputDevice, - void(const std::string&, - const url::Origin&, - const media::SwitchOutputDeviceCB&)); - - media::OutputDeviceStatus GetDeviceStatus() override { - return device_id_ == kInvalidOutputDeviceId - ? media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL - : media::OUTPUT_DEVICE_STATUS_OK; - } - - std::string GetDeviceId() const { return device_id_; } - - media::AudioParameters GetOutputParameters() override { - return media::AudioParameters(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, - media::CHANNEL_LAYOUT_STEREO, - kHardwareSampleRate, 16, kHardwareBufferSize); - } - - protected: - virtual ~FakeAudioOutputDevice() {} - - private: - const std::string device_id_; -}; - class MockAudioRendererSource : public WebRtcAudioRendererSource { public: MockAudioRendererSource() {} @@ -117,39 +77,47 @@ renderer_proxy_ = renderer_->CreateSharedAudioRendererProxy(stream_); } - MOCK_METHOD1(CreateInputDevice, media::AudioInputDevice*(int)); - MOCK_METHOD4(CreateOutputDevice, - media::AudioOutputDevice*(int, - int, - const std::string&, - const url::Origin&)); - MOCK_METHOD5(CreateRestartableAudioRendererSink, - media::RestartableAudioRendererSink*(SourceType, - int, - int, - const std::string&, - const url::Origin&)); - MOCK_METHOD5(MockCreateAudioRendererSink, - media::AudioRendererSink*(SourceType, - int, - int, - const std::string&, - const url::Origin&)); - media::AudioRendererSink* CreateAudioRendererSink( + MOCK_METHOD1(CreateAudioCapturerSource, + scoped_refptr<media::AudioCapturerSource>(int)); + MOCK_METHOD4(CreateAudioRendererMixerSink, + scoped_refptr<media::AudioRendererSink>(int, + int, + const std::string&, + const url::Origin&)); + MOCK_METHOD5( + CreateSwitchableAudioRendererSink, + scoped_refptr<media::SwitchableAudioRendererSink>(SourceType, + int, + int, + const std::string&, + const url::Origin&)); + MOCK_METHOD5( + MockCreateAudioRendererSink, + void(SourceType, int, int, const std::string&, const url::Origin&)); + + scoped_refptr<media::AudioRendererSink> CreateAudioRendererSink( SourceType source_type, int render_frame_id, int session_id, const std::string& device_id, const url::Origin& security_origin) { - FakeAudioOutputDevice* fake_device = new FakeAudioOutputDevice(device_id); + scoped_refptr<media::MockAudioRendererSink> fake_sink( + new media::MockAudioRendererSink( + device_id, device_id == kInvalidOutputDeviceId + ? media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL + : media::OUTPUT_DEVICE_STATUS_OK, + media::AudioParameters( + media::AudioParameters::AUDIO_PCM_LOW_LATENCY, + media::CHANNEL_LAYOUT_STEREO, kHardwareSampleRate, 16, + kHardwareBufferSize))); if (device_id != kInvalidOutputDeviceId) { - mock_output_device_ = fake_device; - EXPECT_CALL(*mock_output_device_.get(), Start()); + mock_sink_ = fake_sink; + EXPECT_CALL(*mock_sink_.get(), Start()); } MockCreateAudioRendererSink(source_type, render_frame_id, session_id, device_id, security_origin); - return fake_device; + return fake_sink; } void TearDown() override { @@ -157,12 +125,12 @@ renderer_ = nullptr; stream_.reset(); source_.reset(); - mock_output_device_ = nullptr; + mock_sink_ = nullptr; blink::WebHeap::collectAllGarbageForTesting(); } scoped_ptr<base::MessageLoopForIO> message_loop_; - scoped_refptr<FakeAudioOutputDevice> mock_output_device_; + scoped_refptr<media::MockAudioRendererSink> mock_sink_; scoped_ptr<MockAudioRendererSource> source_; blink::WebMediaStream stream_; scoped_refptr<WebRtcAudioRenderer> renderer_; @@ -176,7 +144,7 @@ // |renderer_| has only one proxy, stopping the proxy should stop the sink of // |renderer_|. - EXPECT_CALL(*mock_output_device_.get(), Stop()); + EXPECT_CALL(*mock_sink_.get(), Stop()); EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); renderer_proxy_->Stop(); } @@ -199,16 +167,16 @@ // Stop the |renderer_proxy_| should not stop the sink since it is used by // other proxies. - EXPECT_CALL(*mock_output_device_.get(), Stop()).Times(0); + EXPECT_CALL(*mock_sink_.get(), Stop()).Times(0); renderer_proxy_->Stop(); for (int i = 0; i < kNumberOfRendererProxy; ++i) { if (i != kNumberOfRendererProxy -1) { - EXPECT_CALL(*mock_output_device_.get(), Stop()).Times(0); + EXPECT_CALL(*mock_sink_.get(), Stop()).Times(0); } else { // When the last proxy is stopped, the sink will stop. EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); - EXPECT_CALL(*mock_output_device_.get(), Stop()); + EXPECT_CALL(*mock_sink_.get(), Stop()); } renderer_proxies_[i]->Stop(); } @@ -231,56 +199,61 @@ EXPECT_EQ(kHardwareSampleRate, renderer_->sample_rate()); EXPECT_EQ(2, renderer_->channels()); - EXPECT_CALL(*mock_output_device_.get(), Stop()); + EXPECT_CALL(*mock_sink_.get(), Stop()); EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); renderer_proxy_->Stop(); } TEST_F(WebRtcAudioRendererTest, NonDefaultDevice) { SetupRenderer(kDefaultOutputDeviceId); - EXPECT_EQ(mock_output_device_->GetDeviceId(), kDefaultOutputDeviceId); + EXPECT_EQ(kDefaultOutputDeviceId, + mock_sink_->GetOutputDeviceInfo().device_id()); renderer_proxy_->Start(); - EXPECT_CALL(*mock_output_device_.get(), Stop()); + EXPECT_CALL(*mock_sink_.get(), Stop()); EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); renderer_proxy_->Stop(); SetupRenderer(kOtherOutputDeviceId); - EXPECT_EQ(mock_output_device_->GetDeviceId(), kOtherOutputDeviceId); + EXPECT_EQ(kOtherOutputDeviceId, + mock_sink_->GetOutputDeviceInfo().device_id()); renderer_proxy_->Start(); - EXPECT_CALL(*mock_output_device_.get(), Stop()); + EXPECT_CALL(*mock_sink_.get(), Stop()); EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); renderer_proxy_->Stop(); } TEST_F(WebRtcAudioRendererTest, SwitchOutputDevice) { SetupRenderer(kDefaultOutputDeviceId); - EXPECT_EQ(kDefaultOutputDeviceId, mock_output_device_->GetDeviceId()); + EXPECT_EQ(kDefaultOutputDeviceId, + mock_sink_->GetOutputDeviceInfo().device_id()); renderer_proxy_->Start(); - EXPECT_CALL(*mock_output_device_.get(), Stop()); + EXPECT_CALL(*mock_sink_.get(), Stop()); EXPECT_CALL(*this, MockCreateAudioRendererSink(AudioDeviceFactory::kSourceWebRtc, _, _, kOtherOutputDeviceId, _)); EXPECT_CALL(*source_.get(), AudioRendererThreadStopped()); EXPECT_CALL(*this, MockSwitchDeviceCallback(media::OUTPUT_DEVICE_STATUS_OK)); base::RunLoop loop; - renderer_proxy_->GetOutputDevice()->SwitchOutputDevice( + renderer_proxy_->SwitchOutputDevice( kOtherOutputDeviceId, url::Origin(), base::Bind(&WebRtcAudioRendererTest::SwitchDeviceCallback, base::Unretained(this), &loop)); loop.Run(); - EXPECT_EQ(kOtherOutputDeviceId, mock_output_device_->GetDeviceId()); + EXPECT_EQ(kOtherOutputDeviceId, + mock_sink_->GetOutputDeviceInfo().device_id()); - EXPECT_CALL(*mock_output_device_.get(), Stop()); + EXPECT_CALL(*mock_sink_.get(), Stop()); EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); renderer_proxy_->Stop(); } TEST_F(WebRtcAudioRendererTest, SwitchOutputDeviceInvalidDevice) { SetupRenderer(kDefaultOutputDeviceId); - EXPECT_EQ(kDefaultOutputDeviceId, mock_output_device_->GetDeviceId()); + EXPECT_EQ(kDefaultOutputDeviceId, + mock_sink_->GetOutputDeviceInfo().device_id()); renderer_proxy_->Start(); EXPECT_CALL(*this, @@ -289,14 +262,15 @@ EXPECT_CALL(*this, MockSwitchDeviceCallback( media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL)); base::RunLoop loop; - renderer_proxy_->GetOutputDevice()->SwitchOutputDevice( + renderer_proxy_->SwitchOutputDevice( kInvalidOutputDeviceId, url::Origin(), base::Bind(&WebRtcAudioRendererTest::SwitchDeviceCallback, base::Unretained(this), &loop)); loop.Run(); - EXPECT_EQ(kDefaultOutputDeviceId, mock_output_device_->GetDeviceId()); + EXPECT_EQ(kDefaultOutputDeviceId, + mock_sink_->GetOutputDeviceInfo().device_id()); - EXPECT_CALL(*mock_output_device_.get(), Stop()); + EXPECT_CALL(*mock_sink_.get(), Stop()); EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); renderer_proxy_->Stop(); }
diff --git a/content/renderer/pepper/v8_var_converter.h b/content/renderer/pepper/v8_var_converter.h index 4a65bea6..998939b0 100644 --- a/content/renderer/pepper/v8_var_converter.h +++ b/content/renderer/pepper/v8_var_converter.h
@@ -8,6 +8,7 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "content/common/content_export.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_var.h"
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index f05bf0e..e4ee832 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -614,7 +614,7 @@ bool IsReload(FrameMsg_Navigate_Type::Value navigation_type) { return navigation_type == FrameMsg_Navigate_Type::RELOAD || - navigation_type == FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE || + navigation_type == FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE || navigation_type == FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL; } @@ -2429,8 +2429,8 @@ RenderThreadImpl* render_thread = RenderThreadImpl::current(); - scoped_refptr<media::RestartableAudioRendererSink> audio_renderer_sink = - AudioDeviceFactory::NewRestartableAudioRendererSink( + scoped_refptr<media::SwitchableAudioRendererSink> audio_renderer_sink = + AudioDeviceFactory::NewSwitchableAudioRendererSink( AudioDeviceFactory::kSourceMediaElement, routing_id_, 0, sink_id.utf8(), frame_->getSecurityOrigin()); media::WebMediaPlayerParams::Context3DCB context_3d_cb = @@ -5306,7 +5306,7 @@ // depending on the navigation type. if (is_reload) { bool ignore_cache = (common_params.navigation_type == - FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE); + FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE); load_type = ignore_cache ? blink::WebFrameLoadType::ReloadBypassingCache : blink::WebFrameLoadType::Reload; @@ -6006,10 +6006,11 @@ const blink::WebString& sink_id, const blink::WebSecurityOrigin& security_origin, blink::WebSetSinkIdCallbacks* web_callbacks) { - media::SwitchOutputDeviceCB callback = - media::ConvertToSwitchOutputDeviceCB(web_callbacks); - callback.Run(AudioDeviceFactory::GetOutputDeviceStatus( - routing_id_, 0, sink_id.utf8(), security_origin)); + media::OutputDeviceStatusCB callback = + media::ConvertToOutputDeviceStatusCB(web_callbacks); + callback.Run(AudioDeviceFactory::GetOutputDeviceInfo( + routing_id_, 0, sink_id.utf8(), security_origin) + .device_status()); } blink::WebPlugin* RenderFrameImpl::GetWebPluginForFind() {
diff --git a/content/renderer/render_process_impl.cc b/content/renderer/render_process_impl.cc index 16737ea..123799c 100644 --- a/content/renderer/render_process_impl.cc +++ b/content/renderer/render_process_impl.cc
@@ -42,12 +42,6 @@ } #endif - std::string scavenge_reclaim_unmodified_flag( - "--scavenge_reclaim_unmodified_objects"); - v8::V8::SetFlagsFromString( - scavenge_reclaim_unmodified_flag.c_str(), - static_cast<int>(scavenge_reclaim_unmodified_flag.size())); - if (base::SysInfo::IsLowEndDevice()) { std::string optimize_flag("--optimize-for-size"); v8::V8::SetFlagsFromString(optimize_flag.c_str(),
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc index 94c66365..eaa7090 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -447,8 +447,8 @@ blink::WebServiceWorkerCacheStorage* RendererBlinkPlatformImpl::cacheStorage( const blink::WebSecurityOrigin& security_origin) { - return new WebServiceWorkerCacheStorageImpl( - thread_safe_sender_.get(), WebSecurityOriginToGURL(security_origin)); + return new WebServiceWorkerCacheStorageImpl(thread_safe_sender_.get(), + security_origin); } //------------------------------------------------------------------------------ @@ -1006,7 +1006,8 @@ blink::WebGraphicsContext3DProvider* RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider( - const blink::WebGraphicsContext3D::Attributes& web_attributes, + const blink::Platform::ContextAttributes& web_attributes, + const blink::WebURL& top_document_web_url, blink::WebGraphicsContext3DProvider* share_provider, blink::Platform::GraphicsInfo* gl_info) { DCHECK(gl_info); @@ -1025,38 +1026,18 @@ share_provider->context3d()) : nullptr; + // This is an offscreen context, which doesn't use the default frame buffer, + // so don't request any alpha, depth, stencil, antialiasing. gpu::gles2::ContextCreationAttribHelper attributes; - // Defaults matching WebGraphicsContext3D::Attributes. - // TODO(danakj): This is an offscreen context, so we shouldn't care what the - // default framebuffer has, as we won't be using it. Can we always set these - // to 0 and stop requesting them from blink (remove from the web_attributes)? - // - // From kbr: There's a subtle tie between the Blink-level code and the command - // buffer. DrawingBuffer::initialize queries the GL_MAX_SAMPLES_ANGLE - // parameter to figure out how many samples it can request when allocating its - // multisampled renderbuffer or texture. I recall that if we don't request - // antialiasing from the command buffer's default back buffer, that this query - // comes back with 0, disabling WebGL's ability to antialias. I think that the - // pixel tests would catch this if it were broken, but I'm not sure the WebGL - // conformance suite would, since it's legal for a WebGL implementation to not - // support antialiasing. - attributes.alpha_size = 8; - attributes.depth_size = 24; - attributes.stencil_size = 8; - attributes.samples = 4; - attributes.sample_buffers = 1; + attributes.alpha_size = -1; + attributes.depth_size = 0; + attributes.stencil_size = 0; + attributes.samples = 0; + attributes.sample_buffers = 0; attributes.bind_generates_resource = false; - // Overrides from WebGraphicsContext3D::Attributes. - if (!web_attributes.alpha) - attributes.alpha_size = 0; - if (!web_attributes.depth) - attributes.depth_size = 0; - if (!web_attributes.stencil) - attributes.stencil_size = 0; - if (!web_attributes.antialias) - attributes.samples = attributes.sample_buffers = 0; - if (web_attributes.failIfMajorPerformanceCaveat) - attributes.fail_if_major_perf_caveat = true; + + attributes.fail_if_major_perf_caveat = + web_attributes.failIfMajorPerformanceCaveat; DCHECK_LE(web_attributes.webGLVersion, 2u); if (web_attributes.webGLVersion == 1) attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL1; @@ -1068,13 +1049,13 @@ gfx::GpuPreference gpu_preference = web_attributes.preferDiscreteGPU ? gfx::PreferDiscreteGpu : gfx::PreferIntegratedGpu; - GURL url = blink::WebStringToGURL(web_attributes.topDocumentURL); WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( gpu_channel_host.get(), attributes, gpu_preference, share_resources, - automatic_flushes, url, limits, share_context)); + automatic_flushes, GURL(top_document_web_url), limits, + share_context)); scoped_refptr<ContextProviderCommandBuffer> provider = ContextProviderCommandBuffer::Create(std::move(context), RENDERER_MAINTHREAD_CONTEXT);
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h index 105274f0..e7a6f06 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h
@@ -170,7 +170,8 @@ blink::WebMediaStream* web_media_stream, blink::WebMediaPlayer* web_media_player) override; blink::WebGraphicsContext3DProvider* createOffscreenGraphicsContext3DProvider( - const blink::WebGraphicsContext3D::Attributes& attributes, + const blink::Platform::ContextAttributes& attributes, + const blink::WebURL& top_document_web_url, blink::WebGraphicsContext3DProvider* share_provider, blink::Platform::GraphicsInfo* gl_info) override; blink::WebGraphicsContext3DProvider*
diff --git a/content/renderer/renderer_main_platform_delegate_win.cc b/content/renderer/renderer_main_platform_delegate_win.cc index 714ccab8..25381a5 100644 --- a/content/renderer/renderer_main_platform_delegate_win.cc +++ b/content/renderer/renderer_main_platform_delegate_win.cc
@@ -16,7 +16,6 @@ #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h" #include "content/child/font_warmup_win.h" #include "content/public/common/content_switches.h" -#include "content/public/common/dwrite_font_platform_win.h" #include "content/public/common/injection_test_win.h" #include "content/public/renderer/render_thread.h" #include "content/renderer/render_thread_impl.h" @@ -69,10 +68,7 @@ scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); if (use_direct_write) { - if (ShouldUseDirectWriteFontProxyFieldTrial()) - InitializeDWriteFontProxy(); - else - WarmupDirectWrite(); + InitializeDWriteFontProxy(); } else { SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); } @@ -82,8 +78,7 @@ } void RendererMainPlatformDelegate::PlatformUninitialize() { - if (ShouldUseDirectWriteFontProxyFieldTrial()) - UninitializeDWriteFontProxy(); + UninitializeDWriteFontProxy(); } bool RendererMainPlatformDelegate::EnableSandbox() {
diff --git a/content/renderer/service_worker/service_worker_context_client.cc b/content/renderer/service_worker/service_worker_context_client.cc index 23ac853..5f42031 100644 --- a/content/renderer/service_worker/service_worker_context_client.cc +++ b/content/renderer/service_worker/service_worker_context_client.cc
@@ -14,7 +14,6 @@ #include "base/threading/thread_checker.h" #include "base/threading/thread_local.h" #include "base/trace_event/trace_event.h" -#include "content/child/navigator_connect/service_port_dispatcher_impl.h" #include "content/child/notifications/notification_data_conversions.h" #include "content/child/request_extra_data.h" #include "content/child/service_worker/service_worker_dispatcher.h" @@ -45,7 +44,6 @@ #include "ipc/ipc_message.h" #include "ipc/ipc_message_macros.h" #include "third_party/WebKit/public/platform/URLConversion.h" -#include "third_party/WebKit/public/platform/WebCrossOriginServiceWorkerClient.h" #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" #include "third_party/WebKit/public/platform/WebPassOwnPtr.h" #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" @@ -117,16 +115,6 @@ WebMessagePortChannelImpl::ExtractMessagePortIDs(std::move(channels)))); } -void SendCrossOriginMessageToClientOnMainThread( - ThreadSafeSender* sender, - int message_port_id, - const base::string16& message, - scoped_ptr<blink::WebMessagePortChannelArray> channels) { - sender->Send(new MessagePortHostMsg_PostMessage( - message_port_id, MessagePortMessage(message), - WebMessagePortChannelImpl::ExtractMessagePortIDs(std::move(channels)))); -} - blink::WebURLRequest::FetchRequestMode GetBlinkFetchRequestMode( FetchRequestMode mode) { return static_cast<blink::WebURLRequest::FetchRequestMode>(mode); @@ -266,8 +254,6 @@ IPC_MESSAGE_HANDLER(ServiceWorkerMsg_PushEvent, OnPushEvent) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_GeofencingEvent, OnGeofencingEvent) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_MessageToWorker, OnPostMessage) - IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CrossOriginMessageToWorker, - OnCrossOriginMessageToWorker) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidGetClient, OnDidGetClient) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidGetClients, OnDidGetClients) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_OpenWindowResponse, @@ -390,9 +376,6 @@ // Register Mojo services. context_->service_registry.ServiceRegistry::AddService( - base::Bind(&ServicePortDispatcherImpl::Create, - context_->proxy_weak_factory.GetWeakPtr())); - context_->service_registry.ServiceRegistry::AddService( base::Bind(&BackgroundSyncClientImpl::Create)); SetRegistrationInServiceWorkerGlobalScope(registration_info, version_attrs); @@ -630,22 +613,6 @@ base::Passed(&channel_array))); } -void ServiceWorkerContextClient::postMessageToCrossOriginClient( - const blink::WebCrossOriginServiceWorkerClient& client, - const blink::WebString& message, - blink::WebMessagePortChannelArray* channels) { - // This may send channels for MessagePorts, and all internal book-keeping - // messages for MessagePort (e.g. QueueMessages) are sent from main thread - // (with thread hopping), so we need to do the same thread hopping here not - // to overtake those messages. - scoped_ptr<blink::WebMessagePortChannelArray> channel_array(channels); - main_thread_task_runner_->PostTask( - FROM_HERE, base::Bind(&SendCrossOriginMessageToClientOnMainThread, - base::RetainedRef(sender_), client.clientID, - static_cast<base::string16>(message), - base::Passed(&channel_array))); -} - void ServiceWorkerContextClient::focus( const blink::WebString& uuid, blink::WebServiceWorkerClientCallbacks* callback) { @@ -883,25 +850,6 @@ base::TimeTicks::Now() - before); } -void ServiceWorkerContextClient::OnCrossOriginMessageToWorker( - const NavigatorConnectClient& client, - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - const std::vector<int>& new_routing_ids) { - TRACE_EVENT0("ServiceWorker", - "ServiceWorkerContextClient::OnCrossOriginMessageToWorker"); - blink::WebMessagePortChannelArray ports = - WebMessagePortChannelImpl::CreatePorts( - sent_message_ports, new_routing_ids, - main_thread_task_runner_); - - blink::WebCrossOriginServiceWorkerClient web_client; - web_client.origin = client.origin; - web_client.targetURL = client.target_url; - web_client.clientID = client.message_port_id; - proxy_->dispatchCrossOriginMessageEvent(web_client, message, ports); -} - void ServiceWorkerContextClient::OnDidGetClient( int request_id, const ServiceWorkerClientInfo& client) {
diff --git a/content/renderer/service_worker/service_worker_context_client.h b/content/renderer/service_worker/service_worker_context_client.h index daaa12c..f1b476cb 100644 --- a/content/renderer/service_worker/service_worker_context_client.h +++ b/content/renderer/service_worker/service_worker_context_client.h
@@ -39,7 +39,6 @@ namespace blink { struct WebCircularGeofencingRegion; -struct WebCrossOriginServiceWorkerClient; class WebDataSource; struct WebServiceWorkerClientQueryOptions; class WebServiceWorkerContextProxy; @@ -53,7 +52,6 @@ namespace content { -struct NavigatorConnectClient; struct PlatformNotificationData; struct PushEventPayload; struct ServiceWorkerClientInfo; @@ -161,10 +159,6 @@ const blink::WebString& uuid, const blink::WebString& message, blink::WebMessagePortChannelArray* channels) override; - void postMessageToCrossOriginClient( - const blink::WebCrossOriginServiceWorkerClient& client, - const blink::WebString& message, - blink::WebMessagePortChannelArray* channels) override; void focus(const blink::WebString& uuid, blink::WebServiceWorkerClientCallbacks*) override; void navigate(const blink::WebString& uuid, @@ -223,11 +217,6 @@ const std::vector<TransferredMessagePort>& sent_message_ports, const std::vector<int>& new_routing_ids); - void OnCrossOriginMessageToWorker( - const NavigatorConnectClient& client, - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - const std::vector<int>& new_routing_ids); void OnDidGetClient(int request_id, const ServiceWorkerClientInfo& client); void OnDidGetClients( int request_id, const std::vector<ServiceWorkerClientInfo>& clients);
diff --git a/content/renderer/usb/web_usb_client_impl.cc b/content/renderer/usb/web_usb_client_impl.cc index f315de43..33533754 100644 --- a/content/renderer/usb/web_usb_client_impl.cc +++ b/content/renderer/usb/web_usb_client_impl.cc
@@ -123,8 +123,8 @@ base::Unretained(device_manager_.get()))); } -void WebUSBClientImpl::setObserver(Observer* observer) { - if (!observer_) { +void WebUSBClientImpl::addObserver(Observer* observer) { + if (observers_.empty()) { // Set up two sequential calls to GetDeviceChanges to avoid latency. device::usb::DeviceManager* device_manager = GetDeviceManager(); device_manager->GetDeviceChanges(base::Bind( @@ -133,7 +133,12 @@ &WebUSBClientImpl::OnDeviceChangeNotification, base::Unretained(this))); } - observer_ = observer; + observers_.insert(observer); +} + +void WebUSBClientImpl::removeObserver(Observer* observer) { + DCHECK(ContainsKey(observers_, observer)); + observers_.erase(observer); } device::usb::DeviceManager* WebUSBClientImpl::GetDeviceManager() { @@ -144,7 +149,7 @@ void WebUSBClientImpl::OnDeviceChangeNotification( device::usb::DeviceChangeNotificationPtr notification) { - if (!observer_) + if (observers_.empty()) return; device_manager_->GetDeviceChanges(base::Bind( @@ -152,17 +157,20 @@ for (size_t i = 0; i < notification->devices_added.size(); ++i) { const device::usb::DeviceInfoPtr& device_info = notification->devices_added[i]; - device::usb::DevicePtr device; - device_manager_->GetDevice(device_info->guid, mojo::GetProxy(&device)); - observer_->onDeviceConnected(blink::adoptWebPtr(new WebUSBDeviceImpl( - std::move(device), - mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); + for (auto observer : observers_) { + device::usb::DevicePtr device; + device_manager_->GetDevice(device_info->guid, mojo::GetProxy(&device)); + observer->onDeviceConnected(blink::adoptWebPtr(new WebUSBDeviceImpl( + std::move(device), + mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); + } } for (size_t i = 0; i < notification->devices_removed.size(); ++i) { const device::usb::DeviceInfoPtr& device_info = notification->devices_removed[i]; - observer_->onDeviceDisconnected(blink::adoptWebPtr(new WebUSBDeviceImpl( - nullptr, mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); + for (auto observer : observers_) + observer->onDeviceDisconnected(blink::adoptWebPtr(new WebUSBDeviceImpl( + nullptr, mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); } }
diff --git a/content/renderer/usb/web_usb_client_impl.h b/content/renderer/usb/web_usb_client_impl.h index b3b504b..10fe3144 100644 --- a/content/renderer/usb/web_usb_client_impl.h +++ b/content/renderer/usb/web_usb_client_impl.h
@@ -25,7 +25,8 @@ void requestDevice( const blink::WebUSBDeviceRequestOptions& options, blink::WebUSBClientRequestDeviceCallbacks* callbacks) override; - void setObserver(Observer* observer) override; + void addObserver(Observer* observer) override; + void removeObserver(Observer* observer) override; device::usb::DeviceManager* GetDeviceManager(); void OnDeviceChangeNotification( @@ -34,7 +35,7 @@ ServiceRegistry* const service_registry_; device::usb::DeviceManagerPtr device_manager_; device::usb::ChooserServicePtr chooser_service_; - Observer* observer_ = nullptr; + std::set<Observer*> observers_; DISALLOW_COPY_AND_ASSIGN(WebUSBClientImpl); };
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn index 8c5c61a..58e3a2f1 100644 --- a/content/shell/BUILD.gn +++ b/content/shell/BUILD.gn
@@ -74,8 +74,6 @@ "browser/layout_test/layout_test_javascript_dialog_manager.h", "browser/layout_test/layout_test_message_filter.cc", "browser/layout_test/layout_test_message_filter.h", - "browser/layout_test/layout_test_navigator_connect_service_factory.cc", - "browser/layout_test/layout_test_navigator_connect_service_factory.h", "browser/layout_test/layout_test_notification_manager.cc", "browser/layout_test/layout_test_notification_manager.h", "browser/layout_test/layout_test_permission_manager.cc", @@ -254,8 +252,6 @@ "//ui/gl", "//url", "//v8", - - #'copy_test_netscape_plugin', TODO(GYP) ] if (enable_plugins) { deps += [ @@ -296,7 +292,6 @@ if (is_android) { deps += [ "//content/shell/android:content_shell_jni_headers" ] - #deps -= [ "copy_test_netscape_plugin" ] TODO(GYP) } if (is_posix && !is_mac) { @@ -334,11 +329,6 @@ ] } - # The test plugin relies on X11. - if (is_linux && !use_x11) { - #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP) - } - if (is_chromeos) { deps += [ "//chromeos",
diff --git a/content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h b/content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h index aaee4c8..f65e760 100644 --- a/content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h +++ b/content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h
@@ -10,6 +10,7 @@ #include <set> #include <vector> +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "content/public/browser/bluetooth_chooser.h"
diff --git a/content/shell/browser/layout_test/layout_test_content_browser_client.cc b/content/shell/browser/layout_test/layout_test_content_browser_client.cc index ee02e04..f86e9d8 100644 --- a/content/shell/browser/layout_test/layout_test_content_browser_client.cc +++ b/content/shell/browser/layout_test/layout_test_content_browser_client.cc
@@ -6,7 +6,6 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" -#include "content/public/browser/navigator_connect_context.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/resource_dispatcher_host.h" #include "content/public/browser/storage_partition.h" @@ -16,7 +15,6 @@ #include "content/shell/browser/layout_test/layout_test_browser_context.h" #include "content/shell/browser/layout_test/layout_test_browser_main_parts.h" #include "content/shell/browser/layout_test/layout_test_message_filter.h" -#include "content/shell/browser/layout_test/layout_test_navigator_connect_service_factory.h" #include "content/shell/browser/layout_test/layout_test_notification_manager.h" #include "content/shell/browser/layout_test/layout_test_resource_dispatcher_host_delegate.h" #include "content/shell/browser/shell_browser_context.h" @@ -126,10 +124,4 @@ return layout_test_notification_manager_.get(); } -void LayoutTestContentBrowserClient::GetAdditionalNavigatorConnectServices( - const scoped_refptr<NavigatorConnectContext>& context) { - context->AddFactory( - make_scoped_ptr(new LayoutTestNavigatorConnectServiceFactory)); -} - } // namespace content
diff --git a/content/shell/browser/layout_test/layout_test_content_browser_client.h b/content/shell/browser/layout_test/layout_test_content_browser_client.h index 2e583149..57b557a 100644 --- a/content/shell/browser/layout_test/layout_test_content_browser_client.h +++ b/content/shell/browser/layout_test/layout_test_content_browser_client.h
@@ -36,8 +36,6 @@ const MainFunctionParams& parameters) override; PlatformNotificationService* GetPlatformNotificationService() override; - void GetAdditionalNavigatorConnectServices( - const scoped_refptr<NavigatorConnectContext>& context) override; private: scoped_ptr<LayoutTestNotificationManager> layout_test_notification_manager_;
diff --git a/content/shell/browser/layout_test/layout_test_navigator_connect_service_factory.cc b/content/shell/browser/layout_test/layout_test_navigator_connect_service_factory.cc deleted file mode 100644 index 07021de..0000000 --- a/content/shell/browser/layout_test/layout_test_navigator_connect_service_factory.cc +++ /dev/null
@@ -1,124 +0,0 @@ -// 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. - -#include "content/shell/browser/layout_test/layout_test_navigator_connect_service_factory.h" - -#include <utility> - -#include "base/values.h" -#include "content/public/browser/browser_thread.h" -#include "content/public/browser/message_port_delegate.h" -#include "content/public/browser/message_port_provider.h" -#include "content/public/common/message_port_types.h" -#include "content/public/common/navigator_connect_client.h" -#include "url/gurl.h" - -namespace content { - -namespace { -const char* kTestScheme = "chrome-layout-test"; -const char* kEchoService = "echo"; -const char* kAnnotateService = "annotate"; -const char* kAsValue = "as-value"; -} - -class LayoutTestNavigatorConnectServiceFactory::Service - : public MessagePortDelegate { - public: - Service(); - ~Service() override; - - void RegisterConnection(int message_port_id, const std::string& service); - - // MessagePortDelegate implementation. - void SendMessage( - int message_port_id, - const MessagePortMessage& message, - const std::vector<TransferredMessagePort>& sent_message_ports) override; - void SendMessagesAreQueued(int message_port_id) override; - - private: - std::map<int, std::string> connections_; -}; - -LayoutTestNavigatorConnectServiceFactory::Service::Service() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); -} - -LayoutTestNavigatorConnectServiceFactory::Service::~Service() { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - MessagePortProvider::OnMessagePortDelegateClosing(this); -} - -void LayoutTestNavigatorConnectServiceFactory::Service::RegisterConnection( - int message_port_id, - const std::string& service) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - connections_[message_port_id] = service; -} - -void LayoutTestNavigatorConnectServiceFactory::Service::SendMessage( - int message_port_id, - const MessagePortMessage& message, - const std::vector<TransferredMessagePort>& sent_message_ports) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK(connections_.find(message_port_id) != connections_.end()); - if (connections_[message_port_id] == kAnnotateService) { - scoped_ptr<base::DictionaryValue> reply(new base::DictionaryValue); - reply->SetString("message_as_string", message.message_as_string); - reply->Set("message_as_value", message.message_as_value.DeepCopy()); - MessagePortProvider::PostMessageToPort(message_port_id, - MessagePortMessage(std::move(reply)), - sent_message_ports); - } else { - MessagePortProvider::PostMessageToPort(message_port_id, message, - sent_message_ports); - } -} - -void LayoutTestNavigatorConnectServiceFactory::Service::SendMessagesAreQueued( - int message_port_id) { - NOTREACHED() << "This method should never be called."; -} - -LayoutTestNavigatorConnectServiceFactory:: - LayoutTestNavigatorConnectServiceFactory() - : service_(nullptr) { -} - -LayoutTestNavigatorConnectServiceFactory:: - ~LayoutTestNavigatorConnectServiceFactory() { - if (service_) - BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, service_); -} - -bool LayoutTestNavigatorConnectServiceFactory::HandlesUrl( - const GURL& target_url) { - return target_url.SchemeIs(kTestScheme); -} - -void LayoutTestNavigatorConnectServiceFactory::Connect( - const NavigatorConnectClient& client, - const ConnectCallback& callback) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - std::string service = client.target_url.path(); - if (service != kEchoService && service != kAnnotateService) { - callback.Run(nullptr, false); - return; - } - if (!service_) - service_ = new Service; - service_->RegisterConnection(client.message_port_id, service); - callback.Run(service_, client.target_url.query() == kAsValue); - - if (service == kAnnotateService) { - scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue); - value->SetString("origin", client.origin.spec()); - MessagePortProvider::PostMessageToPort( - client.message_port_id, MessagePortMessage(std::move(value)), - std::vector<TransferredMessagePort>()); - } -} - -} // namespace content
diff --git a/content/shell/browser/layout_test/layout_test_navigator_connect_service_factory.h b/content/shell/browser/layout_test/layout_test_navigator_connect_service_factory.h deleted file mode 100644 index e153922b..0000000 --- a/content/shell/browser/layout_test/layout_test_navigator_connect_service_factory.h +++ /dev/null
@@ -1,40 +0,0 @@ -// 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. - -#ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NAVIGATOR_CONNECT_SERVICE_FACTORY_H_ -#define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NAVIGATOR_CONNECT_SERVICE_FACTORY_H_ - -#include <map> -#include <string> - -#include "content/public/browser/navigator_connect_service_factory.h" - -namespace content { - -// Implementation of NavigatorConnectServiceFactory that provides services -// layout tests can connect to under the chrome-layout-test: schema. -// In particular this implements an 'echo' service, that just sends back any -// message sends to it, and an 'annotate' service, which sends back some extra -// metadata in addition to the message it received. -class LayoutTestNavigatorConnectServiceFactory - : public NavigatorConnectServiceFactory { - public: - LayoutTestNavigatorConnectServiceFactory(); - ~LayoutTestNavigatorConnectServiceFactory() override; - - // NavigatorConnectServiceFactory implementation. - bool HandlesUrl(const GURL& target_url) override; - void Connect(const NavigatorConnectClient& client, - const ConnectCallback& callback) override; - - private: - // |service_| is created and destroyed on the IO thread, while - // LayoutTestNavigatorConnectServiceFactory can be destroyed on any thread. - class Service; - Service* service_; -}; - -} // namespace content - -#endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_NAVIGATOR_CONNECT_SERVICE_FACTORY_H_
diff --git a/content/shell/browser/shell_javascript_dialog_manager.cc b/content/shell/browser/shell_javascript_dialog_manager.cc index fdd57253..2ed2684 100644 --- a/content/shell/browser/shell_javascript_dialog_manager.cc +++ b/content/shell/browser/shell_javascript_dialog_manager.cc
@@ -15,8 +15,8 @@ namespace content { -ShellJavaScriptDialogManager::ShellJavaScriptDialogManager() { -} +ShellJavaScriptDialogManager::ShellJavaScriptDialogManager() + : should_proceed_on_beforeunload_(true) {} ShellJavaScriptDialogManager::~ShellJavaScriptDialogManager() { } @@ -68,9 +68,14 @@ WebContents* web_contents, bool is_reload, const DialogClosedCallback& callback) { + // During tests, if the BeforeUnload should not proceed automatically, store + // the callback and return. if (!dialog_request_callback_.is_null()) { dialog_request_callback_.Run(); - callback.Run(true, base::string16()); + if (should_proceed_on_beforeunload_) + callback.Run(true, base::string16()); + else + before_unload_callback_ = callback; dialog_request_callback_.Reset(); return; } @@ -113,6 +118,10 @@ } void ShellJavaScriptDialogManager::ResetDialogState(WebContents* web_contents) { + if (before_unload_callback_.is_null()) + return; + before_unload_callback_.Run(false, base::string16()); + before_unload_callback_.Reset(); } void ShellJavaScriptDialogManager::DialogClosed(ShellJavaScriptDialog* dialog) {
diff --git a/content/shell/browser/shell_javascript_dialog_manager.h b/content/shell/browser/shell_javascript_dialog_manager.h index 42311042..9dee3a22 100644 --- a/content/shell/browser/shell_javascript_dialog_manager.h +++ b/content/shell/browser/shell_javascript_dialog_manager.h
@@ -46,6 +46,9 @@ void set_dialog_request_callback(const base::Closure& callback) { dialog_request_callback_ = callback; } + void set_should_proceed_on_beforeunload(bool proceed) { + should_proceed_on_beforeunload_ = proceed; + } private: #if defined(OS_MACOSX) || defined(OS_WIN) @@ -57,6 +60,12 @@ base::Closure dialog_request_callback_; + // Whether to automatically proceed when asked to display a BeforeUnload + // dialog. + bool should_proceed_on_beforeunload_; + + DialogClosedCallback before_unload_callback_; + DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialogManager); };
diff --git a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc index 00b8839..489339f 100644 --- a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc +++ b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
@@ -8,6 +8,7 @@ #include "base/command_line.h" #include "base/debug/debugger.h" #include "components/test_runner/mock_credential_manager_client.h" +#include "components/test_runner/web_frame_test_proxy.h" #include "components/test_runner/web_test_interfaces.h" #include "components/test_runner/web_test_proxy.h" #include "components/web_cache/renderer/web_cache_render_process_observer.h" @@ -45,10 +46,34 @@ namespace content { +namespace { + +void WebTestProxyCreated(RenderView* render_view, + test_runner::WebTestProxyBase* proxy) { + BlinkTestRunner* test_runner = new BlinkTestRunner(render_view); + test_runner->set_proxy(proxy); + if (!LayoutTestRenderProcessObserver::GetInstance()->test_delegate()) { + LayoutTestRenderProcessObserver::GetInstance()->SetTestDelegate( + test_runner); + } + proxy->SetInterfaces( + LayoutTestRenderProcessObserver::GetInstance()->test_interfaces()); + test_runner->proxy()->SetDelegate( + LayoutTestRenderProcessObserver::GetInstance()->test_delegate()); +} + +void WebFrameTestProxyCreated(RenderFrame* render_frame, + test_runner::WebFrameTestProxyBase* proxy) { + proxy->set_test_client(LayoutTestRenderProcessObserver::GetInstance() + ->test_interfaces() + ->GetWebFrameTestClient()); +} + +} // namespace + LayoutTestContentRendererClient::LayoutTestContentRendererClient() { - EnableWebTestProxyCreation( - base::Bind(&LayoutTestContentRendererClient::WebTestProxyCreated, - base::Unretained(this))); + EnableWebTestProxyCreation(base::Bind(&WebTestProxyCreated), + base::Bind(&WebFrameTestProxyCreated)); } LayoutTestContentRendererClient::~LayoutTestContentRendererClient() { @@ -151,19 +176,4 @@ #endif } -void LayoutTestContentRendererClient::WebTestProxyCreated( - RenderView* render_view, - test_runner::WebTestProxyBase* proxy) { - BlinkTestRunner* test_runner = new BlinkTestRunner(render_view); - test_runner->set_proxy(proxy); - if (!LayoutTestRenderProcessObserver::GetInstance()->test_delegate()) { - LayoutTestRenderProcessObserver::GetInstance()->SetTestDelegate( - test_runner); - } - proxy->SetInterfaces( - LayoutTestRenderProcessObserver::GetInstance()->test_interfaces()); - test_runner->proxy()->SetDelegate( - LayoutTestRenderProcessObserver::GetInstance()->test_delegate()); -} - } // namespace content
diff --git a/content/shell/renderer/layout_test/layout_test_content_renderer_client.h b/content/shell/renderer/layout_test/layout_test_content_renderer_client.h index 6eb2b8f..5748024 100644 --- a/content/shell/renderer/layout_test/layout_test_content_renderer_client.h +++ b/content/shell/renderer/layout_test/layout_test_content_renderer_client.h
@@ -5,24 +5,9 @@ #ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_TEST_CONTENT_RENDERER_CLIENT_H_ #define CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_TEST_CONTENT_RENDERER_CLIENT_H_ -#include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "content/shell/renderer/shell_content_renderer_client.h" -namespace blink { -class WebFrame; -class WebPlugin; -struct WebPluginParams; -} - -namespace web_cache { -class WebCacheRenderProcessObserver; -} - -namespace test_runner { -class WebTestProxyBase; -} - namespace content { class LayoutTestRenderProcessObserver; @@ -52,9 +37,6 @@ override; private: - void WebTestProxyCreated(RenderView* render_view, - test_runner::WebTestProxyBase* proxy); - scoped_ptr<LayoutTestRenderProcessObserver> shell_observer_; scoped_ptr<MockWebClipboardImpl> clipboard_; };
diff --git a/content/shell/tools/plugin/PluginObject.cpp b/content/shell/tools/plugin/PluginObject.cpp deleted file mode 100644 index f20db7dd..0000000 --- a/content/shell/tools/plugin/PluginObject.cpp +++ /dev/null
@@ -1,1490 +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. - -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2009 Holger Hans Peter Freyther - * Copyright (C) 2010 Collabora Ltd. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginObject.h" - -#include <assert.h> -#include <stddef.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "PluginTest.h" -#include "base/strings/string_util.h" -#include "content/shell/tools/plugin/test_object.h" - -// Helper function which takes in the plugin window object for logging to the -// console object. -static void pluginLogWithWindowObject(NPObject* windowObject, - NPP instance, - const char* message) { - NPVariant consoleVariant; - if (!browser->getproperty(instance, - windowObject, - browser->getstringidentifier("console"), - &consoleVariant)) { - fprintf(stderr, - "Failed to retrieve console object while logging: %s\n", - message); - return; - } - - NPObject* consoleObject = NPVARIANT_TO_OBJECT(consoleVariant); - - NPVariant messageVariant; - STRINGZ_TO_NPVARIANT(message, messageVariant); - - NPVariant result; - if (!browser->invoke(instance, - consoleObject, - browser->getstringidentifier("log"), - &messageVariant, - 1, - &result)) { - fprintf( - stderr, "Failed to invoke console.log while logging: %s\n", message); - browser->releaseobject(consoleObject); - return; - } - - browser->releasevariantvalue(&result); - browser->releaseobject(consoleObject); -} - -void pluginLogWithArguments(NPP instance, const char* format, va_list args) { - const size_t messageBufferSize = 2048; - char message[messageBufferSize] = "PLUGIN: "; - int messageLength = sizeof("PLUGIN: ") - 1; - messageLength += vsnprintf(message + messageLength, - messageBufferSize - 1 - messageLength, - format, - args); - message[messageLength] = '\0'; - - NPObject* windowObject = 0; - NPError error = - browser->getvalue(instance, NPNVWindowNPObject, &windowObject); - if (error != NPERR_NO_ERROR) { - fprintf(stderr, - "Failed to retrieve window object while logging: %s\n", - message); - return; - } - - pluginLogWithWindowObject(windowObject, instance, message); - browser->releaseobject(windowObject); -} - -// Helper function to log to the console object. -void pluginLog(NPP instance, const char* format, ...) { - va_list args; - va_start(args, format); - pluginLogWithArguments(instance, format, args); - va_end(args); -} - -static void pluginInvalidate(NPObject*); -static bool pluginHasProperty(NPObject*, NPIdentifier name); -static bool pluginHasMethod(NPObject*, NPIdentifier name); -static bool pluginGetProperty(NPObject*, NPIdentifier name, NPVariant*); -static bool pluginSetProperty(NPObject*, NPIdentifier name, const NPVariant*); -static bool pluginInvoke(NPObject*, - NPIdentifier name, - const NPVariant* args, - uint32_t argCount, - NPVariant* result); -static NPObject* pluginAllocate(NPP npp, NPClass*); -static void pluginDeallocate(NPObject*); - -NPNetscapeFuncs* browser; -NPPluginFuncs* pluginFunctions; - -static NPClass pluginClass_ = { - NP_CLASS_STRUCT_VERSION, pluginAllocate, pluginDeallocate, - pluginInvalidate, pluginHasMethod, pluginInvoke, - 0, // NPClass::invokeDefault, - pluginHasProperty, pluginGetProperty, pluginSetProperty, - 0, // NPClass::removeProperty - 0, // NPClass::enumerate - 0, // NPClass::construct -}; - -NPClass* createPluginClass(void) { - NPClass* pluginClass = new NPClass; - *pluginClass = pluginClass_; - return pluginClass; -} - -static bool identifiersInitialized = false; - -enum { - ID_PROPERTY_PROPERTY = 0, - ID_PROPERTY_EVENT_LOGGING, - ID_PROPERTY_HAS_STREAM, - ID_PROPERTY_TEST_OBJECT, - ID_PROPERTY_LOG_DESTROY, - ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM, - ID_PROPERTY_RETURN_NEGATIVE_ONE_FROM_WRITE, - ID_PROPERTY_THROW_EXCEPTION_PROPERTY, - ID_LAST_SET_WINDOW_ARGUMENTS, - ID_PROPERTY_TEST_OBJECT_COUNT, - ID_PROPERTY_DELETE_IN_GET_PROPERTY, - ID_PROPERTY_DELETE_IN_HAS_PROPERTY_RETURN_TRUE, - ID_PROPERTY_DELETE_IN_SET_PROPERTY, - NUM_PROPERTY_IDENTIFIERS -}; - -static NPIdentifier pluginPropertyIdentifiers[NUM_PROPERTY_IDENTIFIERS]; -static const NPUTF8* pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = { - "property", - "eventLoggingEnabled", - "hasStream", - "testObject", - "logDestroy", - "returnErrorFromNewStream", - "returnNegativeOneFromWrite", - "testThrowExceptionProperty", - "lastSetWindowArguments", - "testObjectCount", - "deletePluginInGetProperty", - "deletePluginInHasPropertyReturnTrue", - "deletePluginInSetProperty"}; - -enum { - ID_TEST_CALLBACK_METHOD = 0, - ID_TEST_CALLBACK_METHOD_RETURN, - ID_TEST_GETURL, - ID_TEST_DOM_ACCESS, - ID_TEST_GET_URL_NOTIFY, - ID_TEST_INVOKE_DEFAULT, - ID_DESTROY_STREAM, - ID_TEST_ENUMERATE, - ID_TEST_GETINTIDENTIFIER, - ID_TEST_GET_PROPERTY, - ID_TEST_HAS_PROPERTY, - ID_TEST_HAS_METHOD, - ID_TEST_EVALUATE, - ID_TEST_GET_PROPERTY_RETURN_VALUE, - ID_TEST_IDENTIFIER_TO_STRING, - ID_TEST_IDENTIFIER_TO_INT, - ID_TEST_PASS_TEST_OBJECT, - ID_TEST_POSTURL_FILE, - ID_TEST_CONSTRUCT, - ID_TEST_THROW_EXCEPTION_METHOD, - ID_TEST_FAIL_METHOD, - ID_TEST_CLONE_OBJECT, - ID_TEST_SCRIPT_OBJECT_INVOKE, - ID_TEST_CREATE_TEST_OBJECT, - ID_DESTROY_NULL_STREAM, - ID_TEST_RELOAD_PLUGINS_NO_PAGES, - ID_TEST_RELOAD_PLUGINS_AND_PAGES, - ID_TEST_GET_BROWSER_PROPERTY, - ID_TEST_SET_BROWSER_PROPERTY, - ID_REMEMBER, - ID_GET_REMEMBERED_OBJECT, - ID_GET_AND_FORGET_REMEMBERED_OBJECT, - ID_REF_COUNT, - ID_SET_STATUS, - ID_RESIZE_TO, - ID_NORMALIZE, - ID_INVALIDATE_RECT, - ID_OBJECTS_ARE_SAME, - ID_TEST_DELETE_WITHIN_INVOKE, - NUM_METHOD_IDENTIFIERS -}; - -static NPIdentifier pluginMethodIdentifiers[NUM_METHOD_IDENTIFIERS]; -static const NPUTF8* pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = { - "testCallback", "testCallbackReturn", - "getURL", "testDOMAccess", - "getURLNotify", "testInvokeDefault", - "destroyStream", "testEnumerate", - "testGetIntIdentifier", "testGetProperty", - "testHasProperty", "testHasMethod", - "testEvaluate", "testGetPropertyReturnValue", - "testIdentifierToString", "testIdentifierToInt", - "testPassTestObject", "testPostURLFile", - "testConstruct", "testThrowException", - "testFail", "testCloneObject", - "testScriptObjectInvoke", "testCreateTestObject", - "destroyNullStream", "reloadPluginsNoPages", - "reloadPluginsAndPages", "testGetBrowserProperty", - "testSetBrowserProperty", "remember", - "getRememberedObject", "getAndForgetRememberedObject", - "refCount", "setStatus", - "resizeTo", "normalize", - "invalidateRect", "objectsAreSame", - "testDeleteWithinInvoke"}; - -static NPUTF8* createCStringFromNPVariant(const NPVariant* variant) { - size_t length = NPVARIANT_TO_STRING(*variant).UTF8Length; - NPUTF8* result = (NPUTF8*)malloc(length + 1); - memcpy(result, NPVARIANT_TO_STRING(*variant).UTF8Characters, length); - result[length] = '\0'; - return result; -} - -static void initializeIdentifiers(void) { - browser->getstringidentifiers(pluginPropertyIdentifierNames, - NUM_PROPERTY_IDENTIFIERS, - pluginPropertyIdentifiers); - browser->getstringidentifiers(pluginMethodIdentifierNames, - NUM_METHOD_IDENTIFIERS, - pluginMethodIdentifiers); -} - -static bool callDeletePlugin(NPObject* obj, - NPIdentifier name, - NPIdentifier identifierToMatch) { - if (name != identifierToMatch) - return false; - - PluginObject* plugin = reinterpret_cast<PluginObject*>(obj); - NPObject* windowScriptObject; - browser->getvalue(plugin->npp, NPNVWindowNPObject, &windowScriptObject); - - NPIdentifier callbackIdentifier = - browser->getstringidentifier("deletePlugin"); - NPVariant browserResult; - if (browser->invoke(plugin->npp, - windowScriptObject, - callbackIdentifier, - 0, - 0, - &browserResult)) - browser->releasevariantvalue(&browserResult); - return true; -} - -static bool pluginHasProperty(NPObject* obj, NPIdentifier name) { - if (callDeletePlugin( - obj, - name, - browser->getstringidentifier("deletePluginInHasPropertyReturnFalse"))) - return false; - - callDeletePlugin(obj, - name, - pluginPropertyIdentifiers - [ID_PROPERTY_DELETE_IN_HAS_PROPERTY_RETURN_TRUE]); - - for (int i = 0; i < NUM_PROPERTY_IDENTIFIERS; i++) - if (name == pluginPropertyIdentifiers[i]) - return true; - return false; -} - -static bool pluginHasMethod(NPObject* obj, NPIdentifier name) { - if (callDeletePlugin( - obj, name, browser->getstringidentifier("deletePluginInHasMethod"))) - return true; - - for (int i = 0; i < NUM_METHOD_IDENTIFIERS; i++) - if (name == pluginMethodIdentifiers[i]) - return true; - return false; -} - -static bool pluginGetProperty(NPObject* obj, - NPIdentifier name, - NPVariant* result) { - PluginObject* plugin = reinterpret_cast<PluginObject*>(obj); - if (name == pluginPropertyIdentifiers[ID_PROPERTY_PROPERTY]) { - static const char* originalString = "property"; - char* buf = - static_cast<char*>(browser->memalloc(strlen(originalString) + 1)); - strcpy(buf, originalString); - STRINGZ_TO_NPVARIANT(buf, *result); - return true; - } - if (name == pluginPropertyIdentifiers[ID_PROPERTY_EVENT_LOGGING]) { - BOOLEAN_TO_NPVARIANT(plugin->eventLogging, *result); - return true; - } - if (name == pluginPropertyIdentifiers[ID_PROPERTY_LOG_DESTROY]) { - BOOLEAN_TO_NPVARIANT(plugin->logDestroy, *result); - return true; - } - if (name == pluginPropertyIdentifiers[ID_PROPERTY_HAS_STREAM]) { - BOOLEAN_TO_NPVARIANT(plugin->stream, *result); - return true; - } - if (name == pluginPropertyIdentifiers[ID_PROPERTY_TEST_OBJECT]) { - NPObject* testObject = plugin->testObject; - browser->retainobject(testObject); - OBJECT_TO_NPVARIANT(testObject, *result); - return true; - } - if (name == - pluginPropertyIdentifiers[ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM]) { - BOOLEAN_TO_NPVARIANT(plugin->returnErrorFromNewStream, *result); - return true; - } - if (name == - pluginPropertyIdentifiers[ID_PROPERTY_RETURN_NEGATIVE_ONE_FROM_WRITE]) { - BOOLEAN_TO_NPVARIANT(plugin->returnNegativeOneFromWrite, *result); - return true; - } - if (name == pluginPropertyIdentifiers[ID_PROPERTY_THROW_EXCEPTION_PROPERTY]) { - browser->setexception(obj, - "plugin object testThrowExceptionProperty SUCCESS"); - return true; - } - if (name == pluginPropertyIdentifiers[ID_LAST_SET_WINDOW_ARGUMENTS]) { - char* buf = static_cast<char*>(browser->memalloc(256)); - snprintf( - buf, - 256, - "x: %d, y: %d, width: %u, height: %u, clipRect: (%u, %u, %u, %u)", - (int)plugin->lastWindow.x, - (int)plugin->lastWindow.y, - (unsigned)plugin->lastWindow.width, - (unsigned)plugin->lastWindow.height, - plugin->lastWindow.clipRect.left, - plugin->lastWindow.clipRect.top, - plugin->lastWindow.clipRect.right - plugin->lastWindow.clipRect.left, - plugin->lastWindow.clipRect.bottom - plugin->lastWindow.clipRect.top); - - STRINGZ_TO_NPVARIANT(buf, *result); - return true; - } - if (name == pluginPropertyIdentifiers[ID_PROPERTY_TEST_OBJECT_COUNT]) { - INT32_TO_NPVARIANT(content::GetTestObjectCount(), *result); - return true; - } - - if (name == pluginPropertyIdentifiers[ID_PROPERTY_DELETE_IN_GET_PROPERTY]) { - browser->retainobject(obj); - callDeletePlugin( - obj, - name, - pluginPropertyIdentifiers[ID_PROPERTY_DELETE_IN_GET_PROPERTY]); - NPObject* testObject = plugin->testObject; - browser->retainobject(testObject); - OBJECT_TO_NPVARIANT(testObject, *result); - browser->releaseobject(obj); - return true; - } - - return false; -} - -static bool pluginSetProperty(NPObject* obj, - NPIdentifier name, - const NPVariant* variant) { - PluginObject* plugin = reinterpret_cast<PluginObject*>(obj); - if (callDeletePlugin( - obj, - name, - pluginPropertyIdentifiers[ID_PROPERTY_DELETE_IN_SET_PROPERTY])) - return true; - - if (name == pluginPropertyIdentifiers[ID_PROPERTY_EVENT_LOGGING]) { - plugin->eventLogging = NPVARIANT_TO_BOOLEAN(*variant); - return true; - } - if (name == pluginPropertyIdentifiers[ID_PROPERTY_LOG_DESTROY]) { - plugin->logDestroy = NPVARIANT_TO_BOOLEAN(*variant); - return true; - } - if (name == - pluginPropertyIdentifiers[ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM]) { - plugin->returnErrorFromNewStream = NPVARIANT_TO_BOOLEAN(*variant); - return true; - } - if (name == - pluginPropertyIdentifiers[ID_PROPERTY_RETURN_NEGATIVE_ONE_FROM_WRITE]) { - plugin->returnNegativeOneFromWrite = NPVARIANT_TO_BOOLEAN(*variant); - return true; - } - if (name == pluginPropertyIdentifiers[ID_PROPERTY_THROW_EXCEPTION_PROPERTY]) { - browser->setexception(obj, - "plugin object testThrowExceptionProperty SUCCESS"); - return true; - } - - return false; -} - -static bool testDOMAccess(PluginObject* obj, - const NPVariant*, - uint32_t, - NPVariant* result) { - // Get plugin's DOM element - NPObject* elementObject; - if (browser->getvalue(obj->npp, NPNVPluginElementNPObject, &elementObject) == - NPERR_NO_ERROR) { - // Get style - NPVariant styleVariant; - NPIdentifier styleIdentifier = browser->getstringidentifier("style"); - if (browser->getproperty( - obj->npp, elementObject, styleIdentifier, &styleVariant) && - NPVARIANT_IS_OBJECT(styleVariant)) { - // Set style.border - NPIdentifier borderIdentifier = browser->getstringidentifier("border"); - NPVariant borderVariant; - STRINGZ_TO_NPVARIANT("3px solid red", borderVariant); - browser->setproperty(obj->npp, - NPVARIANT_TO_OBJECT(styleVariant), - borderIdentifier, - &borderVariant); - browser->releasevariantvalue(&styleVariant); - } - - browser->releaseobject(elementObject); - } - VOID_TO_NPVARIANT(*result); - return true; -} - -static NPIdentifier stringVariantToIdentifier(NPVariant variant) { - assert(NPVARIANT_IS_STRING(variant)); - NPUTF8* utf8String = createCStringFromNPVariant(&variant); - NPIdentifier identifier = browser->getstringidentifier(utf8String); - free(utf8String); - return identifier; -} - -static NPIdentifier int32VariantToIdentifier(NPVariant variant) { - assert(NPVARIANT_IS_INT32(variant)); - int32_t integer = NPVARIANT_TO_INT32(variant); - return browser->getintidentifier(integer); -} - -static NPIdentifier doubleVariantToIdentifier(NPVariant variant) { - assert(NPVARIANT_IS_DOUBLE(variant)); - double value = NPVARIANT_TO_DOUBLE(variant); - // Sadly there is no "getdoubleidentifier" - int32_t integer = static_cast<int32_t>(value); - return browser->getintidentifier(integer); -} - -static NPIdentifier variantToIdentifier(NPVariant variant) { - if (NPVARIANT_IS_STRING(variant)) - return stringVariantToIdentifier(variant); - if (NPVARIANT_IS_INT32(variant)) - return int32VariantToIdentifier(variant); - if (NPVARIANT_IS_DOUBLE(variant)) - return doubleVariantToIdentifier(variant); - return 0; -} - -static bool testIdentifierToString(PluginObject*, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 1) - return true; - NPIdentifier identifier = variantToIdentifier(args[0]); - if (!identifier) - return true; - NPUTF8* utf8String = browser->utf8fromidentifier(identifier); - if (!utf8String) - return true; - STRINGZ_TO_NPVARIANT(utf8String, *result); - return true; -} - -static bool testIdentifierToInt(PluginObject*, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 1) - return false; - NPIdentifier identifier = variantToIdentifier(args[0]); - if (!identifier) - return false; - int32_t integer = browser->intfromidentifier(identifier); - INT32_TO_NPVARIANT(integer, *result); - return true; -} - -static bool testPassTestObject(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 2 || !NPVARIANT_IS_STRING(args[0])) - return false; - - NPObject* windowScriptObject; - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); - - NPUTF8* callbackString = createCStringFromNPVariant(&args[0]); - NPIdentifier callbackIdentifier = - browser->getstringidentifier(callbackString); - free(callbackString); - - NPVariant browserResult; - browser->invoke(obj->npp, - windowScriptObject, - callbackIdentifier, - &args[1], - 1, - &browserResult); - browser->releasevariantvalue(&browserResult); - - VOID_TO_NPVARIANT(*result); - return true; -} - -static bool testCallback(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (!argCount || !NPVARIANT_IS_STRING(args[0])) - return false; - - NPObject* windowScriptObject; - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); - - NPUTF8* callbackString = createCStringFromNPVariant(&args[0]); - NPIdentifier callbackIdentifier = - browser->getstringidentifier(callbackString); - free(callbackString); - - NPVariant browserResult; - if (browser->invoke(obj->npp, - windowScriptObject, - callbackIdentifier, - 0, - 0, - &browserResult)) - browser->releasevariantvalue(&browserResult); - - browser->releaseobject(windowScriptObject); - - VOID_TO_NPVARIANT(*result); - return true; -} - -static bool testCallbackReturn(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 1 || !NPVARIANT_IS_STRING(args[0])) - return false; - - NPObject* windowScriptObject; - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); - - NPUTF8* callbackString = createCStringFromNPVariant(&args[0]); - NPIdentifier callbackIdentifier = - browser->getstringidentifier(callbackString); - free(callbackString); - - NPVariant callbackArgs[1]; - OBJECT_TO_NPVARIANT(windowScriptObject, callbackArgs[0]); - - NPVariant browserResult; - browser->invoke(obj->npp, - windowScriptObject, - callbackIdentifier, - callbackArgs, - 1, - &browserResult); - - if (NPVARIANT_IS_OBJECT(browserResult)) - OBJECT_TO_NPVARIANT(NPVARIANT_TO_OBJECT(browserResult), *result); - else { - browser->releasevariantvalue(&browserResult); - VOID_TO_NPVARIANT(*result); - } - - return true; -} - -static bool getURL(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount == 2 && NPVARIANT_IS_STRING(args[0]) && - NPVARIANT_IS_STRING(args[1])) { - NPUTF8* urlString = createCStringFromNPVariant(&args[0]); - NPUTF8* targetString = createCStringFromNPVariant(&args[1]); - NPError npErr = browser->geturl(obj->npp, urlString, targetString); - free(urlString); - free(targetString); - - INT32_TO_NPVARIANT(npErr, *result); - return true; - } - if (argCount == 1 && NPVARIANT_IS_STRING(args[0])) { - NPUTF8* urlString = createCStringFromNPVariant(&args[0]); - NPError npErr = browser->geturl(obj->npp, urlString, 0); - free(urlString); - - INT32_TO_NPVARIANT(npErr, *result); - return true; - } - return false; -} - -static bool getURLNotify(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 3 || !NPVARIANT_IS_STRING(args[0]) || - (!NPVARIANT_IS_STRING(args[1]) && !NPVARIANT_IS_NULL(args[1])) || - !NPVARIANT_IS_STRING(args[2])) - return false; - - NPUTF8* urlString = createCStringFromNPVariant(&args[0]); - NPUTF8* targetString = - (NPVARIANT_IS_STRING(args[1]) ? createCStringFromNPVariant(&args[1]) : 0); - NPUTF8* callbackString = createCStringFromNPVariant(&args[2]); - - NPIdentifier callbackIdentifier = - browser->getstringidentifier(callbackString); - browser->geturlnotify(obj->npp, urlString, targetString, callbackIdentifier); - - free(urlString); - free(targetString); - free(callbackString); - - VOID_TO_NPVARIANT(*result); - return true; -} - -static bool testInvokeDefault(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (!NPVARIANT_IS_OBJECT(args[0])) - return false; - - NPObject* callback = NPVARIANT_TO_OBJECT(args[0]); - - NPVariant invokeArgs[1]; - NPVariant browserResult; - - STRINGZ_TO_NPVARIANT("test", invokeArgs[0]); - bool retval = - browser->invokeDefault(obj->npp, callback, invokeArgs, 1, &browserResult); - - if (retval) - browser->releasevariantvalue(&browserResult); - - BOOLEAN_TO_NPVARIANT(retval, *result); - return true; -} - -static bool destroyStream(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - NPError npError = - browser->destroystream(obj->npp, obj->stream, NPRES_USER_BREAK); - INT32_TO_NPVARIANT(npError, *result); - return true; -} - -static bool destroyNullStream(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - NPError npError = browser->destroystream(obj->npp, 0, NPRES_USER_BREAK); - INT32_TO_NPVARIANT(npError, *result); - return true; -} - -static bool testEnumerate(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 2 || !NPVARIANT_IS_OBJECT(args[0]) || - !NPVARIANT_IS_OBJECT(args[1])) - return false; - - uint32_t count; - NPIdentifier* identifiers; - if (browser->enumerate( - obj->npp, NPVARIANT_TO_OBJECT(args[0]), &identifiers, &count)) { - NPObject* outArray = NPVARIANT_TO_OBJECT(args[1]); - NPIdentifier pushIdentifier = browser->getstringidentifier("push"); - - for (uint32_t i = 0; i < count; i++) { - NPUTF8* string = browser->utf8fromidentifier(identifiers[i]); - - if (!string) - continue; - - NPVariant args[1]; - STRINGZ_TO_NPVARIANT(string, args[0]); - NPVariant browserResult; - if (browser->invoke( - obj->npp, outArray, pushIdentifier, args, 1, &browserResult)) - browser->releasevariantvalue(&browserResult); - browser->memfree(string); - } - - browser->memfree(identifiers); - } - - VOID_TO_NPVARIANT(*result); - return true; -} - -static bool testGetIntIdentifier(PluginObject*, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 1 || !NPVARIANT_IS_DOUBLE(args[0])) - return false; - - NPIdentifier identifier = - browser->getintidentifier((int)NPVARIANT_TO_DOUBLE(args[0])); - INT32_TO_NPVARIANT((int32_t)(long long)identifier, *result); - return true; -} - -static bool testGetProperty(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (!argCount) - return false; - - NPObject* object; - browser->getvalue(obj->npp, NPNVWindowNPObject, &object); - - for (uint32_t i = 0; i < argCount; i++) { - assert(NPVARIANT_IS_STRING(args[i])); - NPUTF8* propertyString = createCStringFromNPVariant(&args[i]); - NPIdentifier propertyIdentifier = - browser->getstringidentifier(propertyString); - free(propertyString); - - NPVariant variant; - bool retval = - browser->getproperty(obj->npp, object, propertyIdentifier, &variant); - browser->releaseobject(object); - - if (!retval) - break; - - if (i + 1 < argCount) { - assert(NPVARIANT_IS_OBJECT(variant)); - object = NPVARIANT_TO_OBJECT(variant); - } else { - *result = variant; - return true; - } - } - - VOID_TO_NPVARIANT(*result); - return false; -} - -static bool testHasProperty(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 2 || !NPVARIANT_IS_OBJECT(args[0]) || - !NPVARIANT_IS_STRING(args[1])) - return false; - - NPUTF8* propertyString = createCStringFromNPVariant(&args[1]); - NPIdentifier propertyIdentifier = - browser->getstringidentifier(propertyString); - free(propertyString); - - bool retval = browser->hasproperty( - obj->npp, NPVARIANT_TO_OBJECT(args[0]), propertyIdentifier); - - BOOLEAN_TO_NPVARIANT(retval, *result); - return true; -} - -static bool testHasMethod(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 2 || !NPVARIANT_IS_OBJECT(args[0]) || - !NPVARIANT_IS_STRING(args[1])) - return false; - - NPUTF8* propertyString = createCStringFromNPVariant(&args[1]); - NPIdentifier propertyIdentifier = - browser->getstringidentifier(propertyString); - free(propertyString); - - bool retval = browser->hasmethod( - obj->npp, NPVARIANT_TO_OBJECT(args[0]), propertyIdentifier); - - BOOLEAN_TO_NPVARIANT(retval, *result); - return true; -} - -static bool testEvaluate(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 1 || !NPVARIANT_IS_STRING(args[0])) - return false; - NPObject* windowScriptObject; - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); - - NPString s = NPVARIANT_TO_STRING(args[0]); - - bool retval = browser->evaluate(obj->npp, windowScriptObject, &s, result); - browser->releaseobject(windowScriptObject); - return retval; -} - -static bool testGetPropertyReturnValue(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 2 || !NPVARIANT_IS_OBJECT(args[0]) || - !NPVARIANT_IS_STRING(args[1])) - return false; - - NPUTF8* propertyString = createCStringFromNPVariant(&args[1]); - NPIdentifier propertyIdentifier = - browser->getstringidentifier(propertyString); - free(propertyString); - - NPVariant variant; - bool retval = browser->getproperty( - obj->npp, NPVARIANT_TO_OBJECT(args[0]), propertyIdentifier, &variant); - if (retval) - browser->releasevariantvalue(&variant); - - BOOLEAN_TO_NPVARIANT(retval, *result); - return true; -} - -static char* toCString(const NPString& string) { - char* result = static_cast<char*>(malloc(string.UTF8Length + 1)); - memcpy(result, string.UTF8Characters, string.UTF8Length); - result[string.UTF8Length] = '\0'; - - return result; -} - -static bool testPostURLFile(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 4 || !NPVARIANT_IS_STRING(args[0]) || - !NPVARIANT_IS_STRING(args[1]) || !NPVARIANT_IS_STRING(args[2]) || - !NPVARIANT_IS_STRING(args[3])) - return false; - - NPString urlString = NPVARIANT_TO_STRING(args[0]); - char* url = toCString(urlString); - - NPString targetString = NPVARIANT_TO_STRING(args[1]); - char* target = toCString(targetString); - - NPString pathString = NPVARIANT_TO_STRING(args[2]); - char* path = toCString(pathString); - - NPString contentsString = NPVARIANT_TO_STRING(args[3]); - - FILE* tempFile = fopen(path, "w"); - if (!tempFile) - return false; - - size_t written = fwrite( - contentsString.UTF8Characters, contentsString.UTF8Length, 1, tempFile); - fclose(tempFile); - if (!written) - return false; - - NPError error = browser->posturl( - obj->npp, url, target, pathString.UTF8Length, path, true); - - free(path); - free(target); - free(url); - - BOOLEAN_TO_NPVARIANT(error == NPERR_NO_ERROR, *result); - return true; -} - -static bool testConstruct(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (!argCount || !NPVARIANT_IS_OBJECT(args[0])) - return false; - - return browser->construct( - obj->npp, NPVARIANT_TO_OBJECT(args[0]), args + 1, argCount - 1, result); -} - -// Invoke a script callback to get a script NPObject. Then call a method on the -// script NPObject passing it a freshly created NPObject. -static bool testScriptObjectInvoke(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 2 || !NPVARIANT_IS_STRING(args[0]) || - !NPVARIANT_IS_STRING(args[1])) - return false; - NPObject* windowScriptObject; - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); - - // Arg1 is the name of the callback - NPUTF8* callbackString = createCStringFromNPVariant(&args[0]); - NPIdentifier callbackIdentifier = - browser->getstringidentifier(callbackString); - free(callbackString); - - // Invoke a callback that returns a script object - NPVariant object_result; - browser->invoke(obj->npp, - windowScriptObject, - callbackIdentifier, - &args[1], - 1, - &object_result); - - // Script object returned - if (!NPVARIANT_IS_OBJECT(object_result)) { - browser->releasevariantvalue(&object_result); - return false; - } - NPObject* script_object = NPVARIANT_TO_OBJECT(object_result); - - // Arg2 is the name of the method to be called on the script object - NPUTF8* object_method_string = createCStringFromNPVariant(&args[1]); - NPIdentifier object_method = - browser->getstringidentifier(object_method_string); - free(object_method_string); - - // Create a fresh NPObject to be passed as an argument - NPObject* object_arg = browser->createobject(obj->npp, obj->header._class); - - NPVariant invoke_args[1]; - OBJECT_TO_NPVARIANT(object_arg, invoke_args[0]); - - // Invoke the script method - NPVariant object_method_result; - browser->invoke(obj->npp, - script_object, - object_method, - invoke_args, - 1, - &object_method_result); - - browser->releasevariantvalue(&object_result); - VOID_TO_NPVARIANT(*result); - if (NPVARIANT_IS_OBJECT(object_method_result)) { - // Now return the callbacks return value back to our caller. - // BUG 897451: This should be the same as the - // windowScriptObject, but its not (in Chrome) - or at least, it - // has a different refcount. This means Chrome will delete the - // object before returning it and the calling JS gets a garbage - // value. Firefox handles it fine. - OBJECT_TO_NPVARIANT(NPVARIANT_TO_OBJECT(object_method_result), *result); - } else { - browser->releasevariantvalue(&object_method_result); - VOID_TO_NPVARIANT(*result); - } - - browser->releaseobject(object_arg); - - return true; -} - -// Helper function to notify the layout test controller that the test completed. -void notifyTestCompletion(NPP npp, NPObject* object) { - NPVariant result; - NPString script; - script.UTF8Characters = "javascript:window.testRunner.notifyDone();"; - script.UTF8Length = strlen("javascript:window.testRunner.notifyDone();"); - browser->evaluate(npp, object, &script, &result); - browser->releasevariantvalue(&result); -} - -bool testDocumentOpen(NPP npp) { - NPIdentifier documentId = browser->getstringidentifier("document"); - NPIdentifier openId = browser->getstringidentifier("open"); - - NPObject* windowObject = 0; - browser->getvalue(npp, NPNVWindowNPObject, &windowObject); - if (!windowObject) - return false; - - NPVariant docVariant; - browser->getproperty(npp, windowObject, documentId, &docVariant); - if (docVariant.type != NPVariantType_Object) { - browser->releaseobject(windowObject); - return false; - } - - NPObject* documentObject = NPVARIANT_TO_OBJECT(docVariant); - - NPVariant openArgs[2]; - STRINGZ_TO_NPVARIANT("text/html", openArgs[0]); - STRINGZ_TO_NPVARIANT("_blank", openArgs[1]); - - NPVariant result; - if (!browser->invoke(npp, documentObject, openId, openArgs, 2, &result)) { - browser->releaseobject(windowObject); - browser->releaseobject(documentObject); - return false; - } - - browser->releaseobject(documentObject); - - if (result.type != NPVariantType_Object) { - browser->releaseobject(windowObject); - browser->releasevariantvalue(&result); - return false; - } - - pluginLogWithWindowObject(windowObject, npp, "PLUGIN: DOCUMENT OPEN SUCCESS"); - notifyTestCompletion(npp, result.value.objectValue); - browser->releaseobject(result.value.objectValue); - browser->releaseobject(windowObject); - return true; -} - -bool testWindowOpen(NPP npp) { - NPIdentifier openId = browser->getstringidentifier("open"); - - NPObject* windowObject = 0; - browser->getvalue(npp, NPNVWindowNPObject, &windowObject); - if (!windowObject) - return false; - - NPVariant openArgs[2]; - STRINGZ_TO_NPVARIANT("about:blank", openArgs[0]); - STRINGZ_TO_NPVARIANT("_blank", openArgs[1]); - - NPVariant result; - if (!browser->invoke(npp, windowObject, openId, openArgs, 2, &result)) { - browser->releaseobject(windowObject); - return false; - } - - if (result.type != NPVariantType_Object) { - browser->releaseobject(windowObject); - browser->releasevariantvalue(&result); - return false; - } - - pluginLogWithWindowObject(windowObject, npp, "PLUGIN: WINDOW OPEN SUCCESS"); - notifyTestCompletion(npp, result.value.objectValue); - browser->releaseobject(result.value.objectValue); - browser->releaseobject(windowObject); - return true; -} - -static bool testSetStatus(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - char* message = 0; - if (argCount && NPVARIANT_IS_STRING(args[0])) { - NPString statusString = NPVARIANT_TO_STRING(args[0]); - message = toCString(statusString); - } - - browser->status(obj->npp, message); - - free(message); - return true; -} - -static bool testResizeTo(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - VOID_TO_NPVARIANT(*result); - - NPObject* windowObject; - if (NPERR_NO_ERROR != - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowObject)) - return false; - - NPVariant callResult; - if (browser->invoke(obj->npp, - windowObject, - browser->getstringidentifier("resizePlugin"), - args, - argCount, - &callResult)) - browser->releasevariantvalue(&callResult); - - // Force layout. - if (browser->getproperty(obj->npp, - windowObject, - browser->getstringidentifier("pageYOffset"), - &callResult)) - browser->releasevariantvalue(&callResult); - - return true; -} - -static bool normalizeOverride(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - VOID_TO_NPVARIANT(*result); - - NPObject* windowObject; - if (NPERR_NO_ERROR != - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowObject)) - return false; - - NPVariant callResult; - if (browser->invoke(obj->npp, - windowObject, - browser->getstringidentifier("pluginCallback"), - args, - argCount, - &callResult)) - browser->releasevariantvalue(&callResult); - - return true; -} - -static bool invalidateRect(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 4) - return false; - - NPRect rect; - rect.left = static_cast<uint16_t>(NPVARIANT_TO_DOUBLE(args[0])); - rect.top = static_cast<uint16_t>(NPVARIANT_TO_DOUBLE(args[1])); - rect.right = static_cast<uint16_t>(NPVARIANT_TO_DOUBLE(args[2])); - rect.bottom = static_cast<uint16_t>(NPVARIANT_TO_DOUBLE(args[3])); - - browser->invalidaterect(obj->npp, &rect); - return true; -} - -static bool objectsAreSame(PluginObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - if (argCount != 2 || !NPVARIANT_IS_OBJECT(args[0]) || - !NPVARIANT_IS_OBJECT(args[1])) - return false; - - BOOLEAN_TO_NPVARIANT( - NPVARIANT_TO_OBJECT(args[0]) == NPVARIANT_TO_OBJECT(args[1]), *result); - return true; -} - -static bool pluginInvoke(NPObject* header, - NPIdentifier name, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - PluginObject* plugin = reinterpret_cast<PluginObject*>(header); - if (name == pluginMethodIdentifiers[ID_TEST_CALLBACK_METHOD]) - return testCallback(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_CALLBACK_METHOD_RETURN]) - return testCallbackReturn(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_GETURL]) - return getURL(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_DOM_ACCESS]) - return testDOMAccess(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_GET_URL_NOTIFY]) - return getURLNotify(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_INVOKE_DEFAULT]) - return testInvokeDefault(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_ENUMERATE]) - return testEnumerate(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_DESTROY_STREAM]) - return destroyStream(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_GETINTIDENTIFIER]) - return testGetIntIdentifier(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_EVALUATE]) - return testEvaluate(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_GET_PROPERTY]) - return testGetProperty(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_GET_PROPERTY_RETURN_VALUE]) - return testGetPropertyReturnValue(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_HAS_PROPERTY]) - return testHasProperty(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_HAS_METHOD]) - return testHasMethod(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_IDENTIFIER_TO_STRING]) - return testIdentifierToString(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_IDENTIFIER_TO_INT]) - return testIdentifierToInt(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_PASS_TEST_OBJECT]) - return testPassTestObject(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_POSTURL_FILE]) - return testPostURLFile(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_CONSTRUCT]) - return testConstruct(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_SCRIPT_OBJECT_INVOKE]) - return testScriptObjectInvoke(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_THROW_EXCEPTION_METHOD]) { - browser->setexception(header, "plugin object testThrowException SUCCESS"); - return true; - } - if (name == pluginMethodIdentifiers[ID_TEST_FAIL_METHOD]) { - NPObject* windowScriptObject; - browser->getvalue(plugin->npp, NPNVWindowNPObject, &windowScriptObject); - browser->invoke( - plugin->npp, windowScriptObject, name, args, argCount, result); - return false; - } - if (name == pluginMethodIdentifiers[ID_TEST_CLONE_OBJECT]) { - NPObject* new_object = - browser->createobject(plugin->npp, plugin->header._class); - assert(new_object->referenceCount == 1); - OBJECT_TO_NPVARIANT(new_object, *result); - return true; - } - if (name == pluginMethodIdentifiers[ID_TEST_CREATE_TEST_OBJECT]) { - NPObject* testObject = - browser->createobject(plugin->npp, content::GetTestClass()); - assert(testObject->referenceCount == 1); - OBJECT_TO_NPVARIANT(testObject, *result); - return true; - } - if (name == pluginMethodIdentifiers[ID_DESTROY_NULL_STREAM]) - return destroyNullStream(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_RELOAD_PLUGINS_NO_PAGES]) { - browser->reloadplugins(false); - return true; - } - if (name == pluginMethodIdentifiers[ID_TEST_RELOAD_PLUGINS_AND_PAGES]) { - browser->reloadplugins(true); - return true; - } - if (name == pluginMethodIdentifiers[ID_TEST_GET_BROWSER_PROPERTY]) { - browser->getproperty(plugin->npp, - NPVARIANT_TO_OBJECT(args[0]), - stringVariantToIdentifier(args[1]), - result); - return true; - } - if (name == pluginMethodIdentifiers[ID_TEST_SET_BROWSER_PROPERTY]) { - browser->setproperty(plugin->npp, - NPVARIANT_TO_OBJECT(args[0]), - stringVariantToIdentifier(args[1]), - &args[2]); - return true; - } - if (name == pluginMethodIdentifiers[ID_REMEMBER]) { - if (plugin->rememberedObject) - browser->releaseobject(plugin->rememberedObject); - plugin->rememberedObject = NPVARIANT_TO_OBJECT(args[0]); - browser->retainobject(plugin->rememberedObject); - VOID_TO_NPVARIANT(*result); - return true; - } - if (name == pluginMethodIdentifiers[ID_GET_REMEMBERED_OBJECT]) { - assert(plugin->rememberedObject); - browser->retainobject(plugin->rememberedObject); - OBJECT_TO_NPVARIANT(plugin->rememberedObject, *result); - return true; - } - if (name == pluginMethodIdentifiers[ID_GET_AND_FORGET_REMEMBERED_OBJECT]) { - assert(plugin->rememberedObject); - OBJECT_TO_NPVARIANT(plugin->rememberedObject, *result); - plugin->rememberedObject = 0; - return true; - } - if (name == pluginMethodIdentifiers[ID_REF_COUNT]) { - uint32_t refCount = NPVARIANT_TO_OBJECT(args[0])->referenceCount; - INT32_TO_NPVARIANT(refCount, *result); - return true; - } - if (name == pluginMethodIdentifiers[ID_SET_STATUS]) - return testSetStatus(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_RESIZE_TO]) - return testResizeTo(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_NORMALIZE]) - return normalizeOverride(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_INVALIDATE_RECT]) - return invalidateRect(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_OBJECTS_ARE_SAME]) - return objectsAreSame(plugin, args, argCount, result); - if (name == pluginMethodIdentifiers[ID_TEST_DELETE_WITHIN_INVOKE]) { - NPObject* newObject = - browser->createobject(plugin->npp, plugin->header._class); - OBJECT_TO_NPVARIANT(newObject, *result); - callDeletePlugin( - header, name, pluginMethodIdentifiers[ID_TEST_DELETE_WITHIN_INVOKE]); - return true; - } - return false; -} - -static void pluginInvalidate(NPObject* header) { - PluginObject* plugin = reinterpret_cast<PluginObject*>(header); - plugin->testObject = 0; - plugin->rememberedObject = 0; -} - -static NPObject* pluginAllocate(NPP npp, NPClass* theClass) { - PluginObject* newInstance = (PluginObject*)malloc(sizeof(PluginObject)); - - if (!identifiersInitialized) { - identifiersInitialized = true; - initializeIdentifiers(); - } - - newInstance->pluginTest = 0; - newInstance->npp = npp; - newInstance->testObject = browser->createobject(npp, content::GetTestClass()); - newInstance->rememberedObject = 0; - newInstance->eventLogging = false; - newInstance->onStreamLoad = 0; - newInstance->onStreamDestroy = 0; - newInstance->onDestroy = 0; - newInstance->onURLNotify = 0; - newInstance->onSetWindow = 0; - newInstance->onPaintEvent = 0; - newInstance->logDestroy = false; - newInstance->logSetWindow = false; - newInstance->returnErrorFromNewStream = false; - newInstance->returnNegativeOneFromWrite = false; - newInstance->stream = 0; - - newInstance->firstUrl = 0; - newInstance->firstHeaders = 0; - newInstance->lastUrl = 0; - newInstance->lastHeaders = 0; - - newInstance->testGetURLOnDestroy = false; - newInstance->testWindowOpen = false; - newInstance->testKeyboardFocusForPlugins = false; - - newInstance->mouseDownForEvaluateScript = false; - newInstance->evaluateScriptOnMouseDownOrKeyDown = 0; - - return (NPObject*)newInstance; -} - -static void pluginDeallocate(NPObject* header) { - PluginObject* plugin = reinterpret_cast<PluginObject*>(header); - delete plugin->pluginTest; - if (plugin->testObject) - browser->releaseobject(plugin->testObject); - if (plugin->rememberedObject) - browser->releaseobject(plugin->rememberedObject); - - free(plugin->firstUrl); - free(plugin->firstHeaders); - free(plugin->lastUrl); - free(plugin->lastHeaders); - free(plugin); -} - -void handleCallback(PluginObject* object, - const char* url, - NPReason reason, - void* notifyData) { - assert(object); - - NPVariant args[2]; - - NPObject* windowScriptObject; - browser->getvalue(object->npp, NPNVWindowNPObject, &windowScriptObject); - - NPIdentifier callbackIdentifier = notifyData; - - INT32_TO_NPVARIANT(reason, args[0]); - - char* strHdr = 0; - if (object->firstUrl && object->firstHeaders && object->lastUrl && - object->lastHeaders) { - // Format expected by JavaScript validator: four fields separated by \n\n: - // First URL; first header block; last URL; last header block. - // Note that header blocks already end with \n due to how NPStream::headers - // works. - int len = strlen(object->firstUrl) + 2 + strlen(object->firstHeaders) + 1 + - strlen(object->lastUrl) + 2 + strlen(object->lastHeaders) + 1; - strHdr = (char*)malloc(len + 1); - snprintf(strHdr, - len + 1, - "%s\n\n%s\n%s\n\n%s\n", - object->firstUrl, - object->firstHeaders, - object->lastUrl, - object->lastHeaders); - STRINGN_TO_NPVARIANT(strHdr, len, args[1]); - } else - NULL_TO_NPVARIANT(args[1]); - - NPVariant browserResult; - if (browser->invoke(object->npp, - windowScriptObject, - callbackIdentifier, - args, - 2, - &browserResult)) - browser->releasevariantvalue(&browserResult); - - free(strHdr); -} - -void notifyStream(PluginObject* object, const char* url, const char* headers) { - if (!object->firstUrl) { - if (url) - object->firstUrl = base::strdup(url); - if (headers) - object->firstHeaders = base::strdup(headers); - } else { - free(object->lastUrl); - free(object->lastHeaders); - object->lastUrl = (url ? base::strdup(url) : 0); - object->lastHeaders = (headers ? base::strdup(headers) : 0); - } -} - -void testNPRuntime(NPP npp) { - NPObject* windowScriptObject; - browser->getvalue(npp, NPNVWindowNPObject, &windowScriptObject); - - // Invoke - NPIdentifier testNPInvoke = browser->getstringidentifier("testNPInvoke"); - NPVariant args[7]; - - VOID_TO_NPVARIANT(args[0]); - NULL_TO_NPVARIANT(args[1]); - BOOLEAN_TO_NPVARIANT(true, args[2]); - INT32_TO_NPVARIANT(242, args[3]); - DOUBLE_TO_NPVARIANT(242.242, args[4]); - STRINGZ_TO_NPVARIANT("Hello, World", args[5]); - OBJECT_TO_NPVARIANT(windowScriptObject, args[6]); - - NPVariant result; - if (browser->invoke(npp, windowScriptObject, testNPInvoke, args, 7, &result)) - browser->releasevariantvalue(&result); - - browser->releaseobject(windowScriptObject); -}
diff --git a/content/shell/tools/plugin/PluginObject.h b/content/shell/tools/plugin/PluginObject.h deleted file mode 100644 index bc904a5..0000000 --- a/content/shell/tools/plugin/PluginObject.h +++ /dev/null
@@ -1,94 +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. - -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef PluginObject_h -#define PluginObject_h - -#include <bindings/npfunctions.h> -#include <stdarg.h> - -class PluginTest; - -extern NPNetscapeFuncs *browser; -extern NPPluginFuncs* pluginFunctions; - -typedef struct { - NPObject header; - - PluginTest* pluginTest; - - NPP npp; - NPBool eventLogging; - NPBool logSetWindow; - NPBool logDestroy; - NPBool returnNegativeOneFromWrite; - NPBool returnErrorFromNewStream; - NPObject* testObject; - NPObject* rememberedObject; - NPStream* stream; - NPBool testGetURLOnDestroy; - NPBool testWindowOpen; - NPBool testKeyboardFocusForPlugins; - NPBool mouseDownForEvaluateScript; - char* onStreamLoad; - char* onStreamDestroy; - char* onDestroy; - char* onURLNotify; - char* onSetWindow; - char* onPaintEvent; - char* firstUrl; - char* firstHeaders; - char* lastUrl; - char* lastHeaders; - char* evaluateScriptOnMouseDownOrKeyDown; -#ifdef XP_MACOSX - NPEventModel eventModel; -#endif - NPWindow lastWindow; - NPBool alwaysFilterEvents; -} PluginObject; - -extern NPClass* createPluginClass(void); - -extern void handleCallback(PluginObject* object, - const char* url, - NPReason reason, - void* notifyData); -extern void notifyStream(PluginObject* object, - const char* url, - const char* headers); -extern void testNPRuntime(NPP npp); -extern void pluginLog(NPP instance, const char* format, ...); -extern void pluginLogWithArguments(NPP instance, - const char* format, - va_list args); -extern bool testDocumentOpen(NPP npp); -extern bool testWindowOpen(NPP npp); - -#endif // PluginObject_h
diff --git a/content/shell/tools/plugin/PluginTest.cpp b/content/shell/tools/plugin/PluginTest.cpp deleted file mode 100644 index fa95d891..0000000 --- a/content/shell/tools/plugin/PluginTest.cpp +++ /dev/null
@@ -1,265 +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. - -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginTest.h" - -#include "PluginObject.h" -#include <string.h> - -#if defined(XP_UNIX) || defined(ANDROID) -#include <unistd.h> -#endif - -using namespace std; -extern NPNetscapeFuncs *browser; - -static void (*shutdownFunction)(); - -PluginTest* PluginTest::create(NPP npp, const string& identifier) { - if (identifier.empty()) - return new PluginTest(npp, identifier); - - CreateTestFunction createTestFunction = createTestFunctions()[identifier]; - if (createTestFunction) - return createTestFunction(npp, identifier); - - return 0; -} - -PluginTest::PluginTest(NPP npp, const string& identifier) - : m_npp(npp), m_identifier(identifier) { - // Reset the shutdown function. - shutdownFunction = 0; -} - -PluginTest::~PluginTest() {} - -void PluginTest::NP_Shutdown() { - if (shutdownFunction) - shutdownFunction(); -} - -void PluginTest::registerNPShutdownFunction(void (*func)()) { - assert(!shutdownFunction); - shutdownFunction = func; -} - -void PluginTest::indicateTestFailure() { -// This should really be an assert, but there's no way for the test framework -// to know that the plugin process crashed, so we'll just sleep for a while -// to ensure that the test times out. -#if defined(XP_WIN) - ::Sleep(100000); -#else - sleep(1000); -#endif -} - -NPError PluginTest::NPP_New(NPMIMEType pluginType, - uint16_t mode, - int16_t argc, - char* argn[], - char* argv[], - NPSavedData* saved) { - return NPERR_NO_ERROR; -} - -NPError PluginTest::NPP_Destroy(NPSavedData**) { return NPERR_NO_ERROR; } - -NPError PluginTest::NPP_SetWindow(NPWindow*) { return NPERR_NO_ERROR; } - -NPError PluginTest::NPP_NewStream(NPMIMEType type, - NPStream* stream, - NPBool seekable, - uint16_t* stype) { - return NPERR_NO_ERROR; -} - -NPError PluginTest::NPP_DestroyStream(NPStream* stream, NPReason reason) { - return NPERR_NO_ERROR; -} - -int32_t PluginTest::NPP_WriteReady(NPStream*) { return 4096; } - -int32_t PluginTest::NPP_Write(NPStream*, - int32_t offset, - int32_t len, - void* buffer) { - return len; -} - -int16_t PluginTest::NPP_HandleEvent(void*) { return 0; } - -bool PluginTest::NPP_URLNotify(const char* url, NPReason, void* notifyData) { - // FIXME: Port the code from NPP_URLNotify in main.cpp over to always using - // PluginTest, so we don't have to use a return value to indicate whether the - // "default" NPP_URLNotify implementation should be invoked. - return false; -} - -NPError PluginTest::NPP_GetValue(NPPVariable variable, void* value) { - // We don't know anything about plugin values so just return - // NPERR_GENERIC_ERROR. - return NPERR_GENERIC_ERROR; -} - -NPError PluginTest::NPP_SetValue(NPNVariable, void* value) { - return NPERR_GENERIC_ERROR; -} - -// NPN functions. - -NPError PluginTest::NPN_GetValue(NPNVariable variable, void* value) { - return browser->getvalue(m_npp, variable, value); -} - -void PluginTest::NPN_InvalidateRect(NPRect* invalidRect) { - browser->invalidaterect(m_npp, invalidRect); -} - -bool PluginTest::NPN_Invoke(NPObject* npobj, - NPIdentifier methodName, - const NPVariant* args, - uint32_t argCount, - NPVariant* result) { - return browser->invoke(m_npp, npobj, methodName, args, argCount, result); -} - -void* PluginTest::NPN_MemAlloc(uint32_t size) { - return browser->memalloc(size); -} - -// NPRuntime NPN functions. - -NPIdentifier PluginTest::NPN_GetStringIdentifier(const NPUTF8* name) { - return browser->getstringidentifier(name); -} - -NPIdentifier PluginTest::NPN_GetIntIdentifier(int32_t intid) { - return browser->getintidentifier(intid); -} - -bool PluginTest::NPN_IdentifierIsString(NPIdentifier npIdentifier) { - return browser->identifierisstring(npIdentifier); -} - -NPUTF8* PluginTest::NPN_UTF8FromIdentifier(NPIdentifier npIdentifier) { - return browser->utf8fromidentifier(npIdentifier); -} - -int32_t PluginTest::NPN_IntFromIdentifier(NPIdentifier npIdentifier) { - return browser->intfromidentifier(npIdentifier); -} - -NPObject* PluginTest::NPN_CreateObject(NPClass* npClass) { - return browser->createobject(m_npp, npClass); -} - -NPObject* PluginTest::NPN_RetainObject(NPObject* npObject) { - return browser->retainobject(npObject); -} - -void PluginTest::NPN_ReleaseObject(NPObject* npObject) { - browser->releaseobject(npObject); -} - -bool PluginTest::NPN_GetProperty(NPObject* npObject, - NPIdentifier propertyName, - NPVariant* value) { - return browser->getproperty(m_npp, npObject, propertyName, value); -} - -bool PluginTest::NPN_RemoveProperty(NPObject* npObject, - NPIdentifier propertyName) { - return browser->removeproperty(m_npp, npObject, propertyName); -} - -void PluginTest::NPN_ReleaseVariantValue(NPVariant* variant) { - browser->releasevariantvalue(variant); -} - -#ifdef XP_MACOSX -bool PluginTest::NPN_ConvertPoint(double sourceX, - double sourceY, - NPCoordinateSpace sourceSpace, - double* destX, - double* destY, - NPCoordinateSpace destSpace) { - return browser->convertpoint( - m_npp, sourceX, sourceY, sourceSpace, destX, destY, destSpace); -} -#endif - -bool PluginTest::executeScript(const NPString* script, NPVariant* result) { - NPObject* windowScriptObject; - browser->getvalue(m_npp, NPNVWindowNPObject, &windowScriptObject); - - return browser->evaluate( - m_npp, windowScriptObject, const_cast<NPString*>(script), result); -} - -void PluginTest::executeScript(const char* script) { - NPString npScript; - npScript.UTF8Characters = script; - npScript.UTF8Length = strlen(script); - - NPVariant browserResult; - executeScript(&npScript, &browserResult); - browser->releasevariantvalue(&browserResult); -} - -void PluginTest::log(const char* format, ...) { - va_list args; - va_start(args, format); - pluginLogWithArguments(m_npp, format, args); - va_end(args); -} - -NPNetscapeFuncs* PluginTest::netscapeFuncs() { return browser; } - -void PluginTest::waitUntilDone() { - executeScript("testRunner.waitUntilDone()"); -} - -void PluginTest::notifyDone() { executeScript("testRunner.notifyDone()"); } - -void PluginTest::registerCreateTestFunction( - const string& identifier, - CreateTestFunction createTestFunction) { - assert(!createTestFunctions().count(identifier)); - - createTestFunctions()[identifier] = createTestFunction; -} - -std::map<std::string, PluginTest::CreateTestFunction>& -PluginTest::createTestFunctions() { - static std::map<std::string, CreateTestFunction> testFunctions; - - return testFunctions; -}
diff --git a/content/shell/tools/plugin/PluginTest.h b/content/shell/tools/plugin/PluginTest.h deleted file mode 100644 index 9873d83..0000000 --- a/content/shell/tools/plugin/PluginTest.h +++ /dev/null
@@ -1,302 +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. - -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef PluginTest_h -#define PluginTest_h - -#include <assert.h> -#include <bindings/npfunctions.h> -#include <stdint.h> - -#include <map> -#include <string> - -// Helper classes for implementing has_member -typedef char (&no_tag)[1]; -typedef char (&yes_tag)[2]; - -#define DEFINE_HAS_MEMBER_CHECK(member, returnType, argumentTypes) \ - template <typename T, returnType(T::*member) argumentTypes> \ - struct pmf_##member##_helper {}; \ - template <typename T> \ - no_tag has_member_##member##_helper(...); \ - template <typename T> \ - yes_tag has_member_##member##_helper(pmf_##member##_helper<T, &T::member>*); \ - template <typename T> \ - struct has_member_##member { \ - static const bool value = \ - sizeof(has_member_##member##_helper<T>(0)) == sizeof(yes_tag); \ - }; - -DEFINE_HAS_MEMBER_CHECK(hasMethod, bool, (NPIdentifier methodName)); -DEFINE_HAS_MEMBER_CHECK( - invoke, - bool, - (NPIdentifier methodName, const NPVariant*, uint32_t, NPVariant* result)); -DEFINE_HAS_MEMBER_CHECK(invokeDefault, - bool, - (const NPVariant*, uint32_t, NPVariant* result)); -DEFINE_HAS_MEMBER_CHECK(hasProperty, bool, (NPIdentifier propertyName)); -DEFINE_HAS_MEMBER_CHECK(getProperty, - bool, - (NPIdentifier propertyName, NPVariant* result)); -DEFINE_HAS_MEMBER_CHECK(removeProperty, bool, (NPIdentifier propertyName)); - -class PluginTest { - public: - static PluginTest* create(NPP, const std::string& identifier); - virtual ~PluginTest(); - - static void NP_Shutdown(); - - // NPP functions. - virtual NPError NPP_New(NPMIMEType pluginType, - uint16_t mode, - int16_t argc, - char* argn[], - char* argv[], - NPSavedData* saved); - virtual NPError NPP_Destroy(NPSavedData**); - virtual NPError NPP_SetWindow(NPWindow*); - virtual NPError NPP_NewStream(NPMIMEType, - NPStream*, - NPBool seekable, - uint16_t* stype); - virtual NPError NPP_DestroyStream(NPStream*, NPReason); - virtual int32_t NPP_WriteReady(NPStream*); - virtual int32_t NPP_Write(NPStream*, - int32_t offset, - int32_t len, - void* buffer); - virtual int16_t NPP_HandleEvent(void* event); - virtual bool NPP_URLNotify(const char* url, NPReason, void* notifyData); - virtual NPError NPP_GetValue(NPPVariable, void* value); - virtual NPError NPP_SetValue(NPNVariable, void* value); - - // NPN functions. - NPError NPN_GetValue(NPNVariable, void* value); - void NPN_InvalidateRect(NPRect* invalidRect); - bool NPN_Invoke(NPObject*, - NPIdentifier methodName, - const NPVariant* args, - uint32_t argCount, - NPVariant* result); - void* NPN_MemAlloc(uint32_t size); - - // NPRuntime NPN functions. - NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name); - NPIdentifier NPN_GetIntIdentifier(int32_t intid); - bool NPN_IdentifierIsString(NPIdentifier); - NPUTF8* NPN_UTF8FromIdentifier(NPIdentifier); - int32_t NPN_IntFromIdentifier(NPIdentifier); - - NPObject* NPN_CreateObject(NPClass*); - NPObject* NPN_RetainObject(NPObject*); - void NPN_ReleaseObject(NPObject*); - bool NPN_GetProperty(NPObject*, NPIdentifier propertyName, NPVariant* value); - bool NPN_RemoveProperty(NPObject*, NPIdentifier propertyName); - void NPN_ReleaseVariantValue(NPVariant*); - -#ifdef XP_MACOSX - bool NPN_ConvertPoint(double sourceX, - double sourceY, - NPCoordinateSpace sourceSpace, - double* destX, - double* destY, - NPCoordinateSpace destSpace); -#endif - - bool executeScript(const NPString*, NPVariant* result); - void executeScript(const char*); - void log(const char* format, ...); - - void registerNPShutdownFunction(void (*)()); - - static void indicateTestFailure(); - - template <typename TestClassTy> - class Register { - public: - Register(const std::string& identifier) { - registerCreateTestFunction(identifier, Register::create); - } - - private: - static PluginTest* create(NPP npp, const std::string& identifier) { - return new TestClassTy(npp, identifier); - } - }; - - protected: - PluginTest(NPP npp, const std::string& identifier); - - // FIXME: A plugin test shouldn't need to know about it's NPP. Make this - // private. - NPP m_npp; - - const std::string& identifier() const { return m_identifier; } - - static NPNetscapeFuncs* netscapeFuncs(); - - void waitUntilDone(); - void notifyDone(); - - // NPObject helper template. - template <typename T> - struct Object : NPObject { - public: - static NPObject* create(PluginTest* pluginTest) { - Object* object = - static_cast<Object*>(pluginTest->NPN_CreateObject(npClass())); - - object->m_pluginTest = pluginTest; - return object; - } - - // These should never be called. - bool hasMethod(NPIdentifier methodName) { - assert(false); - return false; - } - - bool invoke(NPIdentifier methodName, - const NPVariant*, - uint32_t, - NPVariant* result) { - assert(false); - return false; - } - - bool invokeDefault(const NPVariant*, uint32_t, NPVariant* result) { - assert(false); - return false; - } - - bool hasProperty(NPIdentifier propertyName) { - assert(false); - return false; - } - - bool getProperty(NPIdentifier propertyName, NPVariant* result) { - assert(false); - return false; - } - - bool removeProperty(NPIdentifier propertyName) { - assert(false); - return false; - } - - // Helper functions. - bool identifierIs(NPIdentifier identifier, const char* value) { - return pluginTest()->NPN_GetStringIdentifier(value) == identifier; - } - - protected: - Object() : m_pluginTest(0) {} - - virtual ~Object() {} - - PluginTest* pluginTest() const { return m_pluginTest; } - - private: - static NPObject* NP_Allocate(NPP npp, NPClass* aClass) { return new T; } - - static void NP_Deallocate(NPObject* npObject) { - delete static_cast<T*>(npObject); - } - - static bool NP_HasMethod(NPObject* npObject, NPIdentifier methodName) { - return static_cast<T*>(npObject)->hasMethod(methodName); - } - - static bool NP_Invoke(NPObject* npObject, - NPIdentifier methodName, - const NPVariant* arguments, - uint32_t argumentCount, - NPVariant* result) { - return static_cast<T*>(npObject) - ->invoke(methodName, arguments, argumentCount, result); - } - - static bool NP_InvokeDefault(NPObject* npObject, - const NPVariant* arguments, - uint32_t argumentCount, - NPVariant* result) { - return static_cast<T*>(npObject) - ->invokeDefault(arguments, argumentCount, result); - } - - static bool NP_HasProperty(NPObject* npObject, NPIdentifier propertyName) { - return static_cast<T*>(npObject)->hasProperty(propertyName); - } - - static bool NP_GetProperty(NPObject* npObject, - NPIdentifier propertyName, - NPVariant* result) { - return static_cast<T*>(npObject)->getProperty(propertyName, result); - } - - static bool NP_RemoveProperty(NPObject* npObject, - NPIdentifier propertyName) { - return static_cast<T*>(npObject)->removeProperty(propertyName); - } - - static NPClass* npClass() { - static NPClass npClass = { - NP_CLASS_STRUCT_VERSION, NP_Allocate, NP_Deallocate, - 0, // NPClass::invalidate - has_member_hasMethod<T>::value ? NP_HasMethod : 0, - has_member_invoke<T>::value ? NP_Invoke : 0, - has_member_invokeDefault<T>::value ? NP_InvokeDefault : 0, - has_member_hasProperty<T>::value ? NP_HasProperty : 0, - has_member_getProperty<T>::value ? NP_GetProperty : 0, - 0, // NPClass::setProperty - has_member_removeProperty<T>::value ? NP_RemoveProperty : 0, - 0, // NPClass::enumerate - 0 // NPClass::construct - }; - - return &npClass; - }; - - PluginTest* m_pluginTest; - }; - - private: - typedef PluginTest* (*CreateTestFunction)(NPP, const std::string&); - - static void registerCreateTestFunction(const std::string&, - CreateTestFunction); - static std::map<std::string, CreateTestFunction>& createTestFunctions(); - - std::string m_identifier; -}; - -#endif // PluginTest_h
diff --git a/content/shell/tools/plugin/TestObject.cpp b/content/shell/tools/plugin/TestObject.cpp deleted file mode 100644 index 1c88c3b..0000000 --- a/content/shell/tools/plugin/TestObject.cpp +++ /dev/null
@@ -1,222 +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. - -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "content/shell/tools/plugin/test_object.h" - -#include <stdint.h> -#include <stdlib.h> -#include <string.h> - -#include "PluginObject.h" - -static bool testEnumerate(NPObject* npobj, - NPIdentifier** value, - uint32_t* count); -static bool testHasMethod(NPObject*, NPIdentifier name); -static bool testInvoke(NPObject*, - NPIdentifier name, - const NPVariant* args, - uint32_t argCount, - NPVariant* result); -static bool testHasProperty(NPObject*, NPIdentifier name); -static bool testGetProperty(NPObject*, NPIdentifier name, NPVariant*); -static NPObject* testAllocate(NPP npp, NPClass* theClass); -static void testDeallocate(NPObject* obj); -static bool testConstruct(NPObject* obj, - const NPVariant* args, - uint32_t argCount, - NPVariant* result); - -static NPClass g_test_class = { - NP_CLASS_STRUCT_VERSION, testAllocate, testDeallocate, 0, - testHasMethod, testInvoke, 0, testHasProperty, - testGetProperty, 0, 0, testEnumerate, - testConstruct}; - - -static int g_test_object_count = 0; - -typedef struct { - NPObject header; - NPObject* testObject; -} TestObject; - -static bool identifiersInitialized = false; - -#define NUM_ENUMERATABLE_TEST_IDENTIFIERS 2 - -enum { - ID_PROPERTY_FOO = 0, - ID_PROPERTY_BAR, - ID_PROPERTY_OBJECT_POINTER, - ID_PROPERTY_TEST_OBJECT, - ID_PROPERTY_REF_COUNT, - NUM_TEST_IDENTIFIERS, -}; - -static NPIdentifier testIdentifiers[NUM_TEST_IDENTIFIERS]; -static const NPUTF8* testIdentifierNames[NUM_TEST_IDENTIFIERS] = { - "foo", "bar", "objectPointer", "testObject", "refCount", }; - -#define ID_THROW_EXCEPTION_METHOD 0 -#define NUM_METHOD_IDENTIFIERS 1 - -static NPIdentifier testMethodIdentifiers[NUM_METHOD_IDENTIFIERS]; -static const NPUTF8* testMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = { - "throwException", }; - -static void initializeIdentifiers(void) { - browser->getstringidentifiers( - testIdentifierNames, NUM_TEST_IDENTIFIERS, testIdentifiers); - browser->getstringidentifiers( - testMethodIdentifierNames, NUM_METHOD_IDENTIFIERS, testMethodIdentifiers); -} - -static NPObject* testAllocate(NPP npp, NPClass* /*theClass*/) { - TestObject* newInstance = - static_cast<TestObject*>(malloc(sizeof(TestObject))); - newInstance->testObject = 0; - ++g_test_object_count; - - if (!identifiersInitialized) { - identifiersInitialized = true; - initializeIdentifiers(); - } - - return reinterpret_cast<NPObject*>(newInstance); -} - -static void testDeallocate(NPObject* obj) { - TestObject* testObject = reinterpret_cast<TestObject*>(obj); - if (testObject->testObject) - browser->releaseobject(testObject->testObject); - - --g_test_object_count; - free(obj); -} - -static bool testHasMethod(NPObject*, NPIdentifier name) { - for (unsigned i = 0; i < NUM_METHOD_IDENTIFIERS; i++) { - if (testMethodIdentifiers[i] == name) - return true; - } - return false; -} - -static bool testInvoke(NPObject* header, - NPIdentifier name, - const NPVariant* /*args*/, - uint32_t /*argCount*/, - NPVariant* /*result*/) { - if (name == testMethodIdentifiers[ID_THROW_EXCEPTION_METHOD]) { - browser->setexception(header, "test object throwException SUCCESS"); - return true; - } - return false; -} - -static bool testHasProperty(NPObject*, NPIdentifier name) { - for (unsigned i = 0; i < NUM_TEST_IDENTIFIERS; i++) { - if (testIdentifiers[i] == name) - return true; - } - - return false; -} - -static bool testGetProperty(NPObject* npobj, - NPIdentifier name, - NPVariant* result) { - if (name == testIdentifiers[ID_PROPERTY_FOO]) { - char* mem = static_cast<char*>(browser->memalloc(4)); - strcpy(mem, "foo"); - STRINGZ_TO_NPVARIANT(mem, *result); - return true; - } - if (name == testIdentifiers[ID_PROPERTY_BAR]) { - char* mem = static_cast<char*>(browser->memalloc(4)); - strcpy(mem, "bar"); - STRINGZ_TO_NPVARIANT(mem, *result); - return true; - } - if (name == testIdentifiers[ID_PROPERTY_OBJECT_POINTER]) { - int32_t objectPointer = - static_cast<int32_t>(reinterpret_cast<long long>(npobj)); - - INT32_TO_NPVARIANT(objectPointer, *result); - return true; - } - if (name == testIdentifiers[ID_PROPERTY_TEST_OBJECT]) { - TestObject* testObject = reinterpret_cast<TestObject*>(npobj); - if (!testObject->testObject) - testObject->testObject = browser->createobject(0, &g_test_class); - browser->retainobject(testObject->testObject); - OBJECT_TO_NPVARIANT(testObject->testObject, *result); - return true; - } - if (name == testIdentifiers[ID_PROPERTY_REF_COUNT]) { - INT32_TO_NPVARIANT(npobj->referenceCount, *result); - return true; - } - - return false; -} - -static bool testEnumerate(NPObject* /*npobj*/, - NPIdentifier** value, - uint32_t* count) { - *count = NUM_ENUMERATABLE_TEST_IDENTIFIERS; - - *value = (NPIdentifier*)browser->memalloc(NUM_ENUMERATABLE_TEST_IDENTIFIERS * - sizeof(NPIdentifier)); - memcpy(*value, - testIdentifiers, - sizeof(NPIdentifier) * NUM_ENUMERATABLE_TEST_IDENTIFIERS); - - return true; -} - -static bool testConstruct(NPObject* npobj, - const NPVariant* /*args*/, - uint32_t /*argCount*/, - NPVariant* result) { - browser->retainobject(npobj); - - // Just return the same object. - OBJECT_TO_NPVARIANT(npobj, *result); - return true; -} - -namespace content { - -NPClass* GetTestClass() { return &g_test_class; } - -int GetTestObjectCount() { return g_test_object_count; } - -} // namespace content
diff --git a/content/shell/tools/plugin/Tests/EvaluateJSAfterRemovingPluginElement.cpp b/content/shell/tools/plugin/Tests/EvaluateJSAfterRemovingPluginElement.cpp deleted file mode 100644 index d1f81f0c..0000000 --- a/content/shell/tools/plugin/Tests/EvaluateJSAfterRemovingPluginElement.cpp +++ /dev/null
@@ -1,68 +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. - -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginTest.h" - -#include "PluginObject.h" - -using namespace std; - -// Executing JS after removing the plugin element from the document should not crash. - -class EvaluateJSAfterRemovingPluginElement : public PluginTest { -public: - EvaluateJSAfterRemovingPluginElement(NPP, const string& identifier); - -private: - NPError NPP_DestroyStream(NPStream*, NPReason) override; - - bool m_didExecuteScript; -}; - -static PluginTest::Register<EvaluateJSAfterRemovingPluginElement> registrar("evaluate-js-after-removing-plugin-element"); - -EvaluateJSAfterRemovingPluginElement::EvaluateJSAfterRemovingPluginElement(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - , m_didExecuteScript(false) -{ - waitUntilDone(); -} - -NPError EvaluateJSAfterRemovingPluginElement::NPP_DestroyStream(NPStream*, NPReason) -{ - if (m_didExecuteScript) - return NPERR_NO_ERROR; - m_didExecuteScript = true; - - executeScript("var plugin = document.getElementsByTagName('embed')[0]; plugin.parentElement.removeChild(plugin);"); - executeScript("document.body.appendChild(document.createTextNode('Executing script after removing the plugin element from the document succeeded.'));"); - notifyDone(); - - return NPERR_NO_ERROR; -}
diff --git a/content/shell/tools/plugin/Tests/EvaluateJSWithinNPP_New.cpp b/content/shell/tools/plugin/Tests/EvaluateJSWithinNPP_New.cpp deleted file mode 100644 index 93f8198..0000000 --- a/content/shell/tools/plugin/Tests/EvaluateJSWithinNPP_New.cpp +++ /dev/null
@@ -1,62 +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. - -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginTest.h" - -#include <stdint.h> - -#include "PluginObject.h" - -using namespace std; - -// Executing JS within NPP_New when initializing asynchronously should not be able to deadlock with the WebProcess - -class EvaluteJSWithinNPP_New : public PluginTest { -public: - EvaluteJSWithinNPP_New(NPP, const string& identifier); - -private: - virtual NPError NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *); - -}; - -EvaluteJSWithinNPP_New::EvaluteJSWithinNPP_New(NPP npp, const string& identifier) - : PluginTest(npp, identifier) -{ -} - -NPError EvaluteJSWithinNPP_New::NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved) -{ - // Give the WebProcess enough time to be deadlocked waiting for the PluginProcess. - usleep(15000); - executeScript("var theLocation = window.location;"); - return NPERR_NO_ERROR; -} - -static PluginTest::Register<EvaluteJSWithinNPP_New> registrar("evalute-js-within-npp-new");
diff --git a/content/shell/tools/plugin/Tests/FormValue.cpp b/content/shell/tools/plugin/Tests/FormValue.cpp deleted file mode 100644 index e632254..0000000 --- a/content/shell/tools/plugin/Tests/FormValue.cpp +++ /dev/null
@@ -1,32 +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. - -#include "PluginTest.h" -#include <string.h> - -extern NPNetscapeFuncs *browser; - -class FormValue : public PluginTest { -public: - FormValue(NPP npp, const std::string& identifier) - : PluginTest(npp, identifier) - { - } - NPError NPP_GetValue(NPPVariable, void*) override; -}; - -NPError FormValue::NPP_GetValue(NPPVariable variable, void *value) -{ - if (variable == NPPVformValue) { - static const char formValueText[] = "Plugin form value"; - *((void**)value) = browser->memalloc(sizeof(formValueText)); - if (!*((void**)value)) - return NPERR_OUT_OF_MEMORY_ERROR; - strncpy(*((char**)value), formValueText, sizeof(formValueText)); - return NPERR_NO_ERROR; - } - return NPERR_GENERIC_ERROR; -} - -static PluginTest::Register<FormValue> formValue("form-value");
diff --git a/content/shell/tools/plugin/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp b/content/shell/tools/plugin/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp deleted file mode 100644 index 0f2693c4..0000000 --- a/content/shell/tools/plugin/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp +++ /dev/null
@@ -1,64 +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. - -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginTest.h" - -#include <stdint.h> - -#include "PluginObject.h" - -using namespace std; - -// Trying to get the user agent with a null instance from NPP_New. - -class GetUserAgentWithNullNPPFromNPPNew : public PluginTest { -public: - GetUserAgentWithNullNPPFromNPPNew(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - { - } - -private: - NPError NPP_New(NPMIMEType pluginType, - uint16_t mode, - int16_t argc, - char* argn[], - char* argv[], - NPSavedData* saved) override { - if (!browser->uagent(0)) - pluginLog(m_npp, "FAILURE: Null user agent returned."); - else - pluginLog(m_npp, "SUCCESS!"); - - return NPERR_NO_ERROR; - } - -}; - -static PluginTest::Register<GetUserAgentWithNullNPPFromNPPNew> getUserAgentWithNullNPPFromNPPNew("get-user-agent-with-null-npp-from-npp-new");
diff --git a/content/shell/tools/plugin/Tests/InvokeDestroysPluginWithinNPP_New.cpp b/content/shell/tools/plugin/Tests/InvokeDestroysPluginWithinNPP_New.cpp deleted file mode 100644 index 3e72d2f..0000000 --- a/content/shell/tools/plugin/Tests/InvokeDestroysPluginWithinNPP_New.cpp +++ /dev/null
@@ -1,73 +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. - -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginTest.h" - -#include <stdint.h> - -#include "PluginObject.h" - -using namespace std; - -// Executing JS within NPP_New when initializing asynchronously should not be able to deadlock with the WebProcess - -class InvokeDestroysPluginWithinNPP_New : public PluginTest { -public: - InvokeDestroysPluginWithinNPP_New(NPP, const string& identifier); - -private: - virtual NPError NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *); - -}; - -InvokeDestroysPluginWithinNPP_New::InvokeDestroysPluginWithinNPP_New(NPP npp, const string& identifier) - : PluginTest(npp, identifier) -{ -} - -NPError InvokeDestroysPluginWithinNPP_New::NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved) -{ - // Give the WebProcess enough time to be deadlocked waiting for the PluginProcess if things aren't working correctly. - usleep(15000); - - NPObject* windowObject = 0; - if (NPN_GetValue(NPNVWindowNPObject, &windowObject) != NPERR_NO_ERROR) - return NPERR_GENERIC_ERROR; - - if (!windowObject) - return NPERR_GENERIC_ERROR; - - NPVariant result; - if (!NPN_Invoke(windowObject, NPN_GetStringIdentifier("removePluginElement"), 0, 0, &result)) - return NPERR_GENERIC_ERROR; - - return NPERR_NO_ERROR; -} - -static PluginTest::Register<InvokeDestroysPluginWithinNPP_New> registrar("invoke-destroys-plugin-within-npp-new");
diff --git a/content/shell/tools/plugin/Tests/LeakWindowScriptableObject.cpp b/content/shell/tools/plugin/Tests/LeakWindowScriptableObject.cpp deleted file mode 100644 index ca6f28c..0000000 --- a/content/shell/tools/plugin/Tests/LeakWindowScriptableObject.cpp +++ /dev/null
@@ -1,49 +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. - -#include <stdint.h> - -#include "PluginTest.h" - -using namespace std; - -class LeakWindowScriptableObject : public PluginTest { -public: - LeakWindowScriptableObject(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - { - } - -private: - NPError NPP_New(NPMIMEType pluginType, - uint16_t mode, - int16_t argc, - char* argn[], - char* argv[], - NPSavedData* saved) override { - // Get a new reference to the window script object. - NPObject* window; - if (NPN_GetValue(NPNVWindowNPObject, &window) != NPERR_NO_ERROR) { - log("Fail: Cannot fetch window script object"); - return NPERR_NO_ERROR; - } - - // Get another reference to the same object via window.self. - NPIdentifier self_name = NPN_GetStringIdentifier("self"); - NPVariant window_self_variant; - if (!NPN_GetProperty(window, self_name, &window_self_variant)) { - log("Fail: Cannot query window.self"); - return NPERR_NO_ERROR; - } - if (!NPVARIANT_IS_OBJECT(window_self_variant)) { - log("Fail: window.self is not an object"); - return NPERR_NO_ERROR; - } - - // Leak both references to the window script object. - return NPERR_NO_ERROR; - } -}; - -static PluginTest::Register<LeakWindowScriptableObject> leakWindowScriptableObject("leak-window-scriptable-object");
diff --git a/content/shell/tools/plugin/Tests/LogNPPSetWindow.cpp b/content/shell/tools/plugin/Tests/LogNPPSetWindow.cpp deleted file mode 100644 index 2e3a518b..0000000 --- a/content/shell/tools/plugin/Tests/LogNPPSetWindow.cpp +++ /dev/null
@@ -1,65 +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. - -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginTest.h" - -#include <stdio.h> - -using namespace std; - -class LogNPPSetWindow : public PluginTest { -public: - LogNPPSetWindow(NPP, const string& identifier); - -private: - NPError NPP_SetWindow(NPWindow*) override; -}; - -LogNPPSetWindow::LogNPPSetWindow(NPP npp, const string& identifier) - : PluginTest(npp, identifier) -{ -} - -NPError LogNPPSetWindow::NPP_SetWindow(NPWindow* window) -{ - char message[1024]; - snprintf(message, 1024, "NPP_SetWindow: %s window, Rect {%i, %i, %i, %i}, Clip Rect {%i, %i, %i, %i}, Type %i", - window->window ? "non-NULL" : "NULL", window->x, window->y, window->width, window->height, - window->clipRect.left, window->clipRect.top, window->clipRect.right, window->clipRect.bottom, - window->type); - - char script[1536]; - snprintf(script, 1536, "window.setTimeout('windowWasSet(\"%s\");', 0);", message); - - executeScript(script); - - return NPERR_NO_ERROR; -} - -static PluginTest::Register<LogNPPSetWindow> registrar("log-npp-set-window");
diff --git a/content/shell/tools/plugin/Tests/NPDeallocateCalledBeforeNPShutdown.cpp b/content/shell/tools/plugin/Tests/NPDeallocateCalledBeforeNPShutdown.cpp deleted file mode 100644 index 245a3c44..0000000 --- a/content/shell/tools/plugin/Tests/NPDeallocateCalledBeforeNPShutdown.cpp +++ /dev/null
@@ -1,102 +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. - -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <stdint.h> - -#include "PluginTest.h" - -using namespace std; - -static bool wasShutdownCalled = false; - -class NPDeallocateCalledBeforeNPShutdown : public PluginTest { -public: - NPDeallocateCalledBeforeNPShutdown(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - { - } - -private: - // This is the test object. - class TestObject : public Object<TestObject> { - public: - ~TestObject() override { - if (wasShutdownCalled) - indicateTestFailure(); - } - }; - - // This is the scriptable object. It has a single "testObject" property. - class ScriptableObject : public Object<ScriptableObject> { - public: - bool hasProperty(NPIdentifier propertyName) - { - return propertyName == pluginTest()->NPN_GetStringIdentifier("testObject"); - } - - bool getProperty(NPIdentifier propertyName, NPVariant* result) - { - if (propertyName != pluginTest()->NPN_GetStringIdentifier("testObject")) - return false; - - NPObject* testObject = TestObject::create(pluginTest()); - OBJECT_TO_NPVARIANT(testObject, *result); - return true; - } - }; - - NPError NPP_New(NPMIMEType pluginType, - uint16_t mode, - int16_t argc, - char* argn[], - char* argv[], - NPSavedData* saved) override { - registerNPShutdownFunction(shutdown); - - return NPERR_NO_ERROR; - } - - NPError NPP_GetValue(NPPVariable variable, void* value) override { - if (variable != NPPVpluginScriptableNPObject) - return NPERR_GENERIC_ERROR; - - *(NPObject**)value = ScriptableObject::create(this); - - return NPERR_NO_ERROR; - } - - static void shutdown() - { - wasShutdownCalled = true; - } - -}; - -static PluginTest::Register<NPDeallocateCalledBeforeNPShutdown> npRuntimeObjectFromDestroyedPlugin("np-deallocate-called-before-np-shutdown"); -
diff --git a/content/shell/tools/plugin/Tests/NPPNewFails.cpp b/content/shell/tools/plugin/Tests/NPPNewFails.cpp deleted file mode 100644 index 89254c9..0000000 --- a/content/shell/tools/plugin/Tests/NPPNewFails.cpp +++ /dev/null
@@ -1,56 +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. - -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <stdint.h> - -#include "PluginTest.h" - -#include <string.h> - -using namespace std; - -class NPPNewFails : public PluginTest { -public: - NPPNewFails(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - { - } - -private: - NPError NPP_New(NPMIMEType pluginType, - uint16_t mode, - int16_t argc, - char* argn[], - char* argv[], - NPSavedData* saved) override { - return NPERR_GENERIC_ERROR; - } -}; - -static PluginTest::Register<NPPNewFails> nppNewFails("npp-new-fails");
diff --git a/content/shell/tools/plugin/Tests/NPPSetWindowCalledDuringDestruction.cpp b/content/shell/tools/plugin/Tests/NPPSetWindowCalledDuringDestruction.cpp deleted file mode 100644 index 1a5a13bb..0000000 --- a/content/shell/tools/plugin/Tests/NPPSetWindowCalledDuringDestruction.cpp +++ /dev/null
@@ -1,131 +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. - -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginTest.h" - -#include <stdint.h> - -#include "PluginObject.h" - -using namespace std; - -// NPP_SetWindow should be called with a null window handle as destruction begins on non-Mac platforms. - -class NPPSetWindowCalledDuringDestruction : public PluginTest { -public: - NPPSetWindowCalledDuringDestruction(NPP, const string& identifier); - - void setWillBeDestroyed() { m_willBeDestroyed = true; } - -private: - struct ScriptObject : Object<ScriptObject> { - bool hasMethod(NPIdentifier); - bool invoke(NPIdentifier, const NPVariant*, uint32_t, NPVariant*); - }; - - virtual NPError NPP_GetValue(NPPVariable, void*); - virtual NPError NPP_SetWindow(NPWindow*); - virtual NPError NPP_Destroy(NPSavedData**); - - bool m_willBeDestroyed; - bool m_setWindowCalledBeforeDestruction; - bool m_setWindowCalledDuringDestruction; -}; - -static PluginTest::Register<NPPSetWindowCalledDuringDestruction> registrar("npp-set-window-called-during-destruction"); - -NPPSetWindowCalledDuringDestruction::NPPSetWindowCalledDuringDestruction(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - , m_willBeDestroyed(false) - , m_setWindowCalledBeforeDestruction(false) - , m_setWindowCalledDuringDestruction(false) -{ -} - -NPError NPPSetWindowCalledDuringDestruction::NPP_GetValue(NPPVariable variable, void* value) -{ - if (variable != NPPVpluginScriptableNPObject) - return NPERR_GENERIC_ERROR; - - *static_cast<NPObject**>(value) = ScriptObject::create(this); - - return NPERR_NO_ERROR; -} - -NPError NPPSetWindowCalledDuringDestruction::NPP_SetWindow(NPWindow* window) -{ - if (m_willBeDestroyed) { - m_setWindowCalledDuringDestruction = true; - if (!m_setWindowCalledBeforeDestruction) { - log("Fail: setWillBeDestroyed() was called before the initial NPP_SetWindow call"); - return NPERR_NO_ERROR; - } -#ifndef XP_MACOSX - if (window->window) - log("Fail: NPP_SetWindow passed a non-null window during plugin destruction"); -#endif - return NPERR_NO_ERROR; - } - - if (m_setWindowCalledBeforeDestruction) { - log("Fail: NPP_SetWindow called more than once before plugin destruction"); - return NPERR_NO_ERROR; - } - - m_setWindowCalledBeforeDestruction = true; - return NPERR_NO_ERROR; -} - -NPError NPPSetWindowCalledDuringDestruction::NPP_Destroy(NPSavedData**) -{ -#ifdef XP_MACOSX - bool shouldHaveBeenCalledDuringDestruction = false; -#else - bool shouldHaveBeenCalledDuringDestruction = true; -#endif - - if (m_setWindowCalledDuringDestruction == shouldHaveBeenCalledDuringDestruction) - log("Success: NPP_SetWindow %s called during plugin destruction", shouldHaveBeenCalledDuringDestruction ? "was" : "was not"); - else - log("Fail: NPP_SetWindow %s called during plugin destruction", shouldHaveBeenCalledDuringDestruction ? "was not" : "was"); - - return NPERR_NO_ERROR; -} - -bool NPPSetWindowCalledDuringDestruction::ScriptObject::hasMethod(NPIdentifier methodName) -{ - return methodName == pluginTest()->NPN_GetStringIdentifier("setWillBeDestroyed"); -} - -bool NPPSetWindowCalledDuringDestruction::ScriptObject::invoke(NPIdentifier identifier, const NPVariant*, uint32_t, NPVariant*) -{ - assert(identifier == pluginTest()->NPN_GetStringIdentifier("setWillBeDestroyed")); - static_cast<NPPSetWindowCalledDuringDestruction*>(pluginTest())->setWillBeDestroyed(); - return true; -}
diff --git a/content/shell/tools/plugin/Tests/NPRuntimeCallsWithNullNPP.cpp b/content/shell/tools/plugin/Tests/NPRuntimeCallsWithNullNPP.cpp deleted file mode 100644 index 4c5d40c..0000000 --- a/content/shell/tools/plugin/Tests/NPRuntimeCallsWithNullNPP.cpp +++ /dev/null
@@ -1,76 +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. - -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <stdint.h> - -#include "PluginTest.h" - -class NPRuntimeCallsWithNullNPP : public PluginTest { -public: - NPRuntimeCallsWithNullNPP(NPP npp, const std::string& identifier) - : PluginTest(npp, identifier) - { - } - -private: - NPError NPP_New(NPMIMEType pluginType, - uint16_t mode, - int16_t argc, - char* argn[], - char* argv[], - NPSavedData* saved) override { - NPObject* windowObject = 0; - if (NPN_GetValue(NPNVWindowNPObject, &windowObject) != NPERR_NO_ERROR || !windowObject) - return NPERR_GENERIC_ERROR; - - NPIdentifier alertIdentifier = NPN_GetStringIdentifier("alert"); - if (!PluginTest::netscapeFuncs()->hasmethod(0, windowObject, alertIdentifier)) { - NPN_ReleaseObject(windowObject); - return NPERR_GENERIC_ERROR; - } - - NPIdentifier documentIdentifier = NPN_GetStringIdentifier("document"); - NPVariant variant; - if (!PluginTest::netscapeFuncs()->getproperty(0, windowObject, documentIdentifier, &variant)) { - NPN_ReleaseObject(windowObject); - return NPERR_GENERIC_ERROR; - } - NPN_ReleaseVariantValue(&variant); - - NPN_ReleaseObject(windowObject); - - executeScript("document.getElementById('result').innerHTML = 'SUCCESS!'"); - notifyDone(); - return NPERR_NO_ERROR; - } -}; - -static PluginTest::Register<NPRuntimeCallsWithNullNPP> npRuntimeCallsWithNullNPP("npruntime-calls-with-null-npp"); - -
diff --git a/content/shell/tools/plugin/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp b/content/shell/tools/plugin/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp deleted file mode 100644 index 7b61502..0000000 --- a/content/shell/tools/plugin/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp +++ /dev/null
@@ -1,93 +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. - -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <stdint.h> - -#include "PluginTest.h" - -using namespace std; - -class NPRuntimeObjectFromDestroyedPlugin : public PluginTest { -public: - NPRuntimeObjectFromDestroyedPlugin(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - { - } - -private: - // This is the test object. - class TestObject : public Object<TestObject> { }; - - // This is the scriptable object. It has a single "testObject" property and an "evaluate" function. - class ScriptableObject : public Object<ScriptableObject> { - public: - bool hasMethod(NPIdentifier methodName) - { - return identifierIs(methodName, "evaluate"); - } - - bool invoke(NPIdentifier methodName, const NPVariant* args, uint32_t argCount, NPVariant* result) - { - if (!identifierIs(methodName, "evaluate")) - return false; - - if (argCount != 1 || !NPVARIANT_IS_STRING(args[0])) - return false; - - return pluginTest()->executeScript(&NPVARIANT_TO_STRING(args[0]), result); - } - - bool hasProperty(NPIdentifier propertyName) - { - return identifierIs(propertyName, "testObject"); - } - - bool getProperty(NPIdentifier propertyName, NPVariant* result) - { - if (propertyName != pluginTest()->NPN_GetStringIdentifier("testObject")) - return false; - - NPObject* testObject = TestObject::create(pluginTest()); - OBJECT_TO_NPVARIANT(testObject, *result); - return true; - } - }; - - NPError NPP_GetValue(NPPVariable variable, void* value) override { - if (variable != NPPVpluginScriptableNPObject) - return NPERR_GENERIC_ERROR; - - *(NPObject**)value = ScriptableObject::create(this); - - return NPERR_NO_ERROR; - } -}; - -static PluginTest::Register<NPRuntimeObjectFromDestroyedPlugin> npRuntimeObjectFromDestroyedPlugin("npruntime-object-from-destroyed-plugin"); -
diff --git a/content/shell/tools/plugin/Tests/NPRuntimeRemoveProperty.cpp b/content/shell/tools/plugin/Tests/NPRuntimeRemoveProperty.cpp deleted file mode 100644 index 72b7c87..0000000 --- a/content/shell/tools/plugin/Tests/NPRuntimeRemoveProperty.cpp +++ /dev/null
@@ -1,173 +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. - -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <stdint.h> -#include <string.h> - -#include "PluginTest.h" - -using namespace std; - -class NPRuntimeRemoveProperty : public PluginTest { -public: - NPRuntimeRemoveProperty(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - { - } - -private: - struct TestObject : Object<TestObject> { - public: - TestObject() - : m_lastRemovedProperty(0) - { - } - - bool hasProperty(NPIdentifier propertyName) - { - if (identifierIs(propertyName, "lastRemovedProperty")) - return true; - - return false; - } - - bool getProperty(NPIdentifier propertyName, NPVariant* result) - { - assert(identifierIs(propertyName, "lastRemovedProperty")); - - if (!m_lastRemovedProperty) - return false; - - if (pluginTest()->NPN_IdentifierIsString(m_lastRemovedProperty)) { - char* lastRemovedPropertyName = pluginTest()->NPN_UTF8FromIdentifier(m_lastRemovedProperty); - - STRINGZ_TO_NPVARIANT(lastRemovedPropertyName, *result); - return true; - } - - int intIdentifier = pluginTest()->NPN_IntFromIdentifier(m_lastRemovedProperty); - DOUBLE_TO_NPVARIANT(intIdentifier, *result); - return true; - } - - bool removeProperty(NPIdentifier propertyName) - { - m_lastRemovedProperty = propertyName; - return true; - } - - private: - NPIdentifier m_lastRemovedProperty; - }; - - struct PluginObject : Object<PluginObject> { - public: - PluginObject() - : m_testObject(0) - { - } - - ~PluginObject() override { - if (m_testObject) - pluginTest()->NPN_ReleaseObject(m_testObject); - } - - bool hasMethod(NPIdentifier methodName) - { - if (identifierIs(methodName, "testRemoveProperty")) - return true; - - return false; - } - - bool invoke(NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result) - { - assert(identifierIs(methodName, "testRemoveProperty")); - - if (argumentCount != 2) - return false; - - if (!NPVARIANT_IS_OBJECT(arguments[0])) - return false; - - if (!NPVARIANT_IS_STRING(arguments[1]) && !NPVARIANT_IS_DOUBLE(arguments[1])) - return false; - - NPIdentifier propertyName; - if (NPVARIANT_IS_STRING(arguments[1])) { - string propertyNameString(arguments[1].value.stringValue.UTF8Characters, - arguments[1].value.stringValue.UTF8Length); - - propertyName = pluginTest()->NPN_GetStringIdentifier(propertyNameString.c_str()); - } else { - int32_t number = static_cast<int32_t>(arguments[1].value.doubleValue); - propertyName = pluginTest()->NPN_GetIntIdentifier(number); - } - - pluginTest()->NPN_RemoveProperty(NPVARIANT_TO_OBJECT(arguments[0]), propertyName); - - VOID_TO_NPVARIANT(*result); - return true; - } - - bool hasProperty(NPIdentifier propertyName) - { - if (identifierIs(propertyName, "testObject")) - return true; - - return false; - } - - bool getProperty(NPIdentifier propertyName, NPVariant* result) - { - assert(identifierIs(propertyName, "testObject")); - - if (!m_testObject) - m_testObject = TestObject::create(pluginTest()); - - OBJECT_TO_NPVARIANT(pluginTest()->NPN_RetainObject(m_testObject), *result); - return true; - } - - private: - NPObject* m_testObject; - }; - - NPError NPP_GetValue(NPPVariable variable, void* value) override { - if (variable != NPPVpluginScriptableNPObject) - return NPERR_GENERIC_ERROR; - - *(NPObject**)value = PluginObject::create(this); - - return NPERR_NO_ERROR; - } - -}; - -static PluginTest::Register<NPRuntimeRemoveProperty> npRuntimeRemoveProperty("npruntime-remove-property");
diff --git a/content/shell/tools/plugin/Tests/NullNPPGetValuePointer.cpp b/content/shell/tools/plugin/Tests/NullNPPGetValuePointer.cpp deleted file mode 100644 index 3e76d240..0000000 --- a/content/shell/tools/plugin/Tests/NullNPPGetValuePointer.cpp +++ /dev/null
@@ -1,74 +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. - -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginTest.h" - -#include "PluginObject.h" - -using namespace std; - -// Passing null for our NPP_GetValue function pointer should not crash. - -class NullNPPGetValuePointer : public PluginTest { -public: - NullNPPGetValuePointer(NPP, const string& identifier); - -private: - NPError NPP_Destroy(NPSavedData**) override; - NPError NPP_GetValue(NPPVariable, void* value) override; - - NPP_GetValueProcPtr m_originalNPPGetValuePointer; -}; - -static PluginTest::Register<NullNPPGetValuePointer> registrar("null-npp-getvalue-pointer"); - -NullNPPGetValuePointer::NullNPPGetValuePointer(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - , m_originalNPPGetValuePointer(pluginFunctions->getvalue) -{ - // Be sneaky and null out the getvalue pointer the browser is holding. This simulates a plugin - // that doesn't implement NPP_GetValue (like Shockwave Director 10.3 on Windows). Note that if - // WebKit copies the NPPluginFuncs struct this technique will have no effect and WebKit will - // call into our NPP_GetValue implementation. - pluginFunctions->getvalue = 0; -} - -NPError NullNPPGetValuePointer::NPP_Destroy(NPSavedData**) -{ - // Set the NPP_GetValue pointer back the way it was before we mucked with it so we don't mess - // up future uses of the plugin module. - pluginFunctions->getvalue = m_originalNPPGetValuePointer; - return NPERR_NO_ERROR; -} - -NPError NullNPPGetValuePointer::NPP_GetValue(NPPVariable, void*) -{ - pluginLog(m_npp, "NPP_GetValue was called but should not have been. Maybe WebKit copied the NPPluginFuncs struct, which would invalidate this test."); - return NPERR_GENERIC_ERROR; -}
diff --git a/content/shell/tools/plugin/Tests/PassDifferentNPPStruct.cpp b/content/shell/tools/plugin/Tests/PassDifferentNPPStruct.cpp deleted file mode 100644 index a2a06bb..0000000 --- a/content/shell/tools/plugin/Tests/PassDifferentNPPStruct.cpp +++ /dev/null
@@ -1,75 +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. - -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginTest.h" - -#include "PluginObject.h" - -using namespace std; - -// Passing a different NPP struct that has the same ndata value as the one passed to NPP_New should -// not trigger an assertion failure. - -class PassDifferentNPPStruct : public PluginTest { -public: - PassDifferentNPPStruct(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - , m_didReceiveInitialSetWindowCall(false) - { - } - -private: - NPError NPP_SetWindow(NPWindow* window) override { - if (m_didReceiveInitialSetWindowCall) - return NPERR_NO_ERROR; - m_didReceiveInitialSetWindowCall = true; - - NPP oldNPP = m_npp; - NPP_t differentNPP = *m_npp; - m_npp = &differentNPP; - - NPBool privateMode; - NPError error = NPN_GetValue(NPNVprivateModeBool, &privateMode); - - m_npp = oldNPP; - - if (error != NPERR_NO_ERROR) { - log("NPN_GetValue(NPNVprivateModeBool) with a different NPP struct failed with error %d", error); - notifyDone(); - return NPERR_GENERIC_ERROR; - } - log("NPN_GetValue(NPNVprivateModeBool) with a different NPP struct succeeded"); - notifyDone(); - return NPERR_NO_ERROR; - } - - bool m_didReceiveInitialSetWindowCall; -}; - -static PluginTest::Register<PassDifferentNPPStruct> getValueNetscapeWindow("pass-different-npp-struct");
diff --git a/content/shell/tools/plugin/Tests/PluginScriptableNPObjectInvokeDefault.cpp b/content/shell/tools/plugin/Tests/PluginScriptableNPObjectInvokeDefault.cpp deleted file mode 100644 index 8f27ee86..0000000 --- a/content/shell/tools/plugin/Tests/PluginScriptableNPObjectInvokeDefault.cpp +++ /dev/null
@@ -1,73 +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. - -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <stdint.h> - -#include "PluginTest.h" - -using namespace std; - -// A test where the plugins scriptable object either has or doesn't have an invokeDefault function. -class PluginScriptableNPObjectInvokeDefault : public PluginTest { -public: - PluginScriptableNPObjectInvokeDefault(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - { - } - -private: - struct NPObjectWithoutInvokeDefault : Object<NPObjectWithoutInvokeDefault> { }; - - struct NPObjectWithInvokeDefault : Object<NPObjectWithInvokeDefault> { - public: - bool invokeDefault(const NPVariant*, uint32_t, NPVariant* result) - { - INT32_TO_NPVARIANT(1, *result); - return true; - } - }; - - NPError NPP_GetValue(NPPVariable variable, void* value) override { - if (variable != NPPVpluginScriptableNPObject) - return NPERR_GENERIC_ERROR; - - NPObject* object; - if (identifier() == "plugin-scriptable-npobject-invoke-default") - object = NPObjectWithInvokeDefault::create(this); - else - object = NPObjectWithoutInvokeDefault::create(this); - - *(NPObject**)value = object; - - return NPERR_NO_ERROR; - } -}; - -static PluginTest::Register<PluginScriptableNPObjectInvokeDefault> pluginScriptableNPObjectInvokeDefault("plugin-scriptable-npobject-invoke-default"); -static PluginTest::Register<PluginScriptableNPObjectInvokeDefault> pluginScriptableNPObjectNoInvokeDefault("plugin-scriptable-npobject-no-invoke-default");
diff --git a/content/shell/tools/plugin/Tests/PluginScriptableObjectOverridesAllProperties.cpp b/content/shell/tools/plugin/Tests/PluginScriptableObjectOverridesAllProperties.cpp deleted file mode 100644 index d212e88..0000000 --- a/content/shell/tools/plugin/Tests/PluginScriptableObjectOverridesAllProperties.cpp +++ /dev/null
@@ -1,84 +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. - -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginTest.h" - -#include <stdio.h> -#include <string.h> - -using namespace std; - -class PluginScriptableObjectOverridesAllProperties : public PluginTest { -public: - PluginScriptableObjectOverridesAllProperties(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - { - } - -private: - class PluginObject : public Object<PluginObject> { - public: - PluginObject() - { - } - - ~PluginObject() override {} - - bool hasProperty(NPIdentifier propertyName) - { - return true; - } - - bool getProperty(NPIdentifier propertyName, NPVariant* result) - { - static const char* message = "My name is "; - char* propertyString = pluginTest()->NPN_UTF8FromIdentifier(propertyName); - - int bufferLength = strlen(propertyString) + strlen(message) + 1; - char* resultBuffer = static_cast<char*>(pluginTest()->NPN_MemAlloc(bufferLength)); - snprintf(resultBuffer, bufferLength, "%s%s", message, propertyString); - - STRINGZ_TO_NPVARIANT(resultBuffer, *result); - - return true; - } - }; - - NPError NPP_GetValue(NPPVariable variable, void* value) override { - if (variable != NPPVpluginScriptableNPObject) - return NPERR_GENERIC_ERROR; - - *(NPObject**)value = PluginObject::create(this); - - return NPERR_NO_ERROR; - } - -}; - -static PluginTest::Register<PluginScriptableObjectOverridesAllProperties> pluginScriptableObjectOverridesAllProperties("plugin-scriptable-object-overrides-all-properties");
diff --git a/content/shell/tools/plugin/Tests/SlowNPPNew.cpp b/content/shell/tools/plugin/Tests/SlowNPPNew.cpp deleted file mode 100644 index 65e3e40..0000000 --- a/content/shell/tools/plugin/Tests/SlowNPPNew.cpp +++ /dev/null
@@ -1,93 +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. - -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <stdint.h> - -#include "PluginTest.h" - -#include <string.h> - -using namespace std; - -class SlowNPPNew : public PluginTest { -public: - SlowNPPNew(NPP npp, const string& identifier) - : PluginTest(npp, identifier) - { - } - -private: - class PluginObject : public Object<PluginObject> { - public: - PluginObject() - { - } - - ~PluginObject() - { - } - - bool hasProperty(NPIdentifier propertyName) - { - return true; - } - - bool getProperty(NPIdentifier propertyName, NPVariant* result) - { - static const char* message = "My name is "; - char* propertyString = pluginTest()->NPN_UTF8FromIdentifier(propertyName); - - int bufferLength = strlen(propertyString) + strlen(message) + 1; - char* resultBuffer = static_cast<char*>(pluginTest()->NPN_MemAlloc(bufferLength)); - snprintf(resultBuffer, bufferLength, "%s%s", message, propertyString); - - STRINGZ_TO_NPVARIANT(resultBuffer, *result); - - return true; - } - }; - - virtual NPError NPP_GetValue(NPPVariable variable, void *value) - { - if (variable != NPPVpluginScriptableNPObject) - return NPERR_GENERIC_ERROR; - - *(NPObject**)value = PluginObject::create(this); - - return NPERR_NO_ERROR; - } - - virtual NPError NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved) - { - usleep(550000); - return NPERR_NO_ERROR; - } -}; - -static PluginTest::Register<SlowNPPNew> slowNPPNew("slow-npp-new");
diff --git a/content/shell/tools/plugin/mac/Info.plist b/content/shell/tools/plugin/mac/Info.plist deleted file mode 100644 index 6163742..0000000 --- a/content/shell/tools/plugin/mac/Info.plist +++ /dev/null
@@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>test_netscape_plugin</string> - <key>CFBundleGetInfoString</key> - <string>420+, Copyright 2006-2009 Apple Inc.</string> - <key>CFBundleIconFile</key> - <string></string> - <key>CFBundleIdentifier</key> - <string>com.apple.testnetscapeplugin</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>BRPL</string> - <key>CFBundleShortVersionString</key> - <string>1.0</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>CFPlugInDynamicRegisterFunction</key> - <string></string> - <key>CFPlugInDynamicRegistration</key> - <string>NO</string> - <key>CFPlugInFactories</key> - <dict> - <key>00000000-0000-0000-0000-000000000000</key> - <string>MyFactoryFunction</string> - </dict> - <key>CFPlugInTypes</key> - <dict> - <key>00000000-0000-0000-0000-000000000000</key> - <array> - <string>00000000-0000-0000-0000-000000000000</string> - </array> - </dict> - <key>CFPlugInUnloadFunction</key> - <string></string> - <key>WebPluginDescription</key> - <string>Simple Netscape plug-in that handles test content for WebKit</string> - <key>WebPluginMIMETypes</key> - <dict> - <key>application/x-webkit-test-netscape</key> - <dict> - <key>WebPluginExtensions</key> - <array> - <string>testnetscape</string> - </array> - <key>WebPluginTypeDescription</key> - <string>test netscape content</string> - </dict> - </dict> - <key>WebPluginName</key> - <string>WebKit Test PlugIn</string> -</dict> -</plist>
diff --git a/content/shell/tools/plugin/main.cpp b/content/shell/tools/plugin/main.cpp deleted file mode 100644 index 0f1887e..0000000 --- a/content/shell/tools/plugin/main.cpp +++ /dev/null
@@ -1,853 +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. - -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <string.h> -#include <stdint.h> - -#include <cstdlib> -#include <cstring> -#include <string> - -#include "PluginObject.h" -#include "PluginTest.h" -#include "base/strings/string_util.h" - -#ifdef XP_UNIX -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#endif - -#if !defined(NP_NO_CARBON) && defined(QD_HEADERS_ARE_PRIVATE) && QD_HEADERS_ARE_PRIVATE -extern "C" void GlobalToLocal(Point*); -#endif - -using namespace std; - -#define CRASH() do { \ - *(int *)(uintptr_t)0xbbadbeef = 0; \ - ((void(*)())0)(); /* More reliable, but doesn't say BBADBEEF */ \ -} while(false) - -static bool getEntryPointsWasCalled = false; -static bool initializeWasCalled = false; -static NPClass* pluginObjectClass = 0; - -#if defined(XP_WIN) -#define STDCALL __stdcall - -static inline int strcasecmp(const char* s1, const char* s2) -{ - return _stricmp(s1, s2); -} - -#else -#define STDCALL -#endif - -extern "C" { -NPError STDCALL NP_GetEntryPoints(NPPluginFuncs *pluginFuncs); -} - -// Entry points -extern "C" -NPError STDCALL NP_Initialize(NPNetscapeFuncs *browserFuncs -#ifdef XP_UNIX - , NPPluginFuncs *pluginFuncs -#endif - ) -{ - // Create a copy of the PluginObject NPClass that we can trash on shutdown. - pluginObjectClass = createPluginClass(); - - initializeWasCalled = true; - -#if defined(XP_WIN) - // Simulate Flash and QuickTime's behavior of crashing when NP_Initialize is called before NP_GetEntryPoints. - if (!getEntryPointsWasCalled) - CRASH(); -#endif - - browser = browserFuncs; - -#ifdef XP_UNIX - return NP_GetEntryPoints(pluginFuncs); -#else - return NPERR_NO_ERROR; -#endif -} - -extern "C" -NPError STDCALL NP_GetEntryPoints(NPPluginFuncs *pluginFuncs) -{ - getEntryPointsWasCalled = true; - -#ifdef XP_MACOSX - // Simulate Silverlight's behavior of crashing when NP_GetEntryPoints is called before NP_Initialize. - if (!initializeWasCalled) - CRASH(); -#endif - - pluginFunctions = pluginFuncs; - - pluginFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR; - pluginFuncs->size = sizeof(pluginFuncs); - pluginFuncs->newp = NPP_New; - pluginFuncs->destroy = NPP_Destroy; - pluginFuncs->setwindow = NPP_SetWindow; - pluginFuncs->newstream = NPP_NewStream; - pluginFuncs->destroystream = NPP_DestroyStream; - pluginFuncs->asfile = NPP_StreamAsFile; - pluginFuncs->writeready = NPP_WriteReady; - pluginFuncs->write = (NPP_WriteProcPtr)NPP_Write; - pluginFuncs->print = NPP_Print; - pluginFuncs->event = NPP_HandleEvent; - pluginFuncs->urlnotify = NPP_URLNotify; - pluginFuncs->getvalue = NPP_GetValue; - pluginFuncs->setvalue = NPP_SetValue; - - return NPERR_NO_ERROR; -} - -extern "C" -void STDCALL NP_Shutdown(void) -{ - // Trash the PluginObject NPClass so that the process will deterministically - // crash if Blink tries to call into the plugin's NPObjects after unloading - // it, rather than relying on OS-specific DLL unload behaviour. - // Note that we leak the NPClass copy, to act as a guard for the lifetime of - // the process. - memset(pluginObjectClass, 0xf00dbeef, sizeof(NPClass)); - - PluginTest::NP_Shutdown(); -} - -static void executeScript(const PluginObject* obj, const char* script); - -NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved) -{ -#ifdef XP_MACOSX - NPEventModel eventModel; - - // Always turn on the CG model - NPBool supportsCoreGraphics; - if (browser->getvalue(instance, NPNVsupportsCoreGraphicsBool, &supportsCoreGraphics) != NPERR_NO_ERROR) - supportsCoreGraphics = false; - - if (!supportsCoreGraphics) - return NPERR_INCOMPATIBLE_VERSION_ERROR; - -#ifndef NP_NO_CARBON - NPBool supportsCarbon = false; -#endif - NPBool supportsCocoa = false; - -#ifndef NP_NO_CARBON - // A browser that doesn't know about NPNVsupportsCarbonBool is one that only supports Carbon event model. - if (browser->getvalue(instance, NPNVsupportsCarbonBool, &supportsCarbon) != NPERR_NO_ERROR) - supportsCarbon = true; -#endif - - if (browser->getvalue(instance, NPNVsupportsCocoaBool, &supportsCocoa) != NPERR_NO_ERROR) - supportsCocoa = false; - - if (supportsCocoa) { - eventModel = NPEventModelCocoa; -#ifndef NP_NO_CARBON - } else if (supportsCarbon) { - eventModel = NPEventModelCarbon; -#endif - } else { - return NPERR_INCOMPATIBLE_VERSION_ERROR; - } - - browser->setvalue(instance, NPPVpluginEventModel, (void *)eventModel); -#endif // XP_MACOSX - - PluginObject* obj = (PluginObject*)browser->createobject(instance, pluginObjectClass); - instance->pdata = obj; - -#ifdef XP_MACOSX - obj->eventModel = eventModel; -#endif // XP_MACOSX - obj->alwaysFilterEvents = false; - - string testIdentifier; - const char* onNewScript = 0; - - for (int i = 0; i < argc; i++) { - if (strcasecmp(argn[i], "test") == 0) - testIdentifier = argv[i]; - if (strcasecmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad) - obj->onStreamLoad = base::strdup(argv[i]); - else if (strcasecmp(argn[i], "onStreamDestroy") == 0 && !obj->onStreamDestroy) - obj->onStreamDestroy = base::strdup(argv[i]); - else if (strcasecmp(argn[i], "onURLNotify") == 0 && !obj->onURLNotify) - obj->onURLNotify = base::strdup(argv[i]); - else if (strcasecmp(argn[i], "src") == 0 && - strcasecmp(argv[i], "data:application/x-webkit-test-netscape,returnerrorfromnewstream") == 0) - obj->returnErrorFromNewStream = true; - else if (strcasecmp(argn[i], "src") == 0 && - strcasecmp(argv[i], "data:application/x-webkit-test-netscape,alertwhenloaded") == 0) - executeScript(obj, "alert('Plugin Loaded!')"); - else if (strcasecmp(argn[i], "src") == 0 && - strcasecmp(argv[i], "data:application/x-webkit-test-netscape,logifloaded") == 0) { - for (int j = 0; j < argc; j++) { - if (strcasecmp(argn[j], "log") == 0) { - int length = 26 + strlen(argv[j]) + 1; - char* buffer = (char*) malloc(length); - snprintf(buffer, length, "xWebkitTestNetscapeLog('%s')", argv[j]); - executeScript(obj, buffer); - free(buffer); - } - } - } else if (strcasecmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow) - obj->onSetWindow = base::strdup(argv[i]); - else if (strcasecmp(argn[i], "onNew") == 0 && !onNewScript) - onNewScript = argv[i]; - else if (strcasecmp(argn[i], "onPaintEvent") == 0 && !obj->onPaintEvent) - obj->onPaintEvent = base::strdup(argv[i]); - else if (strcasecmp(argn[i], "logfirstsetwindow") == 0) - obj->logSetWindow = true; - else if (strcasecmp(argn[i], "testnpruntime") == 0) - testNPRuntime(instance); - else if (strcasecmp(argn[i], "logSrc") == 0) { - for (int i = 0; i < argc; i++) - if (strcasecmp(argn[i], "src") == 0) - pluginLog(instance, "src: %s", argv[i]); - } else if (strcasecmp(argn[i], "cleardocumentduringnew") == 0) - executeScript(obj, "document.body.innerHTML = ''"); - else if (!strcasecmp(argn[i], "ondestroy")) - obj->onDestroy = base::strdup(argv[i]); - else if (strcasecmp(argn[i], "testwindowopen") == 0) - obj->testWindowOpen = true; - else if (strcasecmp(argn[i], "testGetURLOnDestroy") == 0) { -#if defined(XP_WIN) - // FIXME: When https://bugs.webkit.org/show_bug.cgi?id=41831 is fixed, this #ifdef can be removed. - obj->testGetURLOnDestroy = TRUE; -#endif - } else if (!strcasecmp(argn[i], "src") && strstr(argv[i], "plugin-document-has-focus.pl")) - obj->testKeyboardFocusForPlugins = true; - else if (!strcasecmp(argn[i], "evaluatescript")) { - char* script = argv[i]; - if (script == strstr(script, "mouse::")) { - obj->mouseDownForEvaluateScript = true; - obj->evaluateScriptOnMouseDownOrKeyDown = base::strdup(script + sizeof("mouse::") - 1); - } else if (script == strstr(script, "key::")) { - obj->evaluateScriptOnMouseDownOrKeyDown = base::strdup(script + sizeof("key::") - 1); - } - // When testing evaluate script on mouse-down or key-down, allow event logging to handle events. - if (obj->evaluateScriptOnMouseDownOrKeyDown) - obj->eventLogging = true; - } else if (!strcasecmp(argn[i], "alwaysFilterEvents")) { - obj->alwaysFilterEvents = true; - } - } - -#ifdef XP_MACOSX - browser->setvalue(instance, NPPVpluginDrawingModel, (void *)NPDrawingModelCoreGraphics); -#endif - - obj->pluginTest = PluginTest::create(instance, testIdentifier); - - if (!obj->pluginTest) { - pluginLog(instance, "NPP_New: Could not find a test named \"%s\", maybe its .cpp file wasn't added to the build system?", testIdentifier.c_str()); - return NPERR_GENERIC_ERROR; - } - - if (onNewScript) - executeScript(obj, onNewScript); - - return obj->pluginTest->NPP_New(pluginType, mode, argc, argn, argv, saved); -} - -NPError NPP_Destroy(NPP instance, NPSavedData **save) -{ - PluginObject* obj = static_cast<PluginObject*>(instance->pdata); - - if (obj) { - if (obj->testGetURLOnDestroy) - browser->geturlnotify(obj->npp, "about:blank", "", 0); - - if (obj->onDestroy) { - executeScript(obj, obj->onDestroy); - free(obj->onDestroy); - } - - if (obj->onStreamLoad) - free(obj->onStreamLoad); - - if (obj->onStreamDestroy) - free(obj->onStreamDestroy); - - if (obj->onURLNotify) - free(obj->onURLNotify); - - if (obj->onSetWindow) - free(obj->onSetWindow); - - if (obj->onPaintEvent) - free(obj->onPaintEvent); - - if (obj->evaluateScriptOnMouseDownOrKeyDown) - free(obj->evaluateScriptOnMouseDownOrKeyDown); - - if (obj->logDestroy) { - // Note: this intentionally avoids using pluginLog(), because that - // requires running JS during document detach, which is forbidden. - puts("PLUGIN: NPP_Destroy"); - fflush(stdout); - } - - if (obj->pluginTest) - obj->pluginTest->NPP_Destroy(save); - - browser->releaseobject(&obj->header); - } - return NPERR_NO_ERROR; -} - -NPError NPP_SetWindow(NPP instance, NPWindow *window) -{ - PluginObject* obj = static_cast<PluginObject*>(instance->pdata); - - if (obj) { - obj->lastWindow = *window; - - if (obj->logSetWindow) { - pluginLog(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height); - obj->logSetWindow = false; - executeScript(obj, "testRunner.notifyDone();"); - } - - if (obj->onSetWindow) - executeScript(obj, obj->onSetWindow); - - if (obj->testWindowOpen) { - testWindowOpen(instance); - obj->testWindowOpen = false; - } - - if (obj->testKeyboardFocusForPlugins) { - obj->eventLogging = true; - executeScript(obj, "eventSender.keyDown('A');"); - } - } - - return obj->pluginTest->NPP_SetWindow(window); -} - -static void executeScript(const PluginObject* obj, const char* script) -{ - NPObject *windowScriptObject; - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); - - NPString npScript; - npScript.UTF8Characters = script; - npScript.UTF8Length = strlen(script); - - NPVariant browserResult; - browser->evaluate(obj->npp, windowScriptObject, &npScript, &browserResult); - browser->releasevariantvalue(&browserResult); -} - -NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, uint16_t *stype) -{ - PluginObject* obj = static_cast<PluginObject*>(instance->pdata); - obj->stream = stream; - *stype = NP_NORMAL; - - if (obj->returnErrorFromNewStream) - return NPERR_GENERIC_ERROR; - - if (browser->version >= NPVERS_HAS_RESPONSE_HEADERS) - notifyStream(obj, stream->url, stream->headers); - - if (obj->onStreamLoad) - executeScript(obj, obj->onStreamLoad); - - return obj->pluginTest->NPP_NewStream(type, stream, seekable, stype); -} - -NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason) -{ - PluginObject* obj = (PluginObject*)instance->pdata; - - if (obj->onStreamDestroy) { - NPObject* windowObject = 0; - NPError error = browser->getvalue(instance, NPNVWindowNPObject, &windowObject); - - if (error == NPERR_NO_ERROR) { - NPVariant onStreamDestroyVariant; - if (browser->getproperty(instance, windowObject, browser->getstringidentifier(obj->onStreamDestroy), &onStreamDestroyVariant)) { - if (NPVARIANT_IS_OBJECT(onStreamDestroyVariant)) { - NPObject* onStreamDestroyFunction = NPVARIANT_TO_OBJECT(onStreamDestroyVariant); - - NPVariant reasonVariant; - INT32_TO_NPVARIANT(reason, reasonVariant); - - NPVariant result; - browser->invokeDefault(instance, onStreamDestroyFunction, &reasonVariant, 1, &result); - browser->releasevariantvalue(&result); - } - browser->releasevariantvalue(&onStreamDestroyVariant); - } - browser->releaseobject(windowObject); - } - } - - return obj->pluginTest->NPP_DestroyStream(stream, reason); -} - -int32_t NPP_WriteReady(NPP instance, NPStream *stream) -{ - PluginObject* obj = (PluginObject*)instance->pdata; - return obj->pluginTest->NPP_WriteReady(stream); -} - -int32_t NPP_Write(NPP instance, NPStream *stream, int32_t offset, int32_t len, void *buffer) -{ - PluginObject* obj = (PluginObject*)instance->pdata; - - if (obj->returnNegativeOneFromWrite) - return -1; - - return obj->pluginTest->NPP_Write(stream, offset, len, buffer); -} - -void NPP_StreamAsFile(NPP instance, NPStream *stream, const char *fname) -{ -} - -void NPP_Print(NPP instance, NPPrint *platformPrint) -{ -} - -#ifdef XP_MACOSX -#ifndef NP_NO_CARBON -static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* event) -{ - Point pt = { event->where.v, event->where.h }; - - switch (event->what) { - case nullEvent: - // these are delivered non-deterministically, don't log. - break; - case mouseDown: - if (obj->eventLogging) { -#if __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - GlobalToLocal(&pt); -#if __clang__ -#pragma clang diagnostic pop -#endif - pluginLog(instance, "mouseDown at (%d, %d)", pt.h, pt.v); - } - if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript) - executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); - break; - case mouseUp: - if (obj->eventLogging) { -#if __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - GlobalToLocal(&pt); -#if __clang__ -#pragma clang diagnostic pop -#endif - pluginLog(instance, "mouseUp at (%d, %d)", pt.h, pt.v); - } - break; - case keyDown: - if (obj->eventLogging) - pluginLog(instance, "keyDown '%c'", (char)(event->message & 0xFF)); - if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript) - executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); - break; - case keyUp: - if (obj->eventLogging) - pluginLog(instance, "keyUp '%c'", (char)(event->message & 0xFF)); - if (obj->testKeyboardFocusForPlugins) { - obj->eventLogging = false; - obj->testKeyboardFocusForPlugins = FALSE; - executeScript(obj, "testRunner.notifyDone();"); - } - break; - case autoKey: - if (obj->eventLogging) - pluginLog(instance, "autoKey '%c'", (char)(event->message & 0xFF)); - break; - case updateEvt: - if (obj->eventLogging) - pluginLog(instance, "updateEvt"); - break; - case diskEvt: - if (obj->eventLogging) - pluginLog(instance, "diskEvt"); - break; - case activateEvt: - if (obj->eventLogging) - pluginLog(instance, "activateEvt"); - break; - case osEvt: - if (!obj->eventLogging) - break; - printf("PLUGIN: osEvt - "); - switch ((event->message & 0xFF000000) >> 24) { - case suspendResumeMessage: - printf("%s\n", (event->message & 0x1) ? "resume" : "suspend"); - break; - case mouseMovedMessage: - printf("mouseMoved\n"); - break; - default: - printf("%08lX\n", event->message); - } - break; - case kHighLevelEvent: - if (obj->eventLogging) - pluginLog(instance, "kHighLevelEvent"); - break; - // NPAPI events - case NPEventType_GetFocusEvent: - if (obj->eventLogging) - pluginLog(instance, "getFocusEvent"); - break; - case NPEventType_LoseFocusEvent: - if (obj->eventLogging) - pluginLog(instance, "loseFocusEvent"); - break; - case NPEventType_AdjustCursorEvent: - if (obj->eventLogging) - pluginLog(instance, "adjustCursorEvent"); - break; - default: - if (obj->eventLogging) - pluginLog(instance, "event %d", event->what); - } - - return 0; -} -#endif - -static int16_t handleEventCocoa(NPP instance, PluginObject* obj, NPCocoaEvent* event) -{ - switch (event->type) { - case NPCocoaEventWindowFocusChanged: - - case NPCocoaEventFocusChanged: - if (obj->eventLogging) { - if (event->data.focus.hasFocus) - pluginLog(instance, "getFocusEvent"); - else - pluginLog(instance, "loseFocusEvent"); - } - return 1; - - case NPCocoaEventDrawRect: { - if (obj->onPaintEvent) - executeScript(obj, obj->onPaintEvent); - return 1; - } - - case NPCocoaEventKeyDown: - if (obj->eventLogging && event->data.key.characters) - pluginLog(instance, "keyDown '%c'", CFStringGetCharacterAtIndex(reinterpret_cast<CFStringRef>(event->data.key.characters), 0)); - if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript) - executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); - return 1; - - case NPCocoaEventKeyUp: - if (obj->eventLogging && event->data.key.characters) { - pluginLog(instance, "keyUp '%c'", CFStringGetCharacterAtIndex(reinterpret_cast<CFStringRef>(event->data.key.characters), 0)); - if (obj->testKeyboardFocusForPlugins) { - obj->eventLogging = false; - obj->testKeyboardFocusForPlugins = FALSE; - executeScript(obj, "testRunner.notifyDone();"); - } - } - return 1; - - case NPCocoaEventFlagsChanged: - return 1; - - case NPCocoaEventMouseDown: - if (obj->eventLogging) { - pluginLog(instance, "mouseDown at (%d, %d)", - (int)event->data.mouse.pluginX, - (int)event->data.mouse.pluginY); - } - if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript) - executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); - return 1; - case NPCocoaEventMouseUp: - if (obj->eventLogging) { - pluginLog(instance, "mouseUp at (%d, %d)", - (int)event->data.mouse.pluginX, - (int)event->data.mouse.pluginY); - } - return 1; - - case NPCocoaEventMouseMoved: - case NPCocoaEventMouseEntered: - case NPCocoaEventMouseExited: - case NPCocoaEventMouseDragged: - case NPCocoaEventScrollWheel: - case NPCocoaEventTextInput: - return 1; - } - - return 0; -} - -#endif // XP_MACOSX - -#ifdef XP_UNIX - -static char keyEventToChar(XKeyEvent* event) -{ - char c = ' '; - XLookupString(event, &c, sizeof(c), 0, 0); - return c; -} - -static int16_t handleEventX11(NPP instance, PluginObject* obj, XEvent* event) -{ - switch (event->type) { - case ButtonPress: - if (obj->eventLogging) - pluginLog(instance, "mouseDown at (%d, %d)", event->xbutton.x, event->xbutton.y); - if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript) - executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); - break; - case ButtonRelease: - if (obj->eventLogging) - pluginLog(instance, "mouseUp at (%d, %d)", event->xbutton.x, event->xbutton.y); - break; - case KeyPress: - // FIXME: extract key code - if (obj->eventLogging) - pluginLog(instance, "keyDown '%c'", keyEventToChar(&event->xkey)); - if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript) - executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); - break; - case KeyRelease: - // FIXME: extract key code - if (obj->eventLogging) - pluginLog(instance, "keyUp '%c'", keyEventToChar(&event->xkey)); - if (obj->testKeyboardFocusForPlugins) { - obj->eventLogging = false; - obj->testKeyboardFocusForPlugins = false; - executeScript(obj, "testRunner.notifyDone();"); - } - break; - case GraphicsExpose: - if (obj->eventLogging) - pluginLog(instance, "updateEvt"); - if (obj->onPaintEvent) - executeScript(obj, obj->onPaintEvent); - break; - // NPAPI events - case FocusIn: - if (obj->eventLogging) - pluginLog(instance, "getFocusEvent"); - break; - case FocusOut: - if (obj->eventLogging) - pluginLog(instance, "loseFocusEvent"); - break; - case EnterNotify: - case LeaveNotify: - case MotionNotify: - break; - default: - if (obj->eventLogging) - pluginLog(instance, "event %d", event->type); - } - - fflush(stdout); - return 0; -} -#endif // XP_UNIX - -#ifdef XP_WIN -static int16_t handleEventWin(NPP instance, PluginObject* obj, NPEvent* event) -{ - switch (event->event) { - case WM_PAINT: - if (obj->onPaintEvent) - executeScript(obj, obj->onPaintEvent); - break; - case WM_KEYDOWN: - if (obj->eventLogging) - pluginLog(instance, "keyDown '%c'", event->wParam); - if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript) - executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); - break; - case WM_CHAR: - break; - case WM_KEYUP: - if (obj->eventLogging) - pluginLog(instance, "keyUp '%c'", event->wParam); - if (obj->testKeyboardFocusForPlugins) { - obj->eventLogging = false; - obj->testKeyboardFocusForPlugins = FALSE; - executeScript(obj, "testRunner.notifyDone();"); - } - break; - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - if (obj->eventLogging) - pluginLog(instance, "mouseDown at (%d, %d)", LOWORD(event->lParam), HIWORD(event->lParam)); - if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript) - executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); - break; - case WM_LBUTTONUP: - case WM_MBUTTONUP: - case WM_RBUTTONUP: - if (obj->eventLogging) - pluginLog(instance, "mouseUp at (%d, %d)", LOWORD(event->lParam), HIWORD(event->lParam)); - break; - case WM_SETFOCUS: - if (obj->eventLogging) - pluginLog(instance, "getFocusEvent"); - break; - case WM_KILLFOCUS: - if (obj->eventLogging) - pluginLog(instance, "loseFocusEvent"); - break; - } - return 0; -} -#endif // XP_WIN - -int16_t NPP_HandleEvent(NPP instance, void *event) -{ - PluginObject* obj = static_cast<PluginObject*>(instance->pdata); - - if (obj->pluginTest->NPP_HandleEvent(event) == 1) - return 1; - - int16_t ret = 0; -#ifdef XP_MACOSX -#ifndef NP_NO_CARBON - assert(obj->eventModel == NPEventModelCarbon || - obj->eventModel == NPEventModelCocoa); - if (obj->eventModel == NPEventModelCocoa) - ret = handleEventCocoa(instance, obj, static_cast<NPCocoaEvent*>(event)); - else if (obj->eventModel == NPEventModelCarbon) - ret = handleEventCarbon(instance, obj, static_cast<EventRecord*>(event)); -#else - assert(obj->eventModel == NPEventModelCocoa); - ret = handleEventCocoa(instance, obj, static_cast<NPCocoaEvent*>(event)); -#endif -#elif defined(XP_UNIX) - ret = handleEventX11(instance, obj, static_cast<XEvent*>(event)); -#elif defined(XP_WIN) - ret = handleEventWin(instance, obj, static_cast<NPEvent*>(event)); -#else - // FIXME: Implement for other platforms. - return obj->alwaysFilterEvents; -#endif // XP_MACOSX - - if (ret == 0 && obj->alwaysFilterEvents) - return 1; - return ret; -} - -void NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyData) -{ - PluginObject* obj = static_cast<PluginObject*>(instance->pdata); - if (obj->pluginTest->NPP_URLNotify(url, reason, notifyData)) - return; - - if (obj->onURLNotify) - executeScript(obj, obj->onURLNotify); - - handleCallback(obj, url, reason, notifyData); -} - -NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value) -{ -#ifdef XP_UNIX - if (variable == NPPVpluginNameString) { - *((char **)value) = const_cast<char*>("WebKit Test PlugIn"); - return NPERR_NO_ERROR; - } - if (variable == NPPVpluginDescriptionString) { - *((char **)value) = const_cast<char*>("Simple Netscape® plugin that handles test content for WebKit"); - return NPERR_NO_ERROR; - } - if (variable == NPPVpluginNeedsXEmbed) { - *((NPBool *)value) = true; - return NPERR_NO_ERROR; - } -#endif - - if (!instance) - return NPERR_GENERIC_ERROR; - PluginObject* obj = static_cast<PluginObject*>(instance->pdata); - - // First, check if the PluginTest object supports getting this value. - if (obj->pluginTest->NPP_GetValue(variable, value) == NPERR_NO_ERROR) - return NPERR_NO_ERROR; - - if (variable == NPPVpluginScriptableNPObject) { - void **v = (void **)value; - // Return value is expected to be retained - browser->retainobject((NPObject *)obj); - *v = obj; - return NPERR_NO_ERROR; - } - - return NPERR_GENERIC_ERROR; -} - -NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value) -{ - PluginObject* obj = static_cast<PluginObject*>(instance->pdata); - return obj->pluginTest->NPP_SetValue(variable, value); -} - -#ifdef XP_UNIX -extern "C" -const char* NP_GetMIMEDescription(void) -{ - return "application/x-webkit-test-netscape:testnetscape:test netscape content"; -} - -extern "C" -NPError NP_GetValue(NPP instance, NPPVariable variable, void* value) -{ - return NPP_GetValue(instance, variable, value); -} -#endif
diff --git a/content/shell/tools/plugin/test_object.h b/content/shell/tools/plugin/test_object.h deleted file mode 100644 index a71c33631..0000000 --- a/content/shell/tools/plugin/test_object.h +++ /dev/null
@@ -1,43 +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. - -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef CONTENT_SHELL_TOOLS_PLUGIN_TEST_OBJECT_H_ -#define CONTENT_SHELL_TOOLS_PLUGIN_TEST_OBJECT_H_ - -#include <bindings/npapi.h> -#include <bindings/npruntime.h> - -namespace content { - -NPClass* GetTestClass(); -int GetTestObjectCount(); - -} // namespace content - -#endif // CONTENT_SHELL_TOOLS_PLUGIN_TEST_OBJECT_H_
diff --git a/content/shell/tools/plugin/win/TestNetscapePlugin.def b/content/shell/tools/plugin/win/TestNetscapePlugin.def deleted file mode 100644 index 3eb5fd86..0000000 --- a/content/shell/tools/plugin/win/TestNetscapePlugin.def +++ /dev/null
@@ -1,6 +0,0 @@ -LIBRARY "np_test_netscape_plugin" - -EXPORTS - NP_GetEntryPoints @1 - NP_Initialize @2 - NP_Shutdown @3
diff --git a/content/shell/tools/plugin/win/TestNetscapePlugin.rc b/content/shell/tools/plugin/win/TestNetscapePlugin.rc deleted file mode 100644 index 7c8245f..0000000 --- a/content/shell/tools/plugin/win/TestNetscapePlugin.rc +++ /dev/null
@@ -1,102 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "windows.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""windows.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "CompanyName", "Apple Inc." - VALUE "FileDescription", "Simple Netscape plug-in that handles test content for WebKit" - VALUE "FileExtents", "testnetscape" - VALUE "FileOpenName", "test netscape content" - VALUE "LegalCopyright", "Copyright Apple Inc. 2007-2009" - VALUE "MIMEType", "application/x-webkit-test-netscape" - VALUE "OriginalFilename", "np_test_netscape_plugin.dll" - VALUE "ProductName", "WebKit Test PlugIn" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED -
diff --git a/content/shell/tools/plugin/win/TestNetscapePlugin_debug.def b/content/shell/tools/plugin/win/TestNetscapePlugin_debug.def deleted file mode 100644 index 21919f11..0000000 --- a/content/shell/tools/plugin/win/TestNetscapePlugin_debug.def +++ /dev/null
@@ -1,6 +0,0 @@ -LIBRARY "np_test_netscape_plugin_debug" - -EXPORTS - NP_GetEntryPoints @1 - NP_Initialize @2 - NP_Shutdown @3
diff --git a/content/shell/tools/plugin/win/resource.h b/content/shell/tools/plugin/win/resource.h deleted file mode 100644 index 39edab2..0000000 --- a/content/shell/tools/plugin/win/resource.h +++ /dev/null
@@ -1,18 +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. - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by TestNetscapePlugin.rc - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index f7736c3..f1c9595 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -415,16 +415,9 @@ ] if (is_mac) { - data += [ - "$root_out_dir/Content Shell.app/", - "$root_out_dir/plugins/test_netscape_plugin.plugin/", - ] + data += [ "$root_out_dir/Content Shell.app/" ] } if (is_win) { - # TODO(GYP): Add this once //content/shell:copy_test_netscape_plugin - # exists. - #data += [ "$root_out_dir/plugins/np_test_netscape_plugin.dll" ] - if (symbol_level != 0) { data += [ "$root_out_dir/content_browsertests.exe.pdb" ] }
diff --git a/content/test/content_browser_test_utils_internal.cc b/content/test/content_browser_test_utils_internal.cc index 207227e26..7e61936 100644 --- a/content/test/content_browser_test_utils_internal.cc +++ b/content/test/content_browser_test_utils_internal.cc
@@ -29,11 +29,36 @@ #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test_utils.h" #include "content/shell/browser/shell.h" +#include "content/shell/browser/shell_javascript_dialog_manager.h" #include "content/test/test_frame_navigation_observer.h" #include "net/url_request/url_request.h" namespace content { +namespace { + +// Helper class used by the TestNavigationManager to pause navigations. +class TestNavigationManagerThrottle : public NavigationThrottle { + public: + TestNavigationManagerThrottle(NavigationHandle* handle, + base::Closure on_will_start_request_closure) + : NavigationThrottle(handle), + on_will_start_request_closure_(on_will_start_request_closure) {} + ~TestNavigationManagerThrottle() override {} + + private: + // NavigationThrottle implementation. + NavigationThrottle::ThrottleCheckResult WillStartRequest() override { + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + on_will_start_request_closure_); + return NavigationThrottle::DEFER; + } + + base::Closure on_will_start_request_closure_; +}; + +} // namespace + void NavigateFrameToURL(FrameTreeNode* node, const GURL& url) { TestFrameNavigationObserver observer(node); NavigationController::LoadURLParams params(url); @@ -43,6 +68,13 @@ observer.Wait(); } +void SetShouldProceedOnBeforeUnload(Shell* shell, bool proceed) { + ShellJavaScriptDialogManager* manager = + static_cast<ShellJavaScriptDialogManager*>( + shell->GetJavaScriptDialogManager(shell->web_contents())); + manager->set_should_proceed_on_beforeunload(proceed); +} + FrameTreeVisualizer::FrameTreeVisualizer() { } @@ -327,4 +359,63 @@ throttles->push_back(new HttpRequestStallThrottle); } +TestNavigationManager::TestNavigationManager(WebContents* web_contents, + const GURL& url) + : WebContentsObserver(web_contents), + url_(url), + navigation_paused_(false), + handle_(nullptr), + weak_factory_(this) {} + +TestNavigationManager::~TestNavigationManager() {} + +void TestNavigationManager::WaitForWillStartRequest() { + if (navigation_paused_) + return; + loop_runner_ = new MessageLoopRunner(); + loop_runner_->Run(); + loop_runner_ = nullptr; +} + +void TestNavigationManager::ResumeNavigation() { + if (!navigation_paused_ || !handle_) + return; + navigation_paused_ = false; + handle_->Resume(); +} + +void TestNavigationManager::WaitForNavigationFinished() { + if (!handle_) + return; + loop_runner_ = new MessageLoopRunner(); + loop_runner_->Run(); + loop_runner_ = nullptr; +} + +void TestNavigationManager::DidStartNavigation(NavigationHandle* handle) { + if (handle_ || handle->GetURL() != url_) + return; + + handle_ = handle; + scoped_ptr<NavigationThrottle> throttle(new TestNavigationManagerThrottle( + handle_, base::Bind(&TestNavigationManager::OnWillStartRequest, + weak_factory_.GetWeakPtr()))); + handle_->RegisterThrottleForTesting(std::move(throttle)); +} + +void TestNavigationManager::DidFinishNavigation(NavigationHandle* handle) { + if (handle != handle_) + return; + handle_ = nullptr; + navigation_paused_ = false; + if (loop_runner_) + loop_runner_->Quit(); +} + +void TestNavigationManager::OnWillStartRequest() { + navigation_paused_ = true; + if (loop_runner_) + loop_runner_->Quit(); +} + } // namespace content
diff --git a/content/test/content_browser_test_utils_internal.h b/content/test/content_browser_test_utils_internal.h index f4a4dde..a894eb2 100644 --- a/content/test/content_browser_test_utils_internal.h +++ b/content/test/content_browser_test_utils_internal.h
@@ -14,8 +14,11 @@ #include <vector> #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "cc/surfaces/surface_id.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/resource_dispatcher_host_delegate.h" +#include "content/public/browser/web_contents_observer.h" #include "url/gurl.h" namespace cc { @@ -25,6 +28,7 @@ namespace content { class FrameTreeNode; +class MessageLoopRunner; class RenderWidgetHostViewChildFrame; class Shell; class SiteInstance; @@ -34,6 +38,10 @@ // navigation finishes. void NavigateFrameToURL(FrameTreeNode* node, const GURL& url); +// Sets the DialogManager to proceed by default or not when showing a +// BeforeUnload dialog. +void SetShouldProceedOnBeforeUnload(Shell* shell, bool proceed); + // Creates compact textual representations of the state of the frame tree that // is appropriate for use in assertions. // @@ -103,6 +111,46 @@ GURL url_; }; +// This class can be used to pause and resume navigations, based on a URL +// match. Note that it only keeps track of one navigation at a time. +class TestNavigationManager : public WebContentsObserver { + public: + // Currently this monitors any frame in WebContents. + // TODO(clamy): Extend this class so that it can monitor a specific frame. + TestNavigationManager(WebContents* web_contents, const GURL& url); + ~TestNavigationManager() override; + + // Waits until the navigation request is ready to be sent to the network + // stack. The navigation will be paused until it is resumed by calling + // ResumeNavigation. + void WaitForWillStartRequest(); + + // Resumes the navigation if it was previously paused. + void ResumeNavigation(); + + // Waits until the navigation has been finished. Users of this method should + // first use WaitForWillStartRequest, then call ResumeNavigation, and only + // then WaitForNavigationFinished. + // TODO(clamy): Do not pause the navigation in WillStartRequest by default. + void WaitForNavigationFinished(); + + private: + // WebContentsObserver implementation. + void DidStartNavigation(NavigationHandle* handle) override; + void DidFinishNavigation(NavigationHandle* handle) override; + + // Called when the NavigationThrottle pauses the navigation in + // WillStartRequest. + void OnWillStartRequest(); + + const GURL url_; + bool navigation_paused_; + NavigationHandle* handle_; + scoped_refptr<MessageLoopRunner> loop_runner_; + + base::WeakPtrFactory<TestNavigationManager> weak_factory_; +}; + // Helper class to assist with hit testing surfaces in multiple processes. // WaitForSurfaceReady() will only return after a Surface from |target_view| // has been composited in the top-level frame's Surface. At that point,
diff --git a/content/test/data/hang_before_unload.html b/content/test/data/hang_before_unload.html new file mode 100644 index 0000000..bd48d4a --- /dev/null +++ b/content/test/data/hang_before_unload.html
@@ -0,0 +1,29 @@ +<html> + + <head><title>BeforeUnload dialog</title> + <script> + function clickLink() { + var evt = document.createEvent("MouseEvents"); + evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, + false, false, 0, null); + var target = document.getElementById("link"); + target.dispatchEvent(evt); + } + + function clickLinkSoon() { + window.setTimeout(clickLink, 100); + return true; + } + + window.addEventListener("beforeunload", function(e) { + var confirmationMessage = "foo"; + e.returnValue = confirmationMessage; + return confirmationMessage; + }); + + </script> + </head> + +<a href="title2.html" id="link">link</a><br> + +</html>
diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc index 5ec52f6..5157465 100644 --- a/content/test/layouttest_support.cc +++ b/content/test/layouttest_support.cc
@@ -41,7 +41,6 @@ #include "content/browser/frame_host/popup_menu_helper_mac.h" #elif defined(OS_WIN) #include "content/child/font_warmup_win.h" -#include "content/public/common/dwrite_font_platform_win.h" #include "third_party/WebKit/public/web/win/WebFontRendering.h" #include "third_party/skia/include/ports/SkFontMgr.h" #include "third_party/skia/include/ports/SkTypeface_win.h" @@ -59,38 +58,32 @@ namespace { -base::LazyInstance< - base::Callback<void(RenderView*, test_runner::WebTestProxyBase*)>>::Leaky - g_callback = LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<ViewProxyCreationCallback>::Leaky + g_view_test_proxy_callback = LAZY_INSTANCE_INITIALIZER; + +base::LazyInstance<FrameProxyCreationCallback>::Leaky + g_frame_test_proxy_callback = LAZY_INSTANCE_INITIALIZER; RenderViewImpl* CreateWebTestProxy(CompositorDependencies* compositor_deps, const ViewMsg_New_Params& params) { typedef test_runner::WebTestProxy<RenderViewImpl, CompositorDependencies*, const ViewMsg_New_Params&> ProxyType; ProxyType* render_view_proxy = new ProxyType(compositor_deps, params); - if (g_callback == 0) + if (g_view_test_proxy_callback == 0) return render_view_proxy; - g_callback.Get().Run(render_view_proxy, render_view_proxy); + g_view_test_proxy_callback.Get().Run(render_view_proxy, render_view_proxy); return render_view_proxy; } -test_runner::WebTestProxyBase* GetWebTestProxyBase( - RenderViewImpl* render_view) { - typedef test_runner::WebTestProxy<RenderViewImpl, const ViewMsg_New_Params&> - ViewProxy; - - ViewProxy* render_view_proxy = static_cast<ViewProxy*>(render_view); - return static_cast<test_runner::WebTestProxyBase*>(render_view_proxy); -} - RenderFrameImpl* CreateWebFrameTestProxy( const RenderFrameImpl::CreateParams& params) { typedef test_runner::WebFrameTestProxy< RenderFrameImpl, const RenderFrameImpl::CreateParams&> FrameProxy; FrameProxy* render_frame_proxy = new FrameProxy(params); - render_frame_proxy->set_base_proxy(GetWebTestProxyBase(params.render_view)); - + if (g_frame_test_proxy_callback == 0) + return render_frame_proxy; + g_frame_test_proxy_callback.Get().Run(render_frame_proxy, render_frame_proxy); return render_frame_proxy; } @@ -103,8 +96,6 @@ i != files.end(); ++i) { SkTypeface* typeface = fontmgr->createFromFile(i->c_str()); - if (!ShouldUseDirectWriteFontProxyFieldTrial()) - DoPreSandboxWarmupForTypeface(typeface); blink::WebFontRendering::addSideloadedFontForTesting(typeface); } } @@ -113,9 +104,10 @@ } // namespace void EnableWebTestProxyCreation( - const base::Callback<void(RenderView*, test_runner::WebTestProxyBase*)>& - callback) { - g_callback.Get() = callback; + const ViewProxyCreationCallback& view_proxy_creation_callback, + const FrameProxyCreationCallback& frame_proxy_creation_callback) { + g_view_test_proxy_callback.Get() = view_proxy_creation_callback; + g_frame_test_proxy_callback.Get() = frame_proxy_creation_callback; RenderViewImpl::InstallCreateHook(CreateWebTestProxy); RenderFrameImpl::InstallCreateHook(CreateWebFrameTestProxy); } @@ -169,10 +161,7 @@ #if defined(OS_WIN) if (gfx::win::ShouldUseDirectWrite()) { - if (ShouldUseDirectWriteFontProxyFieldTrial()) - RegisterSideloadedTypefaces(SkFontMgr_New_DirectWrite()); - else - RegisterSideloadedTypefaces(GetPreSandboxWarmupFontMgr()); + RegisterSideloadedTypefaces(SkFontMgr_New_DirectWrite()); } #endif }
diff --git a/content/utility/in_process_utility_thread.h b/content/utility/in_process_utility_thread.h index 850e015..074837b 100644 --- a/content/utility/in_process_utility_thread.h +++ b/content/utility/in_process_utility_thread.h
@@ -8,6 +8,7 @@ #include <string> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/threading/thread.h" #include "content/common/content_export.h" #include "content/common/in_process_child_thread_params.h"
diff --git a/dbus/exported_object.h b/dbus/exported_object.h index 89de096..8a98b4ab 100644 --- a/dbus/exported_object.h +++ b/dbus/exported_object.h
@@ -13,6 +13,7 @@ #include "base/callback.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/synchronization/waitable_event.h" #include "base/threading/platform_thread.h" #include "base/time/time.h"
diff --git a/dbus/object_proxy.h b/dbus/object_proxy.h index edb97a5..839d5f72 100644 --- a/dbus/object_proxy.h +++ b/dbus/object_proxy.h
@@ -15,6 +15,7 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/string_piece.h" #include "base/time/time.h" #include "dbus/dbus_export.h"
diff --git a/device/bluetooth/bluetooth_discovery_filter.h b/device/bluetooth/bluetooth_discovery_filter.h index da3149e..d1a8ead8 100644 --- a/device/bluetooth/bluetooth_discovery_filter.h +++ b/device/bluetooth/bluetooth_discovery_filter.h
@@ -10,6 +10,7 @@ #include <set> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "device/bluetooth/bluetooth_export.h" #include "device/bluetooth/bluetooth_uuid.h"
diff --git a/device/hid/hid_service.h b/device/hid/hid_service.h index d7877b70..f143fad 100644 --- a/device/hid/hid_service.h +++ b/device/hid/hid_service.h
@@ -12,6 +12,7 @@ #include "base/bind_helpers.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_checker.h"
diff --git a/device/media_transfer_protocol/media_transfer_protocol_manager.cc b/device/media_transfer_protocol/media_transfer_protocol_manager.cc index 974ceb3..3dc372b 100644 --- a/device/media_transfer_protocol/media_transfer_protocol_manager.cc +++ b/device/media_transfer_protocol/media_transfer_protocol_manager.cc
@@ -14,6 +14,7 @@ #include "base/command_line.h" #include "base/location.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/sequenced_task_runner.h"
diff --git a/docs/windows_build_instructions.md b/docs/windows_build_instructions.md index 2793782..ed06056 100644 --- a/docs/windows_build_instructions.md +++ b/docs/windows_build_instructions.md
@@ -19,34 +19,35 @@ ### Open source contributors -For building with Visual Studio 2015 (default compiler as of March 10, -2016): +####For building with Visual Studio 2015 (default compiler as of March 10, 2016): -> Install Visual Studio 2015 Update 1 or later - Community Edition -> should work if its license is appropriate for you. Be sure to select -> Custom install and select VC++ (which selects three sub-categories -> including MFC) and, under Universal Windows App Development Tools, -> select Tools (1.2) and Windows 10 SDK (10.0.10586). You must have the -> 10586 SDK installed or else you will hit compile errors such as -> redefined macros. +Install Visual Studio 2015 Update 1 or later - Community Edition +should work if its license is appropriate for you. Use the Custom Install option +and select: -For building with Visual Studio 2013 (no longer default as of March 10, -2016, and not recommended - requires setting GYP\_MSVS\_VERSION=2013): +- Visual C++, which will select three sub-categories including MFC +- Universal Windows Apps Development Tools > Tools (1.2) +- Universal Windows Apps Development Tools > Windows 10 SDK (10.0.10586) -> Install [Visual Studio 2013 -> Community](http://www.visualstudio.com/products/visual-studio-community-vs) -> or [Visual Studio 2013 -> Professional](http://www.visualstudio.com/products/visual-studio-professional-with-msdn-vs) -> depending on which license is appropriate for you. You can deselect -> the default options if you want, but you must make sure to install -> "Microsoft Foundation Classes for C++". -> \ -> You should also install the [Windows 10 -> SDK](https://dev.windows.com/en-us/downloads/windows-10-sdk) to the -> default install location. You must have SDK version 10.0.10586 or -> greater installed. +You must have the 10586 SDK installed or else you will hit compile errors such +as redefined macros. -Run `set DEPOT\_TOOLS\_WIN\_TOOLCHAIN=0`, or set that variable in your +#### For building with Visual Studio 2013 (no longer default as of March 10, 2016, and not recommended - requires setting `GYP_MSVS_VERSION=2013`): + +Install [Visual Studio 2013 +Community](http://www.visualstudio.com/products/visual-studio-community-vs) +or [Visual Studio 2013 +Professional](http://www.visualstudio.com/products/visual-studio-professional-with-msdn-vs) +depending on which license is appropriate for you. You can deselect +the default options if you want, but you must make sure to install +"Microsoft Foundation Classes for C++". + +You should also install the [Windows 10 +SDK](https://dev.windows.com/en-us/downloads/windows-10-sdk) to the +default install location. You must have SDK version 10.0.10586 or +greater installed. + +Run `set DEPOT_TOOLS_WIN_TOOLCHAIN=0`, or set that variable in your global environment. Visual Studio Express 2013 is **not** supported and will not be able to @@ -56,17 +57,16 @@ ### Google employees -Run: `download\_from\_google\_storage --config` and follow the -authentication instructions.**Note that you must authenticate with your +Run: `download_from_google_storage --config` and follow the +authentication instructions. **Note that you must authenticate with your @google.com credentials**, not @chromium.org. Enter "0" if asked for a project-id. Once you've done this, the toolchain will be installed automatically for you in Step 3, below (near the end of the step). -The toolchain will be in depot\_tools\\win\_toolchain, and windbg can be -found in -depot\_tools\\win\_toolchain\\vs2013\_files\\win8sdk\\Debuggers. +The toolchain will be in `depot_tools\win_toolchain`, and windbg can be +found in `depot_tools\win_toolchain\vs2013_files\win8sdk\Debuggers`. If you want the IDE for debugging and editing, you will need to install it separately, but this is optional and not needed to build Chromium. @@ -75,14 +75,14 @@ Follow the steps to [check out the code](https://www.chromium.org/developers/how-tos/get-the-code) (largely -"fetch chromium"). +`fetch chromium`). ## Building Build the target you are interested in. ```shell -ninja -C out\\Debug chrome +ninja -C out\Debug chrome ``` Alternative (Graphical user interface): Open a generated .sln @@ -90,26 +90,26 @@ This will invoke the real step 4 above. Do not build the whole solution since that conflicts with ninja's build management and everything will explode. -Substitute the build directory given to -C with out\\Debug\_x64 for +Substitute the build directory given to `-C` with `out\Debug_x64` for [64-bit builds](https://www.chromium.org/developers/design-documents/64-bit-support) in GYP, or whatever build directory you have configured if using GN. ### Performance tips -1. Have many and fast CPU cores and enough RAM to keep them all busy. +1. Have a lot of fast CPU cores and enough RAM to keep them all busy. (Minimum recommended is 4-8 fast cores and 16-32 GB of RAM) 2. Reduce file system overhead by excluding build directories from antivirus and indexing software. 3. Store the build tree on a fast disk (preferably SSD). 4. If you are primarily going to be doing debug development builds, you - use the component build (in - [GYP](https://www.chromium.org/developers/gyp-environment-variables) - do set GYP\_DEFINES=component=shared\_library, in - [GN](https://www.chromium.org/developers/gn-build-configuration), - set the build arg is\_component\_build = true). This will generate - many DLLs and enable incremental linking, which makes linking - *much*faster in Debug. + should use the component build: + - for [GYP](https://www.chromium.org/developers/gyp-environment-variables) + set `GYP_DEFINES=component=shared_library` + - for [GN](https://www.chromium.org/developers/gn-build-configuration), + set the build arg `is_component_build = true`. + This will generate many DLLs and enable incremental linking, which makes + linking **much** faster in Debug. -Still expect build times of 30 minutes to 2 hours when everything has to +Still, expect build times of 30 minutes to 2 hours when everything has to be recompiled.
diff --git a/extensions/browser/api/declarative/deduping_factory_unittest.cc b/extensions/browser/api/declarative/deduping_factory_unittest.cc index c5cfc37..f4c335b 100644 --- a/extensions/browser/api/declarative/deduping_factory_unittest.cc +++ b/extensions/browser/api/declarative/deduping_factory_unittest.cc
@@ -5,6 +5,7 @@ #include "extensions/browser/api/declarative/deduping_factory.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/values.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/extensions/browser/api/declarative/rules_cache_delegate.h b/extensions/browser/api/declarative/rules_cache_delegate.h index 560eac2..15553da 100644 --- a/extensions/browser/api/declarative/rules_cache_delegate.h +++ b/extensions/browser/api/declarative/rules_cache_delegate.h
@@ -9,6 +9,7 @@ #include <string> #include "base/gtest_prod_util.h" +#include "base/memory/scoped_ptr.h" #include "base/values.h" #include "content/public/browser/browser_thread.h"
diff --git a/extensions/browser/extension_pref_value_map.h b/extensions/browser/extension_pref_value_map.h index 0facdc77..aed71c5 100644 --- a/extensions/browser/extension_pref_value_map.h +++ b/extensions/browser/extension_pref_value_map.h
@@ -10,6 +10,7 @@ #include <string> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "components/keyed_service/core/keyed_service.h" #include "extensions/browser/extension_prefs_scope.h"
diff --git a/extensions/common/api/alarms.idl b/extensions/common/api/alarms.idl index 9d73f22..500d2ed 100644 --- a/extensions/common/api/alarms.idl +++ b/extensions/common/api/alarms.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.alarms</code> API to schedule code to run // periodically or at a specified time in the future. -[use_movable_types=true] namespace alarms { +namespace alarms { dictionary Alarm { // Name of this alarm. DOMString name;
diff --git a/extensions/common/api/app_current_window_internal.idl b/extensions/common/api/app_current_window_internal.idl index 520ee7e..e6dc17d 100644 --- a/extensions/common/api/app_current_window_internal.idl +++ b/extensions/common/api/app_current_window_internal.idl
@@ -4,7 +4,7 @@ // This is used by the app window API internally to pass through messages to // the shell window. -[use_movable_types=true] namespace app.currentWindowInternal { +namespace app.currentWindowInternal { // Null or undefined indicates that a value should not change. dictionary Bounds {
diff --git a/extensions/common/api/app_runtime.idl b/extensions/common/api/app_runtime.idl index eb89dfd3..daf953c 100644 --- a/extensions/common/api/app_runtime.idl +++ b/extensions/common/api/app_runtime.idl
@@ -5,7 +5,7 @@ // Use the <code>chrome.app.runtime</code> API to manage the app lifecycle. // The app runtime manages app installation, controls the event page, and can // shut down the app at anytime. -[use_movable_types=true] namespace app.runtime { +namespace app.runtime { [inline_doc] dictionary LaunchItem { // Entry for the item.
diff --git a/extensions/common/api/app_view_guest_internal.json b/extensions/common/api/app_view_guest_internal.json index 47c9ddd..37fe657e 100644 --- a/extensions/common/api/app_view_guest_internal.json +++ b/extensions/common/api/app_view_guest_internal.json
@@ -6,8 +6,7 @@ { "namespace": "appViewGuestInternal", "compiler_options": { - "implemented_in": "extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.h", - "use_movable_types": true + "implemented_in": "extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.h" }, "description": "none", "functions": [
diff --git a/extensions/common/api/app_window.idl b/extensions/common/api/app_window.idl index 63eb054..f75978ec 100644 --- a/extensions/common/api/app_window.idl +++ b/extensions/common/api/app_window.idl
@@ -7,7 +7,7 @@ // associated with any Chrome browser windows. See the <a // href="https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/window-state"> // Window State Sample</a> for a demonstration of these options. -[use_movable_types=true] namespace app.window { +namespace app.window { // Previously named Bounds. dictionary ContentBounds {
diff --git a/extensions/common/api/audio.idl b/extensions/common/api/audio.idl index 06a2cd3..36a1124 100644 --- a/extensions/common/api/audio.idl +++ b/extensions/common/api/audio.idl
@@ -5,7 +5,7 @@ // The <code>chrome.audio</code> API is provided to allow users to // get information about and control the audio devices attached to the // system. This API is currently only implemented for ChromeOS. -[use_movable_types=true] namespace audio { +namespace audio { dictionary OutputDeviceInfo { // The unique identifier of the audio output device.
diff --git a/extensions/common/api/bluetooth.idl b/extensions/common/api/bluetooth.idl index 8d32dad..b5523dc 100644 --- a/extensions/common/api/bluetooth.idl +++ b/extensions/common/api/bluetooth.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.bluetooth</code> API to connect to a Bluetooth // device. All functions report failures via chrome.runtime.lastError. -[use_movable_types=true] namespace bluetooth { +namespace bluetooth { // Allocation authorities for Vendor IDs. enum VendorIdSource {bluetooth, usb};
diff --git a/extensions/common/api/bluetooth_private.idl b/extensions/common/api/bluetooth_private.idl index 8daee809..f943ab56 100644 --- a/extensions/common/api/bluetooth_private.idl +++ b/extensions/common/api/bluetooth_private.idl
@@ -6,9 +6,7 @@ // adapter state and handle device pairing. // NOTE: This IDL is dependent on bluetooth.idl. -[implemented_in = "extensions/browser/api/bluetooth/bluetooth_private_api.h", - use_movable_types=true] - +[implemented_in = "extensions/browser/api/bluetooth/bluetooth_private_api.h"] namespace bluetoothPrivate { // Events that can occur during pairing. The method used for pairing varies // depending on the capability of the two devices.
diff --git a/extensions/common/api/bluetooth_socket.idl b/extensions/common/api/bluetooth_socket.idl index a373ccb..cb95c02 100644 --- a/extensions/common/api/bluetooth_socket.idl +++ b/extensions/common/api/bluetooth_socket.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.bluetoothSocket</code> API to send and receive data // to Bluetooth devices using RFCOMM and L2CAP connections. -[use_movable_types=true] namespace bluetoothSocket { +namespace bluetoothSocket { // The socket properties specified in the $ref:create or $ref:update // function. Each property is optional. If a property value is not specified, // a default value is used when calling $ref:create, or the existing value is
diff --git a/extensions/common/api/cast_channel.idl b/extensions/common/api/cast_channel.idl index fa0e8b6..33af514fd 100644 --- a/extensions/common/api/cast_channel.idl +++ b/extensions/common/api/cast_channel.idl
@@ -4,7 +4,7 @@ // API for communicating with a Google Cast device over an authenticated // channel. -[use_movable_types=true] namespace cast.channel { +namespace cast.channel { // The state of the channel. enum ReadyState { // The channel is connecting.
diff --git a/extensions/common/api/declarative_web_request.json b/extensions/common/api/declarative_web_request.json index 36b16ee1..f504070 100644 --- a/extensions/common/api/declarative_web_request.json +++ b/extensions/common/api/declarative_web_request.json
@@ -6,7 +6,6 @@ { "namespace": "declarativeWebRequest", "description": "<em><strong>Note:</strong> this API is currently on hold, without concrete plans to move to stable.</em> Use the <code>chrome.declarativeWebRequest</code> API to intercept, block, or modify requests in-flight. It is significantly faster than the <a href='webRequest'><code>chrome.webRequest</code> API</a> because you can register rules that are evaluated in the browser rather than the JavaScript engine with reduces roundtrip latencies and allows higher efficiency.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "HeaderFilter",
diff --git a/extensions/common/api/diagnostics.idl b/extensions/common/api/diagnostics.idl index f340faf..5f8f31d7 100644 --- a/extensions/common/api/diagnostics.idl +++ b/extensions/common/api/diagnostics.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.diagnostics</code> API to query various properties of // the environment that may be useful for diagnostics. -[use_movable_types=true] namespace diagnostics { +namespace diagnostics { dictionary SendPacketOptions { // Target IP address. DOMString ip;
diff --git a/extensions/common/api/display_source.idl b/extensions/common/api/display_source.idl index 4e0185c..f8c599c7 100644 --- a/extensions/common/api/display_source.idl +++ b/extensions/common/api/display_source.idl
@@ -4,7 +4,7 @@ // The <code>chrome.displaySource</code> API creates a Display // session using WebMediaStreamTrack as sources. -[use_movable_types=true] namespace displaySource { +namespace displaySource { enum ErrorType { // The connection with sink cannot be established or has dropped // unexpectedly.
diff --git a/extensions/common/api/dns.idl b/extensions/common/api/dns.idl index ea8fc11..0500c0f 100644 --- a/extensions/common/api/dns.idl +++ b/extensions/common/api/dns.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Use the <code>chrome.dns</code> API for dns resolution. -[use_movable_types=true] namespace dns { +namespace dns { dictionary ResolveCallbackResolveInfo { // The result code. Zero indicates success.
diff --git a/extensions/common/api/document_scan.idl b/extensions/common/api/document_scan.idl index da0c2c9..a2bdcca 100644 --- a/extensions/common/api/document_scan.idl +++ b/extensions/common/api/document_scan.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.documentScan</code> API to discover and retrieve // images from attached paper document scanners. -[use_movable_types=true] namespace documentScan { +namespace documentScan { dictionary ScanOptions { // The MIME types that are accepted by the caller. DOMString[]? mimeTypes;
diff --git a/extensions/common/api/events.json b/extensions/common/api/events.json index 98e823b..ba31dea 100644 --- a/extensions/common/api/events.json +++ b/extensions/common/api/events.json
@@ -7,8 +7,7 @@ "namespace": "events", "description": "The <code>chrome.events</code> namespace contains common types used by APIs dispatching events to notify you when something interesting happens.", "compiler_options": { - "implemented_in": "extensions/browser/api/declarative/declarative_api.h", - "use_movable_types": true + "implemented_in": "extensions/browser/api/declarative/declarative_api.h" }, "types": [ {
diff --git a/extensions/common/api/extension_options_internal.idl b/extensions/common/api/extension_options_internal.idl index e82bec1..78052d1 100644 --- a/extensions/common/api/extension_options_internal.idl +++ b/extensions/common/api/extension_options_internal.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Internal API for the <extensiontoptions> tag -[use_movable_types=true] namespace extensionOptionsInternal { +namespace extensionOptionsInternal { dictionary SizeChangedOptions { long oldWidth; long oldHeight;
diff --git a/extensions/common/api/extension_types.json b/extensions/common/api/extension_types.json index a69961d..9f27590 100644 --- a/extensions/common/api/extension_types.json +++ b/extensions/common/api/extension_types.json
@@ -6,7 +6,6 @@ { "namespace": "extensionTypes", "description": "The <code>chrome.extensionTypes</code> API contains type declarations for Chrome extensions.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "ImageFormat",
diff --git a/extensions/common/api/extension_view_internal.json b/extensions/common/api/extension_view_internal.json index 2568de9..3160c683 100644 --- a/extensions/common/api/extension_view_internal.json +++ b/extensions/common/api/extension_view_internal.json
@@ -7,8 +7,7 @@ "namespace": "extensionViewInternal", "description": "none", "compiler_options": { - "implemented_in": "extensions/browser/api/guest_view/extension_view/extension_view_internal_api.h", - "use_movable_types": true + "implemented_in": "extensions/browser/api/guest_view/extension_view/extension_view_internal_api.h" }, "functions": [ {
diff --git a/extensions/common/api/extensions_manifest_types.json b/extensions/common/api/extensions_manifest_types.json index cf657cb..23a73fa 100644 --- a/extensions/common/api/extensions_manifest_types.json +++ b/extensions/common/api/extensions_manifest_types.json
@@ -8,10 +8,7 @@ { "namespace": "extensionsManifestTypes", "description": "Schemas for structured manifest entries", - "compiler_options": { - "generate_error_messages": true, - "use_movable_types": true - }, + "compiler_options": { "generate_error_messages": true }, "types": [ { "id": "ContentCapabilities",
diff --git a/extensions/common/api/guest_view_internal.json b/extensions/common/api/guest_view_internal.json index e7756b5..90c5d4e 100644 --- a/extensions/common/api/guest_view_internal.json +++ b/extensions/common/api/guest_view_internal.json
@@ -6,8 +6,7 @@ { "namespace": "guestViewInternal", "compiler_options": { - "implemented_in": "extensions/browser/api/guest_view/guest_view_internal_api.h", - "use_movable_types": true + "implemented_in": "extensions/browser/api/guest_view/guest_view_internal_api.h" }, "description": "none", "types": [
diff --git a/extensions/common/api/hid.idl b/extensions/common/api/hid.idl index 6c6d6154..2e81ebe 100644 --- a/extensions/common/api/hid.idl +++ b/extensions/common/api/hid.idl
@@ -9,7 +9,7 @@ // Errors generated by this API are reported by setting // $(ref:runtime.lastError) and executing the function's regular callback. The // callback's regular parameters will be undefined in this case. -[use_movable_types=true] namespace hid { +namespace hid { dictionary HidCollectionInfo { // HID usage page identifier. long usagePage;
diff --git a/extensions/common/api/idle.json b/extensions/common/api/idle.json index c141bae..43a9d07 100644 --- a/extensions/common/api/idle.json +++ b/extensions/common/api/idle.json
@@ -6,7 +6,6 @@ { "namespace": "idle", "description": "Use the <code>chrome.idle</code> API to detect when the machine's idle state changes.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "IdleState",
diff --git a/extensions/common/api/management.json b/extensions/common/api/management.json index 022ccde5..2e05940 100644 --- a/extensions/common/api/management.json +++ b/extensions/common/api/management.json
@@ -6,7 +6,6 @@ { "namespace":"management", "description": "The <code>chrome.management</code> API provides ways to manage the list of extensions/apps that are installed and running. It is particularly useful for extensions that <a href='override'>override</a> the built-in New Tab page.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "IconInfo",
diff --git a/extensions/common/api/mime_handler_private.idl b/extensions/common/api/mime_handler_private.idl index 1e7c099..dfd47be 100644 --- a/extensions/common/api/mime_handler_private.idl +++ b/extensions/common/api/mime_handler_private.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Mime handler API. -[nodoc, use_movable_types=true] namespace mimeHandlerPrivate { +[nodoc] namespace mimeHandlerPrivate { dictionary StreamInfo { // The MIME type of the intercepted URL request. DOMString mimeType;
diff --git a/extensions/common/api/mojo_private.idl b/extensions/common/api/mojo_private.idl index 0c3a0f1..7a8ddd0 100644 --- a/extensions/common/api/mojo_private.idl +++ b/extensions/common/api/mojo_private.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // The chrome.mojoPrivate API provides access to the mojo modules. -[use_movable_types=true] namespace mojoPrivate { +namespace mojoPrivate { // |modules| is an array of the values returned by |dependencies| factories. callback DefineCallback = void (any[] modules);
diff --git a/extensions/common/api/networking_config.idl b/extensions/common/api/networking_config.idl index c280f31..78b5bc6 100644 --- a/extensions/common/api/networking_config.idl +++ b/extensions/common/api/networking_config.idl
@@ -4,7 +4,7 @@ // Use the <code>networking.config</code> API to authenticate to captive // portals. -[use_movable_types=true] namespace networking.config { +namespace networking.config { // Indicator for the type of network used in $(ref:NetworkInfo). enum NetworkType { WiFi };
diff --git a/extensions/common/api/networking_private.idl b/extensions/common/api/networking_private.idl index 5088f01..1df8ec7 100644 --- a/extensions/common/api/networking_private.idl +++ b/extensions/common/api/networking_private.idl
@@ -27,7 +27,7 @@ // TODO(stevenjb/pneubeck): Merge the ONC documentation with this document and // use it as the ONC specification. -[use_movable_types=true] namespace networkingPrivate { +namespace networkingPrivate { enum ActivationStateType { Activated, Activating, NotActivated, PartiallyActivated };
diff --git a/extensions/common/api/power.idl b/extensions/common/api/power.idl index c5337a80..2a25353 100644 --- a/extensions/common/api/power.idl +++ b/extensions/common/api/power.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.power</code> API to override the system's power // management features. -[use_movable_types=true] namespace power { +namespace power { [noinline_doc] enum Level { // Prevent the system from sleeping in response to user inactivity. system,
diff --git a/extensions/common/api/printer_provider.idl b/extensions/common/api/printer_provider.idl index f6b5ff9e..3de58fa0 100644 --- a/extensions/common/api/printer_provider.idl +++ b/extensions/common/api/printer_provider.idl
@@ -5,7 +5,7 @@ // The <code>chrome.printerProvider</code> API exposes events used by print // manager to query printers controlled by extensions, to query their // capabilities and to submit print jobs to these printers. -[use_movable_types=true] namespace printerProvider { +namespace printerProvider { // Error codes returned in response to $(ref:onPrintRequested) event. enum PrintError { // Operation completed successfully.
diff --git a/extensions/common/api/printer_provider_internal.idl b/extensions/common/api/printer_provider_internal.idl index 035d673..d34e472 100644 --- a/extensions/common/api/printer_provider_internal.idl +++ b/extensions/common/api/printer_provider_internal.idl
@@ -12,7 +12,7 @@ // is internally dispatched having a requestId argument (which is removed from // the argument list before the event actually reaches the event listeners). The // requestId is forwarded to the chrome.printerProviderInternal API functions. -[use_movable_types=true] namespace printerProviderInternal { +namespace printerProviderInternal { // Same as in printerProvider.PrintError enum API. enum PrintError { OK, FAILED, INVALID_TICKET, INVALID_DATA };
diff --git a/extensions/common/api/runtime.json b/extensions/common/api/runtime.json index 7b10b7a..d4a4e598 100644 --- a/extensions/common/api/runtime.json +++ b/extensions/common/api/runtime.json
@@ -9,7 +9,6 @@ { "namespace": "runtime", "description": "Use the <code>chrome.runtime</code> API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs.", - "compiler_options": {"use_movable_types": true}, "types": [ { "id": "Port",
diff --git a/extensions/common/api/serial.idl b/extensions/common/api/serial.idl index 2fc735b..94029dc 100644 --- a/extensions/common/api/serial.idl +++ b/extensions/common/api/serial.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.serial</code> API to read from and write to a device // connected to a serial port. -[use_movable_types=true] namespace serial { +namespace serial { dictionary DeviceInfo { // The device's system path. This should be passed as the <code>path</code>
diff --git a/extensions/common/api/socket.idl b/extensions/common/api/socket.idl index 24bfb18..8a8559ee 100644 --- a/extensions/common/api/socket.idl +++ b/extensions/common/api/socket.idl
@@ -6,7 +6,7 @@ // network using TCP and UDP connections. <b>Note:</b> Starting with Chrome 33, // this API is deprecated in favor of the $(ref:sockets.udp), $(ref:sockets.tcp) and // $(ref:sockets.tcpServer) APIs. -[use_movable_types=true] namespace socket { +namespace socket { enum SocketType { tcp, udp
diff --git a/extensions/common/api/sockets_tcp.idl b/extensions/common/api/sockets_tcp.idl index 5ca2641c..2dffa17 100644 --- a/extensions/common/api/sockets_tcp.idl +++ b/extensions/common/api/sockets_tcp.idl
@@ -5,7 +5,7 @@ // Use the <code>chrome.sockets.tcp</code> API to send and receive data over the // network using TCP connections. This API supersedes the TCP functionality // previously found in the <code>chrome.socket</code> API. -[use_movable_types=true] namespace sockets.tcp { +namespace sockets.tcp { // The socket properties specified in the <code>create</code> or // <code>update</code> function. Each property is optional. If a property // value is not specified, a default value is used when calling
diff --git a/extensions/common/api/sockets_tcp_server.idl b/extensions/common/api/sockets_tcp_server.idl index 6fe9cc8..4a04fa9 100644 --- a/extensions/common/api/sockets_tcp_server.idl +++ b/extensions/common/api/sockets_tcp_server.idl
@@ -5,7 +5,7 @@ // Use the <code>chrome.sockets.tcpServer</code> API to create server // applications using TCP connections. This API supersedes the TCP functionality // previously found in the <code>chrome.socket</code> API. -[use_movable_types=true] namespace sockets.tcpServer { +namespace sockets.tcpServer { // The socket properties specified in the <code>create</code> or // <code>update</code> function. Each property is optional. If a property // value is not specified, a default value is used when calling
diff --git a/extensions/common/api/sockets_udp.idl b/extensions/common/api/sockets_udp.idl index 754ed8d..784a31d 100644 --- a/extensions/common/api/sockets_udp.idl +++ b/extensions/common/api/sockets_udp.idl
@@ -5,7 +5,7 @@ // Use the <code>chrome.sockets.udp</code> API to send and receive data over the // network using UDP connections. This API supersedes the UDP functionality // previously found in the "socket" API. -[use_movable_types=true] namespace sockets.udp { +namespace sockets.udp { // The socket properties specified in the <code>create</code> or // <code>update</code> function. Each property is optional. If a property // value is not specified, a default value is used when calling
diff --git a/extensions/common/api/system_cpu.idl b/extensions/common/api/system_cpu.idl index 78ef35bf..bb3ac85 100644 --- a/extensions/common/api/system_cpu.idl +++ b/extensions/common/api/system_cpu.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Use the <code>system.cpu</code> API to query CPU metadata. -[use_movable_types=true] namespace system.cpu { +namespace system.cpu { // Counters for assessing CPU utilization. Each field is monotonically // increasing while the processor is powered on. Values are in milliseconds.
diff --git a/extensions/common/api/system_display.idl b/extensions/common/api/system_display.idl index 2128fb9..4e3c9e5 100644 --- a/extensions/common/api/system_display.idl +++ b/extensions/common/api/system_display.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Use the <code>system.display</code> API to query display metadata. -[use_movable_types=true] namespace system.display { +namespace system.display { dictionary Bounds { // The x-coordinate of the upper-left corner.
diff --git a/extensions/common/api/system_memory.idl b/extensions/common/api/system_memory.idl index f4e4a580..64af214 100644 --- a/extensions/common/api/system_memory.idl +++ b/extensions/common/api/system_memory.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // The <code>chrome.system.memory</code> API. -[use_movable_types=true] namespace system.memory { +namespace system.memory { dictionary MemoryInfo { // The total amount of physical memory capacity, in bytes.
diff --git a/extensions/common/api/system_network.idl b/extensions/common/api/system_network.idl index 6449267b..bbc28ae9 100644 --- a/extensions/common/api/system_network.idl +++ b/extensions/common/api/system_network.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Use the <code>chrome.system.network</code> API. -[use_movable_types=true] namespace system.network { +namespace system.network { dictionary NetworkInterface { // The underlying name of the adapter. On *nix, this will typically be // "eth0", "wlan0", etc.
diff --git a/extensions/common/api/system_storage.idl b/extensions/common/api/system_storage.idl index c10251c8..f5ca4d56 100644 --- a/extensions/common/api/system_storage.idl +++ b/extensions/common/api/system_storage.idl
@@ -5,7 +5,7 @@ // Use the <code>chrome.system.storage</code> API to query storage device // information and be notified when a removable storage device is attached and // detached. -[use_movable_types=true] namespace system.storage { +namespace system.storage { enum StorageUnitType { // The storage has fixed media, e.g. hard disk or SSD.
diff --git a/extensions/common/api/test.json b/extensions/common/api/test.json index dfd76860..42a7a26 100644 --- a/extensions/common/api/test.json +++ b/extensions/common/api/test.json
@@ -6,7 +6,6 @@ { "namespace": "test", "description": "none", - "compiler_options": {"use_movable_types": true}, "functions": [ { "name": "getConfig",
diff --git a/extensions/common/api/usb.idl b/extensions/common/api/usb.idl index 5b451bb..21e4bd3c 100644 --- a/extensions/common/api/usb.idl +++ b/extensions/common/api/usb.idl
@@ -9,7 +9,7 @@ // Errors generated by this API are reported by setting // $(ref:runtime.lastError) and executing the function's regular callback. The // callback's regular parameters will be undefined in this case. -[use_movable_types=true] namespace usb { +namespace usb { // Direction, Recipient, RequestType, and TransferType all map to their // namesakes within the USB specification.
diff --git a/extensions/common/api/virtual_keyboard_private.json b/extensions/common/api/virtual_keyboard_private.json index 758db0c7..5b335fb 100644 --- a/extensions/common/api/virtual_keyboard_private.json +++ b/extensions/common/api/virtual_keyboard_private.json
@@ -6,8 +6,7 @@ { "namespace": "virtualKeyboardPrivate", "compiler_options": { - "implemented_in": "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h", - "use_movable_types": true + "implemented_in": "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h" }, "platforms": ["chromeos"], "description": "none",
diff --git a/extensions/common/api/vpn_provider.idl b/extensions/common/api/vpn_provider.idl index 69a0ffa..9399f48 100644 --- a/extensions/common/api/vpn_provider.idl +++ b/extensions/common/api/vpn_provider.idl
@@ -4,7 +4,7 @@ // Use the <code>chrome.vpnProvider</code> API to implement a VPN // client. -[use_movable_types=true] namespace vpnProvider { +namespace vpnProvider { // A parameters class for the VPN interface. dictionary Parameters { // IP address for the VPN interface in CIDR notation.
diff --git a/extensions/common/api/web_request.json b/extensions/common/api/web_request.json index 47def07..4e314eb 100644 --- a/extensions/common/api/web_request.json +++ b/extensions/common/api/web_request.json
@@ -6,7 +6,6 @@ { "namespace": "webRequest", "description": "Use the <code>chrome.webRequest</code> API to observe and analyze traffic and to intercept, block, or modify requests in-flight.", - "compiler_options": {"use_movable_types": true}, "properties": { "MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES": { "value": 20,
diff --git a/extensions/common/api/web_request_internal.json b/extensions/common/api/web_request_internal.json index 2fb82daa..4adcd06 100644 --- a/extensions/common/api/web_request_internal.json +++ b/extensions/common/api/web_request_internal.json
@@ -7,8 +7,7 @@ "namespace": "webRequestInternal", "description": "none", "compiler_options": { - "implemented_in": "extensions/browser/api/web_request/web_request_api.h", - "use_movable_types": true + "implemented_in": "extensions/browser/api/web_request/web_request_api.h" }, "types": [ {
diff --git a/extensions/common/api/web_view_internal.json b/extensions/common/api/web_view_internal.json index 716b882..94a6eb9 100644 --- a/extensions/common/api/web_view_internal.json +++ b/extensions/common/api/web_view_internal.json
@@ -7,8 +7,7 @@ "namespace": "webViewInternal", "description": "none", "compiler_options": { - "implemented_in": "extensions/browser/api/guest_view/web_view/web_view_internal_api.h", - "use_movable_types": true + "implemented_in": "extensions/browser/api/guest_view/web_view/web_view_internal_api.h" }, "types": [ {
diff --git a/extensions/common/api/webcam_private.idl b/extensions/common/api/webcam_private.idl index f6a084e..8095699 100644 --- a/extensions/common/api/webcam_private.idl +++ b/extensions/common/api/webcam_private.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Webcam Private API. -[use_movable_types=true] namespace webcamPrivate { +namespace webcamPrivate { enum PanDirection { stop, right, left }; enum TiltDirection { stop, up, down }; enum Protocol { visca };
diff --git a/extensions/common/switches.cc b/extensions/common/switches.cc index 77e5ad1..9f60f961 100644 --- a/extensions/common/switches.cc +++ b/extensions/common/switches.cc
@@ -31,8 +31,8 @@ // Enable BLE Advertisiing in apps. const char kEnableBLEAdvertising[] = "enable-ble-advertising-in-apps"; -const char kEnableDesktopCaptureAudio[] = - "enable-audio-support-for-desktop-share"; +const char kDisableDesktopCaptureAudio[] = + "disable-audio-support-for-desktop-share"; // Hack so that feature switch can work with about_flags. See // kEnableScriptsRequireAction. @@ -55,6 +55,7 @@ const char kEnableOverrideBookmarksUI[] = "enable-override-bookmarks-ui"; // Enables tab for desktop sharing. +const char kDisableTabForDesktopShare[] = "disable-tab-for-desktop-share"; const char kEnableTabForDesktopShare[] = "enable-tab-for-desktop-share"; // Allows the ErrorConsole to collect runtime and manifest errors, and display
diff --git a/extensions/common/switches.h b/extensions/common/switches.h index af2a0f4..a812c12 100644 --- a/extensions/common/switches.h +++ b/extensions/common/switches.h
@@ -13,10 +13,11 @@ extern const char kAllowHTTPBackgroundPage[]; extern const char kAllowLegacyExtensionManifests[]; +extern const char kDisableDesktopCaptureAudio[]; +extern const char kDisableTabForDesktopShare[]; extern const char kEmbeddedExtensionOptions[]; extern const char kEnableAppsShowOnFirstPaint[]; extern const char kEnableAppWindowControls[]; -extern const char kEnableDesktopCaptureAudio[]; extern const char kEnableEmbeddedExtensionOptions[]; extern const char kEnableExperimentalExtensionApis[]; extern const char kEnableExtensionActionRedesign[];
diff --git a/extensions/renderer/activity_log_converter_strategy.cc b/extensions/renderer/activity_log_converter_strategy.cc index 1e32832..f76f9558 100644 --- a/extensions/renderer/activity_log_converter_strategy.cc +++ b/extensions/renderer/activity_log_converter_strategy.cc
@@ -5,6 +5,7 @@ #include "extensions/renderer/activity_log_converter_strategy.h" #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "base/values.h" #include "v8/include/v8.h"
diff --git a/extensions/renderer/api/serial/data_receiver_unittest.cc b/extensions/renderer/api/serial/data_receiver_unittest.cc index 0827a8a2..0c7dc00 100644 --- a/extensions/renderer/api/serial/data_receiver_unittest.cc +++ b/extensions/renderer/api/serial/data_receiver_unittest.cc
@@ -126,12 +126,24 @@ DISALLOW_COPY_AND_ASSIGN(DataReceiverTest); }; -TEST_F(DataReceiverTest, Receive) { +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_Receive DISABLED_Receive +#else +#define MAYBE_Receive Receive +#endif +TEST_F(DataReceiverTest, MAYBE_Receive) { data_to_send_.push("a"); RunTest("data_receiver_unittest.js", "testReceive"); } -TEST_F(DataReceiverTest, ReceiveError) { +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_ReceiveError DISABLED_ReceiveError +#else +#define MAYBE_ReceiveError ReceiveError +#endif +TEST_F(DataReceiverTest, MAYBE_ReceiveError) { error_to_send_.push(1); RunTest("data_receiver_unittest.js", "testReceiveError"); } @@ -176,7 +188,13 @@ RunTest("data_receiver_unittest.js", "testSerializeDuringReceive"); } -TEST_F(DataReceiverTest, SerializeAfterClose) { +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_SerializeAfterClose DISABLED_SerializeAfterClose +#else +#define MAYBE_SerializeAfterClose SerializeAfterClose +#endif +TEST_F(DataReceiverTest, MAYBE_SerializeAfterClose) { data_to_send_.push("a"); RunTest("data_receiver_unittest.js", "testSerializeAfterClose"); }
diff --git a/extensions/renderer/api/serial/data_sender_unittest.cc b/extensions/renderer/api/serial/data_sender_unittest.cc index c9a75cc..a38dd10 100644 --- a/extensions/renderer/api/serial/data_sender_unittest.cc +++ b/extensions/renderer/api/serial/data_sender_unittest.cc
@@ -95,7 +95,13 @@ RunTest("data_sender_unittest.js", "testSend"); } -TEST_F(DataSenderTest, LargeSend) { +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_LargeSend DISABLED_LargeSend +#else +#define MAYBE_LargeSend LargeSend +#endif +TEST_F(DataSenderTest, MAYBE_LargeSend) { std::string pattern = "123"; std::string expected_data; for (int i = 0; i < 11; i++) @@ -146,7 +152,13 @@ RunTest("data_sender_unittest.js", "testSendErrorBeforeLargeSend"); } -TEST_F(DataSenderTest, CancelWithoutSend) { +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_CancelWithoutSend DISABLED_CancelWithoutSend +#else +#define MAYBE_CancelWithoutSend CancelWithoutSend +#endif +TEST_F(DataSenderTest, MAYBE_CancelWithoutSend) { RunTest("data_sender_unittest.js", "testCancelWithoutSend"); } @@ -154,7 +166,13 @@ RunTest("data_sender_unittest.js", "testCancel"); } -TEST_F(DataSenderTest, Close) { +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_Close DISABLED_Close +#else +#define MAYBE_Close Close +#endif +TEST_F(DataSenderTest, MAYBE_Close) { RunTest("data_sender_unittest.js", "testClose"); } @@ -182,7 +200,13 @@ RunTest("data_sender_unittest.js", "testSerializeWaitsForCancel"); } -TEST_F(DataSenderTest, SerializeAfterClose) { +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_SerializeAfterClose DISABLED_SerializeAfterClose +#else +#define MAYBE_SerializeAfterClose SerializeAfterClose +#endif +TEST_F(DataSenderTest, MAYBE_SerializeAfterClose) { RunTest("data_sender_unittest.js", "testSerializeAfterClose"); }
diff --git a/extensions/renderer/api/serial/serial_api_unittest.cc b/extensions/renderer/api/serial/serial_api_unittest.cc index b8c9e42..82f8f2a 100644 --- a/extensions/renderer/api/serial/serial_api_unittest.cc +++ b/extensions/renderer/api/serial/serial_api_unittest.cc
@@ -488,7 +488,13 @@ RunTest("serial_unittest.js", "testGetConnections"); } -TEST_F(SerialApiTest, GetControlSignals) { +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_GetControlSignals DISABLED_GetControlSignals +#else +#define MAYBE_GetControlSignals GetControlSignals +#endif +TEST_F(SerialApiTest, MAYBE_GetControlSignals) { io_handler_ = new GetControlSignalsTestIoHandler; RunTest("serial_unittest.js", "testGetControlSignals"); EXPECT_EQ(16u, io_handler_->num_calls()); @@ -500,13 +506,25 @@ EXPECT_EQ(9u, io_handler_->num_calls()); } -TEST_F(SerialApiTest, Update) { +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_Update DISABLED_Update +#else +#define MAYBE_Update Update +#endif +TEST_F(SerialApiTest, MAYBE_Update) { io_handler_ = new ConfigurePortTestIoHandler; RunTest("serial_unittest.js", "testUpdate"); EXPECT_EQ(11u, io_handler_->num_calls()); } -TEST_F(SerialApiTest, UpdateAcrossSerialization) { +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_UpdateAcrossSerialization DISABLED_UpdateAcrossSerialization +#else +#define MAYBE_UpdateAcrossSerialization UpdateAcrossSerialization +#endif +TEST_F(SerialApiTest, MAYBE_UpdateAcrossSerialization) { io_handler_ = new ConfigurePortTestIoHandler; RunTest("serial_unittest.js", "testUpdateAcrossSerialization"); EXPECT_EQ(11u, io_handler_->num_calls()); @@ -701,7 +719,13 @@ new_api_test_env.RunTest("serial_unittest.js", "testRestoreAndReceiveError"); } -TEST_F(SerialApiTest, StashAndRestoreNoConnections) { +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_StashAndRestoreNoConnections DISABLED_StashAndRestoreNoConnections +#else +#define MAYBE_StashAndRestoreNoConnections StashAndRestoreNoConnections +#endif +TEST_F(SerialApiTest, MAYBE_StashAndRestoreNoConnections) { ASSERT_NO_FATAL_FAILURE( RunTest("serial_unittest.js", "testStashNoConnections")); io_handler_ = nullptr;
diff --git a/extensions/renderer/event_bindings.h b/extensions/renderer/event_bindings.h index ad979fce..8c17998 100644 --- a/extensions/renderer/event_bindings.h +++ b/extensions/renderer/event_bindings.h
@@ -9,6 +9,7 @@ #include <string> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "extensions/renderer/object_backed_native_handler.h" #include "v8/include/v8.h"
diff --git a/extensions/renderer/mojo/stash_client_unittest.cc b/extensions/renderer/mojo/stash_client_unittest.cc index cddd20d..3f361cc 100644 --- a/extensions/renderer/mojo/stash_client_unittest.cc +++ b/extensions/renderer/mojo/stash_client_unittest.cc
@@ -37,8 +37,14 @@ DISALLOW_COPY_AND_ASSIGN(StashClientTest); }; +// https://crbug.com/599898 +#if defined(LEAK_SANITIZER) +#define MAYBE_StashAndRestore DISABLED_StashAndRestore +#else +#define MAYBE_StashAndRestore StashAndRestore +#endif // Test that stashing and restoring work correctly. -TEST_F(StashClientTest, StashAndRestore) { +TEST_F(StashClientTest, MAYBE_StashAndRestore) { ASSERT_NO_FATAL_FAILURE(RunTest("stash_client_unittest.js", "testStash")); scoped_ptr<ModuleSystemTestEnvironment> restore_test_env(CreateEnvironment()); ApiTestEnvironment restore_environment(restore_test_env.get());
diff --git a/extensions/renderer/object_backed_native_handler.cc b/extensions/renderer/object_backed_native_handler.cc index 109fae18..23be1d6 100644 --- a/extensions/renderer/object_backed_native_handler.cc +++ b/extensions/renderer/object_backed_native_handler.cc
@@ -8,10 +8,12 @@ #include "base/logging.h" #include "base/memory/linked_ptr.h" +#include "content/public/child/worker_thread.h" #include "extensions/renderer/console.h" #include "extensions/renderer/module_system.h" #include "extensions/renderer/script_context.h" #include "extensions/renderer/script_context_set.h" +#include "extensions/renderer/v8_helpers.h" #include "v8/include/v8.h" namespace extensions { @@ -19,6 +21,7 @@ namespace { // Key for the base::Bound routed function. const char* kHandlerFunction = "handler_function"; +const char* kFeatureName = "feature_name"; } // namespace ObjectBackedNativeHandler::ObjectBackedNativeHandler(ScriptContext* context) @@ -45,15 +48,36 @@ v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Value> handler_function_value; + v8::Local<v8::Value> feature_name_value; // See comment in header file for why we do this. if (!GetPrivate(context, data, kHandlerFunction, &handler_function_value) || - handler_function_value->IsUndefined()) { + handler_function_value->IsUndefined() || + !GetPrivate(context, data, kFeatureName, &feature_name_value) || + !feature_name_value->IsString()) { ScriptContext* script_context = ScriptContextSet::GetContextByV8Context(context); console::Error(script_context ? script_context->GetRenderFrame() : nullptr, "Extension view no longer exists"); return; } + + // We can't access the ScriptContextSet on a worker thread. Luckily, we also + // don't inject many bindings into worker threads. + // TODO(devlin): Figure out a way around this. + if (content::WorkerThread::GetCurrentId() == 0) { + ScriptContext* script_context = + ScriptContextSet::GetContextByV8Context(context); + v8::Local<v8::String> feature_name_string = + feature_name_value->ToString(context).ToLocalChecked(); + std::string feature_name = *v8::String::Utf8Value(feature_name_string); + // TODO(devlin): Eventually, we should fail if either script_context is null + // or feature_name is empty. + if (script_context && + !feature_name.empty() && + !script_context->GetAvailability(feature_name).is_available()) { + return; + } + } // This CHECK is *important*. Otherwise, we'll go around happily executing // something random. See crbug.com/548273. CHECK(handler_function_value->IsExternal()); @@ -64,6 +88,13 @@ void ObjectBackedNativeHandler::RouteFunction( const std::string& name, const HandlerFunction& handler_function) { + RouteFunction(name, "", handler_function); +} + +void ObjectBackedNativeHandler::RouteFunction( + const std::string& name, + const std::string& feature_name, + const HandlerFunction& handler_function) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::HandleScope handle_scope(isolate); v8::Context::Scope context_scope(context_->v8_context()); @@ -71,6 +102,8 @@ v8::Local<v8::Object> data = v8::Object::New(isolate); SetPrivate(data, kHandlerFunction, v8::External::New(isolate, new HandlerFunction(handler_function))); + SetPrivate(data, kFeatureName, + v8_helpers::ToV8StringUnsafe(isolate, feature_name)); v8::Local<v8::FunctionTemplate> function_template = v8::FunctionTemplate::New(isolate, Router, data); v8::Local<v8::ObjectTemplate>::New(isolate, object_template_)
diff --git a/extensions/renderer/object_backed_native_handler.h b/extensions/renderer/object_backed_native_handler.h index 9842b0b..e3b63119 100644 --- a/extensions/renderer/object_backed_native_handler.h +++ b/extensions/renderer/object_backed_native_handler.h
@@ -45,6 +45,9 @@ // to bind to base::Unretained. void RouteFunction(const std::string& name, const HandlerFunction& handler_function); + void RouteFunction(const std::string& name, + const std::string& feature_name, + const HandlerFunction& handler_function); ScriptContext* context() const { return context_; }
diff --git a/extensions/renderer/script_context.cc b/extensions/renderer/script_context.cc index 4bcec51..6a5b631 100644 --- a/extensions/renderer/script_context.cc +++ b/extensions/renderer/script_context.cc
@@ -4,6 +4,7 @@ #include "extensions/renderer/script_context.h" +#include "base/command_line.h" #include "base/logging.h" #include "base/macros.h" #include "base/memory/scoped_ptr.h" @@ -12,6 +13,7 @@ #include "base/strings/stringprintf.h" #include "base/values.h" #include "content/public/child/v8_value_converter.h" +#include "content/public/common/content_switches.h" #include "content/public/common/url_constants.h" #include "content/public/renderer/render_frame.h" #include "extensions/common/constants.h" @@ -208,6 +210,14 @@ Feature::Availability ScriptContext::GetAvailability( const std::string& api_name) { DCHECK(thread_checker_.CalledOnValidThread()); + if (api_name == "test") { + bool allowed = base::CommandLine::ForCurrentProcess()-> + HasSwitch(::switches::kTestType); + Feature::AvailabilityResult result = + allowed ? Feature::IS_AVAILABLE : Feature::MISSING_COMMAND_LINE_SWITCH; + return Feature::Availability(result, + allowed ? "" : "Only allowed in tests"); + } // Hack: Hosted apps should have the availability of messaging APIs based on // the URL of the page (which might have access depending on some extension // with externally_connectable), not whether the app has access to messaging
diff --git a/extensions/renderer/user_gestures_native_handler.cc b/extensions/renderer/user_gestures_native_handler.cc index 852762c..c01a4ae 100644 --- a/extensions/renderer/user_gestures_native_handler.cc +++ b/extensions/renderer/user_gestures_native_handler.cc
@@ -14,12 +14,15 @@ UserGesturesNativeHandler::UserGesturesNativeHandler(ScriptContext* context) : ObjectBackedNativeHandler(context) { RouteFunction("IsProcessingUserGesture", + "test", base::Bind(&UserGesturesNativeHandler::IsProcessingUserGesture, base::Unretained(this))); RouteFunction("RunWithUserGesture", + "test", base::Bind(&UserGesturesNativeHandler::RunWithUserGesture, base::Unretained(this))); RouteFunction("RunWithoutUserGesture", + "test", base::Bind(&UserGesturesNativeHandler::RunWithoutUserGesture, base::Unretained(this))); }
diff --git a/google_apis/drive/task_util.h b/google_apis/drive/task_util.h index abc0d8f..09c577a4 100644 --- a/google_apis/drive/task_util.h +++ b/google_apis/drive/task_util.h
@@ -6,6 +6,7 @@ #define GOOGLE_APIS_DRIVE_TASK_UTIL_H_ #include "base/bind.h" +#include "base/memory/scoped_ptr.h" #include "base/thread_task_runner_handle.h" namespace google_apis {
diff --git a/google_apis/gcm/engine/connection_handler.h b/google_apis/gcm/engine/connection_handler.h index 7b265f9d..b719ac7 100644 --- a/google_apis/gcm/engine/connection_handler.h +++ b/google_apis/gcm/engine/connection_handler.h
@@ -6,6 +6,7 @@ #define GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_H_ #include "base/callback.h" +#include "base/memory/scoped_ptr.h" #include "google_apis/gcm/base/gcm_export.h" namespace net{
diff --git a/gpu/command_buffer/service/buffer_manager.cc b/gpu/command_buffer/service/buffer_manager.cc index 261b2ed..3281d76 100644 --- a/gpu/command_buffer/service/buffer_manager.cc +++ b/gpu/command_buffer/service/buffer_manager.cc
@@ -119,7 +119,6 @@ : manager_(manager), size_(0), deleted_(false), - shadowed_(false), is_client_side_array_(false), service_id_(service_id), initial_target_(0), @@ -138,28 +137,36 @@ } } -void Buffer::SetInfo( - GLsizeiptr size, GLenum usage, bool shadow, const GLvoid* data, - bool is_client_side_array) { +const GLvoid* Buffer::StageShadow(bool use_shadow, + GLsizeiptr size, + const GLvoid* data) { + shadow_.clear(); + if (use_shadow) { + if (data) { + shadow_.insert(shadow_.begin(), + static_cast<const uint8_t*>(data), + static_cast<const uint8_t*>(data) + size); + } else { + shadow_.resize(size); + } + return shadow_.data(); + } else { + return data; + } +} + +void Buffer::SetInfo(GLsizeiptr size, + GLenum usage, + bool use_shadow, + bool is_client_side_array) { usage_ = usage; is_client_side_array_ = is_client_side_array; ClearCache(); - if (size != size_ || shadow != shadowed_) { - shadowed_ = shadow; - size_ = size; - if (shadowed_) { - shadow_.reset(new int8_t[size]); - } else { - shadow_.reset(); - } - } - if (shadowed_) { - if (data) { - memcpy(shadow_.get(), data, size); - } else { - memset(shadow_.get(), 0, size); - } - } + + // Shadow must have been setup already. + DCHECK_EQ(shadow_.size(), static_cast<size_t>(use_shadow ? size : 0u)); + size_ = size; + mapped_range_.reset(nullptr); } @@ -177,8 +184,9 @@ if (!CheckRange(offset, size)) { return false; } - if (shadowed_) { - memcpy(shadow_.get() + offset, data, size); + if (!shadow_.empty()) { + DCHECK_LE(static_cast<size_t>(offset + size), shadow_.size()); + memcpy(shadow_.data() + offset, data, size); ClearCache(); } return true; @@ -186,13 +194,14 @@ const void* Buffer::GetRange( GLintptr offset, GLsizeiptr size) const { - if (!shadowed_) { + if (shadow_.empty()) { return NULL; } if (!CheckRange(offset, size)) { return NULL; } - return shadow_.get() + offset; + DCHECK_LE(static_cast<size_t>(offset + size), shadow_.size()); + return shadow_.data() + offset; } void Buffer::ClearCache() { @@ -280,7 +289,7 @@ return false; } - if (!shadowed_) { + if (shadow_.empty()) { return false; } @@ -288,24 +297,24 @@ GLuint max_v = 0; switch (type) { case GL_UNSIGNED_BYTE: - max_v = GetMaxValue<uint8_t>(shadow_.get(), offset, count, - primitive_restart_index); + max_v = GetMaxValue<uint8_t>(shadow_.data(), offset, count, + primitive_restart_index); break; case GL_UNSIGNED_SHORT: // Check we are not accessing an odd byte for a 2 byte value. if ((offset & 1) != 0) { return false; } - max_v = GetMaxValue<uint16_t>(shadow_.get(), offset, count, - primitive_restart_index); + max_v = GetMaxValue<uint16_t>(shadow_.data(), offset, count, + primitive_restart_index); break; case GL_UNSIGNED_INT: // Check we are not accessing a non aligned address for a 4 byte value. if ((offset & 3) != 0) { return false; } - max_v = GetMaxValue<uint32_t>(shadow_.get(), offset, count, - primitive_restart_index); + max_v = GetMaxValue<uint32_t>(shadow_.data(), offset, count, + primitive_restart_index); break; default: NOTREACHED(); // should never get here by validation. @@ -338,19 +347,25 @@ .use_non_zero_size_for_client_side_stream_buffers; } -void BufferManager::SetInfo(Buffer* buffer, GLenum target, GLsizeiptr size, - GLenum usage, const GLvoid* data) { - DCHECK(buffer); - memory_type_tracker_->TrackMemFree(buffer->size()); +bool BufferManager::UseShadowBuffer(GLenum target, GLenum usage) { const bool is_client_side_array = IsUsageClientSideArray(usage); const bool support_fixed_attribs = gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2; + // TODO(zmo): Don't shadow buffer data on ES3. crbug.com/491002. - const bool shadow = target == GL_ELEMENT_ARRAY_BUFFER || - allow_buffers_on_multiple_targets_ || - (allow_fixed_attribs_ && !support_fixed_attribs) || - is_client_side_array; - buffer->SetInfo(size, usage, shadow, data, is_client_side_array); + return ( + target == GL_ELEMENT_ARRAY_BUFFER || allow_buffers_on_multiple_targets_ || + (allow_fixed_attribs_ && !support_fixed_attribs) || is_client_side_array); +} + +void BufferManager::SetInfo(Buffer* buffer, + GLenum target, + GLsizeiptr size, + GLenum usage, + bool use_shadow) { + DCHECK(buffer); + memory_type_tracker_->TrackMemFree(buffer->size()); + buffer->SetInfo(size, usage, use_shadow, IsUsageClientSideArray(usage)); memory_type_tracker_->TrackMemAlloc(buffer->size()); } @@ -398,13 +413,10 @@ GLsizeiptr size, GLenum usage, const GLvoid* data) { - // Clear the buffer to 0 if no initial data was passed in. - scoped_ptr<int8_t[]> zero; - if (!data) { - zero.reset(new int8_t[size]); - memset(zero.get(), 0, size); - data = zero.get(); - } + // Stage the shadow buffer first if we are using a shadow buffer so that we + // validate what we store internally. + const bool use_shadow = UseShadowBuffer(target, usage); + data = buffer->StageShadow(use_shadow, size, data); ERRORSTATE_COPY_REAL_GL_ERRORS_TO_WRAPPER(error_state, "glBufferData"); if (IsUsageClientSideArray(usage)) { @@ -414,11 +426,12 @@ glBufferData(target, size, data, usage); } GLenum error = ERRORSTATE_PEEK_GL_ERROR(error_state, "glBufferData"); - if (error == GL_NO_ERROR) { - SetInfo(buffer, target, size, usage, data); - } else { - SetInfo(buffer, target, 0, usage, NULL); + if (error != GL_NO_ERROR) { + size = 0; + buffer->StageShadow(false, 0, nullptr); // Also clear the shadow. } + + SetInfo(buffer, target, size, usage, use_shadow); } void BufferManager::ValidateAndDoBufferSubData(
diff --git a/gpu/command_buffer/service/buffer_manager.h b/gpu/command_buffer/service/buffer_manager.h index ba0c232..8ababfa 100644 --- a/gpu/command_buffer/service/buffer_manager.h +++ b/gpu/command_buffer/service/buffer_manager.h
@@ -9,6 +9,8 @@ #include <stdint.h> #include <map> +#include <vector> + #include "base/containers/hash_tables.h" #include "base/logging.h" #include "base/macros.h" @@ -143,19 +145,26 @@ initial_target_ = target; } - bool shadowed() const { - return shadowed_; - } + bool shadowed() const { return !shadow_.empty(); } void MarkAsDeleted() { deleted_ = true; } + // Setup the shadow buffer. This will either initialize the shadow buffer + // with the passed data or clear the shadow buffer if no shadow required. This + // will return a pointer to the shadowed data if using shadow, otherwise will + // return the original data pointer. + const GLvoid* StageShadow(bool use_shadow, + GLsizeiptr size, + const GLvoid* data); + // Sets the size, usage and initial data of a buffer. // If shadow is true then if data is NULL buffer will be initialized to 0. - void SetInfo( - GLsizeiptr size, GLenum usage, bool shadow, const GLvoid* data, - bool is_client_side_array); + void SetInfo(GLsizeiptr size, + GLenum usage, + bool use_shadow, + bool is_client_side_array); // Sets a range of data for this buffer. Returns false if the offset or size // is out of range. @@ -171,9 +180,9 @@ // The manager that owns this Buffer. BufferManager* manager_; - // A copy of the data in the buffer. This data is only kept if the target - // is backed_ = true. - scoped_ptr<int8_t[]> shadow_; + // A copy of the data in the buffer. This data is only kept if the conditions + // checked in UseShadowBuffer() are true. + std::vector<uint8_t> shadow_; // Size of buffer. GLsizeiptr size_; @@ -181,9 +190,6 @@ // True if deleted. bool deleted_; - // Whether or not the data is shadowed. - bool shadowed_; - // Whether or not this Buffer is not uploaded to the GPU but just // sitting in local memory. bool is_client_side_array_; @@ -311,10 +317,16 @@ GLenum usage, const GLvoid* data); + // Tests whether a shadow buffer needs to be used. + bool UseShadowBuffer(GLenum target, GLenum usage); + // Sets the size, usage and initial data of a buffer. // If data is NULL buffer will be initialized to 0 if shadowed. - void SetInfo(Buffer* buffer, GLenum target, GLsizeiptr size, GLenum usage, - const GLvoid* data); + void SetInfo(Buffer* buffer, + GLenum target, + GLsizeiptr size, + GLenum usage, + bool use_shadow); scoped_ptr<MemoryTypeTracker> memory_type_tracker_; MemoryTracker* memory_tracker_;
diff --git a/gpu/gles2_conform_support/gles2_conform_support.gyp b/gpu/gles2_conform_support/gles2_conform_support.gyp index f585d92e..d4f18708 100644 --- a/gpu/gles2_conform_support/gles2_conform_support.gyp +++ b/gpu/gles2_conform_support/gles2_conform_support.gyp
@@ -96,7 +96,6 @@ 'type': 'executable', 'dependencies': [ 'egl_native', - '../../base/allocator/allocator.gyp:allocator', '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '../../gpu/gpu.gyp:gles2_c_lib_nocheck', '../../third_party/expat/expat.gyp:expat',
diff --git a/gpu/gles2_conform_support/native/main.cc b/gpu/gles2_conform_support/native/main.cc index 406fcd7..be1fa72 100644 --- a/gpu/gles2_conform_support/native/main.cc +++ b/gpu/gles2_conform_support/native/main.cc
@@ -6,6 +6,7 @@ #include "base/at_exit.h" #include "base/command_line.h" +#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #if defined(OS_MACOSX) #include "base/mac/scoped_nsautorelease_pool.h"
diff --git a/headless/README.md b/headless/README.md index 54e9d0e..0748cfd 100644 --- a/headless/README.md +++ b/headless/README.md
@@ -8,32 +8,32 @@ ## Headless shell The headless shell is a sample application which demonstrates the use of the -headless API. To run it, first open the build configuration editor: +headless API. To run it, first initialize a headless build configuration: ``` -$ gn args out/Release +$ mkdir -p out/Debug +$ echo 'import("//build/args/headless.gn")' > out/Debug/args.gn +$ gn gen out/Debug ``` -and enable headless mode with `is_headless = true`. - Then build the shell: ``` -$ ninja -C out/Release headless_shell +$ ninja -C out/Debug headless_shell ``` After the build completes, the headless shell can be run with the following command: ``` -$ out/Release/headless_shell https://www.google.com +$ out/Debug/headless_shell https://www.google.com ``` To attach a [DevTools](https://developer.chrome.com/devtools) debugger to the shell, start it with an argument specifying the debugging port: ``` -$ out/Release/headless_shell --remote-debugging-port=9222 https://youtube.com +$ out/Debug/headless_shell --remote-debugging-port=9222 https://youtube.com ``` Then navigate to `http://127.0.0.1:9222` with your browser.
diff --git a/ios/chrome/browser/autofill/form_input_accessory_view_controller.mm b/ios/chrome/browser/autofill/form_input_accessory_view_controller.mm index f36b2fd..4e819f4 100644 --- a/ios/chrome/browser/autofill/form_input_accessory_view_controller.mm +++ b/ios/chrome/browser/autofill/form_input_accessory_view_controller.mm
@@ -178,10 +178,6 @@ // otherwise. [HACK] - (BOOL)executeFormAssistAction:(NSString*)actionName; -// Runs |block| while allowing the keyboard to be displayed as a result of focus -// changes caused by |block|. -- (void)runBlockAllowingKeyboardDisplay:(ProceduralBlock)block; - // Asynchronously retrieves an accessory view from |_providers|. - (void)retrieveAccessoryViewForForm:(const std::string&)formName field:(const std::string&)fieldName @@ -401,9 +397,7 @@ if (!performedAction) { // We could not find the built-in form assist controls, so try to focus // the next or previous control using JavaScript. - [self runBlockAllowingKeyboardDisplay:^{ - [_JSSuggestionManager closeKeyboard]; - }]; + [_JSSuggestionManager closeKeyboard]; } } @@ -434,16 +428,6 @@ return YES; } -- (void)runBlockAllowingKeyboardDisplay:(ProceduralBlock)block { - DCHECK([UIWebView - instancesRespondToSelector:@selector(keyboardDisplayRequiresUserAction)]); - - BOOL originalValue = [self.webViewProxy keyboardDisplayRequiresUserAction]; - [self.webViewProxy setKeyboardDisplayRequiresUserAction:NO]; - block(); - [self.webViewProxy setKeyboardDisplayRequiresUserAction:originalValue]; -} - #pragma mark - #pragma mark FormInputAccessoryViewDelegate @@ -460,9 +444,7 @@ if (!performedAction) { // We could not find the built-in form assist controls, so try to focus // the next or previous control using JavaScript. - [self runBlockAllowingKeyboardDisplay:^{ - [_JSSuggestionManager selectPreviousElement]; - }]; + [_JSSuggestionManager selectPreviousElement]; } } @@ -479,9 +461,7 @@ if (!performedAction) { // We could not find the built-in form assist controls, so try to focus // the next or previous control using JavaScript. - [self runBlockAllowingKeyboardDisplay:^{ - [_JSSuggestionManager selectNextElement]; - }]; + [_JSSuggestionManager selectNextElement]; } }
diff --git a/ios/web/public/web_state/crw_web_view_proxy.h b/ios/web/public/web_state/crw_web_view_proxy.h index 634b042..0168a89 100644 --- a/ios/web/public/web_state/crw_web_view_proxy.h +++ b/ios/web/public/web_state/crw_web_view_proxy.h
@@ -31,10 +31,6 @@ // fixed. @property(nonatomic, assign) CGFloat topContentPadding; -// A Boolean value indicating whether web content can programmatically display -// the keyboard. -@property(nonatomic, assign) BOOL keyboardDisplayRequiresUserAction; - // Gives the embedder access to the web view's UIScrollView in a limited and // controlled manner. @property(nonatomic, readonly) CRWWebViewScrollViewProxy* scrollViewProxy;
diff --git a/ios/web/web_state/crw_web_view_proxy_impl.mm b/ios/web/web_state/crw_web_view_proxy_impl.mm index b405332..3d105860 100644 --- a/ios/web/web_state/crw_web_view_proxy_impl.mm +++ b/ios/web/web_state/crw_web_view_proxy_impl.mm
@@ -177,16 +177,6 @@ } #endif -- (BOOL)keyboardDisplayRequiresUserAction { - return [_webController keyboardDisplayRequiresUserAction]; -} - -- (void)setKeyboardDisplayRequiresUserAction: - (BOOL)keyboardDisplayRequiresUserAction { - [_webController - setKeyboardDisplayRequiresUserAction:keyboardDisplayRequiresUserAction]; -} - - (BOOL)becomeFirstResponder { return [_contentView becomeFirstResponder]; }
diff --git a/ios/web/web_state/ui/crw_web_controller+protected.h b/ios/web/web_state/ui/crw_web_controller+protected.h index 6fe2462..a1105cc48 100644 --- a/ios/web/web_state/ui/crw_web_controller+protected.h +++ b/ios/web/web_state/ui/crw_web_controller+protected.h
@@ -10,6 +10,7 @@ #import <WebKit/WebKit.h> #include "base/mac/scoped_nsobject.h" +#import "ios/web/public/navigation_manager.h" #include "ios/web/public/referrer.h" #include "ios/web/public/web_state/page_display_state.h" #import "ios/web/web_state/crw_pass_kit_downloader.h" @@ -33,6 +34,19 @@ }; } // namespace web +using web::NavigationManager; +namespace { +// Constants for storing the source of NSErrors received by WKWebViews: +// - Errors received by |-webView:didFailProvisionalNavigation:withError:| are +// recorded using WKWebViewErrorSource::PROVISIONAL_LOAD. These should be +// cancelled. +// - Errors received by |-webView:didFailNavigation:withError:| are recorded +// using WKWebViewsource::NAVIGATION. These errors should not be cancelled, +// as the WKWebView will automatically retry the load. +static NSString* const kWKWebViewErrorSourceKey = @"ErrorSource"; +typedef enum { NONE = 0, PROVISIONAL_LOAD, NAVIGATION } WKWebViewErrorSource; +} // namespace + // URL scheme for messages sent from javascript for asynchronous processing. static NSString* const kScriptMessageName = @"crwebinvoke"; // URL scheme for messages sent from javascript for immediate processing. @@ -103,9 +117,6 @@ - (void)applyWebViewScrollZoomScaleFromZoomState: (const web::PageZoomState&)zoomState; -// Handles cancelled load in WKWebView (error with NSURLErrorCancelled code). -- (void)handleCancelledError:(NSError*)error; - // Creates a web view with given |config|. No-op if web view is already created. - (void)ensureWebViewCreatedWithConfiguration:(WKWebViewConfiguration*)config;
diff --git a/ios/web/web_state/ui/crw_web_controller.h b/ios/web/web_state/ui/crw_web_controller.h index 6e57101..1448f1f 100644 --- a/ios/web/web_state/ui/crw_web_controller.h +++ b/ios/web/web_state/ui/crw_web_controller.h
@@ -110,9 +110,6 @@ // Returns whether the top of the content is visible. @property(nonatomic, readonly) BOOL atTop; -// Whether or not content can programmatically display the keyboard. -@property(nonatomic, assign) BOOL keyboardDisplayRequiresUserAction; - // YES if JavaScript dialogs, HTTP authentication dialogs and window.open // calls should be suppressed. Default is NO. When dialog is suppressed // |CRWWebDelegate webControllerDidSuppressDialog:| will be called.
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index 10ed51e..1a7163e 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -164,6 +164,13 @@ gesture_recognizer.enabled = YES; } } + +// Utility function for getting the source of NSErrors received by WKWebViews. +WKWebViewErrorSource WKWebViewErrorSourceFromError(NSError* error) { + DCHECK(error); + return static_cast<WKWebViewErrorSource>( + [error.userInfo[kWKWebViewErrorSourceKey] integerValue]); +} } // namespace @interface CRWWebController () <CRWNativeContentDelegate, @@ -504,6 +511,13 @@ // Handles 'window.history.go' message. - (BOOL)handleWindowHistoryGoMessage:(base::DictionaryValue*)message context:(NSDictionary*)context; + +// Handles cancelled load in WKWebView (error with NSURLErrorCancelled code). +- (void)handleCancelledError:(NSError*)error; + +// Used to decide whether a load that generates errors with the +// NSURLErrorCancelled code should be cancelled. +- (BOOL)shouldCancelLoadForCancelledError:(NSError*)error; @end namespace { @@ -549,9 +563,6 @@ @synthesize loadPhase = _loadPhase; @synthesize shouldSuppressDialogs = _shouldSuppressDialogs; -// Implemented by subclasses. -@dynamic keyboardDisplayRequiresUserAction; - + (instancetype)allocWithZone:(struct _NSZone*)zone { if (self == [CRWWebController class]) { // This is an abstract class which should not be instantiated directly. @@ -971,19 +982,6 @@ return scrollView.contentOffset.y == -scrollView.contentInset.top; } -- (BOOL)keyboardDisplayRequiresUserAction { - // TODO(stuartmorgan): Find out whether YES or NO is correct. See if we can - // get rid of this (it looks like it may only be fallback code for - // autocomplete that's necessarily used). If not, file a Radar since WKWebView - // doesn't appear to have this property. - NOTIMPLEMENTED(); - return NO; -} - -- (void)setKeyboardDisplayRequiresUserAction:(BOOL)requiresUserAction { - NOTIMPLEMENTED(); -} - - (void)setShouldSuppressDialogs:(BOOL)shouldSuppressDialogs { _shouldSuppressDialogs = shouldSuppressDialogs; if (self.webView) { @@ -2979,9 +2977,25 @@ [self loadErrorInNativeView:error]; } -- (void)handleCancelledError:(NSError*)cancelledError { - // Subclasses must implement this method. - NOTREACHED(); +- (void)handleCancelledError:(NSError*)error { + if ([self shouldCancelLoadForCancelledError:error]) { + [self loadCancelled]; + [[self sessionController] discardNonCommittedEntries]; + } +} + +- (BOOL)shouldCancelLoadForCancelledError:(NSError*)error { + DCHECK_EQ(error.code, NSURLErrorCancelled); + // Do not cancel the load if it is for an app specific URL, as such errors + // are produced during the app specific URL load process. + const GURL errorURL = + net::GURLWithNSURL(error.userInfo[NSURLErrorFailingURLErrorKey]); + if (web::GetWebClient()->IsAppSpecificURL(errorURL)) + return NO; + // Don't cancel NSURLErrorCancelled errors originating from navigation + // as the WKWebView will automatically retry these loads. + WKWebViewErrorSource source = WKWebViewErrorSourceFromError(error); + return source != NAVIGATION; } #pragma mark -
diff --git a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm index 36ecfb3..884a4a00 100644 --- a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm +++ b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
@@ -86,15 +86,6 @@ return [action.request valueForHTTPHeaderField:@"Referer"]; } -// Utility functions for storing the source of NSErrors received by WKWebViews: -// - Errors received by |-webView:didFailProvisionalNavigation:withError:| are -// recorded using WKWebViewErrorSource::PROVISIONAL_LOAD. These should be -// aborted. -// - Errors received by |-webView:didFailNavigation:withError:| are recorded -// using WKWebViewsource::NAVIGATION. These errors should not be aborted, as -// the WKWebView will automatically retry the load. -NSString* const kWKWebViewErrorSourceKey = @"ErrorSource"; -typedef enum { NONE = 0, PROVISIONAL_LOAD, NAVIGATION } WKWebViewErrorSource; NSError* WKWebViewErrorWithSource(NSError* error, WKWebViewErrorSource source) { DCHECK(error); base::scoped_nsobject<NSMutableDictionary> userInfo( @@ -104,12 +95,6 @@ code:error.code userInfo:userInfo]; } -WKWebViewErrorSource WKWebViewErrorSourceFromError(NSError* error) { - DCHECK(error); - return static_cast<WKWebViewErrorSource>( - [error.userInfo[kWKWebViewErrorSourceKey] integerValue]); -} - } // namespace #pragma mark - @@ -345,10 +330,6 @@ // |targetURL|. - (BOOL)isLoadRequestPendingForURL:(const GURL&)targetURL; -// Used to decide whether a load that generates errors with the -// NSURLErrorCancelled code should be cancelled. -- (BOOL)shouldAbortLoadForCancelledError:(NSError*)error; - // Called when WKWebView estimatedProgress has been changed. - (void)webViewEstimatedProgressDidChange; @@ -610,15 +591,6 @@ self.webScrollView.zoomScale = zoomScale; } -- (void)handleCancelledError:(NSError*)error { - if ([self shouldAbortLoadForCancelledError:error]) { - // Do not abort the load for WKWebView, because calling stopLoading may - // stop the subsequent provisional load as well. - [self loadCancelled]; - [[self sessionController] discardNonCommittedEntries]; - } -} - // Override |handleLoadError| to check for PassKit case. - (void)handleLoadError:(NSError*)error inMainFrame:(BOOL)inMainFrame { NSString* MIMEType = [_pendingNavigationInfo MIMEType]; @@ -1166,20 +1138,6 @@ return pendingItem && pendingItem->GetURL() == targetURL; } -- (BOOL)shouldAbortLoadForCancelledError:(NSError*)error { - DCHECK_EQ(error.code, NSURLErrorCancelled); - // Do not abort the load if it is for an app specific URL, as such errors - // are produced during the app specific URL load process. - const GURL errorURL = - net::GURLWithNSURL(error.userInfo[NSURLErrorFailingURLErrorKey]); - if (web::GetWebClient()->IsAppSpecificURL(errorURL)) - return NO; - // Don't abort NSURLErrorCancelled errors originating from navigation - // as the WKWebView will automatically retry these loads. - WKWebViewErrorSource source = WKWebViewErrorSourceFromError(error); - return source != NAVIGATION; -} - #pragma mark - #pragma mark CRWWebViewScrollViewProxyObserver
diff --git a/ios/web/web_state/web_state_impl.mm b/ios/web/web_state/web_state_impl.mm index d787e390..a98110c 100644 --- a/ios/web/web_state/web_state_impl.mm +++ b/ios/web/web_state/web_state_impl.mm
@@ -515,7 +515,9 @@ } GURL WebStateImpl::GetCurrentURL(URLVerificationTrustLevel* trust_level) const { - return [web_controller_ currentURLWithTrustLevel:trust_level]; + GURL URL = [web_controller_ currentURLWithTrustLevel:trust_level]; + DCHECK(URL == GetLastCommittedURL()); + return URL; } void WebStateImpl::AddScriptCommandCallback(
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h index 0747172..c1ad417 100644 --- a/ipc/ipc_channel.h +++ b/ipc/ipc_channel.h
@@ -12,6 +12,7 @@ #include "base/compiler_specific.h" #include "base/files/scoped_file.h" +#include "base/memory/scoped_ptr.h" #include "base/process/process.h" #include "build/build_config.h" #include "ipc/ipc_channel_handle.h"
diff --git a/ipc/unix_domain_socket_util_unittest.cc b/ipc/unix_domain_socket_util_unittest.cc index 49c1c02..2ba8cfe 100644 --- a/ipc/unix_domain_socket_util_unittest.cc +++ b/ipc/unix_domain_socket_util_unittest.cc
@@ -9,6 +9,7 @@ #include "base/files/file_path.h" #include "base/location.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/posix/eintr_wrapper.h" #include "base/single_thread_task_runner.h"
diff --git a/jingle/glue/thread_wrapper.h b/jingle/glue/thread_wrapper.h index c14b8c1b..f1f79f1 100644 --- a/jingle/glue/thread_wrapper.h +++ b/jingle/glue/thread_wrapper.h
@@ -12,6 +12,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h"
diff --git a/media/DEPS b/media/DEPS index 213ce6e..c00fbef 100644 --- a/media/DEPS +++ b/media/DEPS
@@ -17,5 +17,6 @@ "+ui/gl", "+ui/ozone", "+third_party/widevine/cdm/widevine_cdm_common.h", + "-ipc", "-media/blink", ]
diff --git a/media/PRESUBMIT.py b/media/PRESUBMIT.py index d87000b..02bd02b 100644 --- a/media/PRESUBMIT.py +++ b/media/PRESUBMIT.py
@@ -8,6 +8,19 @@ for more details about the presubmit API built into depot_tools. """ +import re +import string + +# Well-defined simple classes containing only <= 4 ints, or <= 2 floats. +BASE_TIME_TYPES = [ + 'base::Time', + 'base::TimeDelta', + 'base::TimeTicks', +] + +BASE_TIME_TYPES_RE = re.compile(r'\bconst (%s)&' % + string.join(BASE_TIME_TYPES, '|')) + def _FilterFile(affected_file): """Return true if the file could contain code requiring a presubmit check.""" return affected_file.LocalPath().endswith( @@ -159,10 +172,29 @@ return [] +def _CheckPassByValue(input_api, output_api): + """Check that base::Time and derived classes are passed by value, and not by + const reference """ + + problems = [] + + for f in input_api.AffectedSourceFiles(_FilterFile): + for line_number, line in f.ChangedContents(): + if BASE_TIME_TYPES_RE.search(line): + problems.append('%s:%d' % (f, line_number)) + + if problems: + return [output_api.PresubmitError( + 'base::Time and derived classes should be passed by value and not by\n' + 'const ref, see base/time/time.h for more information.', problems)] + return [] + + def _CheckChange(input_api, output_api): results = [] results.extend(_CheckForUseOfWrongClock(input_api, output_api)) results.extend(_CheckForMessageLoopProxy(input_api, output_api)) + results.extend(_CheckPassByValue(input_api, output_api)) results.extend(_CheckForHistogramOffByOne(input_api, output_api)) results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) return results
diff --git a/media/audio/audio_output_device.cc b/media/audio/audio_output_device.cc index 7044e9a..1468123 100644 --- a/media/audio/audio_output_device.cc +++ b/media/audio/audio_output_device.cc
@@ -138,27 +138,10 @@ return true; } -OutputDevice* AudioOutputDevice::GetOutputDevice() { - return this; -} - -void AudioOutputDevice::SwitchOutputDevice( - const std::string& device_id, - const url::Origin& security_origin, - const SwitchOutputDeviceCB& callback) { - NOTREACHED(); -} - -AudioParameters AudioOutputDevice::GetOutputParameters() { +OutputDeviceInfo AudioOutputDevice::GetOutputDeviceInfo() { CHECK(!task_runner()->BelongsToCurrentThread()); did_receive_auth_.Wait(); - return output_params_; -} - -OutputDeviceStatus AudioOutputDevice::GetDeviceStatus() { - CHECK(!task_runner()->BelongsToCurrentThread()); - did_receive_auth_.Wait(); - return device_status_; + return OutputDeviceInfo(device_id_, device_status_, output_params_); } void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() {
diff --git a/media/audio/audio_output_device.h b/media/audio/audio_output_device.h index 26f711d..20f4c5b 100644 --- a/media/audio/audio_output_device.h +++ b/media/audio/audio_output_device.h
@@ -75,14 +75,13 @@ #include "media/audio/scoped_task_runner_observer.h" #include "media/base/audio_renderer_sink.h" #include "media/base/media_export.h" -#include "media/base/output_device.h" +#include "media/base/output_device_info.h" namespace media { class MEDIA_EXPORT AudioOutputDevice : NON_EXPORTED_BASE(public AudioRendererSink), NON_EXPORTED_BASE(public AudioOutputIPCDelegate), - NON_EXPORTED_BASE(public OutputDevice), NON_EXPORTED_BASE(public ScopedTaskRunnerObserver) { public: // NOTE: Clients must call Initialize() before using. @@ -104,11 +103,7 @@ void Play() override; void Pause() override; bool SetVolume(double volume) override; - OutputDevice* GetOutputDevice() override; - - // OutputDevice implementation - AudioParameters GetOutputParameters() override; - OutputDeviceStatus GetDeviceStatus() override; + OutputDeviceInfo GetOutputDeviceInfo() override; // Methods called on IO thread ---------------------------------------------- // AudioOutputIPCDelegate methods. @@ -138,11 +133,6 @@ PLAYING, // Playing back. Can Pause()/Stop(). }; - // Unsupported OutputDevice implementation - void SwitchOutputDevice(const std::string& device_id, - const url::Origin& security_origin, - const SwitchOutputDeviceCB& callback) override; - // Methods called on IO thread ---------------------------------------------- // The following methods are tasks posted on the IO thread that need to // be executed on that thread. They use AudioOutputIPC to send IPC messages @@ -203,7 +193,7 @@ bool stopping_hack_; base::WaitableEvent did_receive_auth_; - media::AudioParameters output_params_; + AudioParameters output_params_; OutputDeviceStatus device_status_; DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice);
diff --git a/media/audio/audio_output_ipc.h b/media/audio/audio_output_ipc.h index 607fbfe..d42997ee 100644 --- a/media/audio/audio_output_ipc.h +++ b/media/audio/audio_output_ipc.h
@@ -11,7 +11,7 @@ #include "base/sync_socket.h" #include "media/audio/audio_parameters.h" #include "media/base/media_export.h" -#include "media/base/output_device.h" +#include "media/base/output_device_info.h" #include "url/origin.h" namespace media {
diff --git a/media/audio/audio_output_stream_sink.cc b/media/audio/audio_output_stream_sink.cc index 460dedec..3acc6a8 100644 --- a/media/audio/audio_output_stream_sink.cc +++ b/media/audio/audio_output_stream_sink.cc
@@ -73,8 +73,8 @@ return true; } -OutputDevice* AudioOutputStreamSink::GetOutputDevice() { - return nullptr; +OutputDeviceInfo AudioOutputStreamSink::GetOutputDeviceInfo() { + return OutputDeviceInfo(); } int AudioOutputStreamSink::OnMoreData(AudioBus* dest,
diff --git a/media/audio/audio_output_stream_sink.h b/media/audio/audio_output_stream_sink.h index 9981a66..d8656ee 100644 --- a/media/audio/audio_output_stream_sink.h +++ b/media/audio/audio_output_stream_sink.h
@@ -39,7 +39,7 @@ void Pause() override; void Play() override; bool SetVolume(double volume) override; - OutputDevice* GetOutputDevice() override; + OutputDeviceInfo GetOutputDeviceInfo() override; // AudioSourceCallback implementation. int OnMoreData(AudioBus* dest,
diff --git a/media/audio/audio_parameters.cc b/media/audio/audio_parameters.cc index 10f41d5..8f364cf 100644 --- a/media/audio/audio_parameters.cc +++ b/media/audio/audio_parameters.cc
@@ -96,4 +96,12 @@ effects_ == other.effects() && mic_positions_ == other.mic_positions_; } +// static +AudioParameters AudioParameters::UnavailableDeviceParams() { + return media::AudioParameters( + media::AudioParameters::AUDIO_FAKE, media::CHANNEL_LAYOUT_STEREO, + media::AudioParameters::kAudioCDSampleRate, 16, + media::AudioParameters::kAudioCDSampleRate / 10); +} + } // namespace media
diff --git a/media/audio/audio_parameters.h b/media/audio/audio_parameters.h index 2735d79..d7d730b 100644 --- a/media/audio/audio_parameters.h +++ b/media/audio/audio_parameters.h
@@ -177,6 +177,9 @@ AudioParameters(const AudioParameters&); AudioParameters& operator=(const AudioParameters&); + // Creates reasonable dummy parameters in case no device is available. + static AudioParameters UnavailableDeviceParams(); + private: Format format_; // Format of the stream. ChannelLayout channel_layout_; // Order of surround sound channels.
diff --git a/media/audio/clockless_audio_sink.cc b/media/audio/clockless_audio_sink.cc index 33d6aff..ede067cd 100644 --- a/media/audio/clockless_audio_sink.cc +++ b/media/audio/clockless_audio_sink.cc
@@ -121,8 +121,8 @@ return volume == 0.0; } -OutputDevice* ClocklessAudioSink::GetOutputDevice() { - return nullptr; +OutputDeviceInfo ClocklessAudioSink::GetOutputDeviceInfo() { + return OutputDeviceInfo(); } void ClocklessAudioSink::StartAudioHashForTesting() {
diff --git a/media/audio/clockless_audio_sink.h b/media/audio/clockless_audio_sink.h index aad71b8..f458b9f 100644 --- a/media/audio/clockless_audio_sink.h +++ b/media/audio/clockless_audio_sink.h
@@ -19,7 +19,6 @@ namespace media { class AudioBus; class ClocklessAudioSinkThread; -class OutputDevice; // Implementation of an AudioRendererSink that consumes the audio as fast as // possible. This class does not support multiple Play()/Pause() events. @@ -36,7 +35,7 @@ void Pause() override; void Play() override; bool SetVolume(double volume) override; - OutputDevice* GetOutputDevice() override; + OutputDeviceInfo GetOutputDeviceInfo() override; // Returns the time taken to consume all the audio. base::TimeDelta render_time() { return playback_time_; }
diff --git a/media/audio/null_audio_sink.cc b/media/audio/null_audio_sink.cc index e9f65fd4..6d40c93 100644 --- a/media/audio/null_audio_sink.cc +++ b/media/audio/null_audio_sink.cc
@@ -75,8 +75,14 @@ return volume == 0.0; } -OutputDevice* NullAudioSink::GetOutputDevice() { - return nullptr; +OutputDeviceInfo NullAudioSink::GetOutputDeviceInfo() { + return OutputDeviceInfo(); +} + +void NullAudioSink::SwitchOutputDevice(const std::string& device_id, + const url::Origin& security_origin, + const OutputDeviceStatusCB& callback) { + callback.Run(OUTPUT_DEVICE_STATUS_ERROR_INTERNAL); } void NullAudioSink::CallRender() {
diff --git a/media/audio/null_audio_sink.h b/media/audio/null_audio_sink.h index 5d4e7bc..eebdb14 100644 --- a/media/audio/null_audio_sink.h +++ b/media/audio/null_audio_sink.h
@@ -19,10 +19,9 @@ class AudioBus; class AudioHash; class FakeAudioWorker; -class OutputDevice; class MEDIA_EXPORT NullAudioSink - : NON_EXPORTED_BASE(public RestartableAudioRendererSink) { + : NON_EXPORTED_BASE(public SwitchableAudioRendererSink) { public: NullAudioSink(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); @@ -34,7 +33,10 @@ void Pause() override; void Play() override; bool SetVolume(double volume) override; - OutputDevice* GetOutputDevice() override; + OutputDeviceInfo GetOutputDeviceInfo() override; + void SwitchOutputDevice(const std::string& device_id, + const url::Origin& security_origin, + const OutputDeviceStatusCB& callback) override; // Enables audio frame hashing. Must be called prior to Initialize(). void StartAudioHashForTesting();
diff --git a/media/base/BUILD.gn b/media/base/BUILD.gn index 6ed3bfa..c021356 100644 --- a/media/base/BUILD.gn +++ b/media/base/BUILD.gn
@@ -155,7 +155,8 @@ "multi_channel_resampler.h", "null_video_sink.cc", "null_video_sink.h", - "output_device.h", + "output_device_info.cc", + "output_device_info.h", "pipeline.h", "pipeline_impl.cc", "pipeline_impl.h", @@ -358,8 +359,6 @@ "fake_demuxer_stream.h", "fake_media_resources.cc", "fake_media_resources.h", - "fake_output_device.cc", - "fake_output_device.h", "fake_single_thread_task_runner.cc", "fake_single_thread_task_runner.h", "fake_text_track_stream.cc",
diff --git a/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java b/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java index a74d9862..917a5f2 100644 --- a/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java +++ b/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java
@@ -56,6 +56,10 @@ private static final char[] HEX_CHAR_LOOKUP = "0123456789ABCDEF".toCharArray(); private static final long INVALID_NATIVE_MEDIA_DRM_BRIDGE = 0; + // Scheme UUID for Widevine. See http://dashif.org/identifiers/protection/ + private static final UUID WIDEVINE_UUID = + UUID.fromString("edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"); + // On Android L and before, MediaDrm doesn't support KeyStatus. Use a dummy // key ID to report key status info. // See details: https://github.com/w3c/encrypted-media/issues/32 @@ -181,6 +185,10 @@ return mNativeMediaDrmBridge != INVALID_NATIVE_MEDIA_DRM_BRIDGE; } + private boolean isWidevine() { + return mSchemeUUID.equals(WIDEVINE_UUID); + } + @TargetApi(Build.VERSION_CODES.M) private MediaDrmBridge(UUID schemeUUID, long nativeMediaDrmBridge) throws android.media.UnsupportedSchemeException { @@ -201,8 +209,10 @@ mMediaDrm.setOnKeyStatusChangeListener(new KeyStatusChangeListener(), null); } - mMediaDrm.setPropertyString(PRIVACY_MODE, ENABLE); - mMediaDrm.setPropertyString(SESSION_SHARING, ENABLE); + if (isWidevine()) { + mMediaDrm.setPropertyString(PRIVACY_MODE, ENABLE); + mMediaDrm.setPropertyString(SESSION_SHARING, ENABLE); + } } /** @@ -353,6 +363,11 @@ * @return whether the security level was successfully set. */ private boolean setSecurityLevel(String securityLevel) { + if (!isWidevine()) { + Log.d(TAG, "Security level is not supported."); + return true; + } + assert mMediaDrm != null; assert !securityLevel.isEmpty(); @@ -386,6 +401,11 @@ */ @CalledByNative private boolean setServerCertificate(byte[] certificate) { + if (!isWidevine()) { + Log.d(TAG, "Setting server certificate is not supported."); + return true; + } + try { mMediaDrm.setPropertyByteArray(SERVER_CERTIFICATE, certificate); return true; @@ -735,8 +755,8 @@ */ @CalledByNative private String getSecurityLevel() { - if (mMediaDrm == null) { - Log.e(TAG, "getSecurityLevel() called when MediaDrm is null."); + if (mMediaDrm == null || !isWidevine()) { + Log.e(TAG, "getSecurityLevel(): MediaDrm is null or security level is not supported."); return null; } return mMediaDrm.getPropertyString("securityLevel");
diff --git a/media/base/audio_pull_fifo.h b/media/base/audio_pull_fifo.h index 79173f55..61e8332a 100644 --- a/media/base/audio_pull_fifo.h +++ b/media/base/audio_pull_fifo.h
@@ -7,6 +7,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "media/base/media_export.h" namespace media {
diff --git a/media/base/audio_renderer_mixer.cc b/media/base/audio_renderer_mixer.cc index a2b5e89..d6cca18 100644 --- a/media/base/audio_renderer_mixer.cc +++ b/media/base/audio_renderer_mixer.cc
@@ -112,10 +112,10 @@ NOTREACHED(); } -OutputDevice* AudioRendererMixer::GetOutputDevice() { +OutputDeviceInfo AudioRendererMixer::GetOutputDeviceInfo() { DVLOG(1) << __FUNCTION__; base::AutoLock auto_lock(lock_); - return audio_sink_->GetOutputDevice(); + return audio_sink_->GetOutputDeviceInfo(); } int AudioRendererMixer::Render(AudioBus* audio_bus,
diff --git a/media/base/audio_renderer_mixer.h b/media/base/audio_renderer_mixer.h index 042c4be..9c71210 100644 --- a/media/base/audio_renderer_mixer.h +++ b/media/base/audio_renderer_mixer.h
@@ -46,11 +46,7 @@ pause_delay_ = delay; } - // TODO(guidou): remove this method. The output device of a mixer should - // never be switched, as it may result in a discrepancy between the output - // parameters of the new device and the output parameters with which the - // mixer was initialized. See crbug.com/506507 - OutputDevice* GetOutputDevice(); + OutputDeviceInfo GetOutputDeviceInfo(); private: // Maps input sample rate to the dedicated converter.
diff --git a/media/base/audio_renderer_mixer_input.cc b/media/base/audio_renderer_mixer_input.cc index e47cbea3..55dbfc8 100644 --- a/media/base/audio_renderer_mixer_input.cc +++ b/media/base/audio_renderer_mixer_input.cc
@@ -15,7 +15,6 @@ AudioRendererMixerInput::AudioRendererMixerInput( const GetMixerCB& get_mixer_cb, const RemoveMixerCB& remove_mixer_cb, - const GetHardwareParamsCB& get_hardware_params_cb, const std::string& device_id, const url::Origin& security_origin) : started_(false), @@ -23,7 +22,6 @@ volume_(1.0f), get_mixer_cb_(get_mixer_cb), remove_mixer_cb_(remove_mixer_cb), - get_hardware_params_cb_(get_hardware_params_cb), device_id_(device_id), security_origin_(security_origin), mixer_(nullptr), @@ -113,14 +111,14 @@ return true; } -OutputDevice* AudioRendererMixerInput::GetOutputDevice() { - return this; +OutputDeviceInfo AudioRendererMixerInput::GetOutputDeviceInfo() { + return mixer_ ? mixer_->GetOutputDeviceInfo() : OutputDeviceInfo(); } void AudioRendererMixerInput::SwitchOutputDevice( const std::string& device_id, const url::Origin& security_origin, - const SwitchOutputDeviceCB& callback) { + const OutputDeviceStatusCB& callback) { if (!mixer_) { if (pending_switch_callback_.is_null()) { pending_switch_callback_ = callback; @@ -161,22 +159,6 @@ callback.Run(OUTPUT_DEVICE_STATUS_OK); } -AudioParameters AudioRendererMixerInput::GetOutputParameters() { - if (mixer_) - return mixer_->GetOutputDevice()->GetOutputParameters(); - return get_hardware_params_cb_.Run(device_id_, security_origin_); -} - -OutputDeviceStatus AudioRendererMixerInput::GetDeviceStatus() { - if (mixer_) - return mixer_->GetOutputDevice()->GetDeviceStatus(); - - if (started_) - return OUTPUT_DEVICE_STATUS_ERROR_INTERNAL; - - return OUTPUT_DEVICE_STATUS_OK; -} - double AudioRendererMixerInput::ProvideInput(AudioBus* audio_bus, base::TimeDelta buffer_delay) { // TODO(chcunningham): Delete this conversion and change ProvideInput to more
diff --git a/media/base/audio_renderer_mixer_input.h b/media/base/audio_renderer_mixer_input.h index 9d91b14..a75320e 100644 --- a/media/base/audio_renderer_mixer_input.h +++ b/media/base/audio_renderer_mixer_input.h
@@ -23,7 +23,6 @@ #include "base/synchronization/lock.h" #include "media/base/audio_converter.h" #include "media/base/audio_renderer_sink.h" -#include "media/base/output_device.h" #include "url/origin.h" namespace media { @@ -31,8 +30,7 @@ class AudioRendererMixer; class MEDIA_EXPORT AudioRendererMixerInput - : NON_EXPORTED_BASE(public RestartableAudioRendererSink), - NON_EXPORTED_BASE(public OutputDevice), + : NON_EXPORTED_BASE(public SwitchableAudioRendererSink), public AudioConverter::InputCallback { public: typedef base::Callback<AudioRendererMixer*(const AudioParameters& params, @@ -45,32 +43,23 @@ const url::Origin& security_origin)> RemoveMixerCB; - typedef base::Callback<AudioParameters(const std::string& device_id, - const url::Origin& security_origin)> - GetHardwareParamsCB; - AudioRendererMixerInput(const GetMixerCB& get_mixer_cb, const RemoveMixerCB& remove_mixer_cb, - const GetHardwareParamsCB& get_hardware_params_cb, const std::string& device_id, const url::Origin& security_origin); - // RestartableAudioRendererSink implementation. + // SwitchableAudioRendererSink implementation. void Start() override; void Stop() override; void Play() override; void Pause() override; bool SetVolume(double volume) override; - OutputDevice* GetOutputDevice() override; + OutputDeviceInfo GetOutputDeviceInfo() override; void Initialize(const AudioParameters& params, AudioRendererSink::RenderCallback* renderer) override; - - // OutputDevice implementation. void SwitchOutputDevice(const std::string& device_id, const url::Origin& security_origin, - const SwitchOutputDeviceCB& callback) override; - AudioParameters GetOutputParameters() override; - OutputDeviceStatus GetDeviceStatus() override; + const OutputDeviceStatusCB& callback) override; // Called by AudioRendererMixer when an error occurs. void OnRenderError(); @@ -98,10 +87,6 @@ const GetMixerCB get_mixer_cb_; const RemoveMixerCB remove_mixer_cb_; - // Callbacks provided during construction which allows AudioRendererMixerInput - // to access hardware output parameters when it is detached from the mixer. - const GetHardwareParamsCB get_hardware_params_cb_; - // AudioParameters received during Initialize(). AudioParameters params_; @@ -121,7 +106,7 @@ // Pending switch-device callback, in case SwitchOutputDevice() is invoked // before Start() - SwitchOutputDeviceCB pending_switch_callback_; + OutputDeviceStatusCB pending_switch_callback_; std::string pending_switch_device_id_; url::Origin pending_switch_security_origin_;
diff --git a/media/base/audio_renderer_mixer_input_unittest.cc b/media/base/audio_renderer_mixer_input_unittest.cc index 42c5179..b9a2c7b 100644 --- a/media/base/audio_renderer_mixer_input_unittest.cc +++ b/media/base/audio_renderer_mixer_input_unittest.cc
@@ -44,8 +44,6 @@ base::Unretained(this)), base::Bind(&AudioRendererMixerInputTest::RemoveMixer, base::Unretained(this)), - base::Bind(&AudioRendererMixerInputTest::GetOutputHWParams, - base::Unretained(this)), device_id, url::Origin()); } @@ -89,9 +87,6 @@ const std::string&, const url::Origin&)); - MOCK_METHOD2(GetOutputHWParams, - AudioParameters(const std::string&, const url::Origin&)); - MOCK_METHOD1(SwitchCallbackCalled, void(OutputDeviceStatus)); void SwitchCallback(base::RunLoop* loop, OutputDeviceStatus result) { SwitchCallbackCalled(result);
diff --git a/media/base/audio_renderer_mixer_unittest.cc b/media/base/audio_renderer_mixer_unittest.cc index 102a773e..f338a69 100644 --- a/media/base/audio_renderer_mixer_unittest.cc +++ b/media/base/audio_renderer_mixer_unittest.cc
@@ -95,9 +95,6 @@ const std::string&, const url::Origin&)); - MOCK_METHOD2(GetOutputHWParams, - AudioParameters(const std::string&, const url::Origin&)); - void InitializeInputs(int inputs_per_sample_rate) { mixer_inputs_.reserve(inputs_per_sample_rate * input_parameters_.size()); fake_callbacks_.reserve(inputs_per_sample_rate * input_parameters_.size()); @@ -119,8 +116,6 @@ base::Unretained(this)), base::Bind(&AudioRendererMixerTest::RemoveMixer, base::Unretained(this)), - base::Bind(&AudioRendererMixerTest::GetOutputHWParams, - base::Unretained(this)), // Default device ID and security origin. std::string(), url::Origin())); mixer_inputs_[input]->Initialize(input_parameters_[i], @@ -469,13 +464,11 @@ // not call RemoveMixer(). TEST_P(AudioRendererMixerBehavioralTest, NoInitialize) { EXPECT_CALL(*this, RemoveMixer(testing::_, testing::_, testing::_)).Times(0); - scoped_refptr<AudioRendererMixerInput> audio_renderer_mixer = + scoped_refptr<AudioRendererMixerInput> audio_renderer_mixer_input = new AudioRendererMixerInput( base::Bind(&AudioRendererMixerTest::GetMixer, base::Unretained(this)), base::Bind(&AudioRendererMixerTest::RemoveMixer, base::Unretained(this)), - base::Bind(&AudioRendererMixerTest::GetOutputHWParams, - base::Unretained(this)), // Default device ID and security origin. std::string(), url::Origin()); }
diff --git a/media/base/audio_renderer_sink.h b/media/base/audio_renderer_sink.h index ac845f3f..01be101 100644 --- a/media/base/audio_renderer_sink.h +++ b/media/base/audio_renderer_sink.h
@@ -8,21 +8,13 @@ #include <stdint.h> #include <string> -#include <vector> #include "base/callback.h" -#include "base/logging.h" #include "base/memory/ref_counted.h" -#include "media/audio/audio_output_ipc.h" #include "media/audio/audio_parameters.h" #include "media/base/audio_bus.h" -#include "media/base/media_export.h" -#include "media/base/output_device.h" -#include "url/gurl.h" - -namespace base { -class SingleThreadTaskRunner; -} +#include "media/base/output_device_info.h" +#include "url/origin.h" namespace media { @@ -71,12 +63,12 @@ // Returns |true| on success. virtual bool SetVolume(double volume) = 0; - // Returns a pointer to the internal output device. - // This pointer is not to be owned by the caller and is valid only during - // the lifetime of the AudioRendererSink. - // It can be null, which means that access to the output device is not - // supported. - virtual OutputDevice* GetOutputDevice() = 0; + // Returns current output device information. If the information is not + // available yet, this method may block until it becomes available. + // If the sink is not associated with any output device, |device_status| of + // OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL. + // Must never be called on the IO thread. + virtual OutputDeviceInfo GetOutputDeviceInfo() = 0; protected: friend class base::RefCountedThreadSafe<AudioRendererSink>; @@ -93,6 +85,21 @@ ~RestartableAudioRendererSink() override {} }; +class SwitchableAudioRendererSink : public RestartableAudioRendererSink { + public: + // Attempts to switch the audio output device associated with a sink. + // Once the attempt is finished, |callback| is invoked with the + // result of the operation passed as a parameter. The result is a value from + // the media::OutputDeviceStatus enum. + // There is no guarantee about the thread where |callback| will be invoked. + virtual void SwitchOutputDevice(const std::string& device_id, + const url::Origin& security_origin, + const OutputDeviceStatusCB& callback) = 0; + + protected: + ~SwitchableAudioRendererSink() override {} +}; + } // namespace media #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_
diff --git a/media/base/bind_to_current_loop.h b/media/base/bind_to_current_loop.h index 2d7609f1..8c14e9e 100644 --- a/media/base/bind_to_current_loop.h +++ b/media/base/bind_to_current_loop.h
@@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/location.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/single_thread_task_runner.h" #include "base/thread_task_runner_handle.h"
diff --git a/media/base/bitstream_buffer.h b/media/base/bitstream_buffer.h index c8983f2..000836e 100644 --- a/media/base/bitstream_buffer.h +++ b/media/base/bitstream_buffer.h
@@ -11,11 +11,15 @@ #include "base/macros.h" #include "base/memory/shared_memory.h" #include "base/time/time.h" -#include "ipc/ipc_param_traits.h" #include "media/base/decrypt_config.h" #include "media/base/media_export.h" #include "media/base/timestamp_constants.h" +namespace IPC { +template <class P> +struct ParamTraits; +} + namespace media { // Class for passing bitstream buffers around. Does not take ownership of the
diff --git a/media/base/demuxer.h b/media/base/demuxer.h index 6e1344b..027264b 100644 --- a/media/base/demuxer.h +++ b/media/base/demuxer.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "media/base/data_source.h" #include "media/base/demuxer_stream.h"
diff --git a/media/base/fake_audio_renderer_sink.cc b/media/base/fake_audio_renderer_sink.cc index 5ce6074..40c3cdf9 100644 --- a/media/base/fake_audio_renderer_sink.cc +++ b/media/base/fake_audio_renderer_sink.cc
@@ -7,15 +7,20 @@ #include "base/bind.h" #include "base/location.h" #include "base/logging.h" -#include "base/single_thread_task_runner.h" -#include "media/base/fake_output_device.h" namespace media { FakeAudioRendererSink::FakeAudioRendererSink() : state_(kUninitialized), callback_(NULL), - output_device_(new FakeOutputDevice) {} + output_device_info_( + std::string(), + OUTPUT_DEVICE_STATUS_OK, + media::AudioParameters(media::AudioParameters::AUDIO_FAKE, + media::CHANNEL_LAYOUT_STEREO, + media::AudioParameters::kTelephoneSampleRate, + 16, + 1)) {} FakeAudioRendererSink::~FakeAudioRendererSink() { DCHECK(!callback_); @@ -56,8 +61,8 @@ return true; } -OutputDevice* FakeAudioRendererSink::GetOutputDevice() { - return output_device_.get(); +OutputDeviceInfo FakeAudioRendererSink::GetOutputDeviceInfo() { + return output_device_info_; } bool FakeAudioRendererSink::Render(AudioBus* dest,
diff --git a/media/base/fake_audio_renderer_sink.h b/media/base/fake_audio_renderer_sink.h index afdd018..b69c1b477c 100644 --- a/media/base/fake_audio_renderer_sink.h +++ b/media/base/fake_audio_renderer_sink.h
@@ -12,11 +12,10 @@ #include "base/macros.h" #include "media/audio/audio_parameters.h" #include "media/base/audio_renderer_sink.h" +#include "media/base/output_device_info.h" namespace media { -class FakeOutputDevice; - class FakeAudioRendererSink : public AudioRendererSink { public: enum State { @@ -37,7 +36,7 @@ void Pause() override; void Play() override; bool SetVolume(double volume) override; - OutputDevice* GetOutputDevice() override; + OutputDeviceInfo GetOutputDeviceInfo() override; // Attempts to call Render() on the callback provided to // Initialize() with |dest| and |audio_delay_milliseconds|. @@ -61,7 +60,7 @@ State state_; RenderCallback* callback_; - scoped_ptr<FakeOutputDevice> output_device_; + OutputDeviceInfo output_device_info_; DISALLOW_COPY_AND_ASSIGN(FakeAudioRendererSink); };
diff --git a/media/base/fake_output_device.cc b/media/base/fake_output_device.cc deleted file mode 100644 index 2f7c8e7..0000000 --- a/media/base/fake_output_device.cc +++ /dev/null
@@ -1,36 +0,0 @@ -// Copyright (c) 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. - -#include "media/base/fake_output_device.h" - -#include "base/callback.h" - -namespace media { - -FakeOutputDevice::FakeOutputDevice() - : FakeOutputDevice(OUTPUT_DEVICE_STATUS_OK) {} - -FakeOutputDevice::FakeOutputDevice(OutputDeviceStatus device_status) - : device_status_(device_status) {} - -FakeOutputDevice::~FakeOutputDevice() {} - -void FakeOutputDevice::SwitchOutputDevice( - const std::string& device_id, - const url::Origin& security_origin, - const SwitchOutputDeviceCB& callback) { - callback.Run(device_status_); -} - -AudioParameters FakeOutputDevice::GetOutputParameters() { - return media::AudioParameters( - media::AudioParameters::AUDIO_FAKE, media::CHANNEL_LAYOUT_STEREO, - media::AudioParameters::kTelephoneSampleRate, 16, 1); -} - -OutputDeviceStatus FakeOutputDevice::GetDeviceStatus() { - return device_status_; -} - -} // namespace media
diff --git a/media/base/fake_output_device.h b/media/base/fake_output_device.h deleted file mode 100644 index 45a6abb..0000000 --- a/media/base/fake_output_device.h +++ /dev/null
@@ -1,35 +0,0 @@ -// Copyright (c) 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. - -#ifndef MEDIA_BASE_FAKE_OUTPUT_DEVICE_H_ -#define MEDIA_BASE_FAKE_OUTPUT_DEVICE_H_ - -#include <string> - -#include "base/macros.h" -#include "media/base/output_device.h" - -namespace media { - -class FakeOutputDevice : public OutputDevice { - public: - FakeOutputDevice(); - explicit FakeOutputDevice(OutputDeviceStatus status); - ~FakeOutputDevice() override; - - // OutputDevice implementation. - void SwitchOutputDevice(const std::string& device_id, - const url::Origin& security_origin, - const SwitchOutputDeviceCB& callback) override; - AudioParameters GetOutputParameters() override; - OutputDeviceStatus GetDeviceStatus() override; - - private: - OutputDeviceStatus device_status_; - DISALLOW_COPY_AND_ASSIGN(FakeOutputDevice); -}; - -} // namespace media - -#endif // MEDIA_BASE_FAKE_OUTPUT_DEVICE_H_
diff --git a/media/base/mime_util_internal.cc b/media/base/mime_util_internal.cc index c86dd6f..eb998c5 100644 --- a/media/base/mime_util_internal.cc +++ b/media/base/mime_util_internal.cc
@@ -20,71 +20,6 @@ namespace media { namespace internal { -enum MediaFormatType { COMMON, PROPRIETARY }; - -struct MediaFormat { - const char* const mime_type; - MediaFormatType format_type; - const char* const codecs_list; -}; - -// Strings used as the |codecs_list| only need one valid unambiguous variant for -// each supported MimeUtil::Codec enum value. Each codec string is parsed and -// mapped to corresponding MimeUtil::Codec value. See https://crbug.com/461009. -#if defined(USE_PROPRIETARY_CODECS) -static const char kMP4AudioCodecsExpression[] = -#if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) - "ac-3,ec-3," // AC-3 and E-AC-3. -#endif - "mp4a.66,mp4a.69,mp4a.40.2"; // MPEG-2 AAC, MP3, and MPEG-4 AAC. -static const char kMP4VideoCodecsExpression[] = - "avc1.42E00A," -#if BUILDFLAG(ENABLE_HEVC_DEMUXING) - "hev1.1.6.L93.B0," -#endif -#if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) - "ac-3,ec-3," // AC-3 and E-AC-3. -#endif - "mp4a.66,mp4a.69,mp4a.40.2"; // MPEG-2 AAC, MP3, and MPEG-4 AAC. -#endif // USE_PROPRIETARY_CODECS - -// A list of media types (https://en.wikipedia.org/wiki/Media_type) and -// corresponding media codecs supported by these types/containers. -// Media formats marked as PROPRIETARY are not supported by Chromium, only -// Google Chrome browser supports them. -static const MediaFormat kFormatCodecMappings[] = { - {"video/webm", COMMON, "opus,vorbis,vp8,vp9"}, - {"audio/webm", COMMON, "opus,vorbis"}, - {"audio/wav", COMMON, "1"}, - {"audio/x-wav", COMMON, "1"}, -#if !defined(OS_ANDROID) - // Note: Android does not support Theora and thus video/ogg. - {"video/ogg", COMMON, "opus,theora,vorbis"}, -#endif - {"audio/ogg", COMMON, "opus,vorbis"}, - // Note: Theora is not supported on Android and will be rejected during the - // call to IsCodecSupportedOnPlatform(). - {"application/ogg", COMMON, "opus,theora,vorbis"}, -#if defined(USE_PROPRIETARY_CODECS) - {"audio/mpeg", PROPRIETARY, "mp3"}, - {"audio/mp3", PROPRIETARY, ""}, - {"audio/x-mp3", PROPRIETARY, ""}, - {"audio/aac", PROPRIETARY, ""}, // AAC / ADTS - {"audio/mp4", PROPRIETARY, kMP4AudioCodecsExpression}, - {"audio/x-m4a", PROPRIETARY, kMP4AudioCodecsExpression}, - {"video/mp4", PROPRIETARY, kMP4VideoCodecsExpression}, - {"video/x-m4v", PROPRIETARY, kMP4VideoCodecsExpression}, -#if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) - {"video/mp2t", PROPRIETARY, kMP4VideoCodecsExpression}, -#endif -#if defined(OS_ANDROID) - // HTTP Live Streaming (HLS) - {"application/x-mpegurl", PROPRIETARY, kMP4VideoCodecsExpression}, - {"application/vnd.apple.mpegurl", PROPRIETARY, kMP4VideoCodecsExpression} -#endif -#endif // USE_PROPRIETARY_CODECS -}; - struct CodecIDMappings { const char* const codec_id; MimeUtil::Codec codec; @@ -99,7 +34,7 @@ // avc1/avc3.XXXXXX may be unambiguous; handled by ParseAVCCodecId(). // hev1/hvc1.XXXXXX may be unambiguous; handled by ParseHEVCCodecID(). {"mp3", MimeUtil::MP3}, - // Following is the list of RFC 6381 compliant audio codecs: + // Following is the list of RFC 6381 compliant audio codec strings: // mp4a.66 - MPEG-2 AAC MAIN // mp4a.67 - MPEG-2 AAC LC // mp4a.68 - MPEG-2 AAC SSR @@ -297,7 +232,6 @@ } void MimeUtil::InitializeMimeTypeMaps() { -// Initialize the supported media types. #if defined(USE_PROPRIETARY_CODECS) allow_proprietary_codecs_ = true; #endif @@ -312,23 +246,110 @@ CodecEntry(kAmbiguousCodecStringMap[i].codec, true); } - // Initialize the supported media formats. - for (size_t i = 0; i < arraysize(kFormatCodecMappings); ++i) { - std::vector<std::string> mime_type_codecs; - ParseCodecString(kFormatCodecMappings[i].codecs_list, &mime_type_codecs, - false); + AddSupportedMediaFormats(); +} - CodecSet codecs; - for (size_t j = 0; j < mime_type_codecs.size(); ++j) { - Codec codec = INVALID_CODEC; - bool is_ambiguous = true; - CHECK(StringToCodec(mime_type_codecs[j], &codec, &is_ambiguous)); - DCHECK(!is_ambiguous); - codecs.insert(codec); - } +// Each call to AddContainerWithCodecs() contains a media type +// (https://en.wikipedia.org/wiki/Media_type) and corresponding media codec(s) +// supported by these types/containers. +// +// Strings used as the |codecs_list| only need one valid unambiguous variant for +// each supported MimeUtil::Codec enum value. Each codec string is parsed and +// mapped to corresponding MimeUtil::Codec value. See https://crbug.com/461009. +void MimeUtil::AddSupportedMediaFormats() { + const std::string ogg_audio_codecs = "opus,vorbis"; + std::string ogg_video_codecs; +#if !defined(OS_ANDROID) + ogg_video_codecs = "theora"; +#endif // !defined(OS_ANDROID) + std::string ogg_codecs = ogg_audio_codecs; + if (!ogg_video_codecs.empty()) + ogg_codecs += "," + ogg_video_codecs; - media_format_map_[kFormatCodecMappings[i].mime_type] = codecs; +#if defined(USE_PROPRIETARY_CODECS) + const std::string aac = "mp4a.66,mp4a.40.2"; // MPEG-2 and MPEG-4 AAC. + const std::string mp3 = "mp4a.69"; + const std::string avc = "avc1.42E00A"; + + const std::string avc_and_aac = avc + "," + aac; + std::string mp4_audio_codecs = aac + "," + mp3; +#if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) + mp4_audio_codecs += ",ac-3,ec-3"; // AC-3 and E-AC-3. +#endif // BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) + + std::string mp4_video_codecs = avc; +#if BUILDFLAG(ENABLE_HEVC_DEMUXING) + mp4_video_codecs += ",hev1.1.6.L93.B0"; +#endif // BUILDFLAG(ENABLE_HEVC_DEMUXING) + const std::string mp4_codecs = mp4_video_codecs + "," + mp4_audio_codecs; +#endif // defined(USE_PROPRIETARY_CODECS) + + AddContainerWithCodecs("audio/wav", "1", false); + AddContainerWithCodecs("audio/x-wav", "1", false); + AddContainerWithCodecs("audio/webm", "opus,vorbis", false); + AddContainerWithCodecs("video/webm", "opus,vorbis,vp8,vp9", false); + AddContainerWithCodecs("audio/ogg", ogg_audio_codecs, false); + // video/ogg is only supported if an appropriate video codec is supported. + // Note: This assumes such codecs cannot be later excluded. + if (!ogg_video_codecs.empty()) + AddContainerWithCodecs("video/ogg", ogg_codecs, false); + // TODO(ddorwin): Should the application type support Opus? + AddContainerWithCodecs("application/ogg", ogg_codecs, false); + +#if defined(USE_PROPRIETARY_CODECS) + AddContainerWithCodecs("audio/mpeg", "mp3", true); + AddContainerWithCodecs("audio/mp3", "", true); + AddContainerWithCodecs("audio/x-mp3", "", true); + AddContainerWithCodecs("audio/aac", "", true); // AAC / ADTS + AddContainerWithCodecs("audio/mp4", mp4_audio_codecs, true); + DCHECK(!mp4_video_codecs.empty()); + AddContainerWithCodecs("video/mp4", mp4_codecs, true); + // These strings are supported for backwards compatibility only and thus only + // support the codecs needed for compatibility. + AddContainerWithCodecs("audio/x-m4a", aac, true); + AddContainerWithCodecs("video/x-m4v", avc_and_aac, true); + +#if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) + // TODO(ddorwin): Exactly which codecs should be supported? + DCHECK(!mp4_video_codecs.empty()); + AddContainerWithCodecs("video/mp2t", mp4_codecs, true); +#endif // BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) +#if defined(OS_ANDROID) + // HTTP Live Streaming (HLS). + // TODO(ddorwin): Is any MP3 codec string variant included in real queries? + const std::string hls_codecs = avc_and_aac + "," + mp3; + AddContainerWithCodecs("application/x-mpegurl", hls_codecs, true); + AddContainerWithCodecs("application/vnd.apple.mpegurl", hls_codecs, true); +#endif // defined(OS_ANDROID) +#endif // defined(USE_PROPRIETARY_CODECS) +} + +// TODO(ddorwin): Replace |codecs_list| with a vector of MimeUtil::Codec values. +// See https://crbug.com/461009. +void MimeUtil::AddContainerWithCodecs(const std::string& mime_type, + const std::string& codecs_list, + bool is_proprietary_mime_type) { +#if !defined(USE_PROPRIETARY_CODECS) + DCHECK(!is_proprietary_mime_type); +#endif + + std::vector<std::string> codec_strings; + ParseCodecString(codecs_list, &codec_strings, false); + + CodecSet codecs; + for (const auto& codec_string : codec_strings) { + DCHECK(!codec_string.empty()) << codecs_list; + Codec codec = INVALID_CODEC; + bool is_ambiguous = true; + CHECK(StringToCodec(codec_string, &codec, &is_ambiguous)); + DCHECK(!is_ambiguous) << codec_string; + codecs.insert(codec); } + + media_format_map_[mime_type] = codecs; + + if (is_proprietary_mime_type) + proprietary_media_containers_.push_back(mime_type); } bool MimeUtil::IsSupportedMediaMimeType(const std::string& mime_type) const { @@ -407,9 +428,8 @@ } void MimeUtil::RemoveProprietaryMediaTypesAndCodecs() { - for (size_t i = 0; i < arraysize(kFormatCodecMappings); ++i) - if (kFormatCodecMappings[i].format_type == PROPRIETARY) - media_format_map_.erase(kFormatCodecMappings[i].mime_type); + for (const auto& container : proprietary_media_containers_) + media_format_map_.erase(container); allow_proprietary_codecs_ = false; }
diff --git a/media/base/mime_util_internal.h b/media/base/mime_util_internal.h index 5e06b54..815d1cb7 100644 --- a/media/base/mime_util_internal.h +++ b/media/base/mime_util_internal.h
@@ -87,9 +87,17 @@ }; typedef std::map<std::string, CodecEntry> StringToCodecMappings; - // For faster lookup, keep hash sets. + // Initializes the supported media types into hash sets for faster lookup. void InitializeMimeTypeMaps(); + // Initializes the supported media formats (|media_format_map_|). + void AddSupportedMediaFormats(); + + // Adds |mime_type| with the specified codecs to |media_format_map_|. + void AddContainerWithCodecs(const std::string& mime_type, + const std::string& codecs_list, + bool is_proprietary_mime_type); + // Returns IsSupported if all codec IDs in |codecs| are unambiguous and are // supported in |mime_type_lower_case|. MayBeSupported is returned if at least // one codec ID in |codecs| is ambiguous but all the codecs are supported. @@ -144,8 +152,9 @@ // A map of mime_types and hash map of the supported codecs for the mime_type. MediaFormatMappings media_format_map_; - // Keeps track of whether proprietary codec support should be - // advertised to callers. + // List of proprietary containers in |media_format_map_|. + std::vector<std::string> proprietary_media_containers_; + // Whether proprietary codec support should be advertised to callers. bool allow_proprietary_codecs_; // Lookup table for string compare based string -> Codec mappings.
diff --git a/media/base/mock_audio_renderer_sink.cc b/media/base/mock_audio_renderer_sink.cc index 79653b2..5785ee42 100644 --- a/media/base/mock_audio_renderer_sink.cc +++ b/media/base/mock_audio_renderer_sink.cc
@@ -3,24 +3,49 @@ // found in the LICENSE file. #include "media/base/mock_audio_renderer_sink.h" -#include "media/base/fake_output_device.h" namespace media { MockAudioRendererSink::MockAudioRendererSink() : MockAudioRendererSink(OUTPUT_DEVICE_STATUS_OK) {} MockAudioRendererSink::MockAudioRendererSink(OutputDeviceStatus device_status) - : output_device_(new FakeOutputDevice(device_status)) {} + : MockAudioRendererSink(std::string(), device_status) {} + +MockAudioRendererSink::MockAudioRendererSink(const std::string& device_id, + OutputDeviceStatus device_status) + : MockAudioRendererSink( + device_id, + device_status, + media::AudioParameters(media::AudioParameters::AUDIO_FAKE, + media::CHANNEL_LAYOUT_STEREO, + media::AudioParameters::kTelephoneSampleRate, + 16, + 1)) {} + +MockAudioRendererSink::MockAudioRendererSink( + const std::string& device_id, + OutputDeviceStatus device_status, + const AudioParameters& device_output_params) + : output_device_info_(device_id, device_status, device_output_params) {} MockAudioRendererSink::~MockAudioRendererSink() {} +void MockAudioRendererSink::SwitchOutputDevice( + const std::string& device_id, + const url::Origin& security_origin, + const OutputDeviceStatusCB& callback) { + // NB: output device won't be changed, since it's not required by any tests + // now. + callback.Run(output_device_info_.device_status()); +} + void MockAudioRendererSink::Initialize(const AudioParameters& params, RenderCallback* renderer) { callback_ = renderer; } -OutputDevice* MockAudioRendererSink::GetOutputDevice() { - return output_device_.get(); +OutputDeviceInfo MockAudioRendererSink::GetOutputDeviceInfo() { + return output_device_info_; } } // namespace media
diff --git a/media/base/mock_audio_renderer_sink.h b/media/base/mock_audio_renderer_sink.h index 2194bc9..fa42a0b 100644 --- a/media/base/mock_audio_renderer_sink.h +++ b/media/base/mock_audio_renderer_sink.h
@@ -16,18 +16,27 @@ class FakeOutputDevice; -class MockAudioRendererSink : public RestartableAudioRendererSink { +class MockAudioRendererSink : public SwitchableAudioRendererSink { public: MockAudioRendererSink(); explicit MockAudioRendererSink(OutputDeviceStatus device_status); + MockAudioRendererSink(const std::string& device_id, + OutputDeviceStatus device_status); + MockAudioRendererSink(const std::string& device_id, + OutputDeviceStatus device_status, + const AudioParameters& device_output_params); MOCK_METHOD0(Start, void()); MOCK_METHOD0(Stop, void()); MOCK_METHOD0(Pause, void()); MOCK_METHOD0(Play, void()); MOCK_METHOD1(SetVolume, bool(double volume)); - OutputDevice* GetOutputDevice(); + OutputDeviceInfo GetOutputDeviceInfo(); + + void SwitchOutputDevice(const std::string& device_id, + const url::Origin& security_origin, + const OutputDeviceStatusCB& callback) override; void Initialize(const AudioParameters& params, RenderCallback* renderer) override; AudioRendererSink::RenderCallback* callback() { return callback_; } @@ -37,7 +46,7 @@ private: RenderCallback* callback_; - scoped_ptr<FakeOutputDevice> output_device_; + OutputDeviceInfo output_device_info_; DISALLOW_COPY_AND_ASSIGN(MockAudioRendererSink); };
diff --git a/media/base/output_device.h b/media/base/output_device.h deleted file mode 100644 index 76f88c7..0000000 --- a/media/base/output_device.h +++ /dev/null
@@ -1,67 +0,0 @@ -// Copyright (c) 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. - -#ifndef MEDIA_BASE_OUTPUT_DEVICE_H_ -#define MEDIA_BASE_OUTPUT_DEVICE_H_ - -#include <string> - -#include "base/callback.h" -#include "media/audio/audio_parameters.h" -#include "media/base/media_export.h" -#include "url/origin.h" - -namespace media { - -// Result of an audio output device switch operation -enum OutputDeviceStatus { - OUTPUT_DEVICE_STATUS_OK = 0, - OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, - OUTPUT_DEVICE_STATUS_ERROR_NOT_AUTHORIZED, - OUTPUT_DEVICE_STATUS_ERROR_INTERNAL, - OUTPUT_DEVICE_STATUS_LAST = OUTPUT_DEVICE_STATUS_ERROR_INTERNAL, -}; - -typedef base::Callback<void(OutputDeviceStatus)> SwitchOutputDeviceCB; - -// OutputDevice is an interface that allows performing operations related -// audio output devices. - -class OutputDevice { - public: - // Attempts to switch the audio output device. - // Once the attempt is finished, |callback| is invoked with the - // result of the operation passed as a parameter. The result is a value from - // the media::SwitchOutputDeviceResult enum. - // There is no guarantee about the thread where |callback| will - // be invoked, so users are advised to use media::BindToCurrentLoop() to - // ensure that |callback| runs on the correct thread. - // Note also that copy constructors and destructors for arguments bound to - // |callback| may run on arbitrary threads as |callback| is moved across - // threads. It is advisable to bind arguments such that they are released by - // |callback| when it runs in order to avoid surprises. - virtual void SwitchOutputDevice(const std::string& device_id, - const url::Origin& security_origin, - const SwitchOutputDeviceCB& callback) = 0; - - // Returns the device's audio output parameters. - // The return value is undefined if the device status (as returned by - // GetDeviceStatus()) is different from OUTPUT_DEVICE_STATUS_OK. - // If the parameters are not available, this method may block until they - // become available. - // This method must never be called on the IO thread. - virtual AudioParameters GetOutputParameters() = 0; - - // Returns the status of output device. - // If the status is not available, this method may block until it becomes - // available. Must never be called on the IO thread. - virtual OutputDeviceStatus GetDeviceStatus() = 0; - - protected: - virtual ~OutputDevice() {} -}; - -} // namespace media - -#endif // MEDIA_BASE_OUTPUT_DEVICE_H_
diff --git a/media/base/output_device_info.cc b/media/base/output_device_info.cc new file mode 100644 index 0000000..d1ffa43 --- /dev/null +++ b/media/base/output_device_info.cc
@@ -0,0 +1,40 @@ +// 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. + +#include "media/base/output_device_info.h" + +namespace media { + +// Output device information returned by GetOutputDeviceInfo() methods of +// various interfaces. +OutputDeviceInfo::OutputDeviceInfo() + : OutputDeviceInfo(OUTPUT_DEVICE_STATUS_ERROR_INTERNAL) {} + +OutputDeviceInfo::OutputDeviceInfo(OutputDeviceStatus device_status) + : OutputDeviceInfo(std::string(), + device_status, + AudioParameters::UnavailableDeviceParams()) {} + +OutputDeviceInfo::OutputDeviceInfo(const std::string& device_id, + OutputDeviceStatus device_status, + const AudioParameters& output_params) + : device_id_(device_id), + device_status_(device_status), + output_params_(output_params) {} + +OutputDeviceInfo::OutputDeviceInfo(const OutputDeviceInfo&) = default; + +OutputDeviceInfo& OutputDeviceInfo::operator=(const OutputDeviceInfo&) = + default; + +OutputDeviceInfo::~OutputDeviceInfo() {} + +std::string OutputDeviceInfo::AsHumanReadableString() const { + std::ostringstream s; + s << "device_id: " << device_id() << " device_status: " << device_status() + << " output_params: [ " << output_params().AsHumanReadableString() << " ]"; + return s.str(); +} + +} // namespace media
diff --git a/media/base/output_device_info.h b/media/base/output_device_info.h new file mode 100644 index 0000000..987ae67 --- /dev/null +++ b/media/base/output_device_info.h
@@ -0,0 +1,68 @@ +// 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. + +#ifndef MEDIA_BASE_OUTPUT_DEVICE_INFO_H_ +#define MEDIA_BASE_OUTPUT_DEVICE_INFO_H_ + +#include <string> + +#include "base/callback.h" +#include "media/audio/audio_parameters.h" +#include "media/base/media_export.h" + +namespace media { + +// Result of an audio output device switch operation +enum OutputDeviceStatus { + OUTPUT_DEVICE_STATUS_OK = 0, + OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, + OUTPUT_DEVICE_STATUS_ERROR_NOT_AUTHORIZED, + OUTPUT_DEVICE_STATUS_ERROR_INTERNAL, + OUTPUT_DEVICE_STATUS_LAST = OUTPUT_DEVICE_STATUS_ERROR_INTERNAL, +}; + +using OutputDeviceStatusCB = base::Callback<void(OutputDeviceStatus)>; + +class MEDIA_EXPORT OutputDeviceInfo { + public: + // Use this constructor to initialize with "no info available" values. + OutputDeviceInfo(); + + // Use this constructor to indicate a specific error status of the device. + explicit OutputDeviceInfo(OutputDeviceStatus device_status); + + OutputDeviceInfo(const std::string& device_id, + OutputDeviceStatus device_status, + const AudioParameters& output_params); + + OutputDeviceInfo(const OutputDeviceInfo& other); + + OutputDeviceInfo& operator=(const OutputDeviceInfo&); + + ~OutputDeviceInfo(); + + // Returns the device ID. + const std::string& device_id() const { return device_id_; } + + // Returns the status of output device. + OutputDeviceStatus device_status() const { return device_status_; } + + // Returns the device's audio output parameters. + // The return value is undefined if the device status (as returned by + // device_status()) is different from OUTPUT_DEVICE_STATUS_OK. + const AudioParameters& output_params() const { return output_params_; }; + + // Returns a human-readable string describing |*this|. For debugging & test + // output only. + std::string AsHumanReadableString() const; + + private: + std::string device_id_; + OutputDeviceStatus device_status_; + AudioParameters output_params_; +}; + +} // namespace media + +#endif // MEDIA_BASE_OUTPUT_DEVICE_INFO_H_
diff --git a/media/base/video_frame_metadata.h b/media/base/video_frame_metadata.h index 61b33a3..8c8e20c 100644 --- a/media/base/video_frame_metadata.h +++ b/media/base/video_frame_metadata.h
@@ -9,6 +9,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/values.h" #include "media/base/media_export.h"
diff --git a/media/base/yuv_convert_perftest.cc b/media/base/yuv_convert_perftest.cc index 3af1b75..f92be046 100644 --- a/media/base/yuv_convert_perftest.cc +++ b/media/base/yuv_convert_perftest.cc
@@ -9,6 +9,7 @@ #include "base/files/file_util.h" #include "base/logging.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/time/time.h" #include "build/build_config.h"
diff --git a/media/base/yuv_convert_unittest.cc b/media/base/yuv_convert_unittest.cc index 77c48ce..a05e15a 100644 --- a/media/base/yuv_convert_unittest.cc +++ b/media/base/yuv_convert_unittest.cc
@@ -9,6 +9,7 @@ #include "base/cpu.h" #include "base/files/file_util.h" #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "build/build_config.h" #include "media/base/djb2.h" @@ -39,7 +40,8 @@ static const int kRGB24Size = kSourceYSize * 3; static const int kRGBSizeConverted = kSourceYSize * kBpp; -#if !defined(ARCH_CPU_ARM_FAMILY) && !defined(ARCH_CPU_MIPS_FAMILY) +#if !defined(ARCH_CPU_ARM_FAMILY) && !defined(ARCH_CPU_MIPS_FAMILY) && \ + !defined(OS_ANDROID) static const int kSourceAOffset = kSourceYSize * 12 / 8; static const int kYUVA12Size = kSourceYSize * 20 / 8; #endif
diff --git a/media/blink/webaudiosourceprovider_impl.cc b/media/blink/webaudiosourceprovider_impl.cc index d43a16f..5dca2641 100644 --- a/media/blink/webaudiosourceprovider_impl.cc +++ b/media/blink/webaudiosourceprovider_impl.cc
@@ -87,7 +87,7 @@ }; WebAudioSourceProviderImpl::WebAudioSourceProviderImpl( - const scoped_refptr<RestartableAudioRendererSink>& sink) + const scoped_refptr<SwitchableAudioRendererSink>& sink) : volume_(1.0), state_(kStopped), client_(nullptr), @@ -199,9 +199,20 @@ return true; } -OutputDevice* WebAudioSourceProviderImpl::GetOutputDevice() { +media::OutputDeviceInfo WebAudioSourceProviderImpl::GetOutputDeviceInfo() { base::AutoLock auto_lock(sink_lock_); - return sink_->GetOutputDevice(); + return client_ ? media::OutputDeviceInfo() : sink_->GetOutputDeviceInfo(); +} + +void WebAudioSourceProviderImpl::SwitchOutputDevice( + const std::string& device_id, + const url::Origin& security_origin, + const OutputDeviceStatusCB& callback) { + base::AutoLock auto_lock(sink_lock_); + if (client_) + callback.Run(media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL); + else + sink_->SwitchOutputDevice(device_id, security_origin, callback); } void WebAudioSourceProviderImpl::Initialize(const AudioParameters& params,
diff --git a/media/blink/webaudiosourceprovider_impl.h b/media/blink/webaudiosourceprovider_impl.h index 7e859db..b7b85812 100644 --- a/media/blink/webaudiosourceprovider_impl.h +++ b/media/blink/webaudiosourceprovider_impl.h
@@ -41,13 +41,13 @@ // All calls are protected by a lock. class MEDIA_BLINK_EXPORT WebAudioSourceProviderImpl : NON_EXPORTED_BASE(public blink::WebAudioSourceProvider), - NON_EXPORTED_BASE(public RestartableAudioRendererSink) { + NON_EXPORTED_BASE(public SwitchableAudioRendererSink) { public: using CopyAudioCB = base::Callback< void(scoped_ptr<AudioBus>, uint32_t delay_milliseconds, int sample_rate)>; explicit WebAudioSourceProviderImpl( - const scoped_refptr<RestartableAudioRendererSink>& sink); + const scoped_refptr<SwitchableAudioRendererSink>& sink); // blink::WebAudioSourceProvider implementation. void setClient(blink::WebAudioSourceProviderClient* client) override; @@ -60,9 +60,12 @@ void Play() override; void Pause() override; bool SetVolume(double volume) override; - OutputDevice* GetOutputDevice() override; + OutputDeviceInfo GetOutputDeviceInfo() override; void Initialize(const AudioParameters& params, RenderCallback* renderer) override; + void SwitchOutputDevice(const std::string& device_id, + const url::Origin& security_origin, + const OutputDeviceStatusCB& callback) override; // These methods allow a client to get a copy of the rendered audio. void SetCopyAudioCallback(const CopyAudioCB& callback); @@ -91,7 +94,7 @@ // Where audio ends up unless overridden by |client_|. base::Lock sink_lock_; - const scoped_refptr<RestartableAudioRendererSink> sink_; + const scoped_refptr<SwitchableAudioRendererSink> sink_; scoped_ptr<AudioBus> bus_wrapper_; // An inner class acting as a T filter where actual data can be tapped.
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc index 3c7ee12e..0176405 100644 --- a/media/blink/webmediaplayer_impl.cc +++ b/media/blink/webmediaplayer_impl.cc
@@ -97,13 +97,8 @@ void SetSinkIdOnMediaThread(scoped_refptr<WebAudioSourceProviderImpl> sink, const std::string& device_id, const url::Origin& security_origin, - const SwitchOutputDeviceCB& callback) { - if (sink->GetOutputDevice()) { - sink->GetOutputDevice()->SwitchOutputDevice(device_id, security_origin, - callback); - } else { - callback.Run(OUTPUT_DEVICE_STATUS_ERROR_INTERNAL); - } + const OutputDeviceStatusCB& callback) { + sink->SwitchOutputDevice(device_id, security_origin, callback); } bool IsSuspendUponHiddenEnabled() { @@ -505,8 +500,8 @@ DCHECK(main_task_runner_->BelongsToCurrentThread()); DVLOG(1) << __FUNCTION__; - media::SwitchOutputDeviceCB callback = - media::ConvertToSwitchOutputDeviceCB(web_callback); + media::OutputDeviceStatusCB callback = + media::ConvertToOutputDeviceStatusCB(web_callback); media_task_runner_->PostTask( FROM_HERE, base::Bind(&SetSinkIdOnMediaThread, audio_source_provider_,
diff --git a/media/blink/webmediaplayer_impl_unittest.cc b/media/blink/webmediaplayer_impl_unittest.cc index 1a62f5b..10c74c86 100644 --- a/media/blink/webmediaplayer_impl_unittest.cc +++ b/media/blink/webmediaplayer_impl_unittest.cc
@@ -105,7 +105,7 @@ url_index_, WebMediaPlayerParams( WebMediaPlayerParams::DeferLoadCB(), - scoped_refptr<RestartableAudioRendererSink>(), media_log_, + scoped_refptr<SwitchableAudioRendererSink>(), media_log_, media_thread_.task_runner(), message_loop_.task_runner(), message_loop_.task_runner(), WebMediaPlayerParams::Context3DCB(), base::Bind(&OnAdjustAllocatedMemory), nullptr, nullptr, nullptr)));
diff --git a/media/blink/webmediaplayer_params.cc b/media/blink/webmediaplayer_params.cc index 28915cd..9ad3ba23 100644 --- a/media/blink/webmediaplayer_params.cc +++ b/media/blink/webmediaplayer_params.cc
@@ -13,7 +13,7 @@ WebMediaPlayerParams::WebMediaPlayerParams( const DeferLoadCB& defer_load_cb, - const scoped_refptr<RestartableAudioRendererSink>& audio_renderer_sink, + const scoped_refptr<SwitchableAudioRendererSink>& audio_renderer_sink, const scoped_refptr<MediaLog>& media_log, const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, const scoped_refptr<base::TaskRunner>& worker_task_runner,
diff --git a/media/blink/webmediaplayer_params.h b/media/blink/webmediaplayer_params.h index deb868f..4041301 100644 --- a/media/blink/webmediaplayer_params.h +++ b/media/blink/webmediaplayer_params.h
@@ -26,7 +26,7 @@ namespace media { -class RestartableAudioRendererSink; +class SwitchableAudioRendererSink; class MediaLog; class SurfaceManager; @@ -48,7 +48,7 @@ // |context_3d_cb| may be null. WebMediaPlayerParams( const DeferLoadCB& defer_load_cb, - const scoped_refptr<RestartableAudioRendererSink>& audio_renderer_sink, + const scoped_refptr<SwitchableAudioRendererSink>& audio_renderer_sink, const scoped_refptr<MediaLog>& media_log, const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, const scoped_refptr<base::TaskRunner>& worker_task_runner, @@ -63,7 +63,7 @@ DeferLoadCB defer_load_cb() const { return defer_load_cb_; } - const scoped_refptr<RestartableAudioRendererSink>& audio_renderer_sink() + const scoped_refptr<SwitchableAudioRendererSink>& audio_renderer_sink() const { return audio_renderer_sink_; } @@ -101,7 +101,7 @@ private: DeferLoadCB defer_load_cb_; - scoped_refptr<RestartableAudioRendererSink> audio_renderer_sink_; + scoped_refptr<SwitchableAudioRendererSink> audio_renderer_sink_; scoped_refptr<MediaLog> media_log_; scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; scoped_refptr<base::TaskRunner> worker_task_runner_;
diff --git a/media/blink/webmediaplayer_util.cc b/media/blink/webmediaplayer_util.cc index e88d1ae5..06cd819 100644 --- a/media/blink/webmediaplayer_util.cc +++ b/media/blink/webmediaplayer_util.cc
@@ -235,7 +235,7 @@ } // namespace -SwitchOutputDeviceCB ConvertToSwitchOutputDeviceCB( +OutputDeviceStatusCB ConvertToOutputDeviceStatusCB( blink::WebSetSinkIdCallbacks* web_callbacks) { return media::BindToCurrentLoop( base::Bind(RunSetSinkIdCallback, SetSinkIdCallback(web_callbacks)));
diff --git a/media/blink/webmediaplayer_util.h b/media/blink/webmediaplayer_util.h index bb8c049..c71e6c03 100644 --- a/media/blink/webmediaplayer_util.h +++ b/media/blink/webmediaplayer_util.h
@@ -43,10 +43,10 @@ blink::WebEncryptedMediaInitDataType MEDIA_BLINK_EXPORT ConvertToWebInitDataType(EmeInitDataType init_data_type); -// Wraps a blink::WebSetSinkIdCallbacks into a media::SwitchOutputDeviceCB +// Wraps a blink::WebSetSinkIdCallbacks into a media::OutputDeviceStatusCB // and binds it to the current thread -SwitchOutputDeviceCB MEDIA_BLINK_EXPORT -ConvertToSwitchOutputDeviceCB(blink::WebSetSinkIdCallbacks* web_callbacks); +OutputDeviceStatusCB MEDIA_BLINK_EXPORT +ConvertToOutputDeviceStatusCB(blink::WebSetSinkIdCallbacks* web_callbacks); } // namespace media
diff --git a/media/cast/net/cast_transport_config.h b/media/cast/net/cast_transport_config.h index dc63bee..a1a5323 100644 --- a/media/cast/net/cast_transport_config.h +++ b/media/cast/net/cast_transport_config.h
@@ -11,6 +11,7 @@ #include <string> #include "base/callback.h" +#include "base/memory/scoped_ptr.h" #include "base/stl_util.h" #include "media/cast/common/rtp_time.h" #include "media/cast/net/cast_transport_defines.h"
diff --git a/media/cast/net/cast_transport_sender_impl.cc b/media/cast/net/cast_transport_sender_impl.cc index 414ff3e..40e97b0 100644 --- a/media/cast/net/cast_transport_sender_impl.cc +++ b/media/cast/net/cast_transport_sender_impl.cc
@@ -374,7 +374,8 @@ } if (!cast_message.missing_frames_and_packets.empty()) { - VLOG(2) << "feedback_count: " << cast_message.feedback_count; + VLOG(2) << "feedback_count: " + << static_cast<uint32_t>(cast_message.feedback_count); // This call does two things. // 1. Specifies that retransmissions for packets not listed in the set are // cancelled.
diff --git a/media/filters/decoder_selector.h b/media/filters/decoder_selector.h index f95ad6d..63bd6a8d 100644 --- a/media/filters/decoder_selector.h +++ b/media/filters/decoder_selector.h
@@ -8,6 +8,7 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" #include "build/build_config.h"
diff --git a/media/media.gyp b/media/media.gyp index 21c900a..2f89a98 100644 --- a/media/media.gyp +++ b/media/media.gyp
@@ -385,7 +385,8 @@ 'base/multi_channel_resampler.h', 'base/null_video_sink.cc', 'base/null_video_sink.h', - 'base/output_device.h', + 'base/output_device_info.cc', + 'base/output_device_info.h', 'base/pipeline.h', 'base/pipeline_impl.cc', 'base/pipeline_impl.h', @@ -1547,8 +1548,6 @@ 'base/fake_demuxer_stream.h', 'base/fake_media_resources.cc', 'base/fake_media_resources.h', - 'base/fake_output_device.cc', - 'base/fake_output_device.h', 'base/fake_single_thread_task_runner.cc', 'base/fake_single_thread_task_runner.h', 'base/fake_text_track_stream.cc',
diff --git a/media/media_options.gni b/media/media_options.gni index 0390f21..72f100e 100644 --- a/media/media_options.gni +++ b/media/media_options.gni
@@ -4,7 +4,6 @@ import("//build/config/chromecast_build.gni") import("//build/config/features.gni") -import("//build/config/headless_build.gni") declare_args() { # Allows distributions to link pulseaudio directly (DT_NEEDED) instead of @@ -57,7 +56,7 @@ use_alsa = false # Alsa should be used on non-Android, non-Mac POSIX systems. - if (is_posix && !is_headless && !is_android && !is_mac) { + if (is_posix && !is_android && !is_mac) { use_alsa = true # Pulse is not supported on Chromecast platforms.
diff --git a/media/midi/usb_midi_device.h b/media/midi/usb_midi_device.h index c94687b..67455d1 100644 --- a/media/midi/usb_midi_device.h +++ b/media/midi/usb_midi_device.h
@@ -11,6 +11,7 @@ #include <vector> #include "base/callback.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/time/time.h" #include "media/midi/usb_midi_export.h"
diff --git a/media/muxers/webm_muxer.h b/media/muxers/webm_muxer.h index 4714184..ecec31ce 100644 --- a/media/muxers/webm_muxer.h +++ b/media/muxers/webm_muxer.h
@@ -11,6 +11,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/numerics/safe_math.h" #include "base/strings/string_piece.h" #include "base/threading/thread_checker.h"
diff --git a/mojo/public/mojo_application.gni b/mojo/public/mojo_application.gni index 7ceb2d5..a1811119 100644 --- a/mojo/public/mojo_application.gni +++ b/mojo/public/mojo_application.gni
@@ -3,6 +3,7 @@ # found in the LICENSE file. import("//build/toolchain/toolchain.gni") +import("//mojo/public/mojo_constants.gni") if (is_android) { import("//build/config/android/rules.gni") @@ -32,7 +33,7 @@ copy(copy_step_name) { sources = invoker.resources outputs = [ - "${root_out_dir}/${base_target_name}/resources/{{source_file_part}}", + "${root_out_dir}/${mojo_application_subdir}/${base_target_name}/resources/{{source_file_part}}", ] if (defined(invoker.testonly)) { testonly = invoker.testonly @@ -141,7 +142,7 @@ "${root_shlib_dir}/${library_name}", ] outputs = [ - "${root_out_dir}/${base_target_name}/${output}", + "${root_out_dir}/${mojo_application_subdir}/${base_target_name}/${output}", ] } @@ -192,7 +193,7 @@ copy(copy_step_name) { sources = invoker.resources outputs = [ - "${root_out_dir}/${base_target_name}/resources/{{source_file_part}}", + "${root_out_dir}/${mojo_application_subdir}/${base_target_name}/resources/{{source_file_part}}", ] if (defined(invoker.testonly)) { testonly = invoker.testonly @@ -222,8 +223,7 @@ ]) } - _mojo_output = - "${root_out_dir}/${base_target_name}/${base_target_name}.mojo" + _mojo_output = "${root_out_dir}/${mojo_application_subdir}/${base_target_name}/${base_target_name}.mojo" action(target_name) { script = "//mojo/public/tools/prepend.py"
diff --git a/mojo/public/mojo_application_manifest.gni b/mojo/public/mojo_application_manifest.gni index 5b6cefe1..589e30e 100644 --- a/mojo/public/mojo_application_manifest.gni +++ b/mojo/public/mojo_application_manifest.gni
@@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//mojo/public/mojo_constants.gni") + # Used to produce a Mojo Application Manifest for an application. # # Parameters: @@ -67,7 +69,7 @@ ] if (type == "mojo") { - output = "$root_out_dir/$application_name/manifest.json" + output = "$root_out_dir/$mojo_application_subdir/$application_name/manifest.json" } else { output = "$root_out_dir/${application_name}_manifest.json" } @@ -86,7 +88,7 @@ if (defined(invoker.packaged_applications)) { foreach(application_name, invoker.packaged_applications) { - input = "$root_out_dir/$application_name/manifest.json" + input = "$root_out_dir/$mojo_application_subdir/$application_name/manifest.json" inputs += [ input ] args += [ rebase_path(input, root_build_dir) ] }
diff --git a/mojo/public/mojo_constants.gni b/mojo/public/mojo_constants.gni new file mode 100644 index 0000000..3165a8dc --- /dev/null +++ b/mojo/public/mojo_constants.gni
@@ -0,0 +1,8 @@ +# 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. + +declare_args() { + # Mojo application directories are created within this subdirectory. + mojo_application_subdir = "Mojo Applications" +}
diff --git a/mojo/services/catalog/catalog.cc b/mojo/services/catalog/catalog.cc index e40201bb..1d75a301 100644 --- a/mojo/services/catalog/catalog.cc +++ b/mojo/services/catalog/catalog.cc
@@ -23,8 +23,10 @@ // TODO(beng): think more about how this should be done for exe targets. std::string type = mojo::GetNameType(name); std::string path = mojo::GetNamePath(name); - if (type == mojo::kNameType_Mojo) - return package_dir.AppendASCII(path + "/manifest.json"); + if (type == mojo::kNameType_Mojo) { + return package_dir.AppendASCII("Mojo Applications").AppendASCII( + path + "/manifest.json"); + } if (type == mojo::kNameType_Exe) return package_dir.AppendASCII(path + "_manifest.json"); return base::FilePath(); @@ -36,7 +38,8 @@ if (type == mojo::kNameType_Mojo) { // It's still a mojo: URL, use the default mapping scheme. const std::string host = mojo::GetNamePath(name); - return package_dir.AppendASCII(host + "/" + host + ".mojo"); + return package_dir.AppendASCII("Mojo Applications").AppendASCII( + host + "/" + host + ".mojo"); } if (type == mojo::kNameType_Exe) { #if defined OS_WIN
diff --git a/mojo/services/catalog/store.h b/mojo/services/catalog/store.h index 1a4087f..4ebdaea 100644 --- a/mojo/services/catalog/store.h +++ b/mojo/services/catalog/store.h
@@ -5,6 +5,7 @@ #ifndef MOJO_SERVICES_CATALOG_STORE_H_ #define MOJO_SERVICES_CATALOG_STORE_H_ +#include "base/memory/scoped_ptr.h" #include "base/values.h" namespace catalog {
diff --git a/mojo/shell/public/cpp/initialize_base_and_icu.cc b/mojo/shell/public/cpp/initialize_base_and_icu.cc index 2ec37df..9eb49fa 100644 --- a/mojo/shell/public/cpp/initialize_base_and_icu.cc +++ b/mojo/shell/public/cpp/initialize_base_and_icu.cc
@@ -11,6 +11,7 @@ #include "base/files/file.h" #include "base/i18n/icu_util.h" +#include "base/memory/scoped_ptr.h" #include "base/rand_util.h" #include "base/sys_info.h" #include "mojo/public/c/system/types.h"
diff --git a/mojo/shell/runner/host/child_process_host.cc b/mojo/shell/runner/host/child_process_host.cc index 19a5161d..96200f3 100644 --- a/mojo/shell/runner/host/child_process_host.cc +++ b/mojo/shell/runner/host/child_process_host.cc
@@ -189,6 +189,7 @@ MachBroker* mach_broker = MachBroker::GetInstance(); base::AutoLock locker(mach_broker->GetLock()); #endif + LOG(WARNING) << "PATH: " << app_path_.value(); child_process_ = base::LaunchProcess(*child_command_line, options); #if defined(OS_MACOSX) mach_broker->ExpectPid(child_process_.Handle());
diff --git a/net/BUILD.gn b/net/BUILD.gn index 61e60b5..dc19b130 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -28,10 +28,6 @@ "scope", [ "net.gypi" ]) -# Disable Kerberos on ChromeOS, iOS, Chromecast and headless, at least for now. -# It needs configuration (krb5.conf and so on). -use_kerberos = !is_chromeos && !is_ios && !is_chromecast && !is_headless - # The way the cache uses mmap() is inefficient on some Android devices. If # this flag is set, we hackily avoid using mmap() in the disk cache. We are # pretty confident that mmap-ing the index would not hurt any existing x86 @@ -50,6 +46,11 @@ # cronet. enable_websockets = !is_ios disable_ftp_support = is_ios + + # Enable Kerberos authentication. It is disabled by default on ChromeOS, iOS, + # Chromecast, at least for now. This feature needs configuration (krb5.conf + # and so on). + use_kerberos = !is_chromeos && !is_ios && !is_chromecast } config("net_config") { @@ -443,6 +444,18 @@ ] } + if (is_win) { + libs = [ + "crypt32.lib", + "dhcpcsvc.lib", + "iphlpapi.lib", + "rpcrt4.lib", + "secur32.lib", + "urlmon.lib", + "winhttp.lib", + ] + } + if (!is_nacl) { if (!disable_file_support) { sources += gypi_values.net_file_support_sources @@ -1417,6 +1430,7 @@ "data/certificate_policies_unittest", "data/name_constraints_unittest", "data/parse_certificate_unittest", + "data/parse_ocsp_unittest", "data/test.html", "data/url_request_unittest", "data/verify_certificate_chain_unittest", @@ -1431,14 +1445,6 @@ test("net_unittests") { sources = gypi_values.net_test_sources - if (is_ios) { - sources -= [ - "websockets/websocket_stream_cookie_test.cc", - "websockets/websocket_stream_create_test_base.cc", - "websockets/websocket_stream_create_test_base.h", - ] - } - configs += [ "//build/config:precompiled_headers", @@ -1450,7 +1456,6 @@ deps = [ ":balsa", ":extras", - ":http_server", ":net", ":net_unittests_bundle_data", ":simple_quic_tools", @@ -1571,32 +1576,9 @@ sources -= [ "ssl/openssl_client_key_store_unittest.cc" ] } - if (!enable_websockets) { - sources -= [ - "server/http_connection_unittest.cc", - "server/http_server_response_info_unittest.cc", - "server/http_server_unittest.cc", - "server/web_socket_encoder_unittest.cc", - "websockets/websocket_basic_stream_test.cc", - "websockets/websocket_channel_test.cc", - "websockets/websocket_deflate_parameters_test.cc", - "websockets/websocket_deflate_predictor_impl_test.cc", - "websockets/websocket_deflate_stream_test.cc", - "websockets/websocket_deflater_test.cc", - "websockets/websocket_end_to_end_test.cc", - "websockets/websocket_errors_test.cc", - "websockets/websocket_extension_parser_test.cc", - "websockets/websocket_extension_test.cc", - "websockets/websocket_frame_parser_test.cc", - "websockets/websocket_frame_test.cc", - "websockets/websocket_handshake_challenge_test.cc", - "websockets/websocket_handshake_stream_create_helper_test.cc", - "websockets/websocket_inflater_test.cc", - "websockets/websocket_stream_test.cc", - "websockets/websocket_test_util.cc", - "websockets/websocket_test_util.h", - ] - deps -= [ ":http_server" ] + if (enable_websockets) { + sources += gypi_values.net_websockets_test_sources + deps += [ ":http_server" ] } if (disable_file_support) {
diff --git a/net/base/file_stream.h b/net/base/file_stream.h index 64a3435..fc4b1a4b 100644 --- a/net/base/file_stream.h +++ b/net/base/file_stream.h
@@ -14,6 +14,7 @@ #include "base/files/file.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "net/base/completion_callback.h" #include "net/base/net_export.h"
diff --git a/net/base/ip_address.cc b/net/base/ip_address.cc index b805317e..722e370 100644 --- a/net/base/ip_address.cc +++ b/net/base/ip_address.cc
@@ -193,6 +193,19 @@ return true; } +bool ParseURLHostnameToAddress(const std::string& hostname, + IPAddress* ip_address) { + if (hostname.size() >= 2 && hostname.front() == '[' && + hostname.back() == ']') { + // Strip the square brackets that surround IPv6 literals. + auto ip_literal = + base::StringPiece(hostname).substr(1, hostname.size() - 2); + return ip_address->AssignFromIPLiteral(ip_literal) && ip_address->IsIPv6(); + } + + return ip_address->AssignFromIPLiteral(hostname) && ip_address->IsIPv4(); +} + unsigned CommonPrefixLength(const IPAddress& a1, const IPAddress& a2) { return CommonPrefixLength(a1.bytes(), a2.bytes()); }
diff --git a/net/base/ip_address.h b/net/base/ip_address.h index 1897ebcc..2f9d7ab 100644 --- a/net/base/ip_address.h +++ b/net/base/ip_address.h
@@ -182,6 +182,14 @@ IPAddress* ip_address, size_t* prefix_length_in_bits); +// Parses a URL-safe IP literal (see RFC 3986, Sec 3.2.2) to its numeric value. +// Returns true on success, and fills |ip_address| with the numeric value. +// In other words, |hostname| must be an IPv4 literal, or an IPv6 literal +// surrounded by brackets as in [::1]. +NET_EXPORT bool ParseURLHostnameToAddress(const std::string& hostname, + IPAddress* ip_address) + WARN_UNUSED_RESULT; + // Returns number of matching initial bits between the addresses |a1| and |a2|. unsigned CommonPrefixLength(const IPAddress& a1, const IPAddress& a2);
diff --git a/net/base/ip_address_number.cc b/net/base/ip_address_number.cc index 1c3090d..e991314 100644 --- a/net/base/ip_address_number.cc +++ b/net/base/ip_address_number.cc
@@ -135,28 +135,6 @@ return std::string(reinterpret_cast<const char*>(addr.data()), addr.size()); } -bool ParseURLHostnameToNumber(const std::string& hostname, - IPAddressNumber* ip_number) { - // |hostname| is an already canoncalized hostname, conforming to RFC 3986. - // For an IP address, this is defined in Section 3.2.2 of RFC 3986, with - // the canonical form for IPv6 addresses defined in Section 4 of RFC 5952. - url::Component host_comp(0, hostname.size()); - - // If it has a bracket, try parsing it as an IPv6 address. - if (hostname[0] == '[') { - ip_number->resize(16); // 128 bits. - return url::IPv6AddressToNumber( - hostname.data(), host_comp, &(*ip_number)[0]); - } - - // Otherwise, try IPv4. - ip_number->resize(4); // 32 bits. - int num_components; - url::CanonHostInfo::Family family = url::IPv4AddressToNumber( - hostname.data(), host_comp, &(*ip_number)[0], &num_components); - return family == url::CanonHostInfo::IPV4; -} - bool ParseIPLiteralToNumber(const base::StringPiece& ip_literal, IPAddressNumber* ip_number) { // |ip_literal| could be either a IPv4 or an IPv6 literal. If it contains
diff --git a/net/base/ip_address_number.h b/net/base/ip_address_number.h index 1f7a1e7..8c997e4 100644 --- a/net/base/ip_address_number.h +++ b/net/base/ip_address_number.h
@@ -58,11 +58,6 @@ // Returns the address as a sequence of bytes in network-byte-order. NET_EXPORT std::string IPAddressToPackedString(const IPAddressNumber& addr); -// Parses a URL-safe IP literal (see RFC 3986, Sec 3.2.2) to its numeric value. -// Returns true on success, and fills |ip_number| with the numeric value -NET_EXPORT bool ParseURLHostnameToNumber(const std::string& hostname, - IPAddressNumber* ip_number); - // Parses an IP address literal (either IPv4 or IPv6) to its numeric value. // Returns true on success and fills |ip_number| with the numeric value. NET_EXPORT bool ParseIPLiteralToNumber(const base::StringPiece& ip_literal,
diff --git a/net/base/ip_address_number_unittest.cc b/net/base/ip_address_number_unittest.cc index a0365f4..f7975d6 100644 --- a/net/base/ip_address_number_unittest.cc +++ b/net/base/ip_address_number_unittest.cc
@@ -98,31 +98,6 @@ EXPECT_EQ("::ffff:c0a8:1", IPAddressToString(ipv6_number)); } -TEST(IpAddressNumberTest, ParseURLHostnameToNumber_FailParse) { - IPAddressNumber number; - - EXPECT_FALSE(ParseURLHostnameToNumber("bad value", &number)); - EXPECT_FALSE(ParseURLHostnameToNumber("bad:value", &number)); - EXPECT_FALSE(ParseURLHostnameToNumber(std::string(), &number)); - EXPECT_FALSE(ParseURLHostnameToNumber("192.168.0.1:30", &number)); - EXPECT_FALSE(ParseURLHostnameToNumber(" 192.168.0.1 ", &number)); - EXPECT_FALSE(ParseURLHostnameToNumber("::1", &number)); -} - -TEST(IpAddressNumberTest, ParseURLHostnameToNumber_IPv4) { - IPAddressNumber number; - EXPECT_TRUE(ParseURLHostnameToNumber("192.168.0.1", &number)); - EXPECT_EQ("192,168,0,1", DumpIPNumber(number)); - EXPECT_EQ("192.168.0.1", IPAddressToString(number)); -} - -TEST(IpAddressNumberTest, ParseURLHostnameToNumber_IPv6) { - IPAddressNumber number; - EXPECT_TRUE(ParseURLHostnameToNumber("[1:abcd::3:4:ff]", &number)); - EXPECT_EQ("0,1,171,205,0,0,0,0,0,0,0,3,0,4,0,255", DumpIPNumber(number)); - EXPECT_EQ("1:abcd::3:4:ff", IPAddressToString(number)); -} - TEST(IpAddressNumberTest, IsIPv4Mapped) { IPAddressNumber ipv4_number; EXPECT_TRUE(ParseIPLiteralToNumber("192.168.0.1", &ipv4_number));
diff --git a/net/base/ip_address_unittest.cc b/net/base/ip_address_unittest.cc index d386e49d..3b9f3dfc 100644 --- a/net/base/ip_address_unittest.cc +++ b/net/base/ip_address_unittest.cc
@@ -299,6 +299,31 @@ EXPECT_EQ(112u, prefix_length_in_bits); } +TEST(IPAddressTest, ParseURLHostnameToAddress_FailParse) { + IPAddress address; + EXPECT_FALSE(ParseURLHostnameToAddress("bad value", &address)); + EXPECT_FALSE(ParseURLHostnameToAddress("bad:value", &address)); + EXPECT_FALSE(ParseURLHostnameToAddress(std::string(), &address)); + EXPECT_FALSE(ParseURLHostnameToAddress("192.168.0.1:30", &address)); + EXPECT_FALSE(ParseURLHostnameToAddress(" 192.168.0.1 ", &address)); + EXPECT_FALSE(ParseURLHostnameToAddress("::1", &address)); + EXPECT_FALSE(ParseURLHostnameToAddress("[192.169.0.1]", &address)); +} + +TEST(IPAddressTest, ParseURLHostnameToAddress_IPv4) { + IPAddress address; + EXPECT_TRUE(ParseURLHostnameToAddress("192.168.0.1", &address)); + EXPECT_EQ("192,168,0,1", DumpIPAddress(address)); + EXPECT_EQ("192.168.0.1", address.ToString()); +} + +TEST(IPAddressTest, ParseURLHostnameToAddress_IPv6) { + IPAddress address; + EXPECT_TRUE(ParseURLHostnameToAddress("[1:abcd::3:4:ff]", &address)); + EXPECT_EQ("0,1,171,205,0,0,0,0,0,0,0,3,0,4,0,255", DumpIPAddress(address)); + EXPECT_EQ("1:abcd::3:4:ff", address.ToString()); +} + TEST(IPAddressTest, IPAddressStartsWith) { IPAddress ipv4_address(192, 168, 10, 5);
diff --git a/net/base/keygen_handler_win.cc b/net/base/keygen_handler_win.cc index d7eacd8..f88e7e1 100644 --- a/net/base/keygen_handler_win.cc +++ b/net/base/keygen_handler_win.cc
@@ -20,9 +20,6 @@ #include "crypto/scoped_capi_types.h" #include "crypto/wincrypt_shim.h" -#pragma comment(lib, "crypt32.lib") -#pragma comment(lib, "rpcrt4.lib") - namespace net { // Assigns the contents of a CERT_PUBLIC_KEY_INFO structure for the signing
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h index a420a24..0d3c0dc 100644 --- a/net/base/network_change_notifier.h +++ b/net/base/network_change_notifier.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/observer_list_threadsafe.h" #include "base/time/time.h" #include "net/base/net_export.h"
diff --git a/net/base/network_change_notifier_win.cc b/net/base/network_change_notifier_win.cc index 1c40522..f0f5206c 100644 --- a/net/base/network_change_notifier_win.cc +++ b/net/base/network_change_notifier_win.cc
@@ -17,8 +17,6 @@ #include "net/base/winsock_util.h" #include "net/dns/dns_config_service.h" -#pragma comment(lib, "iphlpapi.lib") - namespace net { namespace {
diff --git a/net/base/network_interfaces_win.cc b/net/base/network_interfaces_win.cc index d64fd98..3255702b 100644 --- a/net/base/network_interfaces_win.cc +++ b/net/base/network_interfaces_win.cc
@@ -4,8 +4,6 @@ #include "net/base/network_interfaces_win.h" -#pragma comment(lib, "iphlpapi.lib") - #include <algorithm> #include "base/files/file_path.h"
diff --git a/net/cert/cert_database_win.cc b/net/cert/cert_database_win.cc index ef8147b..bda2ef0 100644 --- a/net/cert/cert_database_win.cc +++ b/net/cert/cert_database_win.cc
@@ -11,8 +11,6 @@ #include "net/base/net_errors.h" #include "net/cert/x509_certificate.h" -#pragma comment(lib, "crypt32.lib") - namespace net { CertDatabase::CertDatabase()
diff --git a/net/cert/cert_verify_proc_win.cc b/net/cert/cert_verify_proc_win.cc index 86da034a..e485e3d2 100644 --- a/net/cert/cert_verify_proc_win.cc +++ b/net/cert/cert_verify_proc_win.cc
@@ -27,8 +27,6 @@ #include "net/cert/x509_certificate.h" #include "net/cert/x509_certificate_known_roots_win.h" -#pragma comment(lib, "crypt32.lib") - #if !defined(CERT_TRUST_HAS_WEAK_SIGNATURE) // This was introduced in Windows 8 / Windows Server 2012, but retroactively // ported as far back as Windows XP via system update.
diff --git a/net/cert/client_cert_verifier.h b/net/cert/client_cert_verifier.h index f2044aa..8060a028 100644 --- a/net/cert/client_cert_verifier.h +++ b/net/cert/client_cert_verifier.h
@@ -6,6 +6,7 @@ #define NET_CERT_CLIENT_CERT_VERIFIER_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "net/base/completion_callback.h" #include "net/base/net_export.h"
diff --git a/net/cert/crl_set_storage.cc b/net/cert/crl_set_storage.cc index bae7d3b..a41c72b 100644 --- a/net/cert/crl_set_storage.cc +++ b/net/cert/crl_set_storage.cc
@@ -7,6 +7,7 @@ #include "base/base64.h" #include "base/format_macros.h" #include "base/json/json_reader.h" +#include "base/memory/scoped_ptr.h" #include "base/numerics/safe_conversions.h" #include "base/strings/stringprintf.h" #include "base/trace_event/trace_event.h"
diff --git a/net/cert/ct_log_response_parser_unittest.cc b/net/cert/ct_log_response_parser_unittest.cc index e505b05..8084a283 100644 --- a/net/cert/ct_log_response_parser_unittest.cc +++ b/net/cert/ct_log_response_parser_unittest.cc
@@ -8,6 +8,7 @@ #include "base/base64.h" #include "base/json/json_reader.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/stringprintf.h" #include "base/time/time.h" #include "base/values.h"
diff --git a/net/cert/ct_log_verifier.cc b/net/cert/ct_log_verifier.cc index 0f70678..05f1b04 100644 --- a/net/cert/ct_log_verifier.cc +++ b/net/cert/ct_log_verifier.cc
@@ -137,7 +137,7 @@ return proof.nodes.empty(); // Implement the algorithm described in - // https://tools.ietf.org/html/draft-ietf-trans-rfc6962-bis-11#section-9.4.2 + // https://tools.ietf.org/html/draft-ietf-trans-rfc6962-bis-12#section-9.4.2 // // It maintains a pair of hashes |fr| and |sr|, initialized to the same // value. Each node in |proof| will be hashed to the left of both |fr| and @@ -179,10 +179,7 @@ // 5. For each subsequent value "c" in the "consistency_path" array: for (; iter != proof.nodes.end(); ++iter) { - // The proof should end exactly when |sn| becomes zero. This check is - // missing from the draft specification. It and the additional check below - // ensure the proof is consistent with the tree sizes but is not necessary - // to ensure |old_tree_hash| is a prefix of |new_tree_hash|. + // If "sn" is 0, stop the iteration and fail the proof verification. if (sn == 0) return false; // If "LSB(fn)" is set, or if "fn" is equal to "sn", then: @@ -210,13 +207,8 @@ // 6. After completing iterating through the "consistency_path" array as // described above, verify that the "fr" calculated is equal to the - // "first_hash" supplied and that the "sr" calculated is equal to the - // "second_hash" supplied. - // - // The proof should also end exactly when |sn| becomes zero. This check is - // missing from the draft specification. It and the additional check above - // ensure the proof is consistent with the tree sizes but is not necessary to - // ensure |old_tree_hash| is a prefix of |new_tree_hash|. + // "first_hash" supplied, that the "sr" calculated is equal to the + // "second_hash" supplied and that "sn" is 0. return fr == old_tree_hash && sr == new_tree_hash && sn == 0; }
diff --git a/net/cert/x509_cert_types_win.cc b/net/cert/x509_cert_types_win.cc index 70236bb..032c248 100644 --- a/net/cert/x509_cert_types_win.cc +++ b/net/cert/x509_cert_types_win.cc
@@ -14,8 +14,6 @@ #include "crypto/capi_util.h" #include "crypto/wincrypt_shim.h" -#pragma comment(lib, "crypt32.lib") - namespace net { namespace {
diff --git a/net/cert/x509_certificate_win.cc b/net/cert/x509_certificate_win.cc index 86be9913..4c4adda 100644 --- a/net/cert/x509_certificate_win.cc +++ b/net/cert/x509_certificate_win.cc
@@ -24,8 +24,6 @@ #include <blapi.h> #endif -#pragma comment(lib, "crypt32.lib") - using base::Time; namespace net {
diff --git a/net/dns/dns_config_service_win.cc b/net/dns/dns_config_service_win.cc index 46433a6..546c78f 100644 --- a/net/dns/dns_config_service_win.cc +++ b/net/dns/dns_config_service_win.cc
@@ -34,8 +34,6 @@ #include "net/dns/serial_worker.h" #include "url/url_canon.h" -#pragma comment(lib, "iphlpapi.lib") - namespace net { namespace internal {
diff --git a/net/http/http_auth_handler_ntlm_win.cc b/net/http/http_auth_handler_ntlm_win.cc index ed4cdf6..844a0a07 100644 --- a/net/http/http_auth_handler_ntlm_win.cc +++ b/net/http/http_auth_handler_ntlm_win.cc
@@ -14,8 +14,6 @@ #include "net/http/http_auth_preferences.h" #include "net/http/http_auth_sspi_win.h" -#pragma comment(lib, "secur32.lib") - namespace net { HttpAuthHandlerNTLM::HttpAuthHandlerNTLM(
diff --git a/net/http/url_security_manager_win.cc b/net/http/url_security_manager_win.cc index 19d2550..614fa44 100644 --- a/net/http/url_security_manager_win.cc +++ b/net/http/url_security_manager_win.cc
@@ -5,7 +5,6 @@ #include "net/http/url_security_manager.h" #include <urlmon.h> -#pragma comment(lib, "urlmon.lib") #include "base/macros.h" #include "base/strings/string_util.h"
diff --git a/net/net.gyp b/net/net.gyp index c00ce610..1f30e79 100644 --- a/net/net.gyp +++ b/net/net.gyp
@@ -136,7 +136,6 @@ '../third_party/zlib/zlib.gyp:zlib', '../url/url.gyp:url_lib', 'balsa', - 'http_server', 'net', 'net_quic_proto', 'net_derived_sources', @@ -263,12 +262,11 @@ 'ssl/openssl_client_key_store_unittest.cc', ], }], - [ 'enable_websockets != 1', { - 'sources/': [ - ['exclude', '^websockets/'], - ['exclude', '^server/'], + [ 'enable_websockets == 1', { + 'sources': [ + '<@(net_websockets_test_sources)', ], - 'dependencies!': [ + 'dependencies': [ 'http_server', ], }],
diff --git a/net/net.gypi b/net/net.gypi index f946a5b2..1d3b05b 100644 --- a/net/net.gypi +++ b/net/net.gypi
@@ -1727,10 +1727,6 @@ 'quic/test_tools/test_task_runner.cc', 'quic/test_tools/test_task_runner.h', 'sdch/sdch_owner_unittest.cc', - 'server/http_connection_unittest.cc', - 'server/http_server_response_info_unittest.cc', - 'server/http_server_unittest.cc', - 'server/web_socket_encoder_unittest.cc', 'socket/client_socket_pool_base_unittest.cc', 'socket/mock_client_socket_pool_manager.cc', 'socket/mock_client_socket_pool_manager.h', @@ -1847,27 +1843,6 @@ 'url_request/url_request_throttler_unittest.cc', 'url_request/url_request_unittest.cc', 'url_request/view_cache_helper_unittest.cc', - 'websockets/websocket_basic_stream_test.cc', - 'websockets/websocket_channel_test.cc', - 'websockets/websocket_deflate_parameters_test.cc', - 'websockets/websocket_deflate_predictor_impl_test.cc', - 'websockets/websocket_deflate_stream_test.cc', - 'websockets/websocket_deflater_test.cc', - 'websockets/websocket_end_to_end_test.cc', - 'websockets/websocket_errors_test.cc', - 'websockets/websocket_extension_parser_test.cc', - 'websockets/websocket_extension_test.cc', - 'websockets/websocket_frame_parser_test.cc', - 'websockets/websocket_frame_test.cc', - 'websockets/websocket_handshake_challenge_test.cc', - 'websockets/websocket_handshake_stream_create_helper_test.cc', - 'websockets/websocket_inflater_test.cc', - 'websockets/websocket_stream_cookie_test.cc', - 'websockets/websocket_stream_create_test_base.cc', - 'websockets/websocket_stream_create_test_base.h', - 'websockets/websocket_stream_test.cc', - 'websockets/websocket_test_util.cc', - 'websockets/websocket_test_util.h', ], 'net_linux_test_sources': [ 'quic/quic_end_to_end_unittest.cc', @@ -1912,6 +1887,33 @@ 'tools/quic/test_tools/simple_client.cc', 'tools/quic/test_tools/simple_client.h', ], + 'net_websockets_test_sources': [ + 'server/http_connection_unittest.cc', + 'server/http_server_response_info_unittest.cc', + 'server/http_server_unittest.cc', + 'server/web_socket_encoder_unittest.cc', + 'websockets/websocket_basic_stream_test.cc', + 'websockets/websocket_channel_test.cc', + 'websockets/websocket_deflate_parameters_test.cc', + 'websockets/websocket_deflate_predictor_impl_test.cc', + 'websockets/websocket_deflate_stream_test.cc', + 'websockets/websocket_deflater_test.cc', + 'websockets/websocket_end_to_end_test.cc', + 'websockets/websocket_errors_test.cc', + 'websockets/websocket_extension_parser_test.cc', + 'websockets/websocket_extension_test.cc', + 'websockets/websocket_frame_parser_test.cc', + 'websockets/websocket_frame_test.cc', + 'websockets/websocket_handshake_challenge_test.cc', + 'websockets/websocket_handshake_stream_create_helper_test.cc', + 'websockets/websocket_inflater_test.cc', + 'websockets/websocket_stream_cookie_test.cc', + 'websockets/websocket_stream_create_test_base.cc', + 'websockets/websocket_stream_create_test_base.h', + 'websockets/websocket_stream_test.cc', + 'websockets/websocket_test_util.cc', + 'websockets/websocket_test_util.h', + ], 'net_base_mac_ios_sources': [ 'base/mac/url_conversions.h', 'base/mac/url_conversions.mm',
diff --git a/net/net_common.gypi b/net/net_common.gypi index 330c617..c09336e1 100644 --- a/net/net_common.gypi +++ b/net/net_common.gypi
@@ -339,6 +339,34 @@ ], # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 'msvs_disabled_warnings': [4267, ], + 'all_dependent_settings': { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'crypt32.lib', + 'dhcpcsvc.lib', + 'iphlpapi.lib', + 'rpcrt4.lib', + 'secur32.lib', + 'urlmon.lib', + 'winhttp.lib', + ], + }, + }, + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'crypt32.lib', + 'dhcpcsvc.lib', + 'iphlpapi.lib', + 'rpcrt4.lib', + 'secur32.lib', + 'urlmon.lib', + 'winhttp.lib', + ], + }, + }, }, { # else: OS != "win" 'sources!': [ 'base/winsock_init.cc',
diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc index 32e8ad4b..f4ff1e3 100644 --- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc +++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
@@ -21,7 +21,6 @@ #include <windows.h> #include <winsock2.h> #include <dhcpcsdk.h> -#pragma comment(lib, "dhcpcsvc.lib") namespace {
diff --git a/net/proxy/dhcp_proxy_script_fetcher_win.cc b/net/proxy/dhcp_proxy_script_fetcher_win.cc index 03a6c6f..f9463dd 100644 --- a/net/proxy/dhcp_proxy_script_fetcher_win.cc +++ b/net/proxy/dhcp_proxy_script_fetcher_win.cc
@@ -17,7 +17,6 @@ #include <winsock2.h> #include <iphlpapi.h> -#pragma comment(lib, "iphlpapi.lib") namespace {
diff --git a/net/proxy/proxy_config_service_win.cc b/net/proxy/proxy_config_service_win.cc index 5ec2b0c..ef23711 100644 --- a/net/proxy/proxy_config_service_win.cc +++ b/net/proxy/proxy_config_service_win.cc
@@ -21,8 +21,6 @@ #include "net/base/net_errors.h" #include "net/proxy/proxy_config.h" -#pragma comment(lib, "winhttp.lib") - namespace net { namespace {
diff --git a/net/proxy/proxy_resolver_winhttp.cc b/net/proxy/proxy_resolver_winhttp.cc index 7dccbf0b..ee16ef8 100644 --- a/net/proxy/proxy_resolver_winhttp.cc +++ b/net/proxy/proxy_resolver_winhttp.cc
@@ -15,8 +15,6 @@ #include "net/proxy/proxy_resolver.h" #include "url/gurl.h" -#pragma comment(lib, "winhttp.lib") - using base::TimeDelta; using base::TimeTicks;
diff --git a/net/ssl/threaded_ssl_private_key.h b/net/ssl/threaded_ssl_private_key.h index 629ce3b..23aed37c 100644 --- a/net/ssl/threaded_ssl_private_key.h +++ b/net/ssl/threaded_ssl_private_key.h
@@ -12,6 +12,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/strings/string_piece.h" #include "net/ssl/ssl_private_key.h"
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc index 583836fa..0ed878e 100644 --- a/net/url_request/url_request_context_builder.cc +++ b/net/url_request/url_request_context_builder.cc
@@ -209,6 +209,7 @@ throttling_enabled_(false), backoff_enabled_(false), sdch_enabled_(false), + cookie_store_set_by_client_(false), net_log_(nullptr) { } @@ -259,7 +260,9 @@ void URLRequestContextBuilder::SetCookieAndChannelIdStores( scoped_ptr<CookieStore> cookie_store, scoped_ptr<ChannelIDService> channel_id_service) { - DCHECK(cookie_store); + cookie_store_set_by_client_ = true; + // If |cookie_store| is NULL, |channel_id_service| must be NULL too. + DCHECK(cookie_store || !channel_id_service); cookie_store_ = std::move(cookie_store); channel_id_service_ = std::move(channel_id_service); } @@ -337,7 +340,7 @@ storage->set_http_auth_handler_factory(std::move(http_auth_handler_factory_)); - if (cookie_store_) { + if (cookie_store_set_by_client_) { storage->set_cookie_store(std::move(cookie_store_)); storage->set_channel_id_service(std::move(channel_id_service_)); } else {
diff --git a/net/url_request/url_request_context_builder.h b/net/url_request/url_request_context_builder.h index 0d253b0..c570d60 100644 --- a/net/url_request/url_request_context_builder.h +++ b/net/url_request/url_request_context_builder.h
@@ -297,8 +297,10 @@ std::vector<scoped_ptr<URLRequestInterceptor>> url_request_interceptors); // Override the default in-memory cookie store and channel id service. - // |cookie_store| must not be NULL. |channel_id_service| may be NULL to - // disable channel id for this context. + // If both |cookie_store| and |channel_id_service| are NULL, CookieStore and + // ChannelIDService will be disabled for this context. + // If |cookie_store| is not NULL and |channel_id_service| is NULL, + // only ChannelIdService is disabled for this context. // Note that a persistent cookie store should not be used with an in-memory // channel id service, and one cookie store should not be shared between // multiple channel-id stores (or used both with and without a channel id @@ -343,6 +345,7 @@ bool throttling_enabled_; bool backoff_enabled_; bool sdch_enabled_; + bool cookie_store_set_by_client_; scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; HttpCacheParams http_cache_params_;
diff --git a/ppapi/proxy/interface_list.h b/ppapi/proxy/interface_list.h index f3172411..ac05aa5 100644 --- a/ppapi/proxy/interface_list.h +++ b/ppapi/proxy/interface_list.h
@@ -10,6 +10,7 @@ #include "base/containers/scoped_ptr_hash_map.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" #include "ppapi/proxy/interface_proxy.h" #include "ppapi/proxy/ppapi_proxy_export.h"
diff --git a/printing/printing_context.h b/printing/printing_context.h index 609f019..be671ba 100644 --- a/printing/printing_context.h +++ b/printing/printing_context.h
@@ -9,6 +9,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "printing/print_settings.h" #include "ui/gfx/native_widget_types.h"
diff --git a/remoting/BUILD.gn b/remoting/BUILD.gn index bcd380f8..5415aa9 100644 --- a/remoting/BUILD.gn +++ b/remoting/BUILD.gn
@@ -38,10 +38,11 @@ if (is_win) { deps += [ - #"//remoting:remoting_breakpad_tester", - #"//remoting:remoting_console", - #"//remoting:remoting_desktop", - #"//remoting:remoting_host_installation", + "//remoting:remoting_breakpad_tester", + "//remoting/host:remoting_console", + "//remoting/host:remoting_desktop", + + # "//remoting:remoting_host_installation", ] } @@ -87,6 +88,8 @@ "//remoting/host", ] + configs += [ "//build/config/compiler:wexit_time_destructors" ] + sources = [ "tools/breakpad_tester_win.cc", ] @@ -112,7 +115,12 @@ ] if (enable_configuration_policy) { - deps += [ "//components/policy:test_support" ] + deps += [ + "//components/policy:test_support", + + # TODO(zijiehe): This should belong to //components/policy:test_support + "//components/prefs", + ] } if (enable_remoting_host) { @@ -123,6 +131,9 @@ # TODO(GYP) remoting_unittests on Mac. Needs to be tested. if (!is_mac) { test("remoting_unittests") { + defines = [] + libs = [] + configs += [ ":version", @@ -138,6 +149,7 @@ deps = [ ":test_support", + "//base", "//google_apis", "//remoting/base:unit_tests", "//remoting/client:unit_tests", @@ -164,6 +176,19 @@ if (is_android) { deps += [ "//net/android:net_java" ] } + + if (is_win) { + defines += [ "_ALT_NO_EXCEPTIONS" ] + + libs += [ + "rpcrt4.lib", + "wtsapi32.lib", + ] + } + + if (enable_configuration_policy) { + deps += [ "//components/policy:policy_component_test_support" ] + } } if (enable_remoting_host) {
diff --git a/remoting/android/BUILD.gn b/remoting/android/BUILD.gn index 1031f7a..2d31646 100644 --- a/remoting/android/BUILD.gn +++ b/remoting/android/BUILD.gn
@@ -44,6 +44,7 @@ "//remoting/client/jni/remoting_jni_registrar.cc", "//remoting/client/jni/remoting_jni_registrar.h", ] + configs += [ "//remoting:enable_webrtc_remoting_client" ] } _raw_resources_base_dir = "$target_gen_dir/remoting_android_raw_resources/res"
diff --git a/remoting/android/cast/src/org/chromium/chromoting/CastExtensionHandler.java b/remoting/android/cast/src/org/chromium/chromoting/CastExtensionHandler.java deleted file mode 100644 index 1f35106..0000000 --- a/remoting/android/cast/src/org/chromium/chromoting/CastExtensionHandler.java +++ /dev/null
@@ -1,475 +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. - -package org.chromium.chromoting; - -import android.app.Activity; -import android.content.Context; -import android.os.Bundle; -import android.support.v4.view.MenuItemCompat; -import android.support.v7.app.MediaRouteActionProvider; -import android.support.v7.media.MediaRouteSelector; -import android.support.v7.media.MediaRouter; -import android.support.v7.media.MediaRouter.RouteInfo; -import android.view.Menu; -import android.view.MenuItem; -import android.widget.Toast; - -import com.google.android.gms.cast.Cast; -import com.google.android.gms.cast.Cast.Listener; -import com.google.android.gms.cast.CastDevice; -import com.google.android.gms.cast.CastMediaControlIntent; -import com.google.android.gms.cast.CastStatusCodes; -import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; -import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; -import com.google.android.gms.common.api.ResultCallback; -import com.google.android.gms.common.api.Status; - -import org.chromium.base.Log; -import org.chromium.chromoting.jni.JniInterface; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * A handler that interacts with the Cast Extension of the Chromoting host using extension messages. - * It uses the Cast Android Sender API to start our registered Cast Receiver App on a nearby Cast - * device, if the user chooses to do so. - */ -public class CastExtensionHandler implements ClientExtension, ActivityLifecycleListener { - - /** Extension messages of this type will be handled by the CastExtensionHandler. */ - public static final String EXTENSION_MSG_TYPE = "cast_message"; - - /** Tag used for logging. */ - private static final String TAG = "Chromoting"; - - /** Application Id of the Cast Receiver App that will be run on the Cast device. */ - private static final String RECEIVER_APP_ID = "8A1211E3"; - - /** - * Custom namespace that will be used to communicate with the Cast device. - * TODO(aiguha): Use com.google.chromeremotedesktop for official builds. - */ - private static final String CHROMOTOCAST_NAMESPACE = "urn:x-cast:com.chromoting.cast.all"; - - /** Context that wil be used to initialize the MediaRouter and the GoogleApiClient. */ - private Context mContext = null; - - /** True if the application has been launched on the Cast device. */ - private boolean mApplicationStarted; - - /** True if the client is temporarily in a disconnected state. */ - private boolean mWaitingForReconnect; - - /** Object that allows routing of media to external devices including Google Cast devices. */ - private MediaRouter mMediaRouter; - - /** Describes the capabilities of routes that the application might want to use. */ - private MediaRouteSelector mMediaRouteSelector; - - /** Cast device selected by the user. */ - private CastDevice mSelectedDevice; - - /** Object to receive callbacks about media routing changes. */ - private MediaRouter.Callback mMediaRouterCallback; - - /** Listener for events related to the connected Cast device.*/ - private Listener mCastClientListener; - - /** Object that handles Google Play Services integration. */ - private GoogleApiClient mApiClient; - - /** Callback objects for connection changes with Google Play Services. */ - private ConnectionCallbacks mConnectionCallbacks; - private OnConnectionFailedListener mConnectionFailedListener; - - /** Channel for receiving messages from the Cast device. */ - private ChromotocastChannel mChromotocastChannel; - - /** Current session ID, if there is one. */ - private String mSessionId; - - /** Queue of messages that are yet to be delivered to the Receiver App. */ - private List<String> mChromotocastMessageQueue; - - /** Current status of the application, if any. */ - private String mApplicationStatus; - - /** - * A callback class for receiving events about media routing. - */ - private class CustomMediaRouterCallback extends MediaRouter.Callback { - @Override - public void onRouteSelected(MediaRouter router, RouteInfo info) { - mSelectedDevice = CastDevice.getFromBundle(info.getExtras()); - connectApiClient(); - } - - @Override - public void onRouteUnselected(MediaRouter router, RouteInfo info) { - tearDown(); - mSelectedDevice = null; - } - } - - /** - * A callback class for receiving the result of launching an application on the user-selected - * Google Cast device. - */ - private class ApplicationConnectionResultCallback implements - ResultCallback<Cast.ApplicationConnectionResult> { - @Override - public void onResult(Cast.ApplicationConnectionResult result) { - Status status = result.getStatus(); - if (!status.isSuccess()) { - tearDown(); - return; - } - - mSessionId = result.getSessionId(); - mApplicationStatus = result.getApplicationStatus(); - mApplicationStarted = result.getWasLaunched(); - mChromotocastChannel = new ChromotocastChannel(); - - try { - Cast.CastApi.setMessageReceivedCallbacks(mApiClient, - mChromotocastChannel.getNamespace(), mChromotocastChannel); - sendPendingMessagesToCastDevice(); - } catch (IOException e) { - showToast(R.string.connection_to_cast_failed, Toast.LENGTH_SHORT); - tearDown(); - } catch (IllegalStateException e) { - showToast(R.string.connection_to_cast_failed, Toast.LENGTH_SHORT); - tearDown(); - } - } - } - - /** - * A callback class for receiving events about client connections and disconnections from - * Google Play Services. - */ - private class ConnectionCallbacks implements GoogleApiClient.ConnectionCallbacks { - @Override - public void onConnected(Bundle connectionHint) { - if (mWaitingForReconnect) { - mWaitingForReconnect = false; - reconnectChannels(); - return; - } - Cast.CastApi.launchApplication(mApiClient, RECEIVER_APP_ID, false).setResultCallback( - new ApplicationConnectionResultCallback()); - } - - @Override - public void onConnectionSuspended(int cause) { - mWaitingForReconnect = true; - } - } - - /** - * A listener for failures to connect with Google Play Services. - */ - private class ConnectionFailedListener implements GoogleApiClient.OnConnectionFailedListener { - @Override - public void onConnectionFailed(ConnectionResult result) { - Log.e(TAG, "Google Play Service connection failed: %s", result); - tearDown(); - } - } - - /** - * A channel for communication with the Cast device on the CHROMOTOCAST_NAMESPACE. - */ - private class ChromotocastChannel implements Cast.MessageReceivedCallback { - - /** - * Returns the namespace associated with this channel. - */ - public String getNamespace() { - return CHROMOTOCAST_NAMESPACE; - } - - @Override - public void onMessageReceived(CastDevice castDevice, String namespace, String message) { - if (namespace.equals(CHROMOTOCAST_NAMESPACE)) { - sendMessageToHost(message); - } - } - } - - /** - * A listener for changes when connected to a Google Cast device. - */ - private class CastClientListener extends Cast.Listener { - @Override - public void onApplicationStatusChanged() { - try { - if (mApiClient != null) { - mApplicationStatus = Cast.CastApi.getApplicationStatus(mApiClient); - } - } catch (IllegalStateException e) { - showToast(R.string.connection_to_cast_failed, Toast.LENGTH_SHORT); - tearDown(); - } - } - - @Override - public void onVolumeChanged() {} // Changes in volume do not affect us. - - @Override - public void onApplicationDisconnected(int errorCode) { - if (errorCode != CastStatusCodes.SUCCESS) { - Log.e(TAG, "Application disconnected with: %d", errorCode); - } - tearDown(); - } - } - - /** - * Constructs a CastExtensionHandler with an empty message queue. - */ - public CastExtensionHandler() { - mChromotocastMessageQueue = new ArrayList<String>(); - } - - // - // ClientExtension implementation. - // - - @Override - public String getCapability() { - return Capabilities.CAST_CAPABILITY; - } - - @Override - public boolean onExtensionMessage(String type, String data) { - if (type.equals(EXTENSION_MSG_TYPE)) { - mChromotocastMessageQueue.add(data); - if (mApplicationStarted) { - sendPendingMessagesToCastDevice(); - } - return true; - } - return false; - } - - @Override - public ActivityLifecycleListener onActivityAcceptingListener(Activity activity) { - return this; - } - - // - // ActivityLifecycleListener implementation. - // - - /** Initializes the MediaRouter and related objects using the provided activity Context. */ - @Override - public void onActivityCreated(Activity activity, Bundle savedInstanceState) { - if (activity == null) { - return; - } - mContext = activity; - mMediaRouter = MediaRouter.getInstance(activity); - mMediaRouteSelector = new MediaRouteSelector.Builder() - .addControlCategory(CastMediaControlIntent.categoryForCast(RECEIVER_APP_ID)) - .build(); - mMediaRouterCallback = new CustomMediaRouterCallback(); - } - - @Override - public void onActivityDestroyed(Activity activity) { - tearDown(); - } - - @Override - public void onActivityPaused(Activity activity) { - removeMediaRouterCallback(); - } - - @Override - public void onActivityResumed(Activity activity) { - addMediaRouterCallback(); - } - - @Override - public void onActivitySaveInstanceState(Activity activity, Bundle outState) {} - - @Override - public void onActivityStarted(Activity activity) { - addMediaRouterCallback(); - } - - @Override - public void onActivityStopped(Activity activity) { - removeMediaRouterCallback(); - } - - @Override - public boolean onActivityCreatedOptionsMenu(Activity activity, Menu menu) { - // Find the cast button in the menu. - MenuItem mediaRouteMenuItem = menu.findItem(R.id.media_route_menu_item); - if (mediaRouteMenuItem == null) { - return false; - } - - // Setup a MediaRouteActionProvider using the button. - MediaRouteActionProvider mediaRouteActionProvider = - (MediaRouteActionProvider) MenuItemCompat.getActionProvider(mediaRouteMenuItem); - mediaRouteActionProvider.setRouteSelector(mMediaRouteSelector); - - return true; - } - - @Override - public boolean onActivityOptionsItemSelected(Activity activity, MenuItem item) { - if (item.getItemId() == R.id.actionbar_disconnect) { - removeMediaRouterCallback(); - showToast(R.string.connection_to_cast_closed, Toast.LENGTH_SHORT); - tearDown(); - return true; - } - return false; - } - - // - // Extension Message Handling logic - // - - /** Sends a message to the Chromoting host. */ - private void sendMessageToHost(String data) { - JniInterface.sendExtensionMessage(EXTENSION_MSG_TYPE, data); - } - - /** Sends any messages in the message queue to the Cast device. */ - private void sendPendingMessagesToCastDevice() { - for (String msg : mChromotocastMessageQueue) { - sendMessageToCastDevice(msg); - } - mChromotocastMessageQueue.clear(); - } - - // - // Cast Sender API logic - // - - /** - * Initializes and connects to Google Play Services. - */ - private void connectApiClient() { - if (mContext == null) { - return; - } - mCastClientListener = new CastClientListener(); - mConnectionCallbacks = new ConnectionCallbacks(); - mConnectionFailedListener = new ConnectionFailedListener(); - - Cast.CastOptions.Builder apiOptionsBuilder = Cast.CastOptions - .builder(mSelectedDevice, mCastClientListener) - .setVerboseLoggingEnabled(true); - - mApiClient = new GoogleApiClient.Builder(mContext) - .addApi(Cast.API, apiOptionsBuilder.build()) - .addConnectionCallbacks(mConnectionCallbacks) - .addOnConnectionFailedListener(mConnectionFailedListener) - .build(); - mApiClient.connect(); - } - - /** - * Adds the callback object to the MediaRouter. Called when the owning activity starts/resumes. - */ - private void addMediaRouterCallback() { - if (mMediaRouter != null && mMediaRouteSelector != null && mMediaRouterCallback != null) { - mMediaRouter.addCallback(mMediaRouteSelector, mMediaRouterCallback, - MediaRouter.CALLBACK_FLAG_PERFORM_ACTIVE_SCAN); - } - } - - /** - * Removes the callback object from the MediaRouter. Called when the owning activity - * stops/pauses. - */ - private void removeMediaRouterCallback() { - if (mMediaRouter != null && mMediaRouterCallback != null) { - mMediaRouter.removeCallback(mMediaRouterCallback); - } - } - - /** - * Sends a message to the Cast device on the CHROMOTOCAST_NAMESPACE. - */ - private void sendMessageToCastDevice(String message) { - if (mApiClient == null || mChromotocastChannel == null) { - return; - } - Cast.CastApi.sendMessage(mApiClient, mChromotocastChannel.getNamespace(), message) - .setResultCallback(new ResultCallback<Status>() { - @Override - public void onResult(Status result) { - if (!result.isSuccess()) { - Log.e(TAG, "Failed to send message to cast device."); - } - } - }); - - } - - /** - * Restablishes the chromotocast message channel, so we can continue communicating with the - * Google Cast device. This must be called when resuming a connection. - */ - private void reconnectChannels() { - if (mApiClient == null && mChromotocastChannel == null) { - return; - } - try { - Cast.CastApi.setMessageReceivedCallbacks( - mApiClient, mChromotocastChannel.getNamespace(), mChromotocastChannel); - sendPendingMessagesToCastDevice(); - } catch (IOException e) { - showToast(R.string.connection_to_cast_failed, Toast.LENGTH_SHORT); - } catch (IllegalStateException e) { - showToast(R.string.connection_to_cast_failed, Toast.LENGTH_SHORT); - } - } - - /** - * Stops the running application on the Google Cast device and performs the required tearDown - * sequence. - */ - private void tearDown() { - if (mApiClient != null && mApplicationStarted && mApiClient.isConnected()) { - Cast.CastApi.stopApplication(mApiClient, mSessionId); - if (mChromotocastChannel != null) { - try { - Cast.CastApi.removeMessageReceivedCallbacks( - mApiClient, mChromotocastChannel.getNamespace()); - } catch (IOException e) { - Log.e(TAG, "Failed to remove chromotocast channel."); - } - } - mApiClient.disconnect(); - } - mChromotocastChannel = null; - mApplicationStarted = false; - mApiClient = null; - mSelectedDevice = null; - mWaitingForReconnect = false; - mSessionId = null; - } - - /** - * Makes a toast using the given message and duration. - */ - private void showToast(int messageId, int duration) { - if (mContext != null) { - Toast.makeText(mContext, mContext.getString(messageId), duration).show(); - } - } -}
diff --git a/remoting/android/client_java_tmpl.gni b/remoting/android/client_java_tmpl.gni index 357d627..3fd8603 100644 --- a/remoting/android/client_java_tmpl.gni +++ b/remoting/android/client_java_tmpl.gni
@@ -66,10 +66,6 @@ "//remoting/android/java/src/org/chromium/chromoting/TrackpadInputStrategy.java", ] - if (remoting_enable_cast) { - java_files += [ "//remoting/android/cast/src/org/chromium/chromoting/CastExtensionHandler.java" ] - } - deps = [ "//base:base_java", "//remoting/android:remoting_android_client_java_resources",
diff --git a/remoting/android/java/res/menu/desktop_actionbar.xml b/remoting/android/java/res/menu/desktop_actionbar.xml index 3e80bf5..6f1f751 100644 --- a/remoting/android/java/res/menu/desktop_actionbar.xml +++ b/remoting/android/java/res/menu/desktop_actionbar.xml
@@ -8,10 +8,6 @@ <!--Action bar buttons for the Android app's remote desktop viewer--> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> - <item android:id="@+id/media_route_menu_item" - android:title="@string/cast_button_title" - app:actionProviderClass="android.support.v7.app.MediaRouteActionProvider" - app:showAsAction="always"/> <item android:id="@+id/actionbar_trackpad_mode" android:title="@string/select_trackpad_mode" android:icon="@drawable/ic_mouse"
diff --git a/remoting/client/server_log_entry_client.cc b/remoting/client/server_log_entry_client.cc index 290165f..e99345d 100644 --- a/remoting/client/server_log_entry_client.cc +++ b/remoting/client/server_log_entry_client.cc
@@ -55,10 +55,9 @@ return "connection-failed"; case ConnectionToHost::CLOSED: return kValueSessionStateClosed; - default: - NOTREACHED(); - return nullptr; } + NOTREACHED(); + return nullptr; } const char* GetValueError(ErrorCode error) { @@ -83,12 +82,15 @@ return "network-failure"; case protocol::HOST_OVERLOAD: return "host-overload"; + case protocol::MAX_SESSION_LENGTH: + return "max-session-length"; + case protocol::HOST_CONFIGURATION_ERROR: + return "host-configuration-error"; case protocol::UNKNOWN_ERROR: return "unknown-error"; - default: - NOTREACHED(); - return nullptr; } + NOTREACHED(); + return nullptr; } } // namespace
diff --git a/remoting/host/BUILD.gn b/remoting/host/BUILD.gn index 6212842..93fdf43 100644 --- a/remoting/host/BUILD.gn +++ b/remoting/host/BUILD.gn
@@ -5,7 +5,7 @@ import("//build/config/features.gni") import("//build/config/ui.gni") import("//build/util/version.gni") -import("//remoting/remoting_host.gni") +import("//remoting/remoting_enable.gni") import("//remoting/remoting_locales.gni") import("//remoting/remoting_options.gni") import("//remoting/remoting_srcs.gni") @@ -193,11 +193,6 @@ if (enable_webrtc) { deps += [ "//third_party/webrtc/modules/desktop_capture" ] - - sources += - rebase_path(remoting_host_srcs_gypi_values.remoting_cast_sources, - ".", - "//remoting") } } @@ -302,7 +297,6 @@ "third_party_auth_config_unittest.cc", "token_validator_factory_impl_unittest.cc", "touch_injector_win_unittest.cc", - "video_frame_recorder_unittest.cc", "win/rdp_client_unittest.cc", "win/worker_process_launcher_unittest.cc", ] @@ -378,6 +372,44 @@ ] } + config("MIDL_config") { + if (is_clang) { + cflags = [ + # MIDL generated code has a habit of omitting optional braces. + "-Wno-missing-braces", + + # Source files generated by the MIDL compiler trigger warnings with + # -Wincompatible-pointer-types enabled. + "-Wno-incompatible-pointer-types", + + # Generated code contains unused variables. + "-Wno-unused-variable", + + # PROXYFILE_LIST_START is an extern with initializer. + "-Wno-extern-initializer", + ] + } + } + + # GYP version: remoting/remoting_host_win.gypi:remoting_lib_ps + static_library("remoting_lib_ps") { + configs += [ ":MIDL_config" ] + + defines = [ + "ENTRY_PREFIX=Ps", + "REGISTER_PROXY_DLL", + ] + + deps = [ + ":remoting_lib_idl", + ] + + sources = [ + "$root_gen_dir/remoting/host/chromoting_lib.dlldata.c", + "$root_gen_dir/remoting/host/chromoting_lib_p.c", + ] + } + # Makes the .mc file from the .mc.jinja file. remoting_localize("messages_localizing") { sources = [ @@ -405,6 +437,236 @@ ] } + # GYP version: remoting/remoting_host_win.gypi:remoting_console + executable("remoting_console") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + defines = [ "BINARY=BINARY_HOST_ME2ME" ] + + deps = [ + ":remoting_core", + ":remoting_windows_resources", + ] + + sources = [ + "$root_gen_dir/remoting/version.rc", + "win/entry_point.cc", + ] + + ldflags = [ + "/MANIFEST:EMBED", + "/MANIFESTINPUT:" + + rebase_path("win/dpi_aware.manifest", root_build_dir), + "/ENTRY:HostEntryPoint", + + # "/NODEFAULTLIB", + ] + } + + # GYP version: //remoting/remoting_host_win.gypi:remoting_core + shared_library("remoting_core") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + defines = [ + "_ATL_APARTMENT_THREADED", + "_ATL_CSTRING_EXPLICIT_CONSTRUCTORS", + "_ATL_NO_AUTOMATIC_NAMESPACE", + "_ATL_NO_EXCEPTIONS", + "BINARY=BINARY_CORE", + "BINARY_CORE=1", + "BINARY_DESKTOP=2", + "BINARY_HOST_ME2ME=3", + "BINARY_NATIVE_MESSAGING_HOST=4", + "BINARY_REMOTE_ASSISTANCE_HOST=5", + "DAEMON_CONTROLLER_CLSID=\"$daemon_controller_clsid\"", + "RDP_DESKTOP_SESSION_CLSID=\"$rdp_desktop_session_clsid\"", + "HOST_IMPLEMENTATION", + "ISOLATION_AWARE_ENABLED=1", + "STRICT", + "VERSION=$chrome_version_full", + ] + + if (remoting_multi_process != 0 && remoting_rdp_session != 0) { + defines += [ "REMOTING_RDP_SESSION" ] + } + + if (remoting_multi_process != 0) { + defines += [ "REMOTING_MULTI_PROCESS" ] + } + + deps = [ + ":remoting_lib_idl", + ":remoting_lib_ps", + ":remoting_me2me_host_static", + ":remoting_windows_resources", + "//base", + "//base:base_static", + "//base/allocator", + "//base/third_party/dynamic_annotations", + "//ipc", + "//net", + "//remoting/base", + "//remoting/base:breakpad", + "//remoting/codec", + "//remoting/host", + "//remoting/host:messages", + "//remoting/host/it2me:common", + "//remoting/host/native_messaging", + "//remoting/host/setup", + "//remoting/protocol", + "//sandbox/win:sandbox", # Should always use Windows version + "//third_party/webrtc/modules/desktop_capture", + ] + + sources = [ + "desktop_process_main.cc", + "host_main.cc", + "host_main.h", + "it2me/it2me_native_messaging_host_main.cc", + "it2me/it2me_native_messaging_host_main.h", + "security_key/remote_security_key_main.cc", + "security_key/remote_security_key_main.h", + "setup/me2me_native_messaging_host_main.cc", + "setup/me2me_native_messaging_host_main.h", + "win/chromoting_lib.rc", + "win/chromoting_module.cc", + "win/chromoting_module.h", + "win/core.cc", + "win/core_resource.h", + "win/host_service.cc", + "win/host_service.h", + "win/omaha.cc", + "win/omaha.h", + "win/rdp_desktop_session.cc", + "win/rdp_desktop_session.h", + "win/unprivileged_process_delegate.cc", + "win/unprivileged_process_delegate.h", + "win/wts_session_process_delegate.cc", + "win/wts_session_process_delegate.h", + "worker_process_ipc_delegate.h", + ] + + ldflags = [ + "/MANIFEST:EMBED", + "/MANIFESTINPUT:" + + rebase_path("win/common-controls.manifest", root_build_dir), + "/EXPORT:DllGetClassObject=PsDllGetClassObject,PRIVATE", + "/EXPORT:DllCanUnloadNow=PsDllCanUnloadNow,PRIVATE", + "/EXPORT:DllRegisterServer=PsDllRegisterServer,PRIVATE", + "/EXPORT:DllUnregisterServer=PsDllUnregisterServer,PRIVATE", + ] + + libs = [ + "comctl32.lib", + "rpcns4.lib", + "rpcrt4.lib", + "uuid.lib", + "wtsapi32.lib", + ] + + if (is_clang) { + cflags = [ "-Wno-header-hygiene" ] + } + } + + # GYP version: //remoting/remoting_host_win.gypi:remoting_desktop + executable("remoting_desktop") { + configs += [ + "//build/config/compiler:wexit_time_destructors", + "//build/config/win:windowed", + ] + + defines = [ "BINARY=BINARY_DESKTOP" ] + + deps = [ + ":remoting_core", + ":remoting_windows_resources", + ] + + sources = [ + "$root_gen_dir/remoting/version.rc", + "win/entry_point.cc", + ] + + ldflags = [ + "/MANIFEST:EMBED", + "/MANIFESTINPUT:" + + rebase_path("win/dpi_aware.manifest", root_build_dir), + "/MANIFESTUAC", + "/ENTRY:HostEntryPoint", + + # "/NODEFAULTLIB", + ] + + if (is_official_build) { + ldflags += [ + "/MANIFESTUAC:level=2", + "/MANIFESTUAC:uiAccess=true", + ] + } + } + + # GYP version: //remoting/remoting_host_win.gypi:remote_security_key + executable("remote_security_key") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + defines = [ "BINARY=BINARY_REMOTE_SECURITY_KEY" ] + + deps = [ + ":remoting_core", + ":remoting_windows_resources", + ] + + sources = [ + "$root_gen_dir/remoting/version.rc", + "security_key/remote_security_key_entry_point.cc", + ] + } + + # GYP version: + # //remoting/remoting_host_win.gypi:remoting_me2me_native_messaging_host + executable("remoting_me2me_native_messaging_host") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + deps = [ + ":remoting_core", + ":remoting_windows_resources", + ] + + sources = [ + "$root_gen_dir/remoting/version.rc", + "setup/me2me_native_messaging_host_entry_point.cc", + ] + } + + # GYP version: //remoting/remoting_host_win.gypi:remoting_windows_resources + remoting_localize("remoting_windows_resources") { + deps = [ + "//remoting/resources", + ] + + sources = [ + "win/core.rc.jinja2", + "win/version.rc.jinja2", + ] + + # TODO(zijiehe): Export lastchange_path from + # //chrome/version.gni:process_version + variables = [ + rebase_path(chrome_version_file), + rebase_path(remoting_version_file), + rebase_path("//build/util/LASTCHANGE"), + ] + + output = "$root_gen_dir/remoting/{{source_name_part}}" + + locale_dir = webapp_locale_dir + + encoding = "utf-16" + + locales = remoting_locales + } + # TODO(GYP) More Windows remoting targets from remoting_host_win.gypi } @@ -429,8 +691,6 @@ action_foreach("remoting_native_messaging_manifests") { if (is_mac) { assert(false, "not implemented on mac yet") - } else if (is_win) { - assert(false, "not implemented on win yet") } else { me2me_host_path = "/opt/google/chrome-remote-desktop/native-messaging-host" @@ -514,15 +774,58 @@ sources += [ "internal/internal_mac-inl.h" ] defines += [ "USE_REMOTING_MACOSX_INTERNAL" ] } + + if (is_win && remoting_multi_process != 0 && remoting_rdp_session != 0) { + defines += [ "REMOTING_RDP_SESSION" ] + } + + if (remoting_multi_process != 0) { + defines += [ "REMOTING_MULTI_PROCESS" ] + } } - if (!is_win) { + if (is_win) { + # GYP version: //remoting/remoting_host_win.gypi:remoting_me2me_host + executable("remoting_me2me_host") { + configs += [ + "//build/config/compiler:wexit_time_destructors", + "//build/config/win:windowed", + ] + + defines = [ "BINARY=BINARY_HOST_ME2ME" ] + + deps = [ + ":remoting_core", + ":remoting_windows_resources", + ] + + sources = [ + "$root_gen_dir/remoting/version.rc", + "win/entry_point.cc", + ] + + output_name = "remoting_host" + + ldflags = [ + "/MANIFEST:EMBED", + "/MANIFESTINPUT:" + + rebase_path("win/dpi_aware.manifest", root_build_dir), + "/ENTRY:HostEntryPoint", + + # "/NODEFAULTLIB", + ] + } + } else { executable("remoting_me2me_host") { sources = [ "host_main.cc", "host_main.h", ] + if (is_mac && is_chrome_branded && is_official_build) { + defines = [ "REMOTING_ENABLE_BREAKPAD" ] + } + deps = [ ":credits", ":remoting_me2me_host_static", @@ -555,8 +858,8 @@ "$remoting_version_patch" + "." + "$chrome_version_build" + "." + "$chrome_version_patch" ] - if (is_mac || is_win) { - assert(false, "not implemented on mac or win yet") + if (is_mac) { + assert(false, "not implemented on mac yet") } } }
diff --git a/remoting/host/cast_extension.cc b/remoting/host/cast_extension.cc deleted file mode 100644 index b31844c..0000000 --- a/remoting/host/cast_extension.cc +++ /dev/null
@@ -1,33 +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. - -#include "remoting/host/cast_extension.h" - -#include "net/url_request/url_request_context_getter.h" -#include "remoting/host/cast_extension_session.h" -#include "remoting/protocol/transport_context.h" - -namespace remoting { - -const char kCapability[] = "casting"; - -CastExtension::CastExtension( - scoped_refptr<protocol::TransportContext> transport_context) - : transport_context_(transport_context) {} - -CastExtension::~CastExtension() {} - -std::string CastExtension::capability() const { - return kCapability; -} - -scoped_ptr<HostExtensionSession> CastExtension::CreateExtensionSession( - ClientSessionControl* client_session_control, - protocol::ClientStub* client_stub) { - return CastExtensionSession::Create(transport_context_, - client_session_control, client_stub); -} - -} // namespace remoting -
diff --git a/remoting/host/cast_extension.h b/remoting/host/cast_extension.h deleted file mode 100644 index 1c1c6d36..0000000 --- a/remoting/host/cast_extension.h +++ /dev/null
@@ -1,42 +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. - -#ifndef REMOTING_HOST_CAST_EXTENSION_H_ -#define REMOTING_HOST_CAST_EXTENSION_H_ - -#include <string> - -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" -#include "remoting/host/host_extension.h" - -namespace remoting { - -namespace protocol { -class TransportContext; -} // namespace protocol - -// CastExtension extends HostExtension to enable WebRTC support. -class CastExtension : public HostExtension { - public: - CastExtension(scoped_refptr<protocol::TransportContext> transport_context); - ~CastExtension() override; - - // HostExtension interface. - std::string capability() const override; - scoped_ptr<HostExtensionSession> CreateExtensionSession( - ClientSessionControl* client_session_control, - protocol::ClientStub* client_stub) override; - - private: - scoped_refptr<protocol::TransportContext> transport_context_; - - DISALLOW_COPY_AND_ASSIGN(CastExtension); -}; - -} // namespace remoting - -#endif // REMOTING_HOST_CAST_EXTENSION_H_ -
diff --git a/remoting/host/cast_extension_session.cc b/remoting/host/cast_extension_session.cc deleted file mode 100644 index 88e4daa..0000000 --- a/remoting/host/cast_extension_session.cc +++ /dev/null
@@ -1,639 +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. - -#include "remoting/host/cast_extension_session.h" - -#include <utility> - -#include "base/bind.h" -#include "base/json/json_reader.h" -#include "base/json/json_writer.h" -#include "base/logging.h" -#include "base/macros.h" -#include "base/synchronization/waitable_event.h" -#include "base/thread_task_runner_handle.h" -#include "remoting/host/client_session.h" -#include "remoting/proto/control.pb.h" -#include "remoting/protocol/client_stub.h" -#include "remoting/protocol/port_allocator_factory.h" -#include "remoting/protocol/transport_context.h" -#include "remoting/protocol/webrtc_video_capturer_adapter.h" -#include "third_party/webrtc/api/mediastreaminterface.h" -#include "third_party/webrtc/api/test/fakeconstraints.h" - -namespace remoting { - -// Used as the type attribute of all Cast protocol::ExtensionMessages. -const char kExtensionMessageType[] = "cast_message"; - -// Top-level keys used in all extension messages between host and client. -// Must keep synced with webapp. -const char kTopLevelData[] = "chromoting_data"; -const char kTopLevelSubject[] = "subject"; - -// Keys used to describe the subject of a cast extension message. WebRTC-related -// message subjects are prepended with "webrtc_". -// Must keep synced with webapp. -const char kSubjectReady[] = "ready"; -const char kSubjectTest[] = "test"; -const char kSubjectNewCandidate[] = "webrtc_candidate"; -const char kSubjectOffer[] = "webrtc_offer"; -const char kSubjectAnswer[] = "webrtc_answer"; - -// WebRTC headers used inside messages with subject = "webrtc_*". -const char kWebRtcCandidate[] = "candidate"; -const char kWebRtcSessionDescType[] = "type"; -const char kWebRtcSessionDescSDP[] = "sdp"; -const char kWebRtcSDPMid[] = "sdpMid"; -const char kWebRtcSDPMLineIndex[] = "sdpMLineIndex"; - -// Media labels used over the PeerConnection. -const char kVideoLabel[] = "cast_video_label"; -const char kStreamLabel[] = "stream_label"; - -const char kWorkerThreadName[] = "CastExtensionSessionWorkerThread"; - -// Interval between each call to PollPeerConnectionStats(). -const int kStatsLogIntervalSec = 10; - -// Minimum frame rate for video streaming over the PeerConnection in frames per -// second, added as a media constraint when constructing the video source for -// the Peer Connection. -const int kMinFramesPerSecond = 5; - -// A webrtc::SetSessionDescriptionObserver implementation used to receive the -// results of setting local and remote descriptions of the PeerConnection. -class CastSetSessionDescriptionObserver - : public webrtc::SetSessionDescriptionObserver { - public: - static CastSetSessionDescriptionObserver* Create() { - return new rtc::RefCountedObject<CastSetSessionDescriptionObserver>(); - } - void OnSuccess() override { - VLOG(1) << "Setting session description succeeded."; - } - void OnFailure(const std::string& error) override { - LOG(ERROR) << "Setting session description failed: " << error; - } - - protected: - CastSetSessionDescriptionObserver() {} - ~CastSetSessionDescriptionObserver() override {} - - DISALLOW_COPY_AND_ASSIGN(CastSetSessionDescriptionObserver); -}; - -// A webrtc::CreateSessionDescriptionObserver implementation used to receive the -// results of creating descriptions for this end of the PeerConnection. -class CastCreateSessionDescriptionObserver - : public webrtc::CreateSessionDescriptionObserver { - public: - static CastCreateSessionDescriptionObserver* Create( - CastExtensionSession* session) { - return new rtc::RefCountedObject<CastCreateSessionDescriptionObserver>( - session); - } - void OnSuccess(webrtc::SessionDescriptionInterface* desc) override { - if (cast_extension_session_ == nullptr) { - LOG(ERROR) - << "No CastExtensionSession. Creating session description succeeded."; - return; - } - cast_extension_session_->OnCreateSessionDescription(desc); - } - void OnFailure(const std::string& error) override { - if (cast_extension_session_ == nullptr) { - LOG(ERROR) - << "No CastExtensionSession. Creating session description failed."; - return; - } - cast_extension_session_->OnCreateSessionDescriptionFailure(error); - } - void SetCastExtensionSession(CastExtensionSession* cast_extension_session) { - cast_extension_session_ = cast_extension_session; - } - - protected: - explicit CastCreateSessionDescriptionObserver(CastExtensionSession* session) - : cast_extension_session_(session) {} - ~CastCreateSessionDescriptionObserver() override {} - - private: - CastExtensionSession* cast_extension_session_; - - DISALLOW_COPY_AND_ASSIGN(CastCreateSessionDescriptionObserver); -}; - -// A webrtc::StatsObserver implementation used to receive statistics about the -// current PeerConnection. -class CastStatsObserver : public webrtc::StatsObserver { - public: - static CastStatsObserver* Create() { - return new rtc::RefCountedObject<CastStatsObserver>(); - } - - void OnComplete(const webrtc::StatsReports& reports) override { - VLOG(1) << "Received " << reports.size() << " new StatsReports."; - - int index = 0; - for (const auto* report : reports) { - VLOG(1) << "Report " << index++ << ":"; - for (const auto& v : report->values()) { - VLOG(1) << "Stat: " << v.second->display_name() << "=" - << v.second->ToString() << "."; - } - } - } - - protected: - CastStatsObserver() {} - ~CastStatsObserver() override {} - - DISALLOW_COPY_AND_ASSIGN(CastStatsObserver); -}; - -// TODO(aiguha): Fix PeerConnnection-related tear down crash caused by premature -// destruction of cricket::CaptureManager (which occurs on releasing -// |peer_conn_factory_|). See crbug.com/403840. -CastExtensionSession::~CastExtensionSession() { - DCHECK(caller_task_runner_->BelongsToCurrentThread()); - - // Explicitly clear |create_session_desc_observer_|'s pointer to |this|, - // since the CastExtensionSession is destructing. Otherwise, - // |create_session_desc_observer_| would be left with a dangling pointer. - create_session_desc_observer_->SetCastExtensionSession(nullptr); - - CleanupPeerConnection(); -} - -// static -scoped_ptr<CastExtensionSession> CastExtensionSession::Create( - scoped_refptr<protocol::TransportContext> transport_context, - ClientSessionControl* client_session_control, - protocol::ClientStub* client_stub) { - scoped_ptr<CastExtensionSession> cast_extension_session( - new CastExtensionSession(transport_context, - client_session_control, client_stub)); - if (!cast_extension_session->WrapTasksAndSave() || - !cast_extension_session->InitializePeerConnection()) { - return nullptr; - } - return cast_extension_session; -} - -void CastExtensionSession::OnCreateSessionDescription( - webrtc::SessionDescriptionInterface* desc) { - if (!caller_task_runner_->BelongsToCurrentThread()) { - caller_task_runner_->PostTask( - FROM_HERE, - base::Bind(&CastExtensionSession::OnCreateSessionDescription, - base::Unretained(this), - desc)); - return; - } - - peer_connection_->SetLocalDescription( - CastSetSessionDescriptionObserver::Create(), desc); - - base::DictionaryValue json; - json.SetString(kWebRtcSessionDescType, desc->type()); - std::string subject = - (desc->type() == "offer") ? kSubjectOffer : kSubjectAnswer; - std::string desc_str; - desc->ToString(&desc_str); - json.SetString(kWebRtcSessionDescSDP, desc_str); - std::string json_str; - if (!base::JSONWriter::Write(json, &json_str)) { - LOG(ERROR) << "Failed to serialize sdp message."; - return; - } - - SendMessageToClient(subject.c_str(), json_str); -} - -void CastExtensionSession::OnCreateSessionDescriptionFailure( - const std::string& error) { - VLOG(1) << "Creating Session Description failed: " << error; -} - -// TODO(aiguha): Support the case(s) where we've grabbed the capturer already, -// but another extension reset the video pipeline. We should remove the -// stream from the peer connection here, and then attempt to re-setup the -// peer connection in the OnRenegotiationNeeded() callback. -// See crbug.com/403843. -void CastExtensionSession::OnCreateVideoCapturer( - scoped_ptr<webrtc::DesktopCapturer>* capturer) { - if (has_grabbed_capturer_) { - LOG(ERROR) << "The video pipeline was reset unexpectedly."; - has_grabbed_capturer_ = false; - peer_connection_->RemoveStream(stream_.release()); - return; - } - - if (received_offer_) { - has_grabbed_capturer_ = true; - if (SetupVideoStream(std::move(*capturer))) { - peer_connection_->CreateAnswer(create_session_desc_observer_, nullptr); - } else { - has_grabbed_capturer_ = false; - // Ignore the received offer, since we failed to setup a video stream. - received_offer_ = false; - } - return; - } -} - -bool CastExtensionSession::ModifiesVideoPipeline() const { - return true; -} - -// Returns true if the |message| is a Cast ExtensionMessage, even if -// it was badly formed or a resulting action failed. This is done so that -// the host does not continue to attempt to pass |message| to other -// HostExtensionSessions. -bool CastExtensionSession::OnExtensionMessage( - ClientSessionControl* client_session_control, - protocol::ClientStub* client_stub, - const protocol::ExtensionMessage& message) { - if (message.type() != kExtensionMessageType) { - return false; - } - - scoped_ptr<base::Value> value = base::JSONReader::Read(message.data()); - base::DictionaryValue* client_message; - if (!(value && value->GetAsDictionary(&client_message))) { - LOG(ERROR) << "Could not read cast extension message."; - return true; - } - - std::string subject; - if (!client_message->GetString(kTopLevelSubject, &subject)) { - LOG(ERROR) << "Invalid Cast Extension Message (missing subject header)."; - return true; - } - - if (subject == kSubjectOffer && !received_offer_) { - // Reset the video pipeline so we can grab the screen capturer and setup - // a video stream. - if (ParseAndSetRemoteDescription(client_message)) { - received_offer_ = true; - LOG(INFO) << "About to ResetVideoPipeline."; - client_session_control_->ResetVideoPipeline(); - - } - } else if (subject == kSubjectAnswer) { - ParseAndSetRemoteDescription(client_message); - } else if (subject == kSubjectNewCandidate) { - ParseAndAddICECandidate(client_message); - } else { - VLOG(1) << "Unexpected CastExtension Message: " << message.data(); - } - return true; -} - -// Private methods ------------------------------------------------------------ - -CastExtensionSession::CastExtensionSession( - scoped_refptr<protocol::TransportContext> transport_context, - ClientSessionControl* client_session_control, - protocol::ClientStub* client_stub) - : caller_task_runner_(base::ThreadTaskRunnerHandle::Get()), - transport_context_(transport_context), - client_session_control_(client_session_control), - client_stub_(client_stub), - stats_observer_(CastStatsObserver::Create()), - received_offer_(false), - has_grabbed_capturer_(false), - signaling_thread_wrapper_(nullptr), - worker_thread_wrapper_(nullptr), - worker_thread_(kWorkerThreadName) { - DCHECK(caller_task_runner_->BelongsToCurrentThread()); - DCHECK(client_session_control_); - DCHECK(client_stub_); - - // The worker thread is created with base::MessageLoop::TYPE_IO because - // the PeerConnection performs some port allocation operations on this thread - // that require it. See crbug.com/404013. - base::Thread::Options options(base::MessageLoop::TYPE_IO, 0); - worker_thread_.StartWithOptions(options); - worker_task_runner_ = worker_thread_.task_runner(); -} - -bool CastExtensionSession::ParseAndSetRemoteDescription( - base::DictionaryValue* message) { - DCHECK(peer_connection_.get() != nullptr); - - base::DictionaryValue* message_data; - if (!message->GetDictionary(kTopLevelData, &message_data)) { - LOG(ERROR) << "Invalid Cast Extension Message (missing data)."; - return false; - } - - std::string webrtc_type; - if (!message_data->GetString(kWebRtcSessionDescType, &webrtc_type)) { - LOG(ERROR) - << "Invalid Cast Extension Message (missing webrtc type header)."; - return false; - } - - std::string sdp; - if (!message_data->GetString(kWebRtcSessionDescSDP, &sdp)) { - LOG(ERROR) << "Invalid Cast Extension Message (missing webrtc sdp header)."; - return false; - } - - webrtc::SdpParseError error; - webrtc::SessionDescriptionInterface* session_description( - webrtc::CreateSessionDescription(webrtc_type, sdp, &error)); - - if (!session_description) { - LOG(ERROR) << "Invalid Cast Extension Message (could not parse sdp)."; - VLOG(1) << "SdpParseError was: " << error.description; - return false; - } - - peer_connection_->SetRemoteDescription( - CastSetSessionDescriptionObserver::Create(), session_description); - return true; -} - -bool CastExtensionSession::ParseAndAddICECandidate( - base::DictionaryValue* message) { - DCHECK(peer_connection_.get() != nullptr); - - base::DictionaryValue* message_data; - if (!message->GetDictionary(kTopLevelData, &message_data)) { - LOG(ERROR) << "Invalid Cast Extension Message (missing data)."; - return false; - } - - std::string candidate_str; - std::string sdp_mid; - int sdp_mlineindex = 0; - if (!message_data->GetString(kWebRtcSDPMid, &sdp_mid) || - !message_data->GetInteger(kWebRtcSDPMLineIndex, &sdp_mlineindex) || - !message_data->GetString(kWebRtcCandidate, &candidate_str)) { - LOG(ERROR) << "Invalid Cast Extension Message (could not parse)."; - return false; - } - - rtc::scoped_ptr<webrtc::IceCandidateInterface> candidate( - webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, candidate_str, - nullptr)); - if (!candidate.get()) { - LOG(ERROR) - << "Invalid Cast Extension Message (could not create candidate)."; - return false; - } - - if (!peer_connection_->AddIceCandidate(candidate.get())) { - LOG(ERROR) << "Failed to apply received ICE Candidate to PeerConnection."; - return false; - } - - VLOG(1) << "Received and Added ICE Candidate: " << candidate_str; - - return true; -} - -bool CastExtensionSession::SendMessageToClient(const std::string& subject, - const std::string& data) { - DCHECK(caller_task_runner_->BelongsToCurrentThread()); - - if (client_stub_ == nullptr) { - LOG(ERROR) << "No Client Stub. Cannot send message to client."; - return false; - } - - base::DictionaryValue message_dict; - message_dict.SetString(kTopLevelSubject, subject); - message_dict.SetString(kTopLevelData, data); - std::string message_json; - - if (!base::JSONWriter::Write(message_dict, &message_json)) { - LOG(ERROR) << "Failed to serialize JSON message."; - return false; - } - - protocol::ExtensionMessage message; - message.set_type(kExtensionMessageType); - message.set_data(message_json); - client_stub_->DeliverHostMessage(message); - return true; -} - -void CastExtensionSession::EnsureTaskAndSetSend(rtc::Thread** ptr, - base::WaitableEvent* event) { - jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); - jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); - *ptr = jingle_glue::JingleThreadWrapper::current(); - - if (event != nullptr) { - event->Signal(); - } -} - -bool CastExtensionSession::WrapTasksAndSave() { - DCHECK(caller_task_runner_->BelongsToCurrentThread()); - - EnsureTaskAndSetSend(&signaling_thread_wrapper_); - if (signaling_thread_wrapper_ == nullptr) - return false; - - base::WaitableEvent wrap_worker_thread_event(true, false); - worker_task_runner_->PostTask( - FROM_HERE, - base::Bind(&CastExtensionSession::EnsureTaskAndSetSend, - base::Unretained(this), - &worker_thread_wrapper_, - &wrap_worker_thread_event)); - wrap_worker_thread_event.Wait(); - - return (worker_thread_wrapper_ != nullptr); -} - -bool CastExtensionSession::InitializePeerConnection() { - DCHECK(caller_task_runner_->BelongsToCurrentThread()); - DCHECK(!peer_conn_factory_); - DCHECK(!peer_connection_); - DCHECK(worker_thread_wrapper_ != nullptr); - DCHECK(signaling_thread_wrapper_ != nullptr); - - peer_conn_factory_ = webrtc::CreatePeerConnectionFactory( - worker_thread_wrapper_, signaling_thread_wrapper_, nullptr, nullptr, - nullptr); - - if (!peer_conn_factory_.get()) { - CleanupPeerConnection(); - return false; - } - - VLOG(1) << "Created PeerConnectionFactory successfully."; - - // DTLS-SRTP is the preferred encryption method. If set to kValueFalse, the - // peer connection uses SDES. Disabling SDES as well will cause the peer - // connection to fail to connect. - // Note: For protection and unprotection of SRTP packets, the libjingle - // ENABLE_EXTERNAL_AUTH flag must not be set. - webrtc::FakeConstraints constraints; - constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, - webrtc::MediaConstraintsInterface::kValueTrue); - - scoped_ptr<cricket::PortAllocator> port_allocator = - transport_context_->port_allocator_factory()->CreatePortAllocator( - transport_context_); - - webrtc::PeerConnectionInterface::RTCConfiguration rtc_config; - peer_connection_ = peer_conn_factory_->CreatePeerConnection( - rtc_config, &constraints, - rtc::scoped_ptr<cricket::PortAllocator>(port_allocator.release()), - nullptr, this); - - if (!peer_connection_.get()) { - CleanupPeerConnection(); - return false; - } - - VLOG(1) << "Created PeerConnection successfully."; - - create_session_desc_observer_ = - CastCreateSessionDescriptionObserver::Create(this); - - // Send a test message to the client. Then, notify the client to start - // webrtc offer/answer negotiation. - if (!SendMessageToClient(kSubjectTest, "Hello, client.") || - !SendMessageToClient(kSubjectReady, "Host ready to receive offers.")) { - LOG(ERROR) << "Failed to send messages to client."; - return false; - } - - return true; -} - -bool CastExtensionSession::SetupVideoStream( - scoped_ptr<webrtc::DesktopCapturer> desktop_capturer) { - DCHECK(caller_task_runner_->BelongsToCurrentThread()); - DCHECK(desktop_capturer); - - if (stream_) { - VLOG(1) << "Already added MediaStream. Aborting Setup."; - return false; - } - - scoped_ptr<protocol::WebrtcVideoCapturerAdapter> video_capturer_adapter( - new protocol::WebrtcVideoCapturerAdapter(std::move(desktop_capturer))); - - // Set video stream constraints. - webrtc::FakeConstraints video_constraints; - video_constraints.AddMandatory( - webrtc::MediaConstraintsInterface::kMinFrameRate, kMinFramesPerSecond); - - rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track = - peer_conn_factory_->CreateVideoTrack( - kVideoLabel, - peer_conn_factory_->CreateVideoSource( - video_capturer_adapter.release(), &video_constraints)); - - stream_ = peer_conn_factory_->CreateLocalMediaStream(kStreamLabel); - - if (!stream_->AddTrack(video_track) || - !peer_connection_->AddStream(stream_)) { - return false; - } - - VLOG(1) << "Setup video stream successfully."; - - return true; -} - -void CastExtensionSession::PollPeerConnectionStats() { - if (!connection_active()) { - VLOG(1) << "Cannot poll stats while PeerConnection is inactive."; - } - rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> video_track = - stream_->FindVideoTrack(kVideoLabel); - peer_connection_->GetStats( - stats_observer_, video_track.release(), - webrtc::PeerConnectionInterface::kStatsOutputLevelStandard); -} - -void CastExtensionSession::CleanupPeerConnection() { - peer_connection_->Close(); - peer_connection_ = nullptr; - stream_ = nullptr; - peer_conn_factory_ = nullptr; - worker_thread_.Stop(); -} - -bool CastExtensionSession::connection_active() const { - return peer_connection_.get() != nullptr; -} - -// webrtc::PeerConnectionObserver implementation ------------------------------- -void CastExtensionSession::OnSignalingChange( - webrtc::PeerConnectionInterface::SignalingState new_state) { - VLOG(1) << "PeerConnectionObserver: SignalingState changed to:" << new_state; -} - -void CastExtensionSession::OnAddStream(webrtc::MediaStreamInterface* stream) { - VLOG(1) << "PeerConnectionObserver: stream added: " << stream->label(); -} - -void CastExtensionSession::OnRemoveStream( - webrtc::MediaStreamInterface* stream) { - VLOG(1) << "PeerConnectionObserver: stream removed: " << stream->label(); -} - -void CastExtensionSession::OnDataChannel( - webrtc::DataChannelInterface* data_channel) { - VLOG(1) << "PeerConnectionObserver: data channel: " << data_channel->label(); -} - -void CastExtensionSession::OnRenegotiationNeeded() { - VLOG(1) << "PeerConnectionObserver: renegotiation needed."; -} - -void CastExtensionSession::OnIceConnectionChange( - webrtc::PeerConnectionInterface::IceConnectionState new_state) { - VLOG(1) << "PeerConnectionObserver: IceConnectionState changed to: " - << new_state; - - // TODO(aiguha): Maybe start timer only if enabled by command-line flag or - // at a particular verbosity level. - if (!stats_polling_timer_.IsRunning() && - new_state == webrtc::PeerConnectionInterface::kIceConnectionConnected) { - stats_polling_timer_.Start( - FROM_HERE, - base::TimeDelta::FromSeconds(kStatsLogIntervalSec), - this, - &CastExtensionSession::PollPeerConnectionStats); - } -} - -void CastExtensionSession::OnIceGatheringChange( - webrtc::PeerConnectionInterface::IceGatheringState new_state) { - VLOG(1) << "PeerConnectionObserver: IceGatheringState changed to: " - << new_state; -} - -void CastExtensionSession::OnIceCandidate( - const webrtc::IceCandidateInterface* candidate) { - std::string candidate_str; - if (!candidate->ToString(&candidate_str)) { - LOG(ERROR) << "PeerConnectionObserver: failed to serialize candidate."; - return; - } - base::DictionaryValue json; - json.SetString(kWebRtcSDPMid, candidate->sdp_mid()); - json.SetInteger(kWebRtcSDPMLineIndex, candidate->sdp_mline_index()); - json.SetString(kWebRtcCandidate, candidate_str); - std::string json_str; - if (!base::JSONWriter::Write(json, &json_str)) { - LOG(ERROR) << "Failed to serialize candidate message."; - return; - } - SendMessageToClient(kSubjectNewCandidate, json_str); -} - -} // namespace remoting
diff --git a/remoting/host/cast_extension_session.h b/remoting/host/cast_extension_session.h deleted file mode 100644 index 18e4b27..0000000 --- a/remoting/host/cast_extension_session.h +++ /dev/null
@@ -1,230 +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. - -#ifndef REMOTING_HOST_CAST_EXTENSION_SESSION_H_ -#define REMOTING_HOST_CAST_EXTENSION_SESSION_H_ - -#include <string> - -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" -#include "base/threading/thread.h" -#include "base/timer/timer.h" -#include "base/values.h" -#include "jingle/glue/thread_wrapper.h" -#include "remoting/host/host_extension_session.h" -#include "third_party/webrtc/api/peerconnectioninterface.h" -#include "third_party/webrtc/base/scoped_ref_ptr.h" -#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" - -namespace base { -class SingleThreadTaskRunner; -class WaitableEvent; -} // namespace base - -namespace webrtc { -class MediaStreamInterface; -} // namespace webrtc - -namespace remoting { - -class CastCreateSessionDescriptionObserver; - -namespace protocol { -class TransportContext; -} // namespace protocol - -// A HostExtensionSession implementation that enables WebRTC support using -// the PeerConnection native API. -class CastExtensionSession : public HostExtensionSession, - public webrtc::PeerConnectionObserver { - public: - ~CastExtensionSession() override; - - // Creates and returns a CastExtensionSession object, after performing - // initialization steps on it. The caller must take ownership of the returned - // object. - static scoped_ptr<CastExtensionSession> Create( - scoped_refptr<protocol::TransportContext> transport_context, - ClientSessionControl* client_session_control, - protocol::ClientStub* client_stub); - - // Called by webrtc::CreateSessionDescriptionObserver implementation. - void OnCreateSessionDescription(webrtc::SessionDescriptionInterface* desc); - void OnCreateSessionDescriptionFailure(const std::string& error); - - // HostExtensionSession interface. - void OnCreateVideoCapturer( - scoped_ptr<webrtc::DesktopCapturer>* capturer) override; - bool ModifiesVideoPipeline() const override; - bool OnExtensionMessage(ClientSessionControl* client_session_control, - protocol::ClientStub* client_stub, - const protocol::ExtensionMessage& message) override; - - // webrtc::PeerConnectionObserver interface. - void OnSignalingChange( - webrtc::PeerConnectionInterface::SignalingState new_state) override; - void OnAddStream(webrtc::MediaStreamInterface* stream) override; - void OnRemoveStream(webrtc::MediaStreamInterface* stream) override; - void OnDataChannel(webrtc::DataChannelInterface* data_channel) override; - void OnRenegotiationNeeded() override; - void OnIceConnectionChange( - webrtc::PeerConnectionInterface::IceConnectionState new_state) override; - void OnIceGatheringChange( - webrtc::PeerConnectionInterface::IceGatheringState new_state) override; - void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) override; - - private: - CastExtensionSession( - scoped_refptr<protocol::TransportContext> transport_context, - ClientSessionControl* client_session_control, - protocol::ClientStub* client_stub); - - // Parses |message| for a Session Description and sets the remote - // description, returning true if successful. - bool ParseAndSetRemoteDescription(base::DictionaryValue* message); - - // Parses |message| for a PeerConnection ICE candidate and adds it to the - // Peer Connection, returning true if successful. - bool ParseAndAddICECandidate(base::DictionaryValue* message); - - // Sends a message to the client through |client_stub_|. This method must be - // called on the network thread. - // - // A protocol::ExtensionMessage consists of two string fields: type and data. - // - // The type field must be |kExtensionMessageType|. - // The data field must be a JSON formatted string with two compulsory - // top level keys: |kTopLevelSubject| and |kTopLevelData|. - // - // The |subject| of a message describes the message to the receiving peer, - // effectively identifying the command the receiving peer should perform. - // The |subject| MUST be one of constants formatted as kSubject* defined in - // the .cc file. This set of subjects is identical between host and client, - // thus standardizing how they communicate. - // The |data| of a message depends on the |subject| of the message. - // - // Examples of what ExtensionMessage.data() could look like: - // - // Host Ready Message: - // Notifies the remote peer that we are ready to receive an offer. - // - // { - // "subject": "ready", - // "chromoting_data": "Host Ready to receive offers" - // } - // - // WebRTC Offer Message: - // Represents the offer received from the remote peer. The local - // peer would then respond with a webrtc_answer message. - // { - // "subject": "webrtc_offer", - // "chromoting_data": { - // "sdp" : "...", - // "type" : "offer" - // } - // } - // - // WebRTC Candidate Message: - // Represents an ICE candidate received from the remote peer. Each peer - // shares its local ICE candidates in this way, until a connection is - // established. - // - // { - // "subject": "webrtc_candidate", - // "chromoting_data": { - // "candidate" : "...", - // "sdpMid" : "...", - // "sdpMLineIndex" : "..." - // } - // } - // - bool SendMessageToClient(const std::string& subject, const std::string& data); - - // Creates the jingle wrapper for the current thread, sets send to allowed, - // and saves a pointer to the relevant thread pointer in ptr. If |event| - // is not nullptr, signals the event on completion. - void EnsureTaskAndSetSend(rtc::Thread** ptr, - base::WaitableEvent* event = nullptr); - - // Wraps each task runner in JingleThreadWrapper using EnsureTaskAndSetSend(), - // returning true if successful. Wrapping the task runners allows them to be - // shared with and used by the (about to be created) PeerConnectionFactory. - bool WrapTasksAndSave(); - - // Initializes PeerConnectionFactory and PeerConnection and sends a "ready" - // message to client. Returns true if these steps are performed successfully. - bool InitializePeerConnection(); - - // Constructs a CastVideoCapturerAdapter, a VideoSource, a VideoTrack and a - // MediaStream |stream_|, which it adds to the |peer_connection_|. Returns - // true if these steps are performed successfully. This method is called only - // when a PeerConnection offer is received from the client. - bool SetupVideoStream(scoped_ptr<webrtc::DesktopCapturer> desktop_capturer); - - // Polls a single stats report from the PeerConnection immediately. Called - // periodically using |stats_polling_timer_| after a PeerConnection has been - // established. - void PollPeerConnectionStats(); - - // Closes |peer_connection_|, releases |peer_connection_|, |stream_| and - // |peer_conn_factory_| and stops the worker thread. - void CleanupPeerConnection(); - - // Check if the connection is active. - bool connection_active() const; - - // TaskRunners that will be used to setup the PeerConnectionFactory's - // signalling thread and worker thread respectively. - scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; - scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; - - // Objects related to the WebRTC PeerConnection. - rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_; - rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_conn_factory_; - rtc::scoped_refptr<webrtc::MediaStreamInterface> stream_; - rtc::scoped_refptr<CastCreateSessionDescriptionObserver> - create_session_desc_observer_; - - // TransportContext for P2P transport. - scoped_refptr<protocol::TransportContext> transport_context_; - - // Interface to interact with ClientSession. - ClientSessionControl* client_session_control_; - - // Interface through which messages can be sent to the client. - protocol::ClientStub* client_stub_; - - // Used to track webrtc connection statistics. - rtc::scoped_refptr<webrtc::StatsObserver> stats_observer_; - - // Used to repeatedly poll stats from the |peer_connection_|. - base::RepeatingTimer stats_polling_timer_; - - // True if a PeerConnection offer from the client has been received. This - // necessarily means that the host is not the caller in this attempted - // peer connection. - bool received_offer_; - - // True if the webrtc::ScreenCapturer has been grabbed through the - // OnCreateVideoCapturer() callback. - bool has_grabbed_capturer_; - - // PeerConnection signaling and worker threads created from - // JingleThreadWrappers. Each is created by calling - // jingle_glue::EnsureForCurrentMessageLoop() and thus deletes itself - // automatically when the associated MessageLoop is destroyed. - rtc::Thread* signaling_thread_wrapper_; - rtc::Thread* worker_thread_wrapper_; - - // Worker thread that is wrapped to create |worker_thread_wrapper_|. - base::Thread worker_thread_; - - DISALLOW_COPY_AND_ASSIGN(CastExtensionSession); -}; - -} // namespace remoting - -#endif // REMOTING_HOST_CAST_EXTENSION_SESSION_H_
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc index 81ccacfb..c483321 100644 --- a/remoting/host/chromoting_host.cc +++ b/remoting/host/chromoting_host.cc
@@ -20,7 +20,6 @@ #include "remoting/host/desktop_environment.h" #include "remoting/host/host_config.h" #include "remoting/host/input_injector.h" -#include "remoting/host/video_frame_recorder.h" #include "remoting/protocol/client_stub.h" #include "remoting/protocol/host_stub.h" #include "remoting/protocol/ice_connection_to_client.h"
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc index 05da647..e3a6766 100644 --- a/remoting/host/client_session.cc +++ b/remoting/host/client_session.cc
@@ -310,8 +310,24 @@ input_injector_->Start(CreateClipboardProxy()); SetDisableInputs(false); - // Start recording video. - ResetVideoPipeline(); + // Create MouseShapePump to send mouse cursor shape. + mouse_shape_pump_.reset( + new MouseShapePump(desktop_environment_->CreateMouseCursorMonitor(), + connection_->client_stub())); + + // Create a VideoStream to pump frames from the capturer to the client. + video_stream_ = connection_->StartVideoStream( + desktop_environment_->CreateVideoCapturer()); + + video_stream_->SetSizeCallback( + base::Bind(&ClientSession::OnScreenSizeChanged, base::Unretained(this))); + + // Apply video-control parameters to the new stream. + video_stream_->SetLosslessEncode(lossless_video_encode_); + video_stream_->SetLosslessColor(lossless_video_color_); + + // Pause capturing if necessary. + video_stream_->Pause(pause_video_); // Create an AudioPump if audio is enabled, to pump audio samples. if (connection_->session()->config().is_audio_enabled()) { @@ -358,11 +374,6 @@ event_handler_->OnSessionClosed(this); } -void ClientSession::OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder) { - DCHECK(CalledOnValidThread()); - extension_manager_->OnCreateVideoEncoder(encoder); -} - void ClientSession::OnInputEventReceived( protocol::ConnectionToClient* connection, int64_t event_timestamp) { @@ -412,42 +423,6 @@ disable_clipboard_filter_.set_enabled(!disable_inputs); } -void ClientSession::ResetVideoPipeline() { - DCHECK(CalledOnValidThread()); - - video_stream_.reset(); - mouse_shape_pump_.reset(); - - // Create VideoEncoder and DesktopCapturer to match the session's video - // channel configuration. - scoped_ptr<webrtc::DesktopCapturer> video_capturer = - desktop_environment_->CreateVideoCapturer(); - extension_manager_->OnCreateVideoCapturer(&video_capturer); - - // Don't start the video stream if the extension took ownership of the - // capturer. - if (!video_capturer) - return; - - // Create MouseShapePump to send mouse cursor shape. - mouse_shape_pump_.reset( - new MouseShapePump(desktop_environment_->CreateMouseCursorMonitor(), - connection_->client_stub())); - - // Create a VideoStream to pump frames from the capturer to the client. - video_stream_ = connection_->StartVideoStream(std::move(video_capturer)); - - video_stream_->SetSizeCallback( - base::Bind(&ClientSession::OnScreenSizeChanged, base::Unretained(this))); - - // Apply video-control parameters to the new stream. - video_stream_->SetLosslessEncode(lossless_video_encode_); - video_stream_->SetLosslessColor(lossless_video_color_); - - // Pause capturing if necessary. - video_stream_->Pause(pause_video_); -} - scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { DCHECK(CalledOnValidThread());
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h index 34feab64..0caf5e1 100644 --- a/remoting/host/client_session.h +++ b/remoting/host/client_session.h
@@ -116,7 +116,6 @@ protocol::ConnectionToClient* connection) override; void OnConnectionClosed(protocol::ConnectionToClient* connection, protocol::ErrorCode error) override; - void OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder) override; void OnInputEventReceived(protocol::ConnectionToClient* connection, int64_t timestamp) override; void OnRouteChange(protocol::ConnectionToClient* connection, @@ -128,13 +127,10 @@ void DisconnectSession(protocol::ErrorCode error) override; void OnLocalMouseMoved(const webrtc::DesktopVector& position) override; void SetDisableInputs(bool disable_inputs) override; - void ResetVideoPipeline() override; - protocol::ConnectionToClient* connection() const { - return connection_.get(); - } + protocol::ConnectionToClient* connection() const { return connection_.get(); } - bool is_authenticated() { return is_authenticated_; } + bool is_authenticated() { return is_authenticated_; } const std::string* client_capabilities() const { return client_capabilities_.get(); @@ -197,8 +193,6 @@ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; // Objects responsible for sending video, audio and mouse shape. - // |video_stream_| and |mouse_shape_pump_| may be nullptr if the video - // stream is handled by an extension, see ResetVideoPipeline(). scoped_ptr<AudioPump> audio_pump_; scoped_ptr<protocol::VideoStream> video_stream_; scoped_ptr<MouseShapePump> mouse_shape_pump_;
diff --git a/remoting/host/client_session_control.h b/remoting/host/client_session_control.h index cb930f9..9a458c85 100644 --- a/remoting/host/client_session_control.h +++ b/remoting/host/client_session_control.h
@@ -32,9 +32,6 @@ // Disables or enables the remote input in the client session. virtual void SetDisableInputs(bool disable_inputs) = 0; - - // Resets the video pipeline, including re-creating the capturer & encoder. - virtual void ResetVideoPipeline() = 0; }; } // namespace remoting
diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc index d288f5c..32da050c 100644 --- a/remoting/host/client_session_unittest.cc +++ b/remoting/host/client_session_unittest.cc
@@ -374,15 +374,6 @@ } } -// Verifies that the client's video pipeline can be reset mid-session. -TEST_F(ClientSessionTest, ResetVideoPipeline) { - CreateClientSession(); - ConnectClientSession(); - NotifyVideoSize(); - - client_session_->ResetVideoPipeline(); -} - // Verifies that clients can have extensions registered, resulting in the // correct capabilities being reported, and messages delivered correctly. // The extension system is tested more extensively in the @@ -396,9 +387,6 @@ FakeExtension extension3("ext3", "cap3"); extensions_.push_back(&extension3); - // Set the second extension to request to modify the video pipeline. - extension2.set_steal_video_capturer(true); - // Verify that the ClientSession reports the correct capabilities. EXPECT_CALL(client_stub_, SetCapabilities(EqCapabilities("cap1 cap3"))); @@ -412,11 +400,6 @@ capabilities_message.set_capabilities("cap1 cap4 default"); client_session_->SetCapabilities(capabilities_message); - // Simulate OnCreateVideoEncoder() which is normally called by the - // ConnectionToClient when creating the video stream. - scoped_ptr<VideoEncoder> encoder(new VideoEncoderVerbatim()); - connection_->event_handler()->OnCreateVideoEncoder(&encoder); - // Verify that the correct extension messages are delivered, and dropped. protocol::ExtensionMessage message1; message1.set_type("ext1"); @@ -436,56 +419,13 @@ // ext1 was instantiated and sent a message, and did not wrap anything. EXPECT_TRUE(extension1.was_instantiated()); EXPECT_TRUE(extension1.has_handled_message()); - EXPECT_FALSE(extension1.has_wrapped_video_encoder()); // ext2 was instantiated but not sent a message, and wrapped video encoder. EXPECT_TRUE(extension2.was_instantiated()); EXPECT_FALSE(extension2.has_handled_message()); - EXPECT_TRUE(extension2.has_wrapped_video_encoder()); // ext3 was sent a message but not instantiated. EXPECT_FALSE(extension3.was_instantiated()); } -// Verifies that an extension can "steal" the video capture, in which case no -// VideoFramePump is instantiated. -TEST_F(ClientSessionTest, StealVideoCapturer) { - FakeExtension extension("ext1", "cap1"); - extensions_.push_back(&extension); - - // Verify that the ClientSession reports the correct capabilities. - EXPECT_CALL(client_stub_, SetCapabilities(EqCapabilities("cap1"))); - - CreateClientSession(); - ConnectClientSession(); - - // Mimic the client reporting an overlapping set of capabilities. - protocol::Capabilities capabilities_message; - capabilities_message.set_capabilities("cap1"); - client_session_->SetCapabilities(capabilities_message); - - extension.set_steal_video_capturer(true); - client_session_->ResetVideoPipeline(); - - base::RunLoop().RunUntilIdle(); - - // Verify that video control messages received while there is no video - // scheduler active won't crash things. - protocol::VideoControl video_control; - video_control.set_enable(false); - video_control.set_lossless_encode(true); - video_control.set_lossless_color(true); - client_session_->ControlVideo(video_control); - - // TODO(wez): Find a way to verify that the ClientSession never captures any - // frames in this case. - - client_session_->DisconnectSession(protocol::OK); - client_session_.reset(); - - // ext1 was instantiated and wrapped the video capturer. - EXPECT_TRUE(extension.was_instantiated()); - EXPECT_TRUE(extension.has_wrapped_video_capturer()); -} - } // namespace remoting
diff --git a/remoting/host/clipboard.h b/remoting/host/clipboard.h index 8ac3381..c977b7a 100644 --- a/remoting/host/clipboard.h +++ b/remoting/host/clipboard.h
@@ -8,6 +8,7 @@ #include <string> #include "base/callback.h" +#include "base/memory/scoped_ptr.h" namespace remoting {
diff --git a/remoting/host/desktop_session_agent.cc b/remoting/host/desktop_session_agent.cc index c3d678b..274bd2a 100644 --- a/remoting/host/desktop_session_agent.cc +++ b/remoting/host/desktop_session_agent.cc
@@ -253,13 +253,6 @@ NOTREACHED(); } -void DesktopSessionAgent::ResetVideoPipeline() { - DCHECK(caller_task_runner_->BelongsToCurrentThread()); - - // This method is only used by HostExtensionSessions in the network process. - NOTREACHED(); -} - void DesktopSessionAgent::OnStartSessionAgent( const std::string& authenticated_jid, const ScreenResolution& resolution,
diff --git a/remoting/host/desktop_session_agent.h b/remoting/host/desktop_session_agent.h index 358bfce..2c49ee9c 100644 --- a/remoting/host/desktop_session_agent.h +++ b/remoting/host/desktop_session_agent.h
@@ -111,7 +111,6 @@ void DisconnectSession(protocol::ErrorCode error) override; void OnLocalMouseMoved(const webrtc::DesktopVector& position) override; void SetDisableInputs(bool disable_inputs) override; - void ResetVideoPipeline() override; // Handles StartSessionAgent request from the client. void OnStartSessionAgent(const std::string& authenticated_jid,
diff --git a/remoting/host/fake_host_extension.cc b/remoting/host/fake_host_extension.cc index 3317b770..1e980ef 100644 --- a/remoting/host/fake_host_extension.cc +++ b/remoting/host/fake_host_extension.cc
@@ -21,10 +21,6 @@ ~Session() override {} // HostExtensionSession interface. - void OnCreateVideoCapturer( - scoped_ptr<webrtc::DesktopCapturer>* encoder) override; - void OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder) override; - bool ModifiesVideoPipeline() const override; bool OnExtensionMessage(ClientSessionControl* client_session_control, protocol::ClientStub* client_stub, const protocol::ExtensionMessage& message) override; @@ -36,28 +32,9 @@ DISALLOW_COPY_AND_ASSIGN(Session); }; -FakeExtension::Session::Session( - FakeExtension* extension, const std::string& message_type) - : extension_(extension), - message_type_(message_type) { -} - -void FakeExtension::Session::OnCreateVideoCapturer( - scoped_ptr<webrtc::DesktopCapturer>* capturer) { - extension_->has_wrapped_video_capturer_ = true; - if (extension_->steal_video_capturer_) { - capturer->reset(); - } -} - -void FakeExtension::Session::OnCreateVideoEncoder( - scoped_ptr<VideoEncoder>* encoder) { - extension_->has_wrapped_video_encoder_ = true; -} - -bool FakeExtension::Session::ModifiesVideoPipeline() const { - return extension_->steal_video_capturer_; -} +FakeExtension::Session::Session(FakeExtension* extension, + const std::string& message_type) + : extension_(extension), message_type_(message_type) {} bool FakeExtension::Session::OnExtensionMessage( ClientSessionControl* client_session_control, @@ -72,17 +49,9 @@ FakeExtension::FakeExtension(const std::string& message_type, const std::string& capability) - : message_type_(message_type), - capability_(capability), - steal_video_capturer_(false), - has_handled_message_(false), - has_wrapped_video_encoder_(false), - has_wrapped_video_capturer_(false), - was_instantiated_(false) { -} + : message_type_(message_type), capability_(capability) {} -FakeExtension::~FakeExtension() { -} +FakeExtension::~FakeExtension() {} std::string FakeExtension::capability() const { return capability_;
diff --git a/remoting/host/fake_host_extension.h b/remoting/host/fake_host_extension.h index e6ab26b..7152de4 100644 --- a/remoting/host/fake_host_extension.h +++ b/remoting/host/fake_host_extension.h
@@ -33,17 +33,8 @@ ClientSessionControl* client_session_control, protocol::ClientStub* client_stub) override; - // Controls for testing. - void set_steal_video_capturer(bool steal_video_capturer) { - steal_video_capturer_ = steal_video_capturer; - } - // Accessors for testing. bool has_handled_message() const { return has_handled_message_; } - bool has_wrapped_video_encoder() const { return has_wrapped_video_encoder_; } - bool has_wrapped_video_capturer() const { - return has_wrapped_video_capturer_; - } bool was_instantiated() const { return was_instantiated_; } private: @@ -56,19 +47,11 @@ // The capability this fake reports, and requires clients to support, if any. std::string capability_; - // True if this extension should intercept creation of the session's video - // capturer and consume it, preventing the video pipeline being created. - bool steal_video_capturer_; - // True if a message of |message_type_| has been processed by this extension. - bool has_handled_message_; - - // True if this extension had the opportunity to modify the video pipeline. - bool has_wrapped_video_encoder_; - bool has_wrapped_video_capturer_; + bool has_handled_message_ = false; // True if CreateExtensionSession() was called on this extension. - bool was_instantiated_; + bool was_instantiated_ = false; DISALLOW_COPY_AND_ASSIGN(FakeExtension); };
diff --git a/remoting/host/host_extension_session.cc b/remoting/host/host_extension_session.cc deleted file mode 100644 index c2d8076..0000000 --- a/remoting/host/host_extension_session.cc +++ /dev/null
@@ -1,24 +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. - -#include "remoting/host/host_extension_session.h" - -#include "remoting/codec/video_encoder.h" -#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" - -namespace remoting { - -void HostExtensionSession::OnCreateVideoCapturer( - scoped_ptr<webrtc::DesktopCapturer>* capturer) { -} - -void HostExtensionSession::OnCreateVideoEncoder( - scoped_ptr<VideoEncoder>* encoder) { -} - -bool HostExtensionSession::ModifiesVideoPipeline() const { - return false; -} - -} // namespace remoting
diff --git a/remoting/host/host_extension_session.h b/remoting/host/host_extension_session.h index 1c51644c..d30360f 100644 --- a/remoting/host/host_extension_session.h +++ b/remoting/host/host_extension_session.h
@@ -27,20 +27,6 @@ public: virtual ~HostExtensionSession() {} - // Hook functions called when the video pipeline is being (re)constructed. - // Implementations will receive these calls only if they express the need to - // modify the pipeline (see below). They may replace or wrap |capturer| and/or - // |encoder|, e.g. to filter video frames in some way. - // If either |capturer| or |encoder| are reset then the video pipeline is not - // constructed. - virtual void OnCreateVideoCapturer( - scoped_ptr<webrtc::DesktopCapturer>* capturer); - virtual void OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder); - - // Must return true if the HostExtensionSession needs the opportunity to - // modify the video pipeline. - virtual bool ModifiesVideoPipeline() const; - // Called when the host receives an |ExtensionMessage| for the |ClientSession| // associated with this |HostExtensionSession|. // It returns |true| if the message was handled, and |false| otherwise.
diff --git a/remoting/host/host_extension_session_manager.cc b/remoting/host/host_extension_session_manager.cc index b6ce83e..0d56793d 100644 --- a/remoting/host/host_extension_session_manager.cc +++ b/remoting/host/host_extension_session_manager.cc
@@ -10,6 +10,7 @@ #include "remoting/host/host_extension.h" #include "remoting/host/host_extension_session.h" #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" + namespace remoting { HostExtensionSessionManager::HostExtensionSessionManager( @@ -17,11 +18,9 @@ ClientSessionControl* client_session_control) : client_session_control_(client_session_control), client_stub_(nullptr), - extensions_(extensions) { -} + extensions_(extensions) {} -HostExtensionSessionManager::~HostExtensionSessionManager() { -} +HostExtensionSessionManager::~HostExtensionSessionManager() {} std::string HostExtensionSessionManager::GetCapabilities() const { std::string capabilities; @@ -39,26 +38,6 @@ return capabilities; } -void HostExtensionSessionManager::OnCreateVideoCapturer( - scoped_ptr<webrtc::DesktopCapturer>* capturer) { - for (HostExtensionSessions::const_iterator it = extension_sessions_.begin(); - it != extension_sessions_.end(); ++it) { - if ((*it)->ModifiesVideoPipeline()) { - (*it)->OnCreateVideoCapturer(capturer); - } - } -} - -void HostExtensionSessionManager::OnCreateVideoEncoder( - scoped_ptr<VideoEncoder>* encoder) { - for (HostExtensionSessions::const_iterator it = extension_sessions_.begin(); - it != extension_sessions_.end(); ++it) { - if ((*it)->ModifiesVideoPipeline()) { - (*it)->OnCreateVideoEncoder(encoder); - } - } -} - void HostExtensionSessionManager::OnNegotiatedCapabilities( protocol::ClientStub* client_stub, const std::string& capabilities) { @@ -67,8 +46,6 @@ client_stub_ = client_stub; - bool reset_video_pipeline = false; - for (HostExtensions::const_iterator extension = extensions_.begin(); extension != extensions_.end(); ++extension) { // If the extension requires a capability that was not negotiated then do @@ -79,29 +56,20 @@ } scoped_ptr<HostExtensionSession> extension_session = - (*extension)->CreateExtensionSession( - client_session_control_, client_stub_); + (*extension) + ->CreateExtensionSession(client_session_control_, client_stub_); DCHECK(extension_session); - if (extension_session->ModifiesVideoPipeline()) { - reset_video_pipeline = true; - } - extension_sessions_.push_back(extension_session.release()); } - - // Re-create the video pipeline if one or more extensions need to modify it. - if (reset_video_pipeline) { - client_session_control_->ResetVideoPipeline(); - } } bool HostExtensionSessionManager::OnExtensionMessage( const protocol::ExtensionMessage& message) { for(HostExtensionSessions::const_iterator it = extension_sessions_.begin(); it != extension_sessions_.end(); ++it) { - if ((*it)->OnExtensionMessage( - client_session_control_, client_stub_, message)) { + if ((*it)->OnExtensionMessage(client_session_control_, client_stub_, + message)) { return true; } }
diff --git a/remoting/host/host_extension_session_manager.h b/remoting/host/host_extension_session_manager.h index 756bc08..ad9c2c7 100644 --- a/remoting/host/host_extension_session_manager.h +++ b/remoting/host/host_extension_session_manager.h
@@ -43,13 +43,6 @@ // Returns the union of all capabilities supported by registered extensions. std::string GetCapabilities() const; - // Calls the corresponding hook functions for each extension, to allow them - // to wrap or replace video pipeline components. Only extensions which return - // true from ModifiesVideoPipeline() will be called. - // The order in which extensions are called is undefined. - void OnCreateVideoCapturer(scoped_ptr<webrtc::DesktopCapturer>* capturer); - void OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder); - // Handles completion of authentication and capabilities negotiation, creating // the set of HostExtensionSessions to match the client's capabilities. void OnNegotiatedCapabilities(protocol::ClientStub* client_stub,
diff --git a/remoting/host/host_extension_session_manager_unittest.cc b/remoting/host/host_extension_session_manager_unittest.cc index c6d61682..32d582c 100644 --- a/remoting/host/host_extension_session_manager_unittest.cc +++ b/remoting/host/host_extension_session_manager_unittest.cc
@@ -107,85 +107,4 @@ EXPECT_FALSE(extension3_.was_instantiated()); } -// Verifies that matching extensions are given the opportunity to wrap or -// replace the video capturer. -TEST_F(HostExtensionSessionManagerTest, CanWrapVideoCapturer) { - HostExtensionSessionManager extension_manager(extensions_, - &client_session_control_); - - // Set up all the extensions to request to modify the video pipeline. - extension1_.set_steal_video_capturer(true); - extension2_.set_steal_video_capturer(true); - extension3_.set_steal_video_capturer(true); - extension_manager.OnNegotiatedCapabilities(&client_stub_, "cap1"); - - scoped_ptr<webrtc::DesktopCapturer> dummy_capturer; - extension_manager.OnCreateVideoCapturer(&dummy_capturer); - - EXPECT_FALSE(extension1_.has_wrapped_video_encoder()); - EXPECT_TRUE(extension1_.has_wrapped_video_capturer()); - EXPECT_FALSE(extension2_.has_wrapped_video_encoder()); - EXPECT_TRUE(extension2_.has_wrapped_video_capturer()); - EXPECT_FALSE(extension3_.was_instantiated()); -} - -// Verifies that matching extensions are given the opportunity to wrap or -// replace the video encoders. -TEST_F(HostExtensionSessionManagerTest, CanWrapVideoEncoder) { - HostExtensionSessionManager extension_manager(extensions_, - &client_session_control_); - - // Set up all the extensions to request to modify the video pipeline. - extension1_.set_steal_video_capturer(true); - extension2_.set_steal_video_capturer(true); - extension3_.set_steal_video_capturer(true); - extension_manager.OnNegotiatedCapabilities(&client_stub_, "cap1"); - - scoped_ptr<VideoEncoder> dummy_encoder; - extension_manager.OnCreateVideoEncoder(&dummy_encoder); - - EXPECT_TRUE(extension1_.has_wrapped_video_encoder()); - EXPECT_FALSE(extension1_.has_wrapped_video_capturer()); - EXPECT_TRUE(extension2_.has_wrapped_video_encoder()); - EXPECT_FALSE(extension2_.has_wrapped_video_capturer()); - EXPECT_FALSE(extension3_.was_instantiated()); -} - -// Verifies that only extensions which report that they modify the video -// pipeline actually get called to modify it. -TEST_F(HostExtensionSessionManagerTest, RespectModifiesVideoPipeline) { - HostExtensionSessionManager extension_manager(extensions_, - &client_session_control_); - - // Set up the second extension to request to modify the video pipeline. - extension2_.set_steal_video_capturer(true); - extension_manager.OnNegotiatedCapabilities(&client_stub_, "cap1"); - - scoped_ptr<webrtc::DesktopCapturer> dummy_capturer; - extension_manager.OnCreateVideoCapturer(&dummy_capturer); - scoped_ptr<VideoEncoder> dummy_encoder; - extension_manager.OnCreateVideoEncoder(&dummy_encoder); - - EXPECT_FALSE(extension1_.has_wrapped_video_encoder()); - EXPECT_FALSE(extension1_.has_wrapped_video_capturer()); - EXPECT_TRUE(extension2_.has_wrapped_video_encoder()); - EXPECT_TRUE(extension2_.has_wrapped_video_capturer()); - EXPECT_FALSE(extension3_.was_instantiated()); -} - -// Verifies that if an extension reports that it modifies the video pipeline -// then ResetVideoPipeline() is called on the ClientSessionControl interface. -TEST_F(HostExtensionSessionManagerTest, CallsResetVideoPipeline) { - HostExtensionSessionManager extension_manager(extensions_, - &client_session_control_); - - EXPECT_CALL(client_session_control_, ResetVideoPipeline()); - - // Set up only the first extension to request to modify the video pipeline. - extension1_.set_steal_video_capturer(true); - - extension_manager.OnNegotiatedCapabilities(&client_stub_, "cap1"); -} - - } // namespace remoting
diff --git a/remoting/host/host_window_proxy.cc b/remoting/host/host_window_proxy.cc index 4fd0fae..60dd0a1 100644 --- a/remoting/host/host_window_proxy.cc +++ b/remoting/host/host_window_proxy.cc
@@ -44,7 +44,6 @@ void DisconnectSession(protocol::ErrorCode error) override; void OnLocalMouseMoved(const webrtc::DesktopVector& position) override; void SetDisableInputs(bool disable_inputs) override; - void ResetVideoPipeline() override; // Task runner on which public methods of this class must be called. scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; @@ -180,9 +179,4 @@ client_session_control_->SetDisableInputs(disable_inputs); } -void HostWindowProxy::Core::ResetVideoPipeline() { - // ResetVideoPipeline is only used by HostExtensionSession implementations. - NOTREACHED(); -} - } // namespace remoting
diff --git a/remoting/host/it2me/BUILD.gn b/remoting/host/it2me/BUILD.gn index a584c721..6909a350 100644 --- a/remoting/host/it2me/BUILD.gn +++ b/remoting/host/it2me/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/config/features.gni") -import("//remoting/remoting_host.gni") +import("//remoting/remoting_enable.gni") import("//remoting/remoting_srcs.gni") source_set("common") { @@ -27,34 +27,67 @@ ] } -if (!is_win && !is_chromeos && enable_remoting_host) { - executable("remote_assistance_host") { - sources = [ - "it2me_native_messaging_host_entry_point.cc", - "it2me_native_messaging_host_main.cc", - "it2me_native_messaging_host_main.h", - ] +if (!is_chromeos && enable_remoting_host) { + if (is_win) { + # GYP version: + # //remoting/remoting_host_win.gypi:remoting_it2me_native_messaging_host + executable("remote_assistance_host") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] - configs += [ - "//build/config/compiler:wexit_time_destructors", - "//remoting:version", - ] + deps = [ + "//base/allocator", + "//remoting/host:remoting_core", + "//remoting/host:remoting_windows_resources", + ] - deps = [ - ":common", - "//build/config/sanitizers:deps", - "//remoting/host", - "//remoting/host/native_messaging", - "//remoting/proto", - "//ui/gfx", - ] + sources = [ + "$root_gen_dir/remoting/version.rc", + "it2me_native_messaging_host_entry_point.cc", + ] - if (enable_webrtc) { - deps += [ "//third_party/libjingle:libjingle_webrtc" ] + defines = [ "BINARY=BINARY_REMOTE_ASSISTANCE_HOST" ] + + ldflags = [ + "/MANIFEST:EMBED", + "/MANIFESTINPUT:" + + rebase_path("../win/common-controls.manifest", root_build_dir), + "/MANIFESTINPUT:" + + rebase_path("../win/dpi_aware.manifest", root_build_dir), + + # "/NODEFAULTLIB", TODO(zijiehe): Why IgnoreAllDefaultLibraries: true in + # GYP does not take effect? + "comctl32.lib", + ] } + } else { + executable("remote_assistance_host") { + sources = [ + "it2me_native_messaging_host_entry_point.cc", + "it2me_native_messaging_host_main.cc", + "it2me_native_messaging_host_main.h", + ] - if (is_desktop_linux) { - deps += [ "//build/config/linux/gtk2" ] + configs += [ + "//build/config/compiler:wexit_time_destructors", + "//remoting:version", + ] + + deps = [ + ":common", + "//build/config/sanitizers:deps", + "//remoting/host", + "//remoting/host/native_messaging", + "//remoting/proto", + "//ui/gfx", + ] + + if (enable_webrtc) { + deps += [ "//third_party/libjingle:libjingle_webrtc" ] + } + + if (is_desktop_linux) { + deps += [ "//build/config/linux/gtk2" ] + } } } }
diff --git a/remoting/host/linux/audio_pipe_reader_unittest.cc b/remoting/host/linux/audio_pipe_reader_unittest.cc index 57c0fd0..a624a20 100644 --- a/remoting/host/linux/audio_pipe_reader_unittest.cc +++ b/remoting/host/linux/audio_pipe_reader_unittest.cc
@@ -11,6 +11,7 @@ #include "base/files/file.h" #include "base/files/scoped_temp_dir.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/threading/thread.h"
diff --git a/remoting/host/native_messaging/log_message_handler.h b/remoting/host/native_messaging/log_message_handler.h index 047a536..f8b2d1f 100644 --- a/remoting/host/native_messaging/log_message_handler.h +++ b/remoting/host/native_messaging/log_message_handler.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include "base/callback.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/values.h"
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index c0b0b22..ce0950d 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc
@@ -81,7 +81,6 @@ #include "remoting/host/token_validator_factory_impl.h" #include "remoting/host/usage_stats_consent.h" #include "remoting/host/username.h" -#include "remoting/host/video_frame_recorder_host_extension.h" #include "remoting/protocol/authenticator.h" #include "remoting/protocol/channel_authenticator.h" #include "remoting/protocol/chromium_port_allocator_factory.h" @@ -160,9 +159,6 @@ // Command line switch used to enable VP9 encoding. const char kEnableVp9SwitchName[] = "enable-vp9"; -// Command line switch used to enable and configure the frame-recorder. -const char kFrameRecorderBufferKbName[] = "frame-recorder-buffer-kb"; - const char kWindowIdSwitchName[] = "window-id"; // Command line switch used to enable WebRTC-based protocol. @@ -400,7 +396,7 @@ scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; // Accessed on the network thread. - HostState state_; + HostState state_ = HOST_STARTING; scoped_ptr<ConfigWatcher> config_watcher_; @@ -411,32 +407,31 @@ std::string serialized_config_; std::string host_owner_; std::string host_owner_email_; - bool use_service_account_; - bool enable_vp9_; - int64_t frame_recorder_buffer_size_; + bool use_service_account_ = false; + bool enable_vp9_ = false; scoped_ptr<PolicyWatcher> policy_watcher_; - PolicyState policy_state_; + PolicyState policy_state_ = POLICY_INITIALIZING; std::string client_domain_; std::string host_domain_; - bool host_username_match_required_; - bool allow_nat_traversal_; - bool allow_relay_; + bool host_username_match_required_ = false; + bool allow_nat_traversal_ = true; + bool allow_relay_ = true; PortRange udp_port_range_; std::string talkgadget_prefix_; - bool allow_pairing_; + bool allow_pairing_ = true; - bool curtain_required_; + bool curtain_required_ = false; ThirdPartyAuthConfig third_party_auth_config_; - bool gnubby_auth_policy_enabled_; - bool gnubby_extension_supported_; + bool gnubby_auth_policy_enabled_ = false; + bool gnubby_extension_supported_ = false; // Boolean to change flow, where necessary, if we're // capturing a window instead of the entire desktop. - bool enable_window_capture_; + bool enable_window_capture_ = false; // Used to specify which window to stream, if enabled. - webrtc::WindowId window_id_; + webrtc::WindowId window_id_ = 0; // Must outlive |gcd_state_updater_| and |signaling_connector_|. scoped_ptr<OAuthTokenGetter> oauth_token_getter_; @@ -470,7 +465,7 @@ #endif // defined(REMOTING_MULTI_PROCESS) int* exit_code_out_; - bool signal_parent_; + bool signal_parent_ = false; scoped_refptr<PairingRegistry> pairing_registry_; @@ -483,23 +478,8 @@ int* exit_code_out, ShutdownWatchdog* shutdown_watchdog) : context_(std::move(context)), - state_(HOST_STARTING), - use_service_account_(false), - enable_vp9_(false), - frame_recorder_buffer_size_(0), - policy_state_(POLICY_INITIALIZING), - host_username_match_required_(false), - allow_nat_traversal_(true), - allow_relay_(true), - allow_pairing_(true), - curtain_required_(false), - gnubby_auth_policy_enabled_(false), - gnubby_extension_supported_(false), - enable_window_capture_(false), - window_id_(0), self_(this), exit_code_out_(exit_code_out), - signal_parent_(false), shutdown_watchdog_(shutdown_watchdog) { StartOnUiThread(); } @@ -1070,22 +1050,6 @@ config.GetBoolean(kEnableVp9ConfigPath, &enable_vp9_); } - // Allow the command-line to override the size of the frame recorder buffer. - int frame_recorder_buffer_kb = 0; - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - kFrameRecorderBufferKbName)) { - std::string switch_value = - base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - kFrameRecorderBufferKbName); - base::StringToInt(switch_value, &frame_recorder_buffer_kb); - } else { - config.GetInteger(kFrameRecorderBufferKbConfigPath, - &frame_recorder_buffer_kb); - } - if (frame_recorder_buffer_kb > 0) { - frame_recorder_buffer_size_ = 1024LL * frame_recorder_buffer_kb; - } - return true; } @@ -1545,13 +1509,6 @@ host_->AddExtension(make_scoped_ptr(new GnubbyExtension())); } - if (frame_recorder_buffer_size_ > 0) { - scoped_ptr<VideoFrameRecorderHostExtension> frame_recorder_extension( - new VideoFrameRecorderHostExtension()); - frame_recorder_extension->SetMaxContentBytes(frame_recorder_buffer_size_); - host_->AddExtension(std::move(frame_recorder_extension)); - } - // TODO(simonmorris): Get the maximum session duration from a policy. #if defined(OS_LINUX) host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20));
diff --git a/remoting/host/video_frame_recorder.cc b/remoting/host/video_frame_recorder.cc deleted file mode 100644 index 3cec5b7..0000000 --- a/remoting/host/video_frame_recorder.cc +++ /dev/null
@@ -1,251 +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. - -#include "remoting/host/video_frame_recorder.h" - -#include <utility> - -#include "base/bind.h" -#include "base/location.h" -#include "base/macros.h" -#include "base/single_thread_task_runner.h" -#include "base/stl_util.h" -#include "base/thread_task_runner_handle.h" -#include "remoting/codec/video_encoder.h" -#include "remoting/proto/video.pb.h" -#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" -#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" -#include "third_party/webrtc/modules/desktop_capture/desktop_region.h" - -namespace remoting { - -static int64_t FrameContentSize(const webrtc::DesktopFrame* frame) { - DCHECK_GT(frame->stride(), 0); - return frame->stride() * frame->size().height(); -} - -// VideoEncoder wrapper used to intercept frames passed to a real VideoEncoder. -class VideoFrameRecorder::RecordingVideoEncoder : public VideoEncoder { - public: - RecordingVideoEncoder(scoped_ptr<VideoEncoder> encoder, - scoped_refptr<base::TaskRunner> recorder_task_runner, - base::WeakPtr<VideoFrameRecorder> recorder); - - base::WeakPtr<RecordingVideoEncoder> AsWeakPtr(); - - void set_enable_recording(bool enable_recording) { - DCHECK(!encoder_task_runner_.get() || - encoder_task_runner_->BelongsToCurrentThread()); - enable_recording_ = enable_recording; - } - - // remoting::VideoEncoder interface. - void SetLosslessEncode(bool want_lossless) override; - void SetLosslessColor(bool want_lossless) override; - scoped_ptr<VideoPacket> Encode(const webrtc::DesktopFrame& frame) override; - - private: - scoped_ptr<VideoEncoder> encoder_; - scoped_refptr<base::TaskRunner> recorder_task_runner_; - base::WeakPtr<VideoFrameRecorder> recorder_; - - bool enable_recording_; - scoped_refptr<base::SingleThreadTaskRunner> encoder_task_runner_; - - base::WeakPtrFactory<RecordingVideoEncoder> weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(RecordingVideoEncoder); -}; - -VideoFrameRecorder::RecordingVideoEncoder::RecordingVideoEncoder( - scoped_ptr<VideoEncoder> encoder, - scoped_refptr<base::TaskRunner> recorder_task_runner, - base::WeakPtr<VideoFrameRecorder> recorder) - : encoder_(std::move(encoder)), - recorder_task_runner_(recorder_task_runner), - recorder_(recorder), - enable_recording_(false), - weak_factory_(this) { - DCHECK(encoder_); - DCHECK(recorder_task_runner_.get()); -} - -base::WeakPtr<VideoFrameRecorder::RecordingVideoEncoder> -VideoFrameRecorder::RecordingVideoEncoder::AsWeakPtr() { - return weak_factory_.GetWeakPtr(); -} - -void VideoFrameRecorder::RecordingVideoEncoder::SetLosslessEncode( - bool want_lossless) { - encoder_->SetLosslessEncode(want_lossless); -} - -void VideoFrameRecorder::RecordingVideoEncoder::SetLosslessColor( - bool want_lossless) { - encoder_->SetLosslessColor(want_lossless); -} - -scoped_ptr<VideoPacket> VideoFrameRecorder::RecordingVideoEncoder::Encode( - const webrtc::DesktopFrame& frame) { - // If this is the first Encode() then store the TaskRunner and inform the - // VideoFrameRecorder so it can post set_enable_recording() on it. - if (!encoder_task_runner_.get()) { - encoder_task_runner_ = base::ThreadTaskRunnerHandle::Get(); - recorder_task_runner_->PostTask(FROM_HERE, - base::Bind(&VideoFrameRecorder::SetEncoderTaskRunner, - recorder_, - encoder_task_runner_)); - } - - DCHECK(encoder_task_runner_->BelongsToCurrentThread()); - - if (enable_recording_) { - // Copy the frame and post it to the VideoFrameRecorder to store. - scoped_ptr<webrtc::DesktopFrame> frame_copy( - new webrtc::BasicDesktopFrame(frame.size())); - *frame_copy->mutable_updated_region() = frame.updated_region(); - frame_copy->set_dpi(frame.dpi()); - frame_copy->CopyPixelsFrom(frame.data(), - frame.stride(), - webrtc::DesktopRect::MakeSize(frame.size())); - recorder_task_runner_->PostTask(FROM_HERE, - base::Bind(&VideoFrameRecorder::RecordFrame, - recorder_, - base::Passed(&frame_copy))); - } - - return encoder_->Encode(frame); -} - -VideoFrameRecorder::VideoFrameRecorder() - : content_bytes_(0), - max_content_bytes_(0), - enable_recording_(false), - weak_factory_(this) { -} - -VideoFrameRecorder::~VideoFrameRecorder() { - DetachVideoEncoderWrapper(); -} - -scoped_ptr<VideoEncoder> VideoFrameRecorder::WrapVideoEncoder( - scoped_ptr<VideoEncoder> encoder) { - DCHECK(!encoder_task_runner_.get()); - DCHECK(!caller_task_runner_.get()); - caller_task_runner_ = base::ThreadTaskRunnerHandle::Get(); - - scoped_ptr<RecordingVideoEncoder> recording_encoder( - new RecordingVideoEncoder(std::move(encoder), - caller_task_runner_, - weak_factory_.GetWeakPtr())); - recording_encoder_ = recording_encoder->AsWeakPtr(); - - return std::move(recording_encoder); -} - -void VideoFrameRecorder::DetachVideoEncoderWrapper() { - DCHECK(!caller_task_runner_.get() || - caller_task_runner_->BelongsToCurrentThread()); - - // Immediately detach the wrapper from this recorder. - weak_factory_.InvalidateWeakPtrs(); - - // Clean up any pending recorded frames. - STLDeleteElements(&recorded_frames_); - content_bytes_ = 0; - - // Tell the wrapper to stop recording and posting frames to us. - if (encoder_task_runner_.get()) { - encoder_task_runner_->PostTask(FROM_HERE, - base::Bind(&RecordingVideoEncoder::set_enable_recording, - recording_encoder_, false)); - } - - // Detach this recorder from the calling and encode threads. - caller_task_runner_ = nullptr; - encoder_task_runner_ = nullptr; -} - -void VideoFrameRecorder::SetEnableRecording(bool enable_recording) { - DCHECK(!caller_task_runner_.get() || - caller_task_runner_->BelongsToCurrentThread()); - - if (enable_recording_ == enable_recording) { - return; - } - enable_recording_ = enable_recording; - - if (encoder_task_runner_.get()) { - encoder_task_runner_->PostTask(FROM_HERE, - base::Bind(&RecordingVideoEncoder::set_enable_recording, - recording_encoder_, - enable_recording_)); - } -} - -void VideoFrameRecorder::SetMaxContentBytes(int64_t max_content_bytes) { - DCHECK(!caller_task_runner_.get() || - caller_task_runner_->BelongsToCurrentThread()); - DCHECK_GE(max_content_bytes, 0); - - max_content_bytes_ = max_content_bytes; -} - -scoped_ptr<webrtc::DesktopFrame> VideoFrameRecorder::NextFrame() { - DCHECK(caller_task_runner_->BelongsToCurrentThread()); - - scoped_ptr<webrtc::DesktopFrame> frame; - if (!recorded_frames_.empty()) { - frame.reset(recorded_frames_.front()); - recorded_frames_.pop_front(); - content_bytes_ -= FrameContentSize(frame.get()); - DCHECK_GE(content_bytes_, 0); - } - - return frame; -} - -void VideoFrameRecorder::SetEncoderTaskRunner( - scoped_refptr<base::TaskRunner> task_runner) { - DCHECK(caller_task_runner_->BelongsToCurrentThread()); - DCHECK(!encoder_task_runner_.get()); - DCHECK(task_runner.get()); - - encoder_task_runner_ = task_runner; - - // If the caller already enabled recording, inform the recording encoder. - if (enable_recording_ && encoder_task_runner_.get()) { - encoder_task_runner_->PostTask(FROM_HERE, - base::Bind(&RecordingVideoEncoder::set_enable_recording, - recording_encoder_, - enable_recording_)); - } -} - -void VideoFrameRecorder::RecordFrame(scoped_ptr<webrtc::DesktopFrame> frame) { - DCHECK(caller_task_runner_->BelongsToCurrentThread()); - - int64_t frame_bytes = FrameContentSize(frame.get()); - DCHECK_GE(frame_bytes, 0); - - // Purge existing frames until there is space for the new one. - while (content_bytes_ + frame_bytes > max_content_bytes_ && - !recorded_frames_.empty()) { - scoped_ptr<webrtc::DesktopFrame> drop_frame(recorded_frames_.front()); - recorded_frames_.pop_front(); - content_bytes_ -= FrameContentSize(drop_frame.get()); - DCHECK_GE(content_bytes_, 0); - } - - // If the frame is still too big, ignore it. - if (content_bytes_ + frame_bytes > max_content_bytes_) { - return; - } - - // Store the frame and update the content byte count. - recorded_frames_.push_back(frame.release()); - content_bytes_ += frame_bytes; -} - -} // namespace remoting
diff --git a/remoting/host/video_frame_recorder.h b/remoting/host/video_frame_recorder.h deleted file mode 100644 index 535e513..0000000 --- a/remoting/host/video_frame_recorder.h +++ /dev/null
@@ -1,108 +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. - -#ifndef REMOTING_HOST_VIDEO_FRAME_RECORDER_H_ -#define REMOTING_HOST_VIDEO_FRAME_RECORDER_H_ - -#include <stdint.h> -#include <list> - -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" -#include "base/memory/weak_ptr.h" -#include "base/single_thread_task_runner.h" - -namespace webrtc { -class DesktopFrame; -} - -namespace remoting { - -class VideoEncoder; - -// Allows sequences of DesktopFrames passed to a VideoEncoder to be recorded. -// -// VideoFrameRecorder is designed to support applications which use a dedicated -// thread for video encoding, but need to manage that process from a "main" -// or "control" thread. -// -// On the control thread: -// 1. Create the VideoFrameRecorder. -// 2. Specify the amount of memory that may be used for recording. -// 3. Call WrapVideoEncoder(), passing the actual VideoEncoder that will be -// used to encode frames. -// 4. Hand off the returned wrapper VideoEncoder to the video encoding thread, -// to call in place of the actual VideoEncoder. -// 5. Start/stop frame recording as necessary. -// 6. Use NextFrame() to read each recorded frame in sequence. -// -// The wrapper VideoEncoder is designed to be handed off to the video encoding -// thread, and used and torn down there. -// -// The VideoFrameRecorder and VideoEncoder may be torn down in any order; frame -// recording will stop as soon as either is destroyed. - -class VideoFrameRecorder { - public: - VideoFrameRecorder(); - virtual ~VideoFrameRecorder(); - - // Wraps the supplied VideoEncoder, returning a replacement VideoEncoder that - // will route frames to the recorder, as well as passing them for encoding. - // Each VideoFrameRecorder supports at most one wrapper at a time; if a new - // wrapper is required then any existing one must be deleted, or detached via - // DetachVideoEncoderWrapper(), before WrapVideoEncoder() is called again. - scoped_ptr<VideoEncoder> WrapVideoEncoder(scoped_ptr<VideoEncoder> encoder); - - // Detaches the existing VideoEncoder wrapper, stopping it from recording. - // The detached wrapper remains owned by the caller and will continue to - // pass-through frames to the wrapped encoder, without recording them. - void DetachVideoEncoderWrapper(); - - // Enables/disables frame recording. Frame recording is initially disabled. - void SetEnableRecording(bool enable_recording); - - // Sets the maximum number of bytes of pixel data that may be recorded. - // When this maximum is reached older frames will be discarded to make space - // for new ones. - void SetMaxContentBytes(int64_t max_content_bytes); - - // Pops the next recorded frame in the sequence, and returns it. - scoped_ptr<webrtc::DesktopFrame> NextFrame(); - - private: - class RecordingVideoEncoder; - friend class RecordingVideoEncoder; - - void SetEncoderTaskRunner(scoped_refptr<base::TaskRunner> task_runner); - void RecordFrame(scoped_ptr<webrtc::DesktopFrame> frame); - - // The recorded frames, in sequence. - std::list<webrtc::DesktopFrame*> recorded_frames_; - - // Size of the recorded frames' content, in bytes. - int64_t content_bytes_; - - // Size that recorded frames' content must not exceed. - int64_t max_content_bytes_; - - // True if recording is started, false otherwise. - bool enable_recording_; - - // Task runner on which the wrapper VideoEncoder is being run. - scoped_refptr<base::TaskRunner> encoder_task_runner_; - - // Weak reference to the wrapper VideoEncoder, to use to control it. - base::WeakPtr<RecordingVideoEncoder> recording_encoder_; - - scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; - base::WeakPtrFactory<VideoFrameRecorder> weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(VideoFrameRecorder); -}; - -} // namespace remoting - -#endif // REMOTING_HOST_VIDEO_FRAME_RECORDER_H_
diff --git a/remoting/host/video_frame_recorder_host_extension.cc b/remoting/host/video_frame_recorder_host_extension.cc deleted file mode 100644 index f803d157..0000000 --- a/remoting/host/video_frame_recorder_host_extension.cc +++ /dev/null
@@ -1,200 +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. - -#include "remoting/host/video_frame_recorder_host_extension.h" - -#include <utility> - -#include "base/base64.h" -#include "base/json/json_reader.h" -#include "base/json/json_writer.h" -#include "base/logging.h" -#include "base/macros.h" -#include "base/values.h" -#include "remoting/codec/video_encoder_verbatim.h" -#include "remoting/host/host_extension_session.h" -#include "remoting/host/video_frame_recorder.h" -#include "remoting/proto/control.pb.h" -#include "remoting/proto/video.pb.h" -#include "remoting/protocol/client_stub.h" -#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" - -namespace remoting { - -namespace { - -// Name of the extension message type field, and its value for this extension. -const char kType[] = "type"; -const char kVideoRecorderType[] = "video-recorder"; - -class VideoFrameRecorderHostExtensionSession : public HostExtensionSession { - public: - explicit VideoFrameRecorderHostExtensionSession(int64_t max_content_bytes); - ~VideoFrameRecorderHostExtensionSession() override; - - // remoting::HostExtensionSession interface. - void OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder) override; - bool ModifiesVideoPipeline() const override; - bool OnExtensionMessage(ClientSessionControl* client_session_control, - protocol::ClientStub* client_stub, - const protocol::ExtensionMessage& message) override; - - private: - // Handlers for the different frame recorder extension message types. - void OnStart(); - void OnStop(); - void OnNextFrame(protocol::ClientStub* client_stub); - - VideoEncoderVerbatim verbatim_encoder_; - VideoFrameRecorder video_frame_recorder_; - bool first_frame_; - - DISALLOW_COPY_AND_ASSIGN(VideoFrameRecorderHostExtensionSession); -}; - -VideoFrameRecorderHostExtensionSession::VideoFrameRecorderHostExtensionSession( - int64_t max_content_bytes) - : first_frame_(false) { - video_frame_recorder_.SetMaxContentBytes(max_content_bytes); -} - -VideoFrameRecorderHostExtensionSession:: - ~VideoFrameRecorderHostExtensionSession() { -} - -void VideoFrameRecorderHostExtensionSession::OnCreateVideoEncoder( - scoped_ptr<VideoEncoder>* encoder) { - video_frame_recorder_.DetachVideoEncoderWrapper(); - *encoder = video_frame_recorder_.WrapVideoEncoder(std::move(*encoder)); -} - -bool VideoFrameRecorderHostExtensionSession::ModifiesVideoPipeline() const { - return true; -} - -bool VideoFrameRecorderHostExtensionSession::OnExtensionMessage( - ClientSessionControl* client_session_control, - protocol::ClientStub* client_stub, - const protocol::ExtensionMessage& message) { - if (message.type() != kVideoRecorderType) { - return false; - } - - if (!message.has_data()) { - return true; - } - - scoped_ptr<base::Value> value = base::JSONReader::Read(message.data()); - base::DictionaryValue* client_message; - if (!value || !value->GetAsDictionary(&client_message)) { - return true; - } - - std::string type; - if (!client_message->GetString(kType, &type)) { - LOG(ERROR) << "Invalid video-recorder message"; - return true; - } - - const char kStartType[] = "start"; - const char kStopType[] = "stop"; - const char kNextFrameType[] = "next-frame"; - - if (type == kStartType) { - OnStart(); - } else if (type == kStopType) { - OnStop(); - } else if (type == kNextFrameType) { - OnNextFrame(client_stub); - } - - return true; -} - -void VideoFrameRecorderHostExtensionSession::OnStart() { - video_frame_recorder_.SetEnableRecording(true); - first_frame_ = true; -} - -void VideoFrameRecorderHostExtensionSession::OnStop() { - video_frame_recorder_.SetEnableRecording(false); -} - -void VideoFrameRecorderHostExtensionSession::OnNextFrame( - protocol::ClientStub* client_stub) { - scoped_ptr<webrtc::DesktopFrame> frame(video_frame_recorder_.NextFrame()); - - // TODO(wez): This involves six copies of the entire frame. - // See if there's some way to optimize at least a few of them out. - const char kNextFrameReplyType[] = "next-frame-reply"; - base::DictionaryValue reply_message; - reply_message.SetString(kType, kNextFrameReplyType); - if (frame) { - // If this is the first frame then override the updated region so that - // the encoder will send the whole frame's contents. - if (first_frame_) { - first_frame_ = false; - - frame->mutable_updated_region()->SetRect( - webrtc::DesktopRect::MakeSize(frame->size())); - } - - // Encode the frame into a raw ARGB VideoPacket. - scoped_ptr<VideoPacket> encoded_frame( - verbatim_encoder_.Encode(*frame)); - - // Serialize that packet into a string. - std::string data(encoded_frame->ByteSize(), 0); - encoded_frame->SerializeWithCachedSizesToArray( - reinterpret_cast<uint8_t*>(&data[0])); - - // Convert that string to Base64, so it's JSON-friendly. - std::string base64_data; - base::Base64Encode(data, &base64_data); - - // Copy the Base64 data into the message. - const char kData[] = "data"; - reply_message.SetString(kData, base64_data); - } - - // JSON-encode the reply into a string. - // Note that JSONWriter::Write() can only fail due to invalid inputs, and will - // DCHECK in Debug builds in that case. - std::string reply_json; - if (!base::JSONWriter::Write(reply_message, &reply_json)) { - return; - } - - // Return the frame (or a 'data'-less reply) to the client. - protocol::ExtensionMessage message; - message.set_type(kVideoRecorderType); - message.set_data(reply_json); - client_stub->DeliverHostMessage(message); -} - -} // namespace - -VideoFrameRecorderHostExtension::VideoFrameRecorderHostExtension() {} - -VideoFrameRecorderHostExtension::~VideoFrameRecorderHostExtension() {} - -void VideoFrameRecorderHostExtension::SetMaxContentBytes( - int64_t max_content_bytes) { - max_content_bytes_ = max_content_bytes; -} - -std::string VideoFrameRecorderHostExtension::capability() const { - const char kVideoRecorderCapability[] = "videoRecorder"; - return kVideoRecorderCapability; -} - -scoped_ptr<HostExtensionSession> -VideoFrameRecorderHostExtension::CreateExtensionSession( - ClientSessionControl* client_session_control, - protocol::ClientStub* client_stub) { - return make_scoped_ptr( - new VideoFrameRecorderHostExtensionSession(max_content_bytes_)); -} - -} // namespace remoting
diff --git a/remoting/host/video_frame_recorder_host_extension.h b/remoting/host/video_frame_recorder_host_extension.h deleted file mode 100644 index 17b8e6c..0000000 --- a/remoting/host/video_frame_recorder_host_extension.h +++ /dev/null
@@ -1,41 +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. - -#ifndef REMOTING_HOST_VIDEO_FRAME_RECORDER_HOST_EXTENSION_H_ -#define REMOTING_HOST_VIDEO_FRAME_RECORDER_HOST_EXTENSION_H_ - -#include <stdint.h> - -#include "base/macros.h" -#include "base/memory/scoped_ptr.h" -#include "remoting/host/host_extension.h" - -namespace remoting { - -// Extends Chromoting sessions with the ability to record raw frames and -// download them to the client. This can be used to obtain representative -// sequences of frames to run tests against. -class VideoFrameRecorderHostExtension : public HostExtension { - public: - VideoFrameRecorderHostExtension(); - ~VideoFrameRecorderHostExtension() override; - - // Sets the maximum number of bytes that each session may record. - void SetMaxContentBytes(int64_t max_content_bytes); - - // remoting::HostExtension interface. - std::string capability() const override; - scoped_ptr<HostExtensionSession> CreateExtensionSession( - ClientSessionControl* client_session, - protocol::ClientStub* client_stub) override; - - private: - int64_t max_content_bytes_; - - DISALLOW_COPY_AND_ASSIGN(VideoFrameRecorderHostExtension); -}; - -} // namespace remoting - -#endif // REMOTING_HOST_VIDEO_FRAME_RECORDER_HOST_EXTENSION_H_
diff --git a/remoting/host/video_frame_recorder_unittest.cc b/remoting/host/video_frame_recorder_unittest.cc deleted file mode 100644 index c005165..0000000 --- a/remoting/host/video_frame_recorder_unittest.cc +++ /dev/null
@@ -1,319 +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. - -#include "remoting/host/video_frame_recorder.h" - -#include <stddef.h> -#include <stdint.h> - -#include <utility> - -#include "base/macros.h" -#include "base/message_loop/message_loop.h" -#include "base/run_loop.h" -#include "base/stl_util.h" -#include "remoting/codec/video_encoder_verbatim.h" -#include "remoting/proto/video.pb.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" -#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" -#include "third_party/webrtc/modules/desktop_capture/desktop_region.h" - -namespace webrtc { - -// Define equality operator for DesktopFrame to allow use of EXPECT_EQ(). -static bool operator==(const DesktopFrame& a, - const DesktopFrame& b) { - if ((!a.size().equals(b.size())) || - (!a.updated_region().Equals(b.updated_region())) || - (!a.dpi().equals(b.dpi()))) { - return false; - } - - for (int i = 0; i < a.size().height(); ++i) { - if (memcmp(a.data() + a.stride() * i, - b.data() + b.stride() * i, - a.size().width() * DesktopFrame::kBytesPerPixel) != 0) { - return false; - } - } - - return true; -} - -} // namespace - -namespace remoting { - -namespace { -const int kFrameWidth = 640; -const int kFrameHeight = 480; -const size_t kTestFrameCount = 6; -const int64_t kTestFrameBytes = - kFrameWidth * kFrameHeight * webrtc::DesktopFrame::kBytesPerPixel; -} // namespace - -class VideoFrameRecorderTest : public testing::Test { - public: - VideoFrameRecorderTest(); - - void SetUp() override; - void TearDown() override; - - // Creates a new VideoEncoder, wraps it using |recorder_|, and stores the - // newly wrapped encoder in |encoder_|. - void CreateAndWrapEncoder(); - - // Creates the next test frame to pass to |encoder_|. Each test frame's pixel - // values are set uniquely, so that tests can verify that the correct set of - // frames were recorded. - scoped_ptr<webrtc::DesktopFrame> CreateNextFrame(); - - // Calls CreateNextFrame() to create kTextFrameCount test frames, and stores - // them to |test_frames_|. - void CreateTestFrames(); - - // Passes the frames in |test_frames_| to |encoder_|, in order, to encode. - void EncodeTestFrames(); - - // Creates a frame and passes it to |encoder_| without adding it to - // |test_frames_|. - void EncodeDummyFrame(); - - // Configures |recorder_| to start recording, and pumps events to ensure that - // |encoder_| is ready to record frames. - void StartRecording(); - - // Reads frames from |recorder_| and compares them to the |test_frames_|. - void VerifyTestFrames(); - - protected: - typedef std::list<webrtc::DesktopFrame*> DesktopFrames; - - base::MessageLoop message_loop_; - - scoped_ptr<VideoFrameRecorder> recorder_; - scoped_ptr<VideoEncoder> encoder_; - - DesktopFrames test_frames_; - int frame_count_; - - DISALLOW_COPY_AND_ASSIGN(VideoFrameRecorderTest); -}; - -VideoFrameRecorderTest::VideoFrameRecorderTest() : frame_count_(0) {} - -void VideoFrameRecorderTest::SetUp() { - const int64_t kMaxContentBytes = 10 * 1024 * 1024; - recorder_.reset(new VideoFrameRecorder()); - recorder_->SetMaxContentBytes(kMaxContentBytes); -} - -void VideoFrameRecorderTest::TearDown() { - ASSERT_TRUE(test_frames_.empty()); - - // Allow events posted to the recorder_, if still valid, to be processed. - base::RunLoop().RunUntilIdle(); - - // Tear down the recorder, if necessary. - recorder_.reset(); - - // Process any events resulting from recorder teardown. - base::RunLoop().RunUntilIdle(); -} - -void VideoFrameRecorderTest::CreateAndWrapEncoder() { - scoped_ptr<VideoEncoder> encoder(new VideoEncoderVerbatim()); - encoder_ = recorder_->WrapVideoEncoder(std::move(encoder)); - - // Encode a dummy frame to bind the wrapper to the TaskRunner. - EncodeDummyFrame(); -} - -scoped_ptr<webrtc::DesktopFrame> VideoFrameRecorderTest::CreateNextFrame() { - scoped_ptr<webrtc::DesktopFrame> frame(new webrtc::BasicDesktopFrame( - webrtc::DesktopSize(kFrameWidth, kFrameHeight))); - - // Fill content, DPI and updated-region based on |frame_count_| so that each - // generated frame is different. - ++frame_count_; - memset(frame->data(), frame_count_, frame->stride() * kFrameHeight); - frame->set_dpi(webrtc::DesktopVector(frame_count_, frame_count_)); - frame->mutable_updated_region()->SetRect( - webrtc::DesktopRect::MakeWH(frame_count_, frame_count_)); - - return frame; -} - -void VideoFrameRecorderTest::CreateTestFrames() { - for (size_t i = 0; i < kTestFrameCount; ++i) { - test_frames_.push_back(CreateNextFrame().release()); - } -} - -void VideoFrameRecorderTest::EncodeTestFrames() { - for (DesktopFrames::iterator i = test_frames_.begin(); - i != test_frames_.end(); ++i) { - ASSERT_TRUE(encoder_->Encode(**i)); - - // Process tasks to let the recorder pick up the frame. - base::RunLoop().RunUntilIdle(); - } -} - -void VideoFrameRecorderTest::EncodeDummyFrame() { - webrtc::BasicDesktopFrame dummy_frame( - webrtc::DesktopSize(kFrameWidth, kFrameHeight)); - dummy_frame.mutable_updated_region()->SetRect( - webrtc::DesktopRect::MakeWH(kFrameWidth, kFrameHeight)); - ASSERT_TRUE(encoder_->Encode(dummy_frame)); - base::RunLoop().RunUntilIdle(); -} - -void VideoFrameRecorderTest::StartRecording() { - // Start the recorder and pump events to let things initialize. - recorder_->SetEnableRecording(true); - base::RunLoop().RunUntilIdle(); -} - -void VideoFrameRecorderTest::VerifyTestFrames() { - // Verify that the recorded frames match the ones passed to the encoder. - while (!test_frames_.empty()) { - scoped_ptr<webrtc::DesktopFrame> recorded_frame(recorder_->NextFrame()); - ASSERT_TRUE(recorded_frame); - - scoped_ptr<webrtc::DesktopFrame> expected_frame(test_frames_.front()); - test_frames_.pop_front(); - - EXPECT_EQ(*recorded_frame, *expected_frame); - } - - EXPECT_FALSE(recorder_->NextFrame()); -} - -// Basic test that creating & tearing down VideoFrameRecorder doesn't crash. -TEST_F(VideoFrameRecorderTest, CreateDestroy) { -} - -// Basic test that creating, starting, stopping and destroying a -// VideoFrameRecorder succeeds (e.g. does not crash or DCHECK). -TEST_F(VideoFrameRecorderTest, StartStop) { - StartRecording(); - recorder_->SetEnableRecording(false); -} - -// Test that tearing down the VideoFrameRecorder while the VideoEncoder -// wrapper exists doesn't crash. -TEST_F(VideoFrameRecorderTest, DestroyVideoFrameRecorderFirst) { - CreateAndWrapEncoder(); - - // Start the recorder, so that the wrapper will push frames to it. - StartRecording(); - - // Tear down the recorder. - recorder_.reset(); - - // Encode a dummy frame via the wrapper to ensure we don't crash. - EncodeDummyFrame(); -} - -// Test that creating & tearing down the wrapper while the -// VideoFrameRecorder still exists doesn't crash. -TEST_F(VideoFrameRecorderTest, DestroyVideoEncoderWrapperFirst) { - CreateAndWrapEncoder(); - - // Start the recorder, so that the wrapper will push frames to it. - StartRecording(); - - // Encode a dummy frame via the wrapper to ensure we don't crash. - EncodeDummyFrame(); - - // Tear down the encoder wrapper. - encoder_.reset(); - - // Test teardown will stop the recorder and process pending events. -} - -// Test that when asked to encode a short sequence of frames, those frames are -// all recorded, in sequence. -TEST_F(VideoFrameRecorderTest, RecordFrames) { - CreateAndWrapEncoder(); - - // Start the recorder, so that the wrapper will push frames to it. - StartRecording(); - - // Create frames, store them and pass them to the encoder. - CreateTestFrames(); - EncodeTestFrames(); - - // Verify that the recorded frames match the ones passed to the encoder. - VerifyTestFrames(); -} - -// Test that when asked to record more frames than the maximum content bytes -// limit allows, the first encoded frames are dropped. -TEST_F(VideoFrameRecorderTest, MaxContentBytesEnforced) { - CreateAndWrapEncoder(); - - // Configure a maximum content size sufficient for five and a half frames. - recorder_->SetMaxContentBytes((kTestFrameBytes * 11) / 2); - - // Start the recorder, so that the wrapper will push frames to it. - StartRecording(); - - // Create frames, store them and pass them to the encoder. - CreateTestFrames(); - EncodeTestFrames(); - - // Only five of the supplied frames should have been recorded. - while (test_frames_.size() > 5) { - scoped_ptr<webrtc::DesktopFrame> frame(test_frames_.front()); - test_frames_.pop_front(); - } - - // Verify that the recorded frames match the ones passed to the encoder. - VerifyTestFrames(); -} - -// Test that when frames are consumed the corresponding space is freed up in -// the content buffer, allowing subsequent frames to be recorded. -TEST_F(VideoFrameRecorderTest, ContentBytesUpdatedByNextFrame) { - CreateAndWrapEncoder(); - - // Configure a maximum content size sufficient for kTestFrameCount frames. - recorder_->SetMaxContentBytes(kTestFrameBytes * kTestFrameCount); - - // Start the recorder, so that the wrapper will push frames to it. - StartRecording(); - - // Encode a frame, to record it, and consume it from the recorder. - EncodeDummyFrame(); - scoped_ptr<webrtc::DesktopFrame> frame = recorder_->NextFrame(); - EXPECT_TRUE(frame); - - // Create frames, store them and pass them to the encoder. - CreateTestFrames(); - EncodeTestFrames(); - - // Verify that the recorded frames match the ones passed to the encoder. - VerifyTestFrames(); -} - -// Test that when asked to encode a short sequence of frames, none are recorded -// if recording was not enabled. -TEST_F(VideoFrameRecorderTest, EncodeButDontRecord) { - CreateAndWrapEncoder(); - - // Create frames, store them and pass them to the encoder. - CreateTestFrames(); - EncodeTestFrames(); - - // Clear the list of expected test frames, since none should be recorded. - STLDeleteElements(&test_frames_); - - // Verify that the recorded frames match the ones passed to the encoder. - VerifyTestFrames(); -} - -} // namespace remoting
diff --git a/remoting/host/win/chromoting_lib.rc b/remoting/host/win/chromoting_lib.rc new file mode 100644 index 0000000..d5c0b2b --- /dev/null +++ b/remoting/host/win/chromoting_lib.rc
@@ -0,0 +1,5 @@ +// 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. + +1 typelib "remoting/host/chromoting_lib.tlb"
diff --git a/remoting/protocol/authenticator_test_base.h b/remoting/protocol/authenticator_test_base.h index 0cd4cac..e9154234 100644 --- a/remoting/protocol/authenticator_test_base.h +++ b/remoting/protocol/authenticator_test_base.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/remoting/protocol/chromium_socket_factory.cc b/remoting/protocol/chromium_socket_factory.cc index 82a8eb43..22b59b4 100644 --- a/remoting/protocol/chromium_socket_factory.cc +++ b/remoting/protocol/chromium_socket_factory.cc
@@ -386,7 +386,8 @@ uint16_t min_port, uint16_t max_port, int opts) { - // We don't use TCP sockets for remoting connections. + // TCP sockets are not supported. + // TODO(sergeyu): Implement TCP support crbug.com/600032 . NOTIMPLEMENTED(); return nullptr; } @@ -398,8 +399,9 @@ const rtc::ProxyInfo& proxy_info, const std::string& user_agent, int opts) { - // We don't use TCP sockets for remoting connections. - NOTREACHED(); + // TCP sockets are not supported. + // TODO(sergeyu): Implement TCP support crbug.com/600032 . + NOTIMPLEMENTED(); return nullptr; }
diff --git a/remoting/protocol/chromium_socket_factory_unittest.cc b/remoting/protocol/chromium_socket_factory_unittest.cc index db319201..8c59f826a 100644 --- a/remoting/protocol/chromium_socket_factory_unittest.cc +++ b/remoting/protocol/chromium_socket_factory_unittest.cc
@@ -7,6 +7,7 @@ #include <stddef.h> #include <stdint.h> +#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/remoting/protocol/connection_to_client.h b/remoting/protocol/connection_to_client.h index 3cdca44..09ac21b 100644 --- a/remoting/protocol/connection_to_client.h +++ b/remoting/protocol/connection_to_client.h
@@ -46,10 +46,6 @@ virtual void OnConnectionChannelsConnected( ConnectionToClient* connection) = 0; - // Called when a VideoEncoder is created. Used by ClientSession to modify - // the video pipeline if necessary. - virtual void OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder) = 0; - // Called when the network connection is closed or failed. virtual void OnConnectionClosed(ConnectionToClient* connection, ErrorCode error) = 0;
diff --git a/remoting/protocol/ice_connection_to_client.cc b/remoting/protocol/ice_connection_to_client.cc index b69bca0..6e5755136 100644 --- a/remoting/protocol/ice_connection_to_client.cc +++ b/remoting/protocol/ice_connection_to_client.cc
@@ -92,8 +92,6 @@ scoped_ptr<VideoEncoder> video_encoder = CreateVideoEncoder(session_->config()); - event_handler_->OnCreateVideoEncoder(&video_encoder); - DCHECK(video_encoder); scoped_ptr<VideoFramePump> pump( new VideoFramePump(video_encode_task_runner_, std::move(desktop_capturer),
diff --git a/remoting/protocol/video_frame_pump.cc b/remoting/protocol/video_frame_pump.cc index 072b2fd0..ba0d322b 100644 --- a/remoting/protocol/video_frame_pump.cc +++ b/remoting/protocol/video_frame_pump.cc
@@ -14,6 +14,7 @@ #include "base/single_thread_task_runner.h" #include "base/task_runner_util.h" #include "base/time/time.h" +#include "remoting/base/constants.h" #include "remoting/proto/control.pb.h" #include "remoting/proto/video.pb.h" #include "remoting/protocol/video_stub.h" @@ -122,12 +123,16 @@ captured_frame_timestamps_->capture_ended_time = base::TimeTicks::Now(); - if (frame && (!frame_size_.equals(frame->size()) || - !frame_dpi_.equals(frame->dpi()))) { - frame_size_ = frame->size(); - frame_dpi_ = frame->dpi(); - if (!size_callback_.is_null()) - size_callback_.Run(frame_size_, frame_dpi_); + if (frame) { + webrtc::DesktopVector dpi = + frame->dpi().is_zero() ? webrtc::DesktopVector(kDefaultDpi, kDefaultDpi) + : frame->dpi(); + if (!frame_size_.equals(frame->size()) || !frame_dpi_.equals(dpi)) { + frame_size_ = frame->size(); + frame_dpi_ = dpi; + if (!size_callback_.is_null()) + size_callback_.Run(frame_size_, frame_dpi_); + } } // Even when |frame| is nullptr we still need to post it to the encode thread
diff --git a/remoting/protocol/video_stream.h b/remoting/protocol/video_stream.h index 3f7a27b..4e18ea9 100644 --- a/remoting/protocol/video_stream.h +++ b/remoting/protocol/video_stream.h
@@ -22,7 +22,7 @@ class VideoStream { public: // Callback used to notify about screen size changes. The size must be - // specified in DIPs. + // specified in physical pixels. typedef base::Callback<void(const webrtc::DesktopSize& size, const webrtc::DesktopVector& dpi)> SizeCallback;
diff --git a/remoting/protocol/webrtc_video_capturer_adapter.cc b/remoting/protocol/webrtc_video_capturer_adapter.cc index 1690b67f..3013bc9 100644 --- a/remoting/protocol/webrtc_video_capturer_adapter.cc +++ b/remoting/protocol/webrtc_video_capturer_adapter.cc
@@ -6,6 +6,7 @@ #include <utility> +#include "remoting/base/constants.h" #include "third_party/libyuv/include/libyuv/convert.h" #include "third_party/webrtc/media/engine/webrtcvideoframe.h" #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" @@ -164,17 +165,24 @@ // WebRTC needs to have some mechanism to notify when the bandwidth is // exceeded, so the capturer can adapt frame rate. - int width = frame->size().width(); - int height = frame->size().height(); - if (!yuv_frame_ || yuv_frame_->width() != width || - yuv_frame_->height() != height) { + webrtc::DesktopVector dpi = + frame->dpi().is_zero() ? webrtc::DesktopVector(kDefaultDpi, kDefaultDpi) + : frame->dpi(); + if (!frame_size_.equals(frame->size()) || !frame_dpi_.equals(dpi)) { + frame_size_ = frame->size(); + frame_dpi_ = dpi; if (!size_callback_.is_null()) - size_callback_.Run(frame->size(), frame->dpi()); + size_callback_.Run(frame_size_, frame_dpi_); + } - yuv_frame_ = new rtc::RefCountedObject<webrtc::I420Buffer>(width, height); + if (!yuv_frame_ || + !frame_size_.equals( + webrtc::DesktopSize(yuv_frame_->width(), yuv_frame_->height()))) { + yuv_frame_ = new rtc::RefCountedObject<webrtc::I420Buffer>( + frame_size_.width(), frame_size_.height()); // Set updated_region so the whole frame is converted to YUV below. frame->mutable_updated_region()->SetRect( - webrtc::DesktopRect::MakeWH(width, height)); + webrtc::DesktopRect::MakeSize(frame_size_)); } if (!yuv_frame_->HasOneRef()) {
diff --git a/remoting/protocol/webrtc_video_capturer_adapter.h b/remoting/protocol/webrtc_video_capturer_adapter.h index ec483007..01dd6d4 100644 --- a/remoting/protocol/webrtc_video_capturer_adapter.h +++ b/remoting/protocol/webrtc_video_capturer_adapter.h
@@ -18,6 +18,7 @@ #include "remoting/protocol/video_stream.h" #include "third_party/webrtc/media/base/videocapturer.h" #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" namespace base { class SingleThreadTaskRunner; @@ -80,6 +81,9 @@ // Timer to call CaptureNextFrame(). scoped_ptr<base::RepeatingTimer> capture_timer_; + webrtc::DesktopSize frame_size_; + webrtc::DesktopVector frame_dpi_; + // Video frame is kept between captures to avoid YUV conversion for static // parts of the screen. rtc::scoped_refptr<webrtc::I420Buffer> yuv_frame_;
diff --git a/remoting/protocol/webrtc_video_renderer_adapter.h b/remoting/protocol/webrtc_video_renderer_adapter.h index f05e0b2..07e6393 100644 --- a/remoting/protocol/webrtc_video_renderer_adapter.h +++ b/remoting/protocol/webrtc_video_renderer_adapter.h
@@ -6,6 +6,7 @@ #define REMOTING_PROTOCOL_WEBRTC_VIDEO_RENDERER_ADAPTER_H_ #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "third_party/webrtc/api/mediastreaminterface.h" #include "third_party/webrtc/media/base/videosinkinterface.h"
diff --git a/remoting/remoting_android.gypi b/remoting/remoting_android.gypi index 61d4215..5c5d797 100644 --- a/remoting/remoting_android.gypi +++ b/remoting/remoting_android.gypi
@@ -134,15 +134,6 @@ '<(remoting_android_google_play_services_javalib)', ], 'includes': [ '../build/java.gypi' ], - 'conditions' : [ - ['enable_cast==1', { - 'variables': { - 'additional_src_dirs': [ - 'android/cast', - ], - }, - }], - ], }, # end of target 'remoting_android_client_java' { # TODO(lambroslambrou): Move some of this to third_party/cardboard-java/ in case it is
diff --git a/remoting/remoting_enable.gni b/remoting/remoting_enable.gni index f8c1b20d..b213f677 100644 --- a/remoting/remoting_enable.gni +++ b/remoting/remoting_enable.gni
@@ -9,13 +9,13 @@ enable_remoting_host = false enable_me2me_host = false -# TODO(GYP) Make remoting hosts work on Windows and Mac. -#if (is_win || is_mac) { +# TODO(GYP) Make remoting hosts work on Mac. +#if (is_mac) { # enable_remoting_host = true # enable_me2me_host = true #} -if (is_linux && !is_chromeos && use_x11) { +if (is_win || (is_linux && !is_chromeos && use_x11)) { enable_remoting_host = true enable_me2me_host = true }
diff --git a/remoting/remoting_host.gni b/remoting/remoting_host.gni deleted file mode 100644 index d7d38d9c..0000000 --- a/remoting/remoting_host.gni +++ /dev/null
@@ -1,11 +0,0 @@ -# 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. - -import("//build/config/ui.gni") - -# TODO(GYP): make remoting hosts work on win and mac -# enable_remoting_host = is_win || is_mac || is_chromeos || use_x11 -# enable_me2me_host = is_win || is_mac || (use_x11 && !is_chromeos) -enable_remoting_host = is_chromeos || use_x11 -enable_me2me_host = use_x11 && !is_chromeos
diff --git a/remoting/remoting_host.gypi b/remoting/remoting_host.gypi index fa39c46..ea048a9 100644 --- a/remoting/remoting_host.gypi +++ b/remoting/remoting_host.gypi
@@ -183,9 +183,6 @@ 'dependencies': [ '../third_party/webrtc/modules/modules.gyp:desktop_capture', ], - 'sources': [ - '<@(remoting_cast_sources)', - ], }], ['remoting_use_gcd==1', { 'defines': [
diff --git a/remoting/remoting_host_srcs.gypi b/remoting/remoting_host_srcs.gypi index 8f49001..afe2213 100644 --- a/remoting/remoting_host_srcs.gypi +++ b/remoting/remoting_host_srcs.gypi
@@ -113,7 +113,6 @@ 'host/host_exit_codes.h', 'host/host_export.h', 'host/host_extension.h', - 'host/host_extension_session.cc', 'host/host_extension_session.h', 'host/host_extension_session_manager.cc', 'host/host_extension_session_manager.h', @@ -261,10 +260,6 @@ 'host/usage_stats_consent_win.cc', 'host/username.cc', 'host/username.h', - 'host/video_frame_recorder.cc', - 'host/video_frame_recorder.h', - 'host/video_frame_recorder_host_extension.cc', - 'host/video_frame_recorder_host_extension.h', 'host/win/com_imported_mstscax.tlh', 'host/win/com_security.cc', 'host/win/com_security.h', @@ -327,12 +322,6 @@ 'host/native_messaging/pipe_messaging_channel.cc', 'host/native_messaging/pipe_messaging_channel.h', ], - 'remoting_cast_sources': [ - 'host/cast_extension.cc', - 'host/cast_extension.h', - 'host/cast_extension_session.cc', - 'host/cast_extension_session.h', - ], 'remoting_it2me_host_static_sources' : [ 'host/it2me/it2me_confirmation_dialog.cc', 'host/it2me/it2me_confirmation_dialog.h',
diff --git a/remoting/remoting_host_win.gypi b/remoting/remoting_host_win.gypi index c39f5cb..d8a3c5c 100644 --- a/remoting/remoting_host_win.gypi +++ b/remoting/remoting_host_win.gypi
@@ -15,6 +15,7 @@ 'targets': [ { + # GN version: //remoting:remoting_breakpad_tester 'target_name': 'remoting_breakpad_tester', 'type': 'executable', 'variables': { 'enable_wexit_time_destructors': 1, }, @@ -79,6 +80,7 @@ # remoting_lib_ps builds the proxy/stub code generated by MIDL (see # remoting_lib_idl). { + # GN version: //remoting/host:remoting_lib_ps 'target_name': 'remoting_lib_ps', 'type': 'static_library', 'defines': [ @@ -117,6 +119,8 @@ # are rebuilt every time the type library is updated. GYP alone is # not smart enough to figure out this dependency on its own. { + # We do not need remoting_lib_rc target anymore in GN, generate_idl and + # remoting_lib_idl take care of chromoting_lib_idl.templ change. 'target_name': 'remoting_lib_rc', 'type': 'none', 'sources': [ @@ -146,6 +150,7 @@ # |remoting_host.exe| is that the former is a console application. # |remoting_console.exe| is used for debugging purposes. { + # GN version: //remoting/host:remoting_console 'target_name': 'remoting_console', 'type': 'executable', 'variables': { 'enable_wexit_time_destructors': 1, }, @@ -174,6 +179,7 @@ }, }, # end of target 'remoting_console' { + # GN version: //remoting/host:remoting_core 'target_name': 'remoting_core', 'type': 'shared_library', 'variables': { 'enable_wexit_time_destructors': 1, }, @@ -278,6 +284,7 @@ }, }, # end of target 'remoting_core' { + # GN version: //remoting/host:remoting_desktop 'target_name': 'remoting_desktop', 'type': 'executable', 'variables': { 'enable_wexit_time_destructors': 1, }, @@ -316,6 +323,7 @@ }, }, # end of target 'remoting_desktop' { + # GN version: //remoting/host:remoting_me2me_host 'target_name': 'remoting_me2me_host', 'product_name': 'remoting_host', 'type': 'executable', @@ -346,6 +354,7 @@ }, }, # end of target 'remoting_me2me_host' { + # GN version: //remoting/host:remote_security_key 'target_name': 'remote_security_key', 'type': 'executable', 'product_name': 'remote_security_key', @@ -369,6 +378,7 @@ }, }, # end of target 'remote_security_key' { + # GN version: //remoting/host:remoting_me2me_native_messaging_host 'target_name': 'remoting_me2me_native_messaging_host', 'type': 'executable', 'product_name': 'remoting_native_messaging_host', @@ -392,6 +402,7 @@ }, }, # end of target 'remoting_me2me_native_messaging_host' { + # GN version: //remoting/host/it2me:remoting_assistance_host 'target_name': 'remoting_it2me_native_messaging_host', 'type': 'executable', 'product_name': 'remote_assistance_host', @@ -470,6 +481,7 @@ # for chrome/VERSION). # - translated webapp strings { + # GN version: //remoting/host:remoting_windows_resources 'target_name': 'remoting_windows_resources', 'type': 'none', 'dependencies': [
diff --git a/remoting/remoting_options.gni b/remoting/remoting_options.gni index 0dcd4c9..a944b3a 100644 --- a/remoting/remoting_options.gni +++ b/remoting/remoting_options.gni
@@ -12,9 +12,6 @@ # Set this to enable building internal AppRemoting apps. enable_internal_app_remoting_targets = false - # Set this to enable cast mode on the android client. - remoting_enable_cast = false - # Set this to enable Android Chromoting Cardboard Activity. remoting_enable_cardboard = false }
diff --git a/remoting/remoting_options.gypi b/remoting/remoting_options.gypi index 0181d79..5fd89b7 100644 --- a/remoting/remoting_options.gypi +++ b/remoting/remoting_options.gypi
@@ -9,9 +9,6 @@ # Set this to run the jscompile checks after building the webapp. 'run_jscompile%': 0, - # Set this to enable cast mode on the android client. - 'enable_cast%': 0, - # Set this to use GCD instead of the remoting directory service. 'remoting_use_gcd%': 0,
diff --git a/remoting/remoting_test.gypi b/remoting/remoting_test.gypi index 9c47c33d..945d6e8 100644 --- a/remoting/remoting_test.gypi +++ b/remoting/remoting_test.gypi
@@ -313,7 +313,6 @@ 'host/third_party_auth_config_unittest.cc', 'host/token_validator_factory_impl_unittest.cc', 'host/touch_injector_win_unittest.cc', - 'host/video_frame_recorder_unittest.cc', 'host/win/rdp_client_unittest.cc', 'host/win/worker_process_launcher.cc', 'host/win/worker_process_launcher.h',
diff --git a/remoting/remoting_webapp_files.gypi b/remoting/remoting_webapp_files.gypi index 4a98cbb..b1d9c345 100644 --- a/remoting/remoting_webapp_files.gypi +++ b/remoting/remoting_webapp_files.gypi
@@ -24,7 +24,6 @@ # These provide type information for jscompile. 'remoting_webapp_js_proto_files': [ 'webapp/js_proto/chrome_proto.js', - 'webapp/js_proto/chrome_cast_proto.js', 'webapp/js_proto/dom_proto.js', 'webapp/js_proto/remoting_proto.js', ], @@ -136,7 +135,6 @@ ], # Prototypes for objects that are not mocked. 'remoting_webapp_unittests_js_proto_files': [ - 'webapp/js_proto/chrome_cast_proto.js', 'webapp/js_proto/chrome_proto.js', 'webapp/js_proto/dom_proto.js', 'webapp/js_proto/remoting_proto.js', @@ -254,16 +252,11 @@ 'webapp/crd/js/third_party_host_permissions.js', 'webapp/crd/js/third_party_token_fetcher.js', ], - # Cast extension handler JavaScript files. - 'remoting_webapp_js_cast_extension_files': [ - 'webapp/crd/js/cast_extension_handler.js', - ], # Client JavaScript files. 'remoting_webapp_js_client_files': [ 'webapp/crd/js/apps_v2_migration.js', 'webapp/crd/js/event_handlers.js', 'webapp/crd/js/gcd_client.js', - 'webapp/crd/js/video_frame_recorder.js', ], # Gnubby authentication JavaScript files. 'remoting_webapp_js_gnubby_auth_files': [ @@ -353,7 +346,6 @@ '<@(remoting_webapp_js_auth_client2host_files)', '<@(remoting_webapp_js_client_files)', '<@(remoting_webapp_js_gnubby_auth_files)', - '<@(remoting_webapp_js_cast_extension_files)', '<@(remoting_webapp_js_host_control_files)', '<@(remoting_webapp_js_host_display_files)', ],
diff --git a/remoting/resources/remoting_strings.grd b/remoting/resources/remoting_strings.grd index 176151a..7257279 100644 --- a/remoting/resources/remoting_strings.grd +++ b/remoting/resources/remoting_strings.grd
@@ -1005,12 +1005,6 @@ <message desc="Label for button to reconnect to the previous Me2Me host. This button appears on the 'session-finished' page." name="IDS_RECONNECT"> Reconnect </message> - <message desc="Button for starting video frame recording, to capture frame sequences for debugging purposes." name="IDS_START_RECORDING"> - Start Recording - </message> - <message desc="Button for stopping recording of video frames." name="IDS_STOP_RECORDING"> - Stop Recording - </message> <message desc="Button for enabling or disabling the 'resize-to-client' functionality, whereby the host desktop is resized to match the client size as closely as possible." name="IDS_RESIZE_TO_CLIENT"> Resize desktop to fit </message>
diff --git a/remoting/signaling/xmpp_stream_parser.h b/remoting/signaling/xmpp_stream_parser.h index d98bf0e..b05d127 100644 --- a/remoting/signaling/xmpp_stream_parser.h +++ b/remoting/signaling/xmpp_stream_parser.h
@@ -9,6 +9,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" namespace buzz { class XmlElement;
diff --git a/remoting/test/fake_socket_factory.h b/remoting/test/fake_socket_factory.h index 8a01456..7bb537e 100644 --- a/remoting/test/fake_socket_factory.h +++ b/remoting/test/fake_socket_factory.h
@@ -12,6 +12,7 @@ #include "base/callback_forward.h" #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "remoting/test/fake_network_dispatcher.h" #include "third_party/webrtc/p2p/base/packetsocketfactory.h"
diff --git a/remoting/webapp/base/js/client_session.js b/remoting/webapp/base/js/client_session.js index 882a763..a1a940d 100644 --- a/remoting/webapp/base/js/client_session.js +++ b/remoting/webapp/base/js/client_session.js
@@ -247,21 +247,6 @@ // input, for compatibility with non-touch-aware systems. TOUCH_EVENTS: 'touchEvents', - // Indicates that host/client supports Google Drive integration, and that the - // client should send to the host the OAuth tokens to be used by Google Drive - // on the host. - GOOGLE_DRIVE: 'googleDrive', - - // Indicates that the client supports the video frame-recording extension. - VIDEO_RECORDER: 'videoRecorder', - - // Indicates that the client supports 'cast'ing the video stream to a - // cast-enabled device. - CAST: 'casting', - - // Indicates desktop shape support. - DESKTOP_SHAPE: 'desktopShape', - // Indicates whether the client supports security key request forwarding. SECURITY_KEY: 'securityKey', };
diff --git a/remoting/webapp/base/js/client_session_factory.js b/remoting/webapp/base/js/client_session_factory.js index 658d490..4fa9100d 100644 --- a/remoting/webapp/base/js/client_session_factory.js +++ b/remoting/webapp/base/js/client_session_factory.js
@@ -23,9 +23,7 @@ this.requiredCapabilities_ = [ remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION, remoting.ClientSession.Capability.RATE_LIMIT_RESIZE_REQUESTS, - remoting.ClientSession.Capability.VIDEO_RECORDER, - remoting.ClientSession.Capability.TOUCH_EVENTS, - remoting.ClientSession.Capability.DESKTOP_SHAPE + remoting.ClientSession.Capability.TOUCH_EVENTS ]; // Append the app-specific capabilities.
diff --git a/remoting/webapp/base/js/client_session_factory_unittest.js b/remoting/webapp/base/js/client_session_factory_unittest.js index cd53d1c..149be4d1 100644 --- a/remoting/webapp/base/js/client_session_factory_unittest.js +++ b/remoting/webapp/base/js/client_session_factory_unittest.js
@@ -35,7 +35,7 @@ base.doNothing); factory = new remoting.ClientSessionFactory( document.createElement('div'), - [remoting.ClientSession.Capability.VIDEO_RECORDER]); + [remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION]); }, afterEach: function() { mockConnection.restore(); @@ -49,7 +49,7 @@ assert.ok(session instanceof remoting.ClientSession); assert.ok( mockConnection.plugin().hasCapability( - remoting.ClientSession.Capability.VIDEO_RECORDER), + remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION), 'Capability is set correctly.'); }); });
diff --git a/remoting/webapp/base/js/server_log_entry.js b/remoting/webapp/base/js/server_log_entry.js index 3eb13ed..2761c5c 100644 --- a/remoting/webapp/base/js/server_log_entry.js +++ b/remoting/webapp/base/js/server_log_entry.js
@@ -116,6 +116,10 @@ return 'p2p-failure'; case remoting.Error.Tag.CLIENT_SUSPENDED: return 'client-suspended'; + case remoting.Error.Tag.MAX_SESSION_LENGTH: + return 'max-session-length'; + case remoting.Error.Tag.HOST_CONFIGURATION_ERROR: + return 'host-configuration-error'; case remoting.Error.Tag.UNEXPECTED: return 'unexpected'; default:
diff --git a/remoting/webapp/crd/html/window_frame.html b/remoting/webapp/crd/html/window_frame.html index c1de9f4..286fc54 100644 --- a/remoting/webapp/crd/html/window_frame.html +++ b/remoting/webapp/crd/html/window_frame.html
@@ -11,9 +11,6 @@ <img src="icon_options.webp"> </span> <ul class="window-options-menu right-align"> - <li class="menu-start-stop-recording connected-only" - i18n-content="START_RECORDING" - hidden></li> <li class="menu-send-ctrl-alt-del connected-only" i18n-content="SEND_CTRL_ALT_DEL"></li> <li class="menu-send-print-screen connected-only"
diff --git a/remoting/webapp/crd/js/cast_extension_handler.js b/remoting/webapp/crd/js/cast_extension_handler.js deleted file mode 100644 index cf01bed..0000000 --- a/remoting/webapp/crd/js/cast_extension_handler.js +++ /dev/null
@@ -1,355 +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. - -/** - * @fileoverview Description of this file. - * Class handling interaction with the cast extension session of the Chromoting - * host. It receives and sends extension messages from/to the host through - * the client session. It uses the Google Cast Chrome Sender API library to - * interact with nearby Cast receivers. - * - * Once it establishes connection with a Cast device (upon user choice), it - * creates a session, loads our registered receiver application and then becomes - * a message proxy between the host and cast device, helping negotiate - * their peer connection. - */ - -'use strict'; - -/** @suppress {duplicate} */ -var remoting = remoting || {}; - -/** - * @constructor - * @implements {remoting.ProtocolExtension} - */ -remoting.CastExtensionHandler = function() { - /** @private {chrome.cast.Session} */ - this.session_ = null; - - /** @private {string} */ - this.kCastNamespace_ = 'urn:x-cast:com.chromoting.cast.all'; - - /** @private {string} */ - this.kApplicationId_ = "8A1211E3"; - - /** @private {Array<Object>} */ - this.messageQueue_ = []; - - /** @private {?function(string,string)} */ - this.sendMessageToHostCallback_ = null; -}; - -/** @private {string} */ -remoting.CastExtensionHandler.EXTENSION_TYPE = 'cast_message'; - -/** @override @return {Array<string>} */ -remoting.CastExtensionHandler.prototype.getExtensionTypes = function() { - return [remoting.CastExtensionHandler.EXTENSION_TYPE]; -}; - -/** - * The id of the script node. - * @private {string} - */ -remoting.CastExtensionHandler.prototype.SCRIPT_NODE_ID_ = 'cast-script-node'; - -/** - * Attempts to load the Google Cast Chrome Sender API libary. - * - * @param {function(string,string)} sendMessageToHost Callback to send a message - * to the host. - */ -remoting.CastExtensionHandler.prototype.startExtension = - function(sendMessageToHost) { - this.sendMessageToHostCallback_ = sendMessageToHost; - - var node = document.getElementById(this.SCRIPT_NODE_ID_); - if (node) { - console.error( - 'Multiple calls to CastExtensionHandler.start_ not expected.'); - return; - } - - // Create a script node to load the Cast Sender API. - node = document.createElement('script'); - node.id = this.SCRIPT_NODE_ID_; - node.src = "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"; - node.type = 'text/javascript'; - document.body.insertBefore(node, document.body.firstChild); - - /** @type {remoting.CastExtensionHandler} */ - var that = this; - var onLoad = function() { - window['__onGCastApiAvailable'] = that.onGCastApiAvailable.bind(that); - - }; - var onLoadError = function(event) { - console.error("Failed to load Chrome Cast Sender API."); - } - node.addEventListener('load', onLoad, false); - node.addEventListener('error', onLoadError, false); -}; - -/** - * Process Cast Extension Messages from the Chromoting host. - * - * @param {string} type The message type. - * @param {Object} message The parsed extension message data. - * @return {boolean} True if the extension message was handled. - */ -remoting.CastExtensionHandler.prototype.onExtensionMessage = - function(type, message) { - // Save messages to send after a session is established. - this.messageQueue_.push(message); - // Trigger the sending of pending messages, followed by the one just - // received. - if (this.session_) { - this.sendPendingMessages_(); - } - return true; -}; - -/** - * Send cast-extension messages through the host via the plugin. - * @param {Object} data The JSON response to be sent to the host. The - * response object must contain the appropriate keys. - * @private - */ -remoting.CastExtensionHandler.prototype.sendMessageToHost_ = function(data) { - this.sendMessageToHostCallback_(remoting.CastExtensionHandler.EXTENSION_TYPE, - JSON.stringify(data)); -}; - -/** - * Send pending messages from the host to the receiver app. - * @private - */ -remoting.CastExtensionHandler.prototype.sendPendingMessages_ = function() { - var len = this.messageQueue_.length; - for(var i = 0; i<len; i++) { - this.session_.sendMessage(this.kCastNamespace_, - this.messageQueue_[i], - this.sendMessageSuccess.bind(this), - this.sendMessageFailure.bind(this)); - } - this.messageQueue_ = []; -}; - -/** - * Event handler for '__onGCastApiAvailable' window event. This event is - * triggered if the Google Cast Chrome Sender API is available. We attempt to - * load this API in this.start(). If the API loaded successfully, we can proceed - * to initialize it and configure it to launch our Cast Receiver Application. - * - * @param {boolean} loaded True if the API loaded succesfully. - * @param {Object} errorInfo Info if the API load failed. - */ -remoting.CastExtensionHandler.prototype.onGCastApiAvailable = - function(loaded, errorInfo) { - if (loaded) { - this.initializeCastApi(); - } else { - console.log(errorInfo); - } -}; - -/** - * Initialize the Cast API. - * @private - */ -remoting.CastExtensionHandler.prototype.initializeCastApi = function() { - var sessionRequest = new chrome.cast.SessionRequest(this.kApplicationId_); - var apiConfig = - new chrome.cast.ApiConfig(sessionRequest, - this.sessionListener.bind(this), - this.receiverListener.bind(this), - chrome.cast.AutoJoinPolicy.PAGE_SCOPED, - chrome.cast.DefaultActionPolicy.CREATE_SESSION); - chrome.cast.initialize( - apiConfig, this.onInitSuccess.bind(this), this.onInitError.bind(this)); -}; - -/** - * Callback for successful initialization of the Cast API. - */ -remoting.CastExtensionHandler.prototype.onInitSuccess = function() { - console.log("Initialization Successful."); -}; - -/** - * Callback for failed initialization of the Cast API. - */ -remoting.CastExtensionHandler.prototype.onInitError = function() { - console.error("Initialization Failed."); -}; - -/** - * Listener invoked when a session is created or connected by the SDK. - * Note: The requestSession method would not cause this callback to be invoked - * since it is passed its own listener. - * @param {chrome.cast.Session} session The resulting session. - */ -remoting.CastExtensionHandler.prototype.sessionListener = function(session) { - console.log('New Session:' + /** @type {string} */ (session.sessionId)); - this.session_ = session; - if (this.session_.media.length != 0) { - - // There should be no media associated with the session, since we never - // directly load media from the Sender application. - this.onMediaDiscovered('sessionListener', this.session_.media[0]); - } - this.session_.addMediaListener( - this.onMediaDiscovered.bind(this, 'addMediaListener')); - this.session_.addUpdateListener(this.sessionUpdateListener.bind(this)); - this.session_.addMessageListener(this.kCastNamespace_, - this.chromotingMessageListener.bind(this)); - this.session_.sendMessage(this.kCastNamespace_, - {subject : 'test', chromoting_data : 'Hello, Cast.'}, - this.sendMessageSuccess.bind(this), - this.sendMessageFailure.bind(this)); - this.sendPendingMessages_(); -}; - -/** - * Listener invoked when a media session is created by another sender. - * @param {string} how How this callback was triggered. - * @param {chrome.cast.media.Media} media The media item discovered. - * @private - */ -remoting.CastExtensionHandler.prototype.onMediaDiscovered = - function(how, media) { - console.error("Unexpected media session discovered."); -}; - -/** - * Listener invoked when a cast extension message was sent to the cast device - * successfully. - * @private - */ -remoting.CastExtensionHandler.prototype.sendMessageSuccess = function() { -}; - -/** - * Listener invoked when a cast extension message failed to be sent to the cast - * device. - * @param {Object} error The error. - * @private - */ -remoting.CastExtensionHandler.prototype.sendMessageFailure = function(error) { - console.error('Failed to Send Message.', error); -}; - -/** - * Listener invoked when a cast extension message is received from the Cast - * device. - * @param {string} ns The namespace of the message received. - * @param {string} message The stringified JSON message received. - */ -remoting.CastExtensionHandler.prototype.chromotingMessageListener = - function(ns, message) { - if (ns === this.kCastNamespace_) { - try { - var messageObj = base.getJsonObjectFromString(message); - this.sendMessageToHost_(messageObj); - } catch (err) { - console.error('Failed to process message from Cast device.'); - } - } else { - console.error("Unexpected message from Cast device."); - } -}; - -/** - * Listener invoked when there updates to the current session. - * - * @param {boolean} isAlive True if the session is still alive. - */ -remoting.CastExtensionHandler.prototype.sessionUpdateListener = - function(isAlive) { - var message = isAlive ? 'Session Updated' : 'Session Removed'; - message += ': ' + this.session_.sessionId +'.'; - console.log(message); -}; - -/** - * Listener invoked when the availability of a Cast receiver that supports - * the application in sessionRequest is known or changes. - * - * @param {chrome.cast.ReceiverAvailability} availability Receiver availability. - */ -remoting.CastExtensionHandler.prototype.receiverListener = - function(availability) { - if (availability === chrome.cast.ReceiverAvailability.AVAILABLE) { - console.log("Receiver(s) Found."); - } else { - console.error("No Receivers Available."); - } -}; - -/** - * Launches the associated receiver application by requesting that it be created - * on the Cast device. It uses the SessionRequest passed during initialization - * to determine what application to launch on the Cast device. - * - * Note: This method is intended to be used as a click listener for a custom - * cast button on the webpage. We currently use the default cast button in - * Chrome, so this method is unused. - */ -remoting.CastExtensionHandler.prototype.launchApp = function() { - chrome.cast.requestSession(this.onRequestSessionSuccess.bind(this), - this.onLaunchError.bind(this)); -}; - -/** - * Listener invoked when chrome.cast.requestSession completes successfully. - * - * @param {chrome.cast.Session} session The requested session. - */ -remoting.CastExtensionHandler.prototype.onRequestSessionSuccess = - function (session) { - this.session_ = session; - this.session_.addUpdateListener(this.sessionUpdateListener.bind(this)); - if (this.session_.media.length != 0) { - this.onMediaDiscovered('onRequestSession', this.session_.media[0]); - } - this.session_.addMediaListener( - this.onMediaDiscovered.bind(this, 'addMediaListener')); - this.session_.addMessageListener(this.kCastNamespace_, - this.chromotingMessageListener.bind(this)); -}; - -/** - * Listener invoked when chrome.cast.requestSession fails. - * @param {chrome.cast.Error} error The error code. - */ -remoting.CastExtensionHandler.prototype.onLaunchError = function(error) { - console.error("Error Casting to Receiver.", error); -}; - -/** - * Stops the running receiver application associated with the session. - * TODO(aiguha): When the user disconnects using the blue drop down bar, - * the client session should notify the CastExtensionHandler, which should - * call this method to close the session with the Cast device. - */ -remoting.CastExtensionHandler.prototype.stopApp = function() { - this.session_.stop(this.onStopAppSuccess.bind(this), - this.onStopAppError.bind(this)); -}; - -/** - * Listener invoked when the receiver application is stopped successfully. - */ -remoting.CastExtensionHandler.prototype.onStopAppSuccess = function() { -}; - -/** - * Listener invoked when we fail to stop the receiver application. - * - * @param {chrome.cast.Error} error The error code. - */ -remoting.CastExtensionHandler.prototype.onStopAppError = function(error) { - console.error('Error Stopping App: ', error); -};
diff --git a/remoting/webapp/crd/js/desktop_connected_view.js b/remoting/webapp/crd/js/desktop_connected_view.js index d06a5a2..5696b731 100644 --- a/remoting/webapp/crd/js/desktop_connected_view.js +++ b/remoting/webapp/crd/js/desktop_connected_view.js
@@ -39,9 +39,6 @@ /** @private {remoting.ConnectedView} */ this.view_ = null; - /** @private {remoting.VideoFrameRecorder} */ - this.videoFrameRecorder_ = null; - /** @private {base.Disposable} */ this.eventHooks_ = null; @@ -297,40 +294,6 @@ this.plugin_.setRemapKeys(this.host_.options.getRemapKeys()); }; -/** @param {remoting.VideoFrameRecorder} recorder */ -remoting.DesktopConnectedView.prototype.setVideoFrameRecorder = - function(recorder) { - this.videoFrameRecorder_ = recorder; -}; - -/** - * Returns true if the ClientSession can record video frames to a file. - * @return {boolean} - */ -remoting.DesktopConnectedView.prototype.canRecordVideo = function() { - return !!this.videoFrameRecorder_; -}; - -/** - * Returns true if the ClientSession is currently recording video frames. - * @return {boolean} - */ -remoting.DesktopConnectedView.prototype.isRecordingVideo = function() { - if (!this.videoFrameRecorder_) { - return false; - } - return this.videoFrameRecorder_.isRecording(); -}; - -/** - * Starts or stops recording of video frames. - */ -remoting.DesktopConnectedView.prototype.startStopRecording = function() { - if (this.videoFrameRecorder_) { - this.videoFrameRecorder_.startStopRecording(); - } -}; - /** * Factory function so that it can be overwritten in unit test to avoid * UI dependencies.
diff --git a/remoting/webapp/crd/js/desktop_remoting_activity.js b/remoting/webapp/crd/js/desktop_remoting_activity.js index a5a39c8..3d0c6c4 100644 --- a/remoting/webapp/crd/js/desktop_remoting_activity.js +++ b/remoting/webapp/crd/js/desktop_remoting_activity.js
@@ -103,14 +103,6 @@ // Apply the default or previously-specified keyboard remapping. var remapping = connectionInfo.host().options.getRemapKeys(); this.connectedView_.setRemapKeys(remapping); - - if (connectionInfo.plugin().hasCapability( - remoting.ClientSession.Capability.VIDEO_RECORDER)) { - var recorder = new remoting.VideoFrameRecorder(); - connectionInfo.plugin().extensions().register(recorder); - this.connectedView_.setVideoFrameRecorder(recorder); - } - this.parentActivity_.onConnected(connectionInfo); };
diff --git a/remoting/webapp/crd/js/me2me_activity.js b/remoting/webapp/crd/js/me2me_activity.js index 8635565..0b63f29 100644 --- a/remoting/webapp/crd/js/me2me_activity.js +++ b/remoting/webapp/crd/js/me2me_activity.js
@@ -257,13 +257,10 @@ this.retryOnHostOffline_ = true; var plugin = connectionInfo.plugin(); - if (plugin.hasCapability(remoting.ClientSession.Capability.CAST)) { - plugin.extensions().register(new remoting.CastExtensionHandler()); - } // TODO(joedow): Do not register the GnubbyAuthHandler extension if the host // does not support security key forwarding. plugin.extensions().register(this.gnubbyAuthHandler_); - this.pinDialog_.requestPairingIfNecessary(connectionInfo.plugin()); + this.pinDialog_.requestPairingIfNecessary(plugin); // Drop the session after 30s of suspension. If this timeout is too short, we // risk dropping a connection that is self-recoverable. If this timeout is too
diff --git a/remoting/webapp/crd/js/options_menu.js b/remoting/webapp/crd/js/options_menu.js index 9d7d086..4cf6441fa 100644 --- a/remoting/webapp/crd/js/options_menu.js +++ b/remoting/webapp/crd/js/options_menu.js
@@ -21,13 +21,11 @@ * @param {Element} newConnection * @param {Element?} fullscreen * @param {Element?} toggleStats - * @param {Element?} startStopRecording * @constructor */ remoting.OptionsMenu = function(sendCtrlAltDel, sendPrtScrn, mapRightCtrl, resizeToClient, shrinkToFit, - newConnection, fullscreen, toggleStats, - startStopRecording) { + newConnection, fullscreen, toggleStats) { this.sendCtrlAltDel_ = sendCtrlAltDel; this.sendPrtScrn_ = sendPrtScrn; this.mapRightCtrl_ = mapRightCtrl; @@ -36,7 +34,6 @@ this.newConnection_ = newConnection; this.fullscreen_ = fullscreen; this.toggleStats_ = toggleStats; - this.startStopRecording_ = startStopRecording; /** @private {remoting.DesktopConnectedView} */ this.desktopConnectedView_ = null; @@ -61,10 +58,7 @@ toggleStats.addEventListener( 'click', this.onToggleStats_.bind(this), false); } - if (this.startStopRecording_) { - this.startStopRecording_.addEventListener( - 'click', this.onStartStopRecording_.bind(this), false); - } + }; /** @@ -101,17 +95,6 @@ remoting.MenuButton.select( this.toggleStats_, this.desktopConnectedView_.isStatsVisible()); } - if (this.startStopRecording_) { - this.startStopRecording_.hidden = - !this.desktopConnectedView_.canRecordVideo(); - if (this.desktopConnectedView_.isRecordingVideo()) { - l10n.localizeElementFromTag(this.startStopRecording_, - /*i18n-content*/'STOP_RECORDING'); - } else { - l10n.localizeElementFromTag(this.startStopRecording_, - /*i18n-content*/'START_RECORDING'); - } - } } }; @@ -164,12 +147,6 @@ } }; -remoting.OptionsMenu.prototype.onStartStopRecording_ = function() { - if (this.desktopConnectedView_) { - this.desktopConnectedView_.startStopRecording(); - } -}; - /** * @type {remoting.OptionsMenu} */
diff --git a/remoting/webapp/crd/js/remoting_activity_test_driver.js b/remoting/webapp/crd/js/remoting_activity_test_driver.js index 3771371..131b574 100644 --- a/remoting/webapp/crd/js/remoting_activity_test_driver.js +++ b/remoting/webapp/crd/js/remoting_activity_test_driver.js
@@ -46,8 +46,6 @@ */ var MockDesktopConnectedView = function() {}; /** @override */ -MockDesktopConnectedView.prototype.setVideoFrameRecorder = function() {}; -/** @override */ MockDesktopConnectedView.prototype.dispose = function() {}; /** @override */ MockDesktopConnectedView.prototype.setRemapKeys = function() {};
diff --git a/remoting/webapp/crd/js/toolbar.js b/remoting/webapp/crd/js/toolbar.js index d43d084..235aa495 100644 --- a/remoting/webapp/crd/js/toolbar.js +++ b/remoting/webapp/crd/js/toolbar.js
@@ -73,7 +73,6 @@ document.getElementById('screen-shrink-to-fit'), document.getElementById('new-window'), document.getElementById('toggle-full-screen'), - null, null); };
diff --git a/remoting/webapp/crd/js/video_frame_recorder.js b/remoting/webapp/crd/js/video_frame_recorder.js deleted file mode 100644 index 6064c4a2..0000000 --- a/remoting/webapp/crd/js/video_frame_recorder.js +++ /dev/null
@@ -1,179 +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. - -/** - * @fileoverview - * Class implement the video frame recorder extension client. - */ - -'use strict'; - -/** @suppress {duplicate} */ -var remoting = remoting || {}; - -/** - * @constructor - * @implements {remoting.ProtocolExtension} - */ -remoting.VideoFrameRecorder = function() { - /** @private {?function(string,string)} */ - this.sendMessageToHostCallback_ = null; - - this.fileWriter_ = null; - this.isRecording_ = false; -}; - -/** @private {string} */ -remoting.VideoFrameRecorder.EXTENSION_TYPE = 'video-recorder'; - -/** @override @return {Array<string>} */ -remoting.VideoFrameRecorder.prototype.getExtensionTypes = function() { - return [remoting.VideoFrameRecorder.EXTENSION_TYPE]; -}; - -/** - * @param {function(string,string)} sendMessageToHost Callback to send a message - * to the host. - */ -remoting.VideoFrameRecorder.prototype.startExtension = - function(sendMessageToHost) { - this.sendMessageToHostCallback_ = sendMessageToHost; -}; - -/** - * @param {Object} data The data to send. - * @private - */ -remoting.VideoFrameRecorder.prototype.sendMessageToHost_ = function(data) { - this.sendMessageToHostCallback_(remoting.VideoFrameRecorder.EXTENSION_TYPE, - JSON.stringify(data)); -} - -/** - * Handles 'video-recorder' extension messages and returns true. Returns - * false for all other message types. - * - * @param {string} type Type of extension message. - * @param {Object} message The parsed extension message data. - * @return {boolean} - */ -remoting.VideoFrameRecorder.prototype.onExtensionMessage = - function(type, message) { - console.assert(type == remoting.VideoFrameRecorder.EXTENSION_TYPE, - 'Unexpected extension message type: ' + type + '.'); - - var messageType = base.getStringAttr(message, 'type'); - var messageData = base.getStringAttr(message, 'data'); - - if (messageType == 'next-frame-reply') { - if (!this.fileWriter_) { - console.log("Received frame but have no writer"); - return true; - } - if (!messageData) { - console.log("Finished receiving frames"); - this.fileWriter_ = null; - return true; - } - - console.log("Received frame"); - var videoPacketString = window.atob(messageData); - - console.log("Converted from Base64 - length:" + videoPacketString.length); - var byteArrays = []; - - for (var offset = 0; offset < videoPacketString.length; offset += 512) { - var slice = videoPacketString.slice(offset, offset + 512); - var byteNumbers = new Array(slice.length); - for (var i = 0; i < slice.length; i++) { - byteNumbers[i] = slice.charCodeAt(i); - } - var byteArray = new Uint8Array(byteNumbers); - byteArrays.push(byteArray); - } - - console.log("Writing frame"); - videoPacketString = null; - /** - * @param {Array} parts - * @return {Blob} - */ - var makeBlob = function(parts) { - return new Blob(parts); - } - var videoPacketBlob = makeBlob(byteArrays); - byteArrays = null; - - this.fileWriter_.write(videoPacketBlob); - - return true; - } - - console.log("Unrecognized message: " + messageType); - return true; -} - -/** - * Starts or stops video recording. - */ -remoting.VideoFrameRecorder.prototype.startStopRecording = function() { - var data = {}; - if (this.isRecording_) { - this.isRecording_ = false; - data = { type: 'stop' } - - chrome.fileSystem.chooseEntry( - {type: 'saveFile', suggestedName: 'videoRecording.pb'}, - this.onFileChosen_.bind(this)); - } else { - this.isRecording_ = true; - data = { type: 'start' } - } - this.sendMessageToHost_(data); -} - -/** - * Returns true if the session is currently being recorded. - * @return {boolean} - */ -remoting.VideoFrameRecorder.prototype.isRecording = function() { - return this.isRecording_; -} - -/** - * @param {Entry=} entry The single file entry if multiple files are not - * allowed. - * @param {Array<!FileEntry>=} fileEntries List of file entries if multiple - * files are allowed. - */ -remoting.VideoFrameRecorder.prototype.onFileChosen_ = function( - entry, fileEntries) { - if (!entry) { - console.log("Cancelled save of video frames."); - } else { - chrome.fileSystem.getDisplayPath(entry, function(path) { - console.log("Saving video frames to:" + path); - }); - entry.createWriter(this.onFileWriter_.bind(this)); - } -} - -/** @param {FileWriter} fileWriter */ -remoting.VideoFrameRecorder.prototype.onFileWriter_ = function(fileWriter) { - console.log("Obtained FileWriter for video frame write"); - fileWriter.onwriteend = this.onWriteComplete_.bind(this); - this.fileWriter_ = fileWriter; - this.fetchNextFrame_(); -} - -remoting.VideoFrameRecorder.prototype.onWriteComplete_ = function(e) { - console.log("Video frame write complete"); - this.fetchNextFrame_(); -} - -remoting.VideoFrameRecorder.prototype.fetchNextFrame_ = function() { - console.log("Request next video frame"); - var data = { type: 'next-frame' } - this.sendMessageToHost_(data); -}
diff --git a/remoting/webapp/crd/js/window_frame.js b/remoting/webapp/crd/js/window_frame.js index fc5046e..160a791 100644 --- a/remoting/webapp/crd/js/window_frame.js +++ b/remoting/webapp/crd/js/window_frame.js
@@ -89,8 +89,7 @@ this.titleBar_.querySelector('.menu-shrink-to-fit'), this.titleBar_.querySelector('.menu-new-window'), this.titleBar_.querySelector('.window-fullscreen'), - this.titleBar_.querySelector('.menu-toggle-connection-stats'), - this.titleBar_.querySelector('.menu-start-stop-recording')); + this.titleBar_.querySelector('.menu-toggle-connection-stats')); }; /**
diff --git a/remoting/webapp/files.gni b/remoting/webapp/files.gni index b3dd4cf..abb6b28 100644 --- a/remoting/webapp/files.gni +++ b/remoting/webapp/files.gni
@@ -19,7 +19,6 @@ # These provide type information for jscompile. remoting_webapp_js_proto_files = [ "js_proto/chrome_proto.js", - "js_proto/chrome_cast_proto.js", "js_proto/dom_proto.js", "js_proto/remoting_proto.js", ] @@ -130,7 +129,6 @@ # Prototypes for objects that are not mocked. remoting_webapp_unittests_js_proto_files = [ - "js_proto/chrome_cast_proto.js", "js_proto/chrome_proto.js", "js_proto/dom_proto.js", "js_proto/remoting_proto.js", @@ -252,15 +250,11 @@ "crd/js/third_party_token_fetcher.js", ] -# Cast extension handler JavaScript files. -remoting_webapp_js_cast_extension_files = [ "crd/js/cast_extension_handler.js" ] - # Client JavaScript files. remoting_webapp_js_client_files = [ "crd/js/apps_v2_migration.js", "crd/js/event_handlers.js", "crd/js/gcd_client.js", - "crd/js/video_frame_recorder.js", ] # Gnubby authentication JavaScript files. @@ -350,7 +344,6 @@ remoting_webapp_shared_js_signaling_files + remoting_webapp_js_auth_client2host_files + remoting_webapp_js_client_files + remoting_webapp_js_gnubby_auth_files + - remoting_webapp_js_cast_extension_files + remoting_webapp_js_host_control_files + remoting_webapp_js_host_display_files
diff --git a/remoting/webapp/js_proto/chrome_cast_proto.js b/remoting/webapp/js_proto/chrome_cast_proto.js deleted file mode 100644 index 58fa914..0000000 --- a/remoting/webapp/js_proto/chrome_cast_proto.js +++ /dev/null
@@ -1,129 +0,0 @@ -// 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. - -// This file contains various hacks needed to inform JSCompiler of various -// WebKit- and Chrome-specific properties and methods. It is used only with -// JSCompiler to verify the type-correctness of our code. - -/** @type {Object} */ -chrome.cast = {}; - -/** @constructor */ -chrome.cast.AutoJoinPolicy = function() {}; - -/** @type {chrome.cast.AutoJoinPolicy} */ -chrome.cast.AutoJoinPolicy.PAGE_SCOPED; - -/** @type {chrome.cast.AutoJoinPolicy} */ -chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED; - -/** @type {chrome.cast.AutoJoinPolicy} */ -chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED; - -/** @constructor */ -chrome.cast.DefaultActionPolicy = function() {}; - -/** @type {chrome.cast.DefaultActionPolicy} */ -chrome.cast.DefaultActionPolicy.CAST_THIS_TAB; - -/** @type {chrome.cast.DefaultActionPolicy} */ -chrome.cast.DefaultActionPolicy.CREATE_SESSION; - -/** @constructor */ -chrome.cast.Error = function() {}; - -/** @constructor */ -chrome.cast.ReceiverAvailability = function() {}; - -/** @type {chrome.cast.ReceiverAvailability} */ -chrome.cast.ReceiverAvailability.AVAILABLE; - -/** @type {chrome.cast.ReceiverAvailability} */ -chrome.cast.ReceiverAvailability.UNAVAILABLE; - -/** @type {Object} */ -chrome.cast.media = {}; - -/** @constructor */ -chrome.cast.media.Media = function() { - /** @type {number} */ - this.mediaSessionId = 0; -}; - -/** @constructor */ -chrome.cast.Session = function() { - /** @type {Array<chrome.cast.media.Media>} */ - this.media = []; - - /** @type {string} */ - this.sessionId = ''; -}; - -/** - * @param {string} namespace - * @param {Object} message - * @param {function():void} successCallback - * @param {function(chrome.cast.Error):void} errorCallback - */ -chrome.cast.Session.prototype.sendMessage = - function(namespace, message, successCallback, errorCallback) {}; - -/** - * @param {function(chrome.cast.media.Media):void} listener - */ -chrome.cast.Session.prototype.addMediaListener = function(listener) {}; - -/** - * @param {function(boolean):void} listener - */ -chrome.cast.Session.prototype.addUpdateListener = function(listener) {}; - -/** - * @param {string} namespace - * @param {function(string, string):void} listener - */ -chrome.cast.Session.prototype.addMessageListener = - function(namespace, listener){}; - -/** - * @param {function():void} successCallback - * @param {function(chrome.cast.Error):void} errorCallback - */ -chrome.cast.Session.prototype.stop = - function(successCallback, errorCallback) {}; - -/** - * @constructor - * @param {string} applicationID - */ -chrome.cast.SessionRequest = function(applicationID) {}; - -/** - * @constructor - * @param {chrome.cast.SessionRequest} sessionRequest - * @param {function(chrome.cast.Session):void} sessionListener - * @param {function(chrome.cast.ReceiverAvailability):void} receiverListener - * @param {chrome.cast.AutoJoinPolicy=} opt_autoJoinPolicy - * @param {chrome.cast.DefaultActionPolicy=} opt_defaultActionPolicy - */ -chrome.cast.ApiConfig = function(sessionRequest, - sessionListener, - receiverListener, - opt_autoJoinPolicy, - opt_defaultActionPolicy) {}; - -/** - * @param {chrome.cast.ApiConfig} apiConfig - * @param {function():void} onInitSuccess - * @param {function(chrome.cast.Error):void} onInitError - */ -chrome.cast.initialize = - function(apiConfig, onInitSuccess, onInitError) {}; - -/** - * @param {function(chrome.cast.Session):void} successCallback - * @param {function(chrome.cast.Error):void} errorCallback - */ -chrome.cast.requestSession = - function(successCallback, errorCallback) {};
diff --git a/sandbox/mac/BUILD.gn b/sandbox/mac/BUILD.gn index cdaf527a..c317cef 100644 --- a/sandbox/mac/BUILD.gn +++ b/sandbox/mac/BUILD.gn
@@ -5,45 +5,6 @@ import("//build/config/mac/mac_sdk.gni") import("//testing/test.gni") -generate_stubs_script = "//tools/generate_stubs/generate_stubs.py" -generate_stubs_header = "xpc_stubs_header.fragment" -generate_stubs_sig_public = "xpc_stubs.sig" -generate_stubs_sig_private = "xpc_private_stubs.sig" -generate_stubs_project = "sandbox/mac" -generate_stubs_output_stem = "xpc_stubs" - -action("generate_stubs") { - script = generate_stubs_script - sources = [ - generate_stubs_sig_private, - generate_stubs_sig_public, - ] - inputs = [ - generate_stubs_header, - ] - outputs = [ - "$target_gen_dir/$generate_stubs_output_stem.cc", - "$target_gen_dir/$generate_stubs_output_stem.h", - ] - args = [ - "-i", - rebase_path(target_gen_dir, root_build_dir), - "-o", - rebase_path(target_gen_dir, root_build_dir), - "-t", - "posix_stubs", - "-e", - rebase_path(generate_stubs_header, root_build_dir), - "-s", - generate_stubs_output_stem, - "-p", - generate_stubs_project, - "-x", - "SANDBOX_EXPORT", - ] - args += rebase_path(sources, root_build_dir) -} - component("sandbox") { sources = [ "bootstrap_sandbox.cc", @@ -59,7 +20,6 @@ "policy.h", "pre_exec_delegate.cc", "pre_exec_delegate.h", - "xpc.cc", "xpc.h", "xpc_message_server.cc", "xpc_message_server.h", @@ -71,15 +31,6 @@ deps = [ "//base", ] - - # When the build SDK is 10.6, generate a dynamic stub loader. When the - # SDK is higher, then libxpc.dylib will be loaded automatically as part - # of libSystem, and only forward declarations of private symbols are - # necessary. - if (mac_sdk_version == "10.6") { - deps += [ ":generate_stubs" ] - sources += get_target_outputs(":generate_stubs") - } } test("sandbox_mac_unittests") {
diff --git a/sandbox/mac/bootstrap_sandbox_unittest.mm b/sandbox/mac/bootstrap_sandbox_unittest.mm index 467189e..6ef1937 100644 --- a/sandbox/mac/bootstrap_sandbox_unittest.mm +++ b/sandbox/mac/bootstrap_sandbox_unittest.mm
@@ -80,11 +80,6 @@ namespace sandbox { -void InitializeXPCIfRequired() { - if (base::mac::IsOSYosemiteOrLater()) - CHECK(InitializeXPC()); -} - class BootstrapSandboxTest : public base::MultiProcessTest { public: void SetUp() override { @@ -179,8 +174,6 @@ } MULTIPROCESS_TEST_MAIN(PostNotification) { - InitializeXPCIfRequired(); - [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kTestNotification object:[NSString stringWithFormat:@"%d", getpid()]]; @@ -198,8 +191,6 @@ } MULTIPROCESS_TEST_MAIN(PolicyDenyError) { - InitializeXPCIfRequired(); - mach_port_t port = MACH_PORT_NULL; kern_return_t kr = bootstrap_look_up(bootstrap_port, kTestServer, &port); @@ -223,8 +214,6 @@ } MULTIPROCESS_TEST_MAIN(PolicyDenyDummyPort) { - InitializeXPCIfRequired(); - mach_port_t port = MACH_PORT_NULL; kern_return_t kr = bootstrap_look_up(bootstrap_port, kTestServer, &port); @@ -290,8 +279,6 @@ } MULTIPROCESS_TEST_MAIN(PolicySubstitutePort) { - InitializeXPCIfRequired(); - mach_port_t port = MACH_PORT_NULL; kern_return_t kr = bootstrap_look_up(bootstrap_port, kTestServer, &port); CHECK_EQ(KERN_SUCCESS, kr); @@ -409,8 +396,6 @@ } MULTIPROCESS_TEST_MAIN(DefaultRuleAllow) { - InitializeXPCIfRequired(); - [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kTestNotification object:[NSString stringWithFormat:@"%d", getpid()]]; @@ -492,8 +477,6 @@ } MULTIPROCESS_TEST_MAIN(ChildOutliveSandbox) { - InitializeXPCIfRequired(); - // Get the synchronization channel. mach_port_t port = MACH_PORT_NULL; CHECK_EQ(KERN_SUCCESS, bootstrap_look_up(bootstrap_port, "sync", &port));
diff --git a/sandbox/mac/os_compatibility.cc b/sandbox/mac/os_compatibility.cc index abd02a4..1ec0e3a 100644 --- a/sandbox/mac/os_compatibility.cc +++ b/sandbox/mac/os_compatibility.cc
@@ -19,15 +19,8 @@ #pragma pack(push, 4) // Verified from launchd-329.3.3 (10.6.8). -struct look_up2_request_10_6 { - mach_msg_header_t Head; - NDR_record_t NDR; - name_t servicename; - pid_t targetpid; - uint64_t flags; -}; - -struct look_up2_reply_10_6 { +// look_up2_reply_10_7 is the same as the 10_6 version. +struct look_up2_reply_10_7 { mach_msg_header_t Head; mach_msg_body_t msgh_body; mach_msg_port_descriptor_t service_port; @@ -46,15 +39,13 @@ uint64_t flags; }; -// look_up2_reply_10_7 is the same as the 10_6 version. - // Verified from: // launchd-329.3.3 (10.6.8) // launchd-392.39 (10.7.5) // launchd-442.26.2 (10.8.5) // launchd-842.1.4 (10.9.0) typedef int vproc_gsk_t; // Defined as an enum in liblaunch/vproc_priv.h. -struct swap_integer_request_10_6 { +struct swap_integer_request_10_7 { mach_msg_header_t Head; NDR_record_t NDR; vproc_gsk_t inkey; @@ -73,10 +64,10 @@ return len; } -class OSCompatibility_10_6 : public OSCompatibility { +class OSCompatibility_10_7 : public OSCompatibility { public: - OSCompatibility_10_6() {} - ~OSCompatibility_10_6() override {} + OSCompatibility_10_7() {} + ~OSCompatibility_10_7() override {} uint64_t GetMessageSubsystem(const IPCMessage message) override { return (message.mach->msgh_id / 100) * 100; @@ -99,12 +90,12 @@ } std::string GetServiceLookupName(const IPCMessage message) override { - return GetRequestName<look_up2_request_10_6>(message); + return GetRequestName<look_up2_request_10_7>(message); } void WriteServiceLookUpReply(IPCMessage message, mach_port_t service_port) override { - auto reply = reinterpret_cast<look_up2_reply_10_6*>(message.mach); + auto reply = reinterpret_cast<look_up2_reply_10_7*>(message.mach); reply->Head.msgh_size = sizeof(*reply); reply->Head.msgh_bits = MACH_MSGH_BITS_REMOTE(MACH_MSG_TYPE_MOVE_SEND_ONCE) | @@ -117,7 +108,7 @@ bool IsSwapIntegerReadOnly(const IPCMessage message) override { auto request = - reinterpret_cast<const swap_integer_request_10_6*>(message.mach); + reinterpret_cast<const swap_integer_request_10_7*>(message.mach); return request->inkey == 0 && request->inval == 0 && request->outkey != 0; } @@ -137,16 +128,6 @@ } }; -class OSCompatibility_10_7 : public OSCompatibility_10_6 { - public: - OSCompatibility_10_7() {} - ~OSCompatibility_10_7() override {} - - std::string GetServiceLookupName(const IPCMessage message) override { - return GetRequestName<look_up2_request_10_7>(message); - } -}; - class OSCompatibility_10_10 : public OSCompatibility { public: OSCompatibility_10_10() {} @@ -199,9 +180,7 @@ // static scoped_ptr<OSCompatibility> OSCompatibility::CreateForPlatform() { - if (base::mac::IsOSSnowLeopard()) - return make_scoped_ptr(new OSCompatibility_10_6()); - else if (base::mac::IsOSLionOrLater() && base::mac::IsOSMavericksOrEarlier()) + if (base::mac::IsOSLionOrLater() && base::mac::IsOSMavericksOrEarlier()) return make_scoped_ptr(new OSCompatibility_10_7()); else return make_scoped_ptr(new OSCompatibility_10_10());
diff --git a/sandbox/mac/sandbox_mac.gypi b/sandbox/mac/sandbox_mac.gypi index 91ad20b..13aa403 100644 --- a/sandbox/mac/sandbox_mac.gypi +++ b/sandbox/mac/sandbox_mac.gypi
@@ -21,7 +21,6 @@ 'policy.h', 'pre_exec_delegate.cc', 'pre_exec_delegate.h', - 'xpc.cc', 'xpc.h', 'xpc_message_server.cc', 'xpc_message_server.h', @@ -41,52 +40,6 @@ '$(SDKROOT)/usr/lib/libbsm.dylib', ], }, - 'conditions': [ - # When the build SDK is 10.6, generate a dynamic stub loader. When the - # SDK is higher, then libxpc.dylib will be loaded automatically as part - # of libSystem, and only forward declarations of private symbols are - # necessary. - ['mac_sdk == "10.6"', { - 'actions': [ - { - 'variables': { - 'generate_stubs_script': '../tools/generate_stubs/generate_stubs.py', - 'generate_stubs_header_path': 'xpc_stubs_header.fragment', - 'generate_stubs_sig_public_path': 'xpc_stubs.sig', - 'generate_stubs_sig_private_path': 'xpc_private_stubs.sig', - 'generate_stubs_project': 'sandbox/mac', - 'generate_stubs_output_stem': 'xpc_stubs', - }, - 'action_name': 'generate_stubs', - 'inputs': [ - '<(generate_stubs_script)', - '<(generate_stubs_header_path)', - '<(generate_stubs_sig_public_path)', - '<(generate_stubs_sig_private_path)', - ], - 'outputs': [ - '<(INTERMEDIATE_DIR)/<(generate_stubs_output_stem).cc', - '<(SHARED_INTERMEDIATE_DIR)/<(generate_stubs_project)/<(generate_stubs_output_stem).h', - ], - 'action': [ - 'python', - '<(generate_stubs_script)', - '-i', '<(INTERMEDIATE_DIR)', - '-o', '<(SHARED_INTERMEDIATE_DIR)/<(generate_stubs_project)', - '-t', 'posix_stubs', - '-e', '<(generate_stubs_header_path)', - '-s', '<(generate_stubs_output_stem)', - '-p', '<(generate_stubs_project)', - '-x', 'SANDBOX_EXPORT', - '<(generate_stubs_sig_public_path)', - '<(generate_stubs_sig_private_path)', - ], - 'process_outputs_as_sources': 1, - 'message': 'Generating XPC stubs for 10.6 compatability.', - }, - ], - }], - ], }, { 'target_name': 'sandbox_mac_unittests',
diff --git a/sandbox/mac/xpc.cc b/sandbox/mac/xpc.cc deleted file mode 100644 index b8d526b..0000000 --- a/sandbox/mac/xpc.cc +++ /dev/null
@@ -1,25 +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. - -#include "sandbox/mac/xpc.h" - -namespace sandbox { - -bool InitializeXPC() { -#if !defined(MAC_OS_X_VERSION_10_7) || \ - MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 - std::vector<std::string> path_list; - path_list.push_back("/usr/lib/system/libxpc.dylib"); - - sandbox_mac::StubPathMap path_map; - path_map[sandbox_mac::kModuleXpc_stubs] = path_list; - path_map[sandbox_mac::kModuleXpc_private_stubs] = path_list; - - return sandbox_mac::InitializeStubs(path_map); -#else - return true; -#endif -} - -} // namespace sandbox
diff --git a/sandbox/mac/xpc.h b/sandbox/mac/xpc.h index 33d3945..8ff1faa 100644 --- a/sandbox/mac/xpc.h +++ b/sandbox/mac/xpc.h
@@ -2,49 +2,71 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This file provides forward declarations for XPC symbols that are not -// present in the 10.6 SDK. It uses generate_stubs to produce code to -// dynamically load the libxpc.dylib library and set up a stub table, with -// the same names as the real XPC functions. +// This file provides forward declarations for private XPC symbols. #ifndef SANDBOX_MAC_XPC_H_ #define SANDBOX_MAC_XPC_H_ #include <AvailabilityMacros.h> #include <mach/mach.h> +#include <bsm/libbsm.h> +#include <xpc/xpc.h> #include "sandbox/sandbox_export.h" -// Declares XPC object types. This includes <xpc/xpc.h> if available. -#include "sandbox/mac/xpc_stubs_header.fragment" - -#if !defined(MAC_OS_X_VERSION_10_7) || \ - MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 - -// C++ library loader. -#include "sandbox/mac/xpc_stubs.h" - +// Declare private types. extern "C" { -// Signatures for XPC public functions that are loaded by xpc_stubs.h. -#include "sandbox/mac/xpc_stubs.sig" -// Signatures for private XPC functions. -#include "sandbox/mac/xpc_private_stubs.sig" +typedef struct _xpc_pipe_s* xpc_pipe_t; } // extern "C" -#else - -// Signatures for private XPC functions. +#if defined(MAC_OS_X_VERSION_10_7) && \ + MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 +// Redeclare methods that only exist on 10.7+ to suppress +// -Wpartial-availability warnings. extern "C" { -#include "sandbox/mac/xpc_private_stubs.sig" +void xpc_dictionary_set_int64(xpc_object_t xdict, + const char* key, + int64_t value); +void xpc_release(xpc_object_t object); +bool xpc_dictionary_get_bool(xpc_object_t xdict, const char* key); +int64_t xpc_dictionary_get_int64(xpc_object_t xdict, const char* key); +const char* xpc_dictionary_get_string(xpc_object_t xdict, const char* key); +uint64_t xpc_dictionary_get_uint64(xpc_object_t xdict, const char* key); +void xpc_dictionary_set_uint64(xpc_object_t xdict, + const char* key, + uint64_t value); +void xpc_dictionary_set_string(xpc_object_t xdict, const char* key, + const char* string); +xpc_object_t xpc_dictionary_create(const char* const* keys, + const xpc_object_t* values, + size_t count); +xpc_object_t xpc_dictionary_create_reply(xpc_object_t original); +xpc_object_t xpc_dictionary_get_value(xpc_object_t xdict, const char* key); +char* xpc_copy_description(xpc_object_t object); } // extern "C" - #endif -namespace sandbox { +// Signatures for private XPC functions. +extern "C" { +// Dictionary manipulation. +void xpc_dictionary_set_mach_send(xpc_object_t dictionary, + const char* name, + mach_port_t port); +void xpc_dictionary_get_audit_token(xpc_object_t dictionary, + audit_token_t* token); -// Dynamically loads the XPC library. -bool SANDBOX_EXPORT InitializeXPC(); +// Raw object getters. +mach_port_t xpc_mach_send_get_right(xpc_object_t value); -} // namespace sandbox +// Pipe methods. +xpc_pipe_t xpc_pipe_create_from_port(mach_port_t port, int flags); +int xpc_pipe_receive(mach_port_t port, xpc_object_t* message); +int xpc_pipe_routine(xpc_pipe_t pipe, + xpc_object_t request, + xpc_object_t* reply); +int xpc_pipe_routine_reply(xpc_object_t reply); +int xpc_pipe_simpleroutine(xpc_pipe_t pipe, xpc_object_t message); +int xpc_pipe_routine_forward(xpc_pipe_t forward_to, xpc_object_t request); +} // extern "C" #endif // SANDBOX_MAC_XPC_H_
diff --git a/sandbox/mac/xpc_message_server.cc b/sandbox/mac/xpc_message_server.cc index 1375310..273419b 100644 --- a/sandbox/mac/xpc_message_server.cc +++ b/sandbox/mac/xpc_message_server.cc
@@ -18,9 +18,7 @@ mach_port_t server_receive_right) : demuxer_(demuxer), server_port_(server_receive_right), - reply_message_(NULL) { - CHECK(InitializeXPC()); -} + reply_message_(NULL) {} XPCMessageServer::~XPCMessageServer() { }
diff --git a/sandbox/mac/xpc_message_server_unittest.cc b/sandbox/mac/xpc_message_server_unittest.cc index 585a627..16872901 100644 --- a/sandbox/mac/xpc_message_server_unittest.cc +++ b/sandbox/mac/xpc_message_server_unittest.cc
@@ -26,7 +26,6 @@ void SetUp() override { if (!RunXPCTest()) return; - ASSERT_TRUE(InitializeXPC()); } bool RunXPCTest() { @@ -180,8 +179,6 @@ } MULTIPROCESS_TEST_MAIN(GetSenderPID) { - CHECK(sandbox::InitializeXPC()); - mach_port_t port = MACH_PORT_NULL; CHECK_EQ(KERN_SUCCESS, bootstrap_look_up(bootstrap_port, kGetSenderPID, &port));
diff --git a/sandbox/mac/xpc_private_stubs.sig b/sandbox/mac/xpc_private_stubs.sig deleted file mode 100644 index b8e1c50..0000000 --- a/sandbox/mac/xpc_private_stubs.sig +++ /dev/null
@@ -1,22 +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. - -// This file contains declarations of private XPC functions. This file is -// used for both forward declarations of private symbols and to use with -// tools/generate_stubs for creating a dynamic library loader. - -// Dictionary manipulation. -void xpc_dictionary_set_mach_send(xpc_object_t dictionary, const char* name, mach_port_t port); -void xpc_dictionary_get_audit_token(xpc_object_t dictionary, audit_token_t* token); - -// Raw object getters. -mach_port_t xpc_mach_send_get_right(xpc_object_t value); - -// Pipe methods. -xpc_pipe_t xpc_pipe_create_from_port(mach_port_t port, int flags); -int xpc_pipe_receive(mach_port_t port, xpc_object_t* message); -int xpc_pipe_routine(xpc_pipe_t pipe, xpc_object_t request, xpc_object_t* reply); -int xpc_pipe_routine_reply(xpc_object_t reply); -int xpc_pipe_simpleroutine(xpc_pipe_t pipe, xpc_object_t message); -int xpc_pipe_routine_forward(xpc_pipe_t forward_to, xpc_object_t request);
diff --git a/sandbox/mac/xpc_stubs.sig b/sandbox/mac/xpc_stubs.sig deleted file mode 100644 index b8e76997..0000000 --- a/sandbox/mac/xpc_stubs.sig +++ /dev/null
@@ -1,20 +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. - -// This file contains declarations of public XPC functions used in the sandbox. -// This file is used with tools/generate_stubs for creating a dynamic library -// loader. - -// XPC object management. -void xpc_release(xpc_object_t object); - -// Dictionary manipulation. -xpc_object_t xpc_dictionary_create(const char* const *keys, const xpc_object_t* values, size_t count); -const char* xpc_dictionary_get_string(xpc_object_t dictionary, const char* key); -uint64_t xpc_dictionary_get_uint64(xpc_object_t dictionary, const char* key); -void xpc_dictionary_set_uint64(xpc_object_t dictionary, const char* key, uint64_t value); -int64_t xpc_dictionary_get_int64(xpc_object_t dictionary, const char* key); -void xpc_dictionary_set_int64(xpc_object_t dictionary, const char* key, int64_t value); -bool xpc_dictionary_get_bool(xpc_object_t dictionary, const char* key); -xpc_object_t xpc_dictionary_create_reply(xpc_object_t request);
diff --git a/sandbox/mac/xpc_stubs_header.fragment b/sandbox/mac/xpc_stubs_header.fragment deleted file mode 100644 index 2aa81cc..0000000 --- a/sandbox/mac/xpc_stubs_header.fragment +++ /dev/null
@@ -1,78 +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. - -#ifndef SANDBOX_MAC_XPC_STUBS_HEADER_FRAGMENT_ -#define SANDBOX_MAC_XPC_STUBS_HEADER_FRAGMENT_ - -#include <bsm/libbsm.h> -#include <stddef.h> -#include <stdint.h> - -#include "sandbox/sandbox_export.h" - -// Declare or include public types. -#if !defined(MAC_OS_X_VERSION_10_7) || \ - MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 - -extern "C" { -typedef void* xpc_object_t; -} // extern "C" - -#else - -#include <xpc/xpc.h> - -#endif - -// Declare private types. -extern "C" { -typedef struct _xpc_pipe_s* xpc_pipe_t; -} // extern "C" - -#if defined(MAC_OS_X_VERSION_10_7) && \ - MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 -// Redeclare methods that only exist on 10.7+ to suppress -// -Wpartial-availability warnings. -extern "C" { -XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 void -xpc_dictionary_set_int64(xpc_object_t xdict, const char* key, int64_t value); - -XPC_EXPORT XPC_NONNULL1 void xpc_release(xpc_object_t object); - -XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL -bool xpc_dictionary_get_bool(xpc_object_t xdict, const char* key); - -XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL int64_t -xpc_dictionary_get_int64(xpc_object_t xdict, const char* key); - -XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL -const char* xpc_dictionary_get_string(xpc_object_t xdict, const char* key); - -XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL uint64_t -xpc_dictionary_get_uint64(xpc_object_t xdict, const char* key); - -XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 void -xpc_dictionary_set_uint64(xpc_object_t xdict, const char* key, uint64_t value); - -XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 -void xpc_dictionary_set_string(xpc_object_t xdict, const char* key, - const char* string); - -XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT xpc_object_t -xpc_dictionary_create(const char* const* keys, - const xpc_object_t* values, - size_t count); -XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL_ALL - xpc_object_t - xpc_dictionary_create_reply(xpc_object_t original); - -XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 XPC_NONNULL2 -xpc_object_t xpc_dictionary_get_value(xpc_object_t xdict, const char* key); - -XPC_EXPORT XPC_MALLOC XPC_WARN_RESULT XPC_NONNULL1 -char* xpc_copy_description(xpc_object_t object); -} // extern "C" -#endif - -#endif // SANDBOX_MAC_XPC_STUBS_HEADER_FRAGMENT_
diff --git a/sandbox/win/src/process_mitigations_test.cc b/sandbox/win/src/process_mitigations_test.cc index b7c608e..783cc68e 100644 --- a/sandbox/win/src/process_mitigations_test.cc +++ b/sandbox/win/src/process_mitigations_test.cc
@@ -204,9 +204,9 @@ namespace sandbox { -// A shared helper test command that will attempt to CreateProcess -// with a given command line. The second parameter, if set to non-zero -// will cause the child process to return exit code STATUS_ACCESS_VIOLATION. +// A shared helper test command that will attempt to CreateProcess with a given +// command line. The second optional parameter will cause the child process to +// return that as an exit code on termination. // // ***Make sure you've enabled basic process creation in the // test sandbox settings via: @@ -214,12 +214,14 @@ // sandbox::TargetPolicy::SetTokenLevel(), // and TestRunner::SetDisableCsrss(). SBOX_TESTS_COMMAND int TestChildProcess(int argc, wchar_t** argv) { - if (argc < 2) + if (argc < 1) return SBOX_TEST_INVALID_PARAMETER; - int desired_exit_code = _wtoi(argv[1]); - if (desired_exit_code) - desired_exit_code = STATUS_ACCESS_VIOLATION; + int desired_exit_code = 0; + + if (argc == 2) { + desired_exit_code = wcstoul(argv[1], nullptr, 0); + } std::wstring cmd = argv[0]; base::LaunchOptions options = base::LaunchOptionsForTest(); @@ -677,7 +679,6 @@ std::wstring test_command = L"TestChildProcess "; test_command += cmd.value().c_str(); - test_command += L" 0"; EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(test_command.c_str())); } @@ -701,16 +702,17 @@ std::wstring test_command = L"TestChildProcess "; test_command += cmd.value().c_str(); - test_command += L" 0"; EXPECT_EQ(SBOX_TEST_FAILED, runner.RunTest(test_command.c_str())); } -// This test validates that we can spawn a child process if -// MITIGATION_CHILD_PROCESS_CREATION_RESTRICTED mitigation is -// not set. This also tests that a crashing child process is correctly handled -// by the broker. -TEST(ProcessMitigationsTest, CheckChildProcessSuccessAbnormalExit) { +// This test validates that when the sandboxed target within a job spawns a +// child process and the target process exits abnormally, the broker correctly +// handles the JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS message. +// Because this involves spawning a child process from the target process and is +// very similar to the above CheckChildProcess* tests, this test is here rather +// than elsewhere closer to the other Job tests. +TEST(ProcessMitigationsTest, CheckChildProcessAbnormalExit) { TestRunner runner; sandbox::TargetPolicy* policy = runner.GetPolicy(); @@ -723,36 +725,11 @@ EXPECT_TRUE(base::PathService::Get(base::DIR_SYSTEM, &cmd)); cmd = cmd.Append(L"calc.exe"); - std::wstring test_command = L"TestChildProcess "; - test_command += cmd.value().c_str(); - test_command += L" 1"; + std::wstring test_command(base::StringPrintf(L"TestChildProcess %ls 0x%08X", + cmd.value().c_str(), + STATUS_ACCESS_VIOLATION)); EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(test_command.c_str())); } -// This test validates that setting the -// MITIGATION_CHILD_PROCESS_CREATION_RESTRICTED mitigation prevents -// the spawning of child processes. This also tests that a crashing child -// process is correctly handled by the broker. -TEST(ProcessMitigationsTest, CheckChildProcessFailureAbnormalExit) { - TestRunner runner; - sandbox::TargetPolicy* policy = runner.GetPolicy(); - - // Now set the job level to be <= JOB_LIMITED_USER - // and ensure we can no longer create a child process. - policy->SetJobLevel(JOB_LIMITED_USER, 0); - policy->SetTokenLevel(USER_UNPROTECTED, USER_UNPROTECTED); - runner.SetDisableCsrss(false); - - base::FilePath cmd; - EXPECT_TRUE(base::PathService::Get(base::DIR_SYSTEM, &cmd)); - cmd = cmd.Append(L"calc.exe"); - - std::wstring test_command = L"TestChildProcess "; - test_command += cmd.value().c_str(); - test_command += L" 1"; - - EXPECT_EQ(SBOX_TEST_FAILED, runner.RunTest(test_command.c_str())); -} - } // namespace sandbox
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index 68485be..ee5f08a5 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h
@@ -254,10 +254,6 @@ # define SK_SUPPORT_LEGACY_SETSHADER_PTR #endif -#ifndef SK_SUPPORT_LEGACY_XFERMODE_PTR -# define SK_SUPPORT_LEGACY_XFERMODE_PTR -#endif - #ifndef SK_SUPPORT_LEGACY_TYPEFACE_PTR # define SK_SUPPORT_LEGACY_TYPEFACE_PTR #endif
diff --git a/skia/ext/benchmarking_canvas.cc b/skia/ext/benchmarking_canvas.cc index cb299c7..3d90f10 100644 --- a/skia/ext/benchmarking_canvas.cc +++ b/skia/ext/benchmarking_canvas.cc
@@ -7,6 +7,7 @@ #include <utility> #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/stringprintf.h" #include "base/time/time.h" #include "third_party/skia/include/core/SkColorFilter.h" @@ -470,7 +471,7 @@ DCHECK(canvas->overdraw_xfermode_); paint_ = paint ? filtered_paint_.set(*paint) : filtered_paint_.init(); - filtered_paint_.get()->setXfermode(canvas->overdraw_xfermode_.get()); + filtered_paint_.get()->setXfermode(canvas->overdraw_xfermode_); filtered_paint_.get()->setAntiAlias(false); } @@ -510,7 +511,7 @@ addCanvas(canvas); if (flags & kOverdrawVisualization_Flag) - overdraw_xfermode_ = AdoptRef(new OverdrawXfermode); + overdraw_xfermode_ = sk_make_sp<OverdrawXfermode>(); } BenchmarkingCanvas::~BenchmarkingCanvas() {
diff --git a/skia/ext/benchmarking_canvas.h b/skia/ext/benchmarking_canvas.h index 2935117..bb7e1db 100644 --- a/skia/ext/benchmarking_canvas.h +++ b/skia/ext/benchmarking_canvas.h
@@ -8,7 +8,6 @@ #include <stddef.h> #include "base/values.h" -#include "skia/ext/refptr.h" #include "third_party/skia/include/utils/SkNWayCanvas.h" class SkXfermode; @@ -85,7 +84,7 @@ base::ListValue op_records_; unsigned flags_; - RefPtr<SkXfermode> overdraw_xfermode_; + sk_sp<SkXfermode> overdraw_xfermode_; }; }
diff --git a/skia/ext/skia_memory_dump_provider_unittest.cc b/skia/ext/skia_memory_dump_provider_unittest.cc index af5c30b..8d9d23e 100644 --- a/skia/ext/skia_memory_dump_provider_unittest.cc +++ b/skia/ext/skia_memory_dump_provider_unittest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/memory/scoped_ptr.h" #include "base/trace_event/process_memory_dump.h" #include "skia/ext/skia_memory_dump_provider.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/sync/api/model_type_store.h b/sync/api/model_type_store.h index 51ddca6..694b5ab 100644 --- a/sync/api/model_type_store.h +++ b/sync/api/model_type_store.h
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "sync/base/sync_export.h" namespace base {
diff --git a/sync/internal_api/public/attachments/task_queue.h b/sync/internal_api/public/attachments/task_queue.h index e8ff1a04..9d430b8 100644 --- a/sync/internal_api/public/attachments/task_queue.h +++ b/sync/internal_api/public/attachments/task_queue.h
@@ -6,6 +6,7 @@ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_TASK_QUEUE_H_ #include <stddef.h> + #include <deque> #include <set> #include <utility> @@ -13,6 +14,7 @@ #include "base/bind.h" #include "base/callback.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "base/threading/non_thread_safe.h"
diff --git a/sync/internal_api/public/base/progress_marker_map.cc b/sync/internal_api/public/base/progress_marker_map.cc index 24d80ac..c4e4c49 100644 --- a/sync/internal_api/public/base/progress_marker_map.cc +++ b/sync/internal_api/public/base/progress_marker_map.cc
@@ -4,6 +4,7 @@ #include "sync/internal_api/public/base/progress_marker_map.h" +#include "base/base64.h" #include "base/json/json_writer.h" #include "base/json/string_escape.h" #include "base/values.h" @@ -18,6 +19,7 @@ std::string printable_payload; base::EscapeJSONString( it->second, false /* put_in_quotes */, &printable_payload); + base::Base64Encode(printable_payload, &printable_payload); value->SetString(ModelTypeToString(it->first), printable_payload); } return value;
diff --git a/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc b/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc index ce6a92a..862195f 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc +++ b/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc
@@ -34,7 +34,7 @@ model_neutral.num_server_overwrites = 18; ProgressMarkerMap download_progress_markers; - download_progress_markers[BOOKMARKS] = "test"; + download_progress_markers[BOOKMARKS] = "\xef\xb7\xa4"; download_progress_markers[APPS] = "apps"; scoped_ptr<base::DictionaryValue> expected_download_progress_markers_value( ProgressMarkerMapToValue(download_progress_markers));
diff --git a/testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter b/testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter index 2f1374f0..f59da93 100644 --- a/testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter +++ b/testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter
@@ -7,3 +7,4 @@ -SessionHistoryTest.FrameBackForward -SessionHistoryTest.FrameFormBackForward -SitePerProcessIgnoreCertErrorsBrowserTest.CrossSiteRedirectCertificateStore +-WebContentsImplBrowserTest.NoResetOnBeforeUnloadCanceledOnCommit
diff --git a/testing/libfuzzer/BUILD.gn b/testing/libfuzzer/BUILD.gn index 2063f92..863d98c7 100644 --- a/testing/libfuzzer/BUILD.gn +++ b/testing/libfuzzer/BUILD.gn
@@ -11,25 +11,10 @@ import("//build/config/sanitizers/sanitizers.gni") static_library("libfuzzer_main") { - # libfuzzer should be compiled without coverage (infinite loop in trace_cmp). - configs -= [ "//build/config/sanitizers:default_sanitizer_coverage_flags" ] - + deps = [] sources = [] if (use_libfuzzer) { - sources += [ - "../../third_party/llvm/lib/Fuzzer/FuzzerCrossOver.cpp", - "../../third_party/llvm/lib/Fuzzer/FuzzerDriver.cpp", - "../../third_party/llvm/lib/Fuzzer/FuzzerFlags.def", - "../../third_party/llvm/lib/Fuzzer/FuzzerIO.cpp", - "../../third_party/llvm/lib/Fuzzer/FuzzerInterface.cpp", - "../../third_party/llvm/lib/Fuzzer/FuzzerLoop.cpp", - "../../third_party/llvm/lib/Fuzzer/FuzzerMain.cpp", - "../../third_party/llvm/lib/Fuzzer/FuzzerMutate.cpp", - "../../third_party/llvm/lib/Fuzzer/FuzzerSHA1.cpp", - "../../third_party/llvm/lib/Fuzzer/FuzzerTracePC.cpp", - "../../third_party/llvm/lib/Fuzzer/FuzzerTraceState.cpp", - "../../third_party/llvm/lib/Fuzzer/FuzzerUtil.cpp", - ] + deps += [ "//third_party/libFuzzer:libfuzzer" ] } else if (use_drfuzz) { sources += [ "drfuzz_main.cc" ] } else {
diff --git a/testing/libfuzzer/fuzzers/gfx_png_image_fuzzer.cc b/testing/libfuzzer/fuzzers/gfx_png_image_fuzzer.cc index 82a072f..ab1e9e6 100644 --- a/testing/libfuzzer/fuzzers/gfx_png_image_fuzzer.cc +++ b/testing/libfuzzer/fuzzers/gfx_png_image_fuzzer.cc
@@ -5,8 +5,20 @@ #include <stddef.h> #include <stdint.h> +#include "base/logging.h" #include "ui/gfx/image/image.h" + +struct Environment { + Environment() { + // Disable noisy logging. + logging::SetMinLogLevel(logging::LOG_FATAL); + } +}; + +Environment* env = new Environment(); + + // Entry point for LibFuzzer. extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { gfx::Image image = gfx::Image::CreateFrom1xPNGBytes(data, size); @@ -18,4 +30,3 @@ return 0; } -
diff --git a/testing/scripts/host_info.py b/testing/scripts/host_info.py index f5ebfd1..b7da5ab 100755 --- a/testing/scripts/host_info.py +++ b/testing/scripts/host_info.py
@@ -28,8 +28,7 @@ # Stat the current path for info on the current disk. stat_result = os.statvfs('.') # Multiply block size by number of free blocks, express in GiB. - return stat_result.f_frsize * stat_result.f_bavail / ( - 1024.0 / 1024.0 / 1024.0) + return stat_result.f_frsize * stat_result.f_bavail / (1024.0 ** 3) failures.append('get_free_disk_space: OS %s not supported.' % os.name) return 0
diff --git a/testing/test.gni b/testing/test.gni index b9955197..4f55c2eb 100644 --- a/testing/test.gni +++ b/testing/test.gni
@@ -48,7 +48,8 @@ # builds). create_native_executable_dist(_dist_target) { testonly = true - dist_dir = "$target_out_dir/$target_name" + include_main_binary = true + dist_dir = "$root_out_dir/$target_name" binary = _exec_output deps = [ ":$_exec_target", @@ -122,7 +123,7 @@ test_runner_script(_test_runner_target) { forward_variables_from(invoker, [ "isolate_file" ]) if (_use_raw_android_executable) { - executable = _exec_output + executable = "$root_out_dir/$_dist_target/${invoker.target_name}" } else { apk_target = ":$_apk_target" }
diff --git a/testing/variations/fieldtrial_testing_config_android.json b/testing/variations/fieldtrial_testing_config_android.json index 0563893..aa5a58a2 100644 --- a/testing/variations/fieldtrial_testing_config_android.json +++ b/testing/variations/fieldtrial_testing_config_android.json
@@ -110,6 +110,14 @@ } } ], + "DocumentWriteEvaluator": [ + { + "enable_features": [ + "DocumentWriteEvaluator" + ], + "group_name": "Enabled" + } + ], "EnableMediaThreadForMediaPlayback": [ { "group_name": "Enabled" @@ -229,26 +237,6 @@ "group_name": "Enabled" } ], - "PreconnectMore": [ - { - "enable_features": [ - "PreconnectMore" - ], - "group_name": "PreconnectMoreAllFrames", - "params": { - "preconnect_subframes": "true" - } - }, - { - "enable_features": [ - "PreconnectMore" - ], - "group_name": "PreconnectMoreMainFrameOnly", - "params": { - "preconnect_subframes": "false" - } - } - ], "ProgressBarAnimationAndroid": [ { "group_name": "SmoothAnimation",
diff --git a/testing/variations/fieldtrial_testing_config_linux.json b/testing/variations/fieldtrial_testing_config_linux.json index 9f228c5..6905526 100644 --- a/testing/variations/fieldtrial_testing_config_linux.json +++ b/testing/variations/fieldtrial_testing_config_linux.json
@@ -43,6 +43,14 @@ "group_name": "Enabled" } ], + "DocumentWriteEvaluator": [ + { + "enable_features": [ + "DocumentWriteEvaluator" + ], + "group_name": "Enabled" + } + ], "EnableGoogleCachedCopyTextExperiment": [ { "group_name": "Button" @@ -88,26 +96,6 @@ "group_name": "SmartLockBrandingSavePromptOnly" } ], - "PreconnectMore": [ - { - "enable_features": [ - "PreconnectMore" - ], - "group_name": "PreconnectMoreAllFrames", - "params": { - "preconnect_subframes": "true" - } - }, - { - "enable_features": [ - "PreconnectMore" - ], - "group_name": "PreconnectMoreMainFrameOnly", - "params": { - "preconnect_subframes": "false" - } - } - ], "QUIC": [ { "group_name": "Enabled"
diff --git a/testing/variations/fieldtrial_testing_config_mac.json b/testing/variations/fieldtrial_testing_config_mac.json index 4b1df279..8401cf2 100644 --- a/testing/variations/fieldtrial_testing_config_mac.json +++ b/testing/variations/fieldtrial_testing_config_mac.json
@@ -49,6 +49,14 @@ "group_name": "Enabled" } ], + "DocumentWriteEvaluator": [ + { + "enable_features": [ + "DocumentWriteEvaluator" + ], + "group_name": "Enabled" + } + ], "EnableGoogleCachedCopyTextExperiment": [ { "group_name": "Button" @@ -104,26 +112,6 @@ "group_name": "SmartLockBrandingSavePromptOnly" } ], - "PreconnectMore": [ - { - "enable_features": [ - "PreconnectMore" - ], - "group_name": "PreconnectMoreAllFrames", - "params": { - "preconnect_subframes": "true" - } - }, - { - "enable_features": [ - "PreconnectMore" - ], - "group_name": "PreconnectMoreMainFrameOnly", - "params": { - "preconnect_subframes": "false" - } - } - ], "QUIC": [ { "group_name": "Enabled"
diff --git a/testing/variations/fieldtrial_testing_config_win.json b/testing/variations/fieldtrial_testing_config_win.json index 4cb6220..3f9873c6 100644 --- a/testing/variations/fieldtrial_testing_config_win.json +++ b/testing/variations/fieldtrial_testing_config_win.json
@@ -59,6 +59,14 @@ "group_name": "Enabled" } ], + "DocumentWriteEvaluator": [ + { + "enable_features": [ + "DocumentWriteEvaluator" + ], + "group_name": "Enabled" + } + ], "EnableGoogleCachedCopyTextExperiment": [ { "group_name": "Button" @@ -171,26 +179,6 @@ } } ], - "PreconnectMore": [ - { - "enable_features": [ - "PreconnectMore" - ], - "group_name": "PreconnectMoreAllFrames", - "params": { - "preconnect_subframes": "true" - } - }, - { - "enable_features": [ - "PreconnectMore" - ], - "group_name": "PreconnectMoreMainFrameOnly", - "params": { - "preconnect_subframes": "false" - } - } - ], "QUIC": [ { "group_name": "Enabled"
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 8d4d2fd..8eef763 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -147,7 +147,6 @@ crbug.com/522645 [ Linux ] virtual/android/fullscreen/video-fixed-background.html [ Failure Pass ] crbug.com/522647 http/tests/notifications/close-dispatch-asynchronous.html [ Failure Pass ] crbug.com/522648 fast/events/touch/compositor-touch-hit-rects-iframes.html [ Crash Failure Pass ] -crbug.com/521859 http/tests/navigatorconnect/postmessage-from-worker.html [ Pass Timeout ] crbug.com/521858 [ Win7 ] http/tests/security/media-element-audio-source-node-same-origin.html [ Failure Pass ] crbug.com/521855 transitions/cancel-and-start-new.html [ Failure Pass ] crbug.com/521853 [ Win ] http/tests/inspector/search/sources-search-scope.html [ Failure Pass ] @@ -171,7 +170,6 @@ crbug.com/520184 http/tests/history/frameset-repeated-name.html [ Failure Pass ] crbug.com/520187 [ Linux Win ] http/tests/loading/bad-scheme-subframe.html [ Failure Pass ] crbug.com/520188 [ Win ] http/tests/local/fileapi/file-last-modified-after-delete.html [ Failure Pass ] -crbug.com/520190 http/tests/navigatorconnect/postmessage-cross-origin.html [ Pass Timeout ] crbug.com/520191 http/tests/security/mixedContent/strict-mode-via-pref-image-blocked.https.html [ Failure Pass ] crbug.com/520611 [ Debug ] fast/filesystem/workers/file-writer-events-shared-worker.html [ Failure Pass ] crbug.com/520612 [ Linux ] fullscreen/anonymous-block-merge-crash.html [ Pass Timeout ] @@ -197,7 +195,6 @@ crbug.com/410974 virtual/threaded/fast/scroll-behavior/scroll-customization/touch-scroll-customization.html [ Pass Failure ] crbug.com/381730 http/tests/navigation/pending-location-change-assert.html [ Failure Pass ] -crbug.com/518974 http/tests/navigatorconnect/postmessage.html [ Failure Pass Timeout ] crbug.com/518883 crbug.com/390452 http/tests/security/isolatedWorld/media-query-wrapper-leaks.html [ Failure Pass Timeout ] crbug.com/518987 http/tests/xmlhttprequest/navigation-abort-detaches-frame.html [ Pass Timeout ] crbug.com/518988 [ Win7 ] http/tests/xmlhttprequest/xmlhttprequest-50ms-download-dispatch.html [ Failure Pass ] @@ -265,26 +262,6 @@ crbug.com/542541 [ Debug ] virtual/trustedeventsdefaultaction/fast/events/click-count.html [ Pass Failure ] crbug.com/542541 [ Debug ] virtual/pointerevent/fast/events/click-count.html [ Pass Failure ] -crbug.com/273306 [ Mac Win7 ] compositing/squashing/squashing-print.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win7 ] printing/ellipsis-printing-style.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] printing/forced-break-tree-dump-only.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win7 ] printing/iframe-print.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] printing/page-count-relayout-shrink.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] printing/page-count-with-one-word.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win7 ] printing/simultaneous-position-float-change.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] printing/quirks-percentage-height-body.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] printing/quirks-percentage-height.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] printing/standards-percentage-heights.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] printing/subframes-percentage-height.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win7 ] virtual/threaded/printing/ellipsis-printing-style.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win7 ] virtual/threaded/printing/iframe-print.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] virtual/threaded/printing/quirks-percentage-height-body.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] virtual/threaded/printing/quirks-percentage-height.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] virtual/threaded/printing/standards-percentage-heights.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] virtual/threaded/printing/subframes-percentage-height.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] virtual/threaded/printing/forced-break-tree-dump-only.html [ NeedsRebaseline ] -crbug.com/273306 [ Mac Win ] virtual/threaded/printing/page-count-relayout-shrink.html [ NeedsRebaseline ] - # TODO(oshima): Mac Android are currently not supported. crbug.com/567837 [ Mac Android ] virtual/scalefactor200withzoom/fast/hidpi/static [ Skip ] @@ -1138,10 +1115,6 @@ crbug.com/595483 [ Android ] fast/invalid/009.html [ Failure Crash ] crbug.com/595483 [ Android ] fast/hidpi/clip-text-in-hidpi.html [ Failure Crash ] -# TODO(radu.velea): uncomment the next 2 lines after https://codereview.chromium.org/1779163002/ lands -# crbug.com/591901 [ Win ] fast/images/color-profile-background-clip-text.html [ Failure ] -# crbug.com/591901 [ Win ] fast/images/color-profile-svg-fill-text.html [ Failure ] - crbug.com/521730 [ Win10 ] fast/forms/month-multiple-fields/month-multiple-fields-preserve-value-after-history-back.html [ Failure ] crbug.com/521730 [ Win10 ] fast/forms/month-multiple-fields/month-multiple-fields-value-set-empty.html [ Failure ] crbug.com/521730 [ Win10 ] fast/forms/suggested-value.html [ Failure ] @@ -1235,6 +1208,41 @@ crbug.com/591500 [ Win10 ] printing/ellipsis-printing-style.html [ Skip ] crbug.com/591500 [ Win10 ] printing/iframe-print.html [ Skip ] crbug.com/591500 [ Win10 ] virtual/threaded/printing/iframe-print.html [ Skip ] +crbug.com/599946 [ Win10 ] printing/quirks-percentage-height-body.html [ Missing ] +crbug.com/599946 [ Win10 ] printing/quirks-percentage-height.html [ Missing ] +crbug.com/599946 [ Win10 ] printing/standards-percentage-heights.html [ Missing ] +crbug.com/599946 [ Win10 ] printing/subframes-percentage-height.html [ Missing ] +crbug.com/599946 [ Win10 ] virtual/threaded/printing/quirks-percentage-height-body.html [ Missing ] +crbug.com/599946 [ Win10 ] virtual/threaded/printing/quirks-percentage-height.html [ Missing ] +crbug.com/599946 [ Win10 ] virtual/threaded/printing/standards-percentage-heights.html [ Missing ] +crbug.com/599946 [ Win10 ] virtual/threaded/printing/subframes-percentage-height.html [ Missing ] + +# https://codereview.chromium.org/1847173002 +crbug.com/525142 [ Win10 ] fast/writing-mode/japanese-ruby-vertical-lr.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/repaint/japanese-rl-selection-clear.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/writing-mode/japanese-ruby-vertical-rl.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/text/decorations-with-text-combine.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/text/international/001.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/text/international/003.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] svg/W3C-SVG-1.1/text-intro-01-t.svg [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/text/international/vertical-text-metrics-test.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/text/justify-ideograph-leading-expansion.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] svg/W3C-SVG-1.1/text-intro-03-b.svg [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/text/emphasis-vertical.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/text/international/lang-glyph-cache-separation.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/inline/vertical-align-with-fallback-fonts.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/writing-mode/japanese-lr-selection.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/ruby/nested-ruby.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/writing-mode/text-combine-various-fonts.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/dynamic/text-combine.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/repaint/japanese-rl-selection-repaint.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/text/international/wrap-CJK-001.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/text/international/002.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/forms/month/month-appearance-l10n.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/writing-mode/japanese-rl-selection.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] svg/W3C-SVG-1.1/text-intro-04-t.svg [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/text/selection-multiple-runs.html [ NeedsRebaseline ] +crbug.com/525142 [ Win10 ] fast/ruby/base-shorter-than-text.html [ NeedsRebaseline ] crbug.com/331582 [ Win ] fast/inline/justify-emphasis-inline-box.html [ Failure ] crbug.com/474759 fast/writing-mode/vertical-rl-replaced-selection.html [ Failure ] @@ -1336,6 +1344,12 @@ crbug.com/588103 fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer.html [ Pass Failure ] +# An upcoming Skia change (https://codereview.chromium.org/1848953002/) will cause minor pixel diffs. +crbug.com/599933 css3/filters/effect-reference-hw.html [ NeedsManualRebaseline ] +crbug.com/599933 css3/filters/effect-reference-colorspace-hw.html [ NeedsManualRebaseline ] +crbug.com/599933 css3/filters/effect-reference-ordering-hw.html [ NeedsManualRebaseline ] +crbug.com/599933 css3/filters/effect-reference-zoom-hw.html [ NeedsManualRebaseline ] + crbug.com/594672 fast/events/iframe-object-onload.html [ Failure Pass ] crbug.com/594672 fast/events/scale-and-scroll-iframe-body.html [ Failure Pass ] crbug.com/594672 fast/events/updateLayoutForHitTest.html [ Failure Pass ] @@ -1383,4 +1397,4 @@ crbug.com/453002 [ Win ] fast/text/justify-ideograph-vertical.html [ Failure Pass ] crbug.com/453002 [ Win ] fast/text/orientation-sideways.html [ Failure Pass ] -crbug.com/599662 inspector/sources/debugger-ui/debugger-save-to-temp-var.html [ Failure ] +crbug.com/599662 inspector/sources/debugger-ui/debugger-save-to-temp-var.html [ Failure Crash ]
diff --git a/third_party/WebKit/LayoutTests/compositing/geometry/flipped-blocks-inline-mapping.html b/third_party/WebKit/LayoutTests/compositing/geometry/flipped-blocks-inline-mapping.html index 4a70bc5..a2891c7 100644 --- a/third_party/WebKit/LayoutTests/compositing/geometry/flipped-blocks-inline-mapping.html +++ b/third_party/WebKit/LayoutTests/compositing/geometry/flipped-blocks-inline-mapping.html
@@ -1,6 +1,6 @@ <style> .container { - -webkit-writing-mode: horizontal-bt; + -webkit-writing-mode: vertical-rl; height: 100px; border: 1px solid black; }
diff --git a/third_party/WebKit/LayoutTests/css3/background/background-large-position-and-size-remains-stable-expected.png b/third_party/WebKit/LayoutTests/css3/background/background-large-position-and-size-remains-stable-expected.png new file mode 100644 index 0000000..ebb7c0b --- /dev/null +++ b/third_party/WebKit/LayoutTests/css3/background/background-large-position-and-size-remains-stable-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css3/background/background-large-position-and-size-remains-stable.html b/third_party/WebKit/LayoutTests/css3/background/background-large-position-and-size-remains-stable.html new file mode 100644 index 0000000..98f39cf --- /dev/null +++ b/third_party/WebKit/LayoutTests/css3/background/background-large-position-and-size-remains-stable.html
@@ -0,0 +1,68 @@ +<!DOCTYPE html> +<html> + <head> + <style> + .imageDiv { + display: inline-block; + width: 25%; + padding-bottom: 25%; + border: 5px solid black; + } + + .firstImage { + background-image: url(resources/red-red-green.png); + + /* Relative to the background positioning area. 75% of containing block width in this case. */ + background-size: 300% 100%; + + /* Relative to background positioning area - background image size. + 100 times (-50% of view width) = -5000% of containing block width. + size is 75% of view width, so this is always 66.666 tiles, so we start 2/3 of the way into the image. + */ + background-position: 10000% 0; + } + + .secondImage { + background-image: url(resources/red-green-red.png); + + background-size: 300% 100%; + + /* As above, but now we start 1/3 of the way into the image. */ + background-position: 20000% 0; + } + + .thirdImage { + background-image: url(resources/red-red-green-vertical.png); + + /* Relative to the background positioning area. 75% of containing block width in this case. */ + background-size: 100% 300%; + + /* Relative to background positioning area - background image size. + 100 times (-50% of view width) = -5000% of containing block width. + size is 75% of view width, so this is always 66.666 tiles, so we start 2/3 of the way into the image. + */ + background-position: 0 10000%; + } + + .fourthImage { + background-image: url(resources/red-green-red-vertical.png); + + background-size: 100% 300%; + + /* As above, but now we start 1/3 of the way into the image. */ + background-position: 0 20000%; + } + </style> + </head> + <body> + <div style="display: block; width: 671px; height: 200px;"> + <div class="firstImage imageDiv"></div> + <div class="secondImage imageDiv"></div> + </div> + <br> + <div style="display: block; width: 671px; height: 200px;"> + <div class="thirdImage imageDiv"></div> + <div class="fourthImage imageDiv"></div> + </div> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/css3/background/resources/red-green-red-vertical.png b/third_party/WebKit/LayoutTests/css3/background/resources/red-green-red-vertical.png new file mode 100644 index 0000000..e9e64cc --- /dev/null +++ b/third_party/WebKit/LayoutTests/css3/background/resources/red-green-red-vertical.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css3/background/resources/red-green-red.png b/third_party/WebKit/LayoutTests/css3/background/resources/red-green-red.png new file mode 100644 index 0000000..6488356 --- /dev/null +++ b/third_party/WebKit/LayoutTests/css3/background/resources/red-green-red.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css3/background/resources/red-red-green-vertical.png b/third_party/WebKit/LayoutTests/css3/background/resources/red-red-green-vertical.png new file mode 100644 index 0000000..42fc48f --- /dev/null +++ b/third_party/WebKit/LayoutTests/css3/background/resources/red-red-green-vertical.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css3/background/resources/red-red-green.png b/third_party/WebKit/LayoutTests/css3/background/resources/red-red-green.png new file mode 100644 index 0000000..dc53da5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/css3/background/resources/red-red-green.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css3/flexbox/cross-axis-scrollbar.html b/third_party/WebKit/LayoutTests/css3/flexbox/cross-axis-scrollbar.html index 92f995f..bd47193 100644 --- a/third_party/WebKit/LayoutTests/css3/flexbox/cross-axis-scrollbar.html +++ b/third_party/WebKit/LayoutTests/css3/flexbox/cross-axis-scrollbar.html
@@ -133,7 +133,7 @@ </div> </div> -<!-- FIXME: Add tests for horizontal-bt and vertical-rl. Setting the logical +<!-- FIXME: Add tests for vertical-rl. Setting the logical bottom border on these tests cause additional scrollbars to appear. --> </body>
diff --git a/third_party/WebKit/LayoutTests/css3/flexbox/position-absolute-child.html b/third_party/WebKit/LayoutTests/css3/flexbox/position-absolute-child.html index 37928e42..1095aaa7f 100644 --- a/third_party/WebKit/LayoutTests/css3/flexbox/position-absolute-child.html +++ b/third_party/WebKit/LayoutTests/css3/flexbox/position-absolute-child.html
@@ -304,7 +304,6 @@ ], }, column: { - // The same as horizontal-bt + row. ltr: [ { offsets: [0, 0, 240], sizes: [0, 240, 360] }, { offsets: [0, 150, 150], sizes: [150, 0, 450] },
diff --git a/third_party/WebKit/LayoutTests/css3/flexbox/true-centering.html b/third_party/WebKit/LayoutTests/css3/flexbox/true-centering.html index 5937a96..248f8b3d 100644 --- a/third_party/WebKit/LayoutTests/css3/flexbox/true-centering.html +++ b/third_party/WebKit/LayoutTests/css3/flexbox/true-centering.html
@@ -123,7 +123,7 @@ isReverse = direction == 'ltr'; break; case 'column': - isReverse = writingMode == 'vertical-rl' || writingMode == 'horizontal-bt'; + isReverse = writingMode == 'vertical-rl'; break; case 'column-reverse': isReverse = writingMode == 'vertical-lr' || writingMode == 'horizontal-tb';
diff --git a/third_party/WebKit/LayoutTests/csspaint/registerPaint-expected.txt b/third_party/WebKit/LayoutTests/csspaint/registerPaint-expected.txt new file mode 100644 index 0000000..5840133 --- /dev/null +++ b/third_party/WebKit/LayoutTests/csspaint/registerPaint-expected.txt
@@ -0,0 +1,23 @@ +CONSOLE MESSAGE: line 14: The worklet should throw an error with: "A class with name:'foo' is already registered." +CONSOLE ERROR: line 1: Uncaught [object DOMException] +CONSOLE MESSAGE: line 14: The worklet should throw an error with: "The empty string is not a valid name." +CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The empty string is not a valid name. +CONSOLE MESSAGE: line 14: The worklet should throw an error with: "failed!" +CONSOLE ERROR: line 1: Uncaught Error: failed! +CONSOLE MESSAGE: line 14: The worklet should throw an error with: "The value provided is neither an array, nor does it have indexed properties." +CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The value provided is neither an array, nor does it have indexed properties. +CONSOLE MESSAGE: line 14: The worklet should throw an error with: "The 'prototype' object on the class does not exist." +CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'prototype' object on the class does not exist. +CONSOLE MESSAGE: line 14: The worklet should throw an error with: "The 'prototype' property on the class is not an object." +CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'prototype' property on the class is not an object. +CONSOLE MESSAGE: line 14: The worklet should throw an error with: "The 'paint' function on the prototype does not exist." +CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'paint' function on the prototype does not exist. +CONSOLE MESSAGE: line 14: The worklet should throw an error with: "The 'paint' property on the prototype is not a function." +CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'paint' property on the prototype is not a function. +CONSOLE MESSAGE: line 16: The worklet should not throw an error. +CONSOLE MESSAGE: line 1: Success for 'foo9'. +CONSOLE MESSAGE: line 16: The worklet should not throw an error. +CONSOLE MESSAGE: line 1: Success for 'foo10'. +This tests a series of PaintWorkletGlobalScope#registerPaint calls. + +See the devtools console for test output.
diff --git a/third_party/WebKit/LayoutTests/csspaint/registerPaint.html b/third_party/WebKit/LayoutTests/csspaint/registerPaint.html new file mode 100644 index 0000000..2bd21d4f --- /dev/null +++ b/third_party/WebKit/LayoutTests/csspaint/registerPaint.html
@@ -0,0 +1,65 @@ +<!DOCTYPE html> +<html> +<head> +<script> +function runner(tests) { + if (window.testRunner) { + testRunner.waitUntilDone(); + testRunner.dumpAsText(); + } + + tests.reduce(function(chain, obj) { + return chain.then(function() { + if (obj.expectedError) { + console.log('The worklet should throw an error with: "' + obj.expectedError + '"'); + } else { + console.log('The worklet should not throw an error.'); + } + var blob = new Blob([obj.script], {type: 'text/javascript'}); + return paintWorklet.import(URL.createObjectURL(blob)); + }); + }, Promise.resolve()).then(function() { + if (window.testRunner) { + testRunner.notifyDone(); + } + }); +} + +function runTest() { + runner([{ + expectedError: "A class with name:'foo' is already registered.", + script: "registerPaint('foo', class { paint() { } }); registerPaint('foo', class { paint() { } });", + }, { + expectedError: "The empty string is not a valid name.", + script: "registerPaint('', class { });", + }, { + expectedError: "failed!", + script: "registerPaint('foo3', class { static get inputProperties() { throw Error('failed!'); } });", + }, { + expectedError: "The value provided is neither an array, nor does it have indexed properties.", + script: "registerPaint('foo4', class { static get inputProperties() { return 42; } });", + }, { + expectedError: "The 'prototype' object on the class does not exist.", + script: "var a = function() { }; a.prototype = undefined; registerPaint('foo5', a);", + }, { + expectedError: "The 'prototype' property on the class is not an object.", + script: "var b = function() { }; b.prototype = 42; registerPaint('foo6', b);", + }, { + expectedError: "The 'paint' function on the prototype does not exist.", + script: "registerPaint('foo7', class { });", + }, { + expectedError: "The 'paint' property on the prototype is not a function.", + script: "registerPaint('foo8', class { get paint() { return 42; } });", + }, { + script: "registerPaint('foo9', class { paint() { } }); console.log('Success for \\'foo9\\'.');", + }, { + script: "var c = function() { }; c.prototype.paint = function() { }; registerPaint('foo10', c); console.log('Success for \\'foo10\\'.');", + }]); +} +</script> +</head> +<body onload="runTest()"> +<p>This tests a series of PaintWorkletGlobalScope#registerPaint calls.</p> +<p>See the devtools console for test output.</p> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize12-expected.png b/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize12-expected.png index caf1e4e..7f98b057 100644 --- a/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize12-expected.png +++ b/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize12-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize18-expected.png b/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize18-expected.png index 5511f32..66f731b6 100644 --- a/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize18-expected.png +++ b/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize18-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize19-expected.png b/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize19-expected.png index 975d4823..470de4d 100644 --- a/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize19-expected.png +++ b/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize19-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize21-expected.png b/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize21-expected.png index 5511f32..66f731b6 100644 --- a/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize21-expected.png +++ b/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize21-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize22-expected.png b/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize22-expected.png index 189de23..1cdc2b5 100644 --- a/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize22-expected.png +++ b/third_party/WebKit/LayoutTests/fast/backgrounds/size/backgroundSize22-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/block/dynamic-padding-border-expected.txt b/third_party/WebKit/LayoutTests/fast/block/dynamic-padding-border-expected.txt index 6fa1b51..f63d5c9 100644 --- a/third_party/WebKit/LayoutTests/fast/block/dynamic-padding-border-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/block/dynamic-padding-border-expected.txt
@@ -3,4 +3,3 @@ PASS PASS PASS -PASS
diff --git a/third_party/WebKit/LayoutTests/fast/block/dynamic-padding-border.html b/third_party/WebKit/LayoutTests/fast/block/dynamic-padding-border.html index 1fecc47..aa35319b 100644 --- a/third_party/WebKit/LayoutTests/fast/block/dynamic-padding-border.html +++ b/third_party/WebKit/LayoutTests/fast/block/dynamic-padding-border.html
@@ -25,14 +25,8 @@ </div> </div> -<div class="container" style="width: 100px; -webkit-writing-mode: horizontal-bt;"> - <div id="test3" class="red" style="border-left: 50px solid red" data-expected-width="100"> - <div class="green" style="height: 20px" data-expected-width="100"></div> - </div> -</div> - <div class="container" style="-webkit-writing-mode: vertical-lr; height: 100px"> - <div id="test4" class="red" style="border-top: 50px solid red" data-expected-height="100"> + <div id="test3" class="red" style="border-top: 50px solid red" data-expected-height="100"> <div class="green" style="width: 20px" data-expected-height="100"></div> </div> </div> @@ -43,7 +37,6 @@ document.getElementById("test1").style.paddingLeft = "0"; document.getElementById("test2").style.paddingTop = "0"; document.getElementById("test3").style.borderWidth = "0"; -document.getElementById("test4").style.borderWidth = "0"; checkLayout(".container"); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/fast/block/float/intruding-float-not-removed-writing-mode.xhtml b/third_party/WebKit/LayoutTests/fast/block/float/intruding-float-not-removed-writing-mode.xhtml index 9720e71e..f8bbdd3 100644 --- a/third_party/WebKit/LayoutTests/fast/block/float/intruding-float-not-removed-writing-mode.xhtml +++ b/third_party/WebKit/LayoutTests/fast/block/float/intruding-float-not-removed-writing-mode.xhtml
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> Test passes if it does not crash. -<head id="head1" style="-webkit-writing-mode: horizontal-bt;"></head> +<head id="head1" style="-webkit-writing-mode: vertical-rl;"></head> <i id="i1"><button id="button1"></button></i> <td id="td1"><body id="body2"></body></td> <i id="i2"></i>
diff --git a/third_party/WebKit/LayoutTests/fast/block/margins-perpendicular-containing-block-expected.txt b/third_party/WebKit/LayoutTests/fast/block/margins-perpendicular-containing-block-expected.txt index 40f949f..f61966d 100644 --- a/third_party/WebKit/LayoutTests/fast/block/margins-perpendicular-containing-block-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/block/margins-perpendicular-containing-block-expected.txt
@@ -6,5 +6,3 @@ PASS PASS PASS -PASS -PASS
diff --git a/third_party/WebKit/LayoutTests/fast/block/margins-perpendicular-containing-block.html b/third_party/WebKit/LayoutTests/fast/block/margins-perpendicular-containing-block.html index 0950c87..a72a3f3 100644 --- a/third_party/WebKit/LayoutTests/fast/block/margins-perpendicular-containing-block.html +++ b/third_party/WebKit/LayoutTests/fast/block/margins-perpendicular-containing-block.html
@@ -22,49 +22,33 @@ <div data-offset-x=10 style="-webkit-writing-mode: vertical-lr"></div> </div> -<div style="-webkit-writing-mode: horizontal-bt" class="check"> - <div data-offset-x=10 style="-webkit-writing-mode: vertical-rl"></div> - <div data-offset-x=10 style="-webkit-writing-mode: vertical-lr"></div> -</div> - <div style="-webkit-writing-mode: horizontal-tb; direction: rtl" class="check"> <div data-offset-x=530 style="-webkit-writing-mode: vertical-rl"></div> <div data-offset-x=530 style="-webkit-writing-mode: vertical-lr"></div> </div> -<div style="-webkit-writing-mode: horizontal-bt; direction: rtl" class="check"> - <div data-offset-x=530 style="-webkit-writing-mode: vertical-rl"></div> - <div data-offset-x=530 style="-webkit-writing-mode: vertical-lr"></div> -</div> - <div style="-webkit-writing-mode: vertical-rl" class="check"> <div data-offset-y=10 style="-webkit-writing-mode: horizontal-tb"></div> - <div data-offset-y=10 style="-webkit-writing-mode: horizontal-bt"></div> </div> <div style="-webkit-writing-mode: vertical-lr" class="check"> <div data-offset-y=10 style="-webkit-writing-mode: horizontal-tb"></div> - <div data-offset-y=10 style="-webkit-writing-mode: horizontal-bt"></div> </div> <div style="-webkit-writing-mode: vertical-rl; direction: rtl" class="check"> <div data-offset-y=10 style="-webkit-writing-mode: horizontal-tb"></div> - <div data-offset-y=10 style="-webkit-writing-mode: horizontal-bt"></div> </div> <div style="-webkit-writing-mode: vertical-lr; direction: rtl" class="check"> <div data-offset-y=10 style="-webkit-writing-mode: horizontal-tb"></div> - <div data-offset-y=10 style="-webkit-writing-mode: horizontal-bt"></div> </div> <div style="-webkit-writing-mode: vertical-rl" class="check"> <div data-offset-y=10 style="-webkit-writing-mode: horizontal-tb; direction: rtl"></div> - <div data-offset-y=10 style="-webkit-writing-mode: horizontal-bt; direction: rtl"></div> </div> <div style="-webkit-writing-mode: vertical-lr" class="check"> <div data-offset-y=10 style="-webkit-writing-mode: horizontal-tb; direction: rtl"></div> - <div data-offset-y=10 style="-webkit-writing-mode: horizontal-bt; direction: rtl"></div> </div> </body>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen-expected.txt new file mode 100644 index 0000000..fe93a30c --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen-expected.txt
@@ -0,0 +1,12 @@ +Test transferControlToOffscreen. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS offscreenCanvas.width is width +PASS offscreenCanvas.height is height +PASS transferControlToOffscreen from a canvas with context throws an exception: InvalidStateError: Failed to execute 'transferControlToOffscreen' on 'HTMLCanvasElement': Cannot transfer control from a canvas that has a rendering context. +PASS successfullyParsed is true + +TEST COMPLETE +
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html new file mode 100644 index 0000000..36ba020 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html
@@ -0,0 +1,33 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<script src="../../resources/js-test.js"></script> +</head> +<body> +<script> + +description("Test transferControlToOffscreen."); +window.jsTestIsAsync = true; + +var width = 50; +var height = 50; +var canvas = document.createElement("canvas"); +canvas.width = width; +canvas.height = height; + +var offscreenCanvas = canvas.transferControlToOffscreen(); +shouldBe("offscreenCanvas.width", "width"); +shouldBe("offscreenCanvas.height", "height"); + +var ctx = canvas.getContext("2d"); +try { + offscreenCanvas = canvas.transferControlToOffscreen(); + testFailed("transferControlToOffscreen from a canvas with context didn't throw an exception."); +} catch (ex) { + testPassed("transferControlToOffscreen from a canvas with context throws an exception: " + ex); +} + +finishJSTest(); +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horiz-bt-expected.txt b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horiz-bt-expected.txt deleted file mode 100644 index 341ecbd..0000000 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horiz-bt-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This test checks that the grid's rows and columns 'auto' sizes are updated accordingly to its grid-item's before and start margins. -PASS -PASS -PASS -PASS
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horiz-bt.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horiz-bt.html deleted file mode 100644 index 43663cf..0000000 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horiz-bt.html +++ /dev/null
@@ -1,83 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../resources/check-layout.js"></script> -<link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel="stylesheet"> -<link href="resources/grid.css" rel="stylesheet"> -<style> -.grid { - grid-template-rows: auto auto; - grid-template-columns: auto auto; -} - -.gridItem { - width: 20px; - height: 40px; -} - -.marginTop { - margin-top: 20px; -} - -.marginBottom { - margin-bottom: 20px; -} - -.borderTop { - border-top: 5px solid; -} - -.borderBottom { - border-bottom: 5px solid; -} - -.paddingTop { - padding-top: 10px; -} - -.paddingBottom { - padding-bottom: 10px; -} -</style> -</head> -<body onload="checkLayout('.grid')"> - -<div>This test checks that the grid's rows and columns 'auto' sizes are updated accordingly to its grid-item's before and start margins.</div> - -<div style="position: relative"> - <div class="grid fit-content horizontalBT" data-expected-width="40" data-expected-height="120"> - <div class="gridItem marginTop firstRowFirstColumn"></div> - <div class="gridItem firstRowSecondColumn"></div> - <div class="gridItem marginBottom secondRowFirstColumn"></div> - <div class="gridItem secondRowSecondColumn"></div> - </div> -</div> - -<div style="position: relative"> - <div class="grid fit-content horizontalBT" data-expected-width="40" data-expected-height="120"> - <div class="gridItem marginTop paddingTop firstRowFirstColumn"></div> - <div class="gridItem firstRowSecondColumn"></div> - <div class="gridItem borderTop borderBottom secondRowFirstColumn"></div> - <div class="gridItem secondRowSecondColumn"></div> - </div> -</div> - -<div style="position: relative"> - <div class="grid fit-content horizontalBT" data-expected-width="40" data-expected-height="120"> - <div class="gridItem marginTop paddingTop firstRowFirstColumn"></div> - <div class="gridItem firstRowSecondColumn"></div> - <div class="gridItem borderTop borderBottom secondRowFirstColumn"></div> - <div class="gridItem secondRowSecondColumn"></div> - </div> -</div> - -<div style="position: relative"> - <div class="grid fit-content horizontalBT" data-expected-width="40" data-expected-height="120"> - <div class="gridItem marginTop paddingTop firstRowFirstColumn"></div> - <div class="gridItem firstRowSecondColumn"></div> - <div class="gridItem paddingBottom secondRowFirstColumn"></div> - <div class="gridItem secondRowSecondColumn"></div> - </div> -</div> - -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-children-writing-modes-expected.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-children-writing-modes-expected.html index f1f6adfa..e0c8f67 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-children-writing-modes-expected.html +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-children-writing-modes-expected.html
@@ -33,10 +33,6 @@ <div class="sizedToGridArea green">XX</div> </div> -<div class="grid horizontalBT"> - <div class="sizedToGridArea green">XX</div> -</div> - <div class="grid directionRTL"> <div class="sizedToGridArea green">XX</div> </div> @@ -49,9 +45,5 @@ <div class="sizedToGridArea green">XX</div> </div> -<div class="grid horizontalBT directionRTL"> - <div class="sizedToGridArea green">XX</div> -</div> - </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-children-writing-modes.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-children-writing-modes.html index 2c038cdc..88a45d56 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-children-writing-modes.html +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-children-writing-modes.html
@@ -52,11 +52,6 @@ <div class="sizedToGridArea absolute onlyFirstRowOnlyFirstColumn">XX</div> </div> -<div class="grid horizontalBT"> - <div class="sizedToGridArea red"></div> - <div class="sizedToGridArea absolute onlyFirstRowOnlyFirstColumn">XX</div> -</div> - <div class="grid directionRTL"> <div class="sizedToGridArea red"></div> <div class="sizedToGridArea absolute onlyFirstRowOnlyFirstColumn">XX</div> @@ -72,10 +67,5 @@ <div class="sizedToGridArea absolute onlyFirstRowOnlyFirstColumn">XX</div> </div> -<div class="grid horizontalBT directionRTL"> - <div class="sizedToGridArea red"></div> - <div class="sizedToGridArea absolute onlyFirstRowOnlyFirstColumn">XX</div> -</div> - </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-gaps-rtl.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-gaps-rtl.html new file mode 100644 index 0000000..d95c7a87 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-gaps-rtl.html
@@ -0,0 +1,305 @@ +<!DOCTYPE html> +<html> +<link href="resources/grid.css" rel="stylesheet"> +<style> + +.grid { + grid-template-columns: 100px 100px 100px 100px; + grid-template-rows: 50px 50px; + grid-gap: 25px 50px; + width: 800px; + height: 200px; + border: 5px solid black; + margin: 30px; + padding: 15px; + /* Ensures that the grid container is the containing block of the absolutely positioned grid children. */ + position: relative; +} + +.grid > div { + position: absolute; + width: 100%; + height: 100%; + background-color: lime; +} + +.offsets { + left: 0; + top: 0; +} + +</style> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../../resources/check-layout-th.js"></script> +<body onload="checkLayout('.grid')"> +<div id="log"></div> + +<p>This test checks the behavior of the positioned items in a grid container with gaps in RTL.</p> + +<div class="grid directionRTL"> + <div style="grid-column: auto / auto; grid-row: auto / auto;" + data-offset-x="-15" data-offset-y="15" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: auto / auto; grid-row: auto / auto;" + data-offset-x="0" data-offset-y="0" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 1 / auto; grid-row: 1 / auto;" + data-offset-x="0" data-offset-y="15" data-expected-width="815" data-expected-height="215"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 1 / auto; grid-row: 1 / auto;" + data-offset-x="0" data-offset-y="15" data-expected-width="815" data-expected-height="215"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 1 / 2; grid-row: 1 / 2;" + data-offset-x="715" data-offset-y="15" data-expected-width="100" data-expected-height="50"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 1 / 2; grid-row: 1 / 2;" + data-offset-x="715" data-offset-y="15" data-expected-width="100" data-expected-height="50"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 1 / 3; grid-row: 1 / 3;" + data-offset-x="565" data-offset-y="15" data-expected-width="250" data-expected-height="125"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 1 / 3; grid-row: 1 / 3;" + data-offset-x="565" data-offset-y="15" data-expected-width="250" data-expected-height="125"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 1 / 4; grid-row: 1 / 4;" + data-offset-x="415" data-offset-y="15" data-expected-width="400" data-expected-height="215"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 1 / 4; grid-row: 1 / 4;" + data-offset-x="415" data-offset-y="15" data-expected-width="400" data-expected-height="215"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 1 / 5; grid-row: 1 / 5;" + data-offset-x="265" data-offset-y="15" data-expected-width="550" data-expected-height="215"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 1 / 5; grid-row: 1 / 5;" + data-offset-x="265" data-offset-y="15" data-expected-width="550" data-expected-height="215"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 1 / 6; grid-row: 1 / 6;" + data-offset-x="0" data-offset-y="15" data-expected-width="815" data-expected-height="215"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 1 / 6; grid-row: 1 / 6;" + data-offset-x="0" data-offset-y="15" data-expected-width="815" data-expected-height="215"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 2 / auto; grid-row: 2 / auto;" + data-offset-x="0" data-offset-y="90" data-expected-width="665" data-expected-height="140"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 2 / auto; grid-row: 2 / auto;" + data-offset-x="0" data-offset-y="90" data-expected-width="665" data-expected-height="140"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 2 / 3; grid-row: 2 / 3;" + data-offset-x="565" data-offset-y="90" data-expected-width="100" data-expected-height="50"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 2 / 3; grid-row: 2 / 3;" + data-offset-x="565" data-offset-y="90" data-expected-width="100" data-expected-height="50"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 2 / 4; grid-row: 2 / 4;" + data-offset-x="415" data-offset-y="90" data-expected-width="250" data-expected-height="140"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 2 / 4; grid-row: 2 / 4;" + data-offset-x="415" data-offset-y="90" data-expected-width="250" data-expected-height="140"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 2 / 5; grid-row: 2 / 5;" + data-offset-x="265" data-offset-y="90" data-expected-width="400" data-expected-height="140"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 2 / 5; grid-row: 2 / 5;" + data-offset-x="265" data-offset-y="90" data-expected-width="400" data-expected-height="140"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 2 / 6; grid-row: 2 / 6;" + data-offset-x="0" data-offset-y="90" data-expected-width="665" data-expected-height="140"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 2 / 6; grid-row: 2 / 6;" + data-offset-x="0" data-offset-y="90" data-expected-width="665" data-expected-height="140"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 3 / auto; grid-row: 3 / auto;" + data-offset-x="0" data-offset-y="140" data-expected-width="515" data-expected-height="90"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 3 / auto; grid-row: 3 / auto;" + data-offset-x="0" data-offset-y="140" data-expected-width="515" data-expected-height="90"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 4 / auto; grid-row: 4 / auto;" + data-offset-x="0" data-offset-y="15" data-expected-width="365" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 4 / auto; grid-row: 4 / auto;" + data-offset-x="0" data-offset-y="0" data-expected-width="365" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 5 / auto; grid-row: 5 / auto;" + data-offset-x="0" data-offset-y="15" data-expected-width="265" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 5 / auto; grid-row: 5 / auto;" + data-offset-x="0" data-offset-y="0" data-expected-width="265" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: 6 / auto; grid-row: 6 / auto;" + data-offset-x="-15" data-offset-y="15" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: 6 / auto; grid-row: 6 / auto;" + data-offset-x="0" data-offset-y="0" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: auto / 1; grid-row: auto / 1;" + data-offset-x="800" data-offset-y="15" data-expected-width="15" data-expected-height="15"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: auto / 1; grid-row: auto / 1;" + data-offset-x="815" data-offset-y="0" data-expected-width="15" data-expected-height="15"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: auto / 2; grid-row: auto / 2;" + data-offset-x="700" data-offset-y="15" data-expected-width="115" data-expected-height="65"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: auto / 2; grid-row: auto / 2;" + data-offset-x="715" data-offset-y="0" data-expected-width="115" data-expected-height="65"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: auto / 3; grid-row: auto / 3;" + data-offset-x="550" data-offset-y="15" data-expected-width="265" data-expected-height="140"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: auto / 3; grid-row: auto / 3;" + data-offset-x="565" data-offset-y="0" data-expected-width="265" data-expected-height="140"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: auto / 4; grid-row: auto / 4;" + data-offset-x="400" data-offset-y="15" data-expected-width="415" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: auto / 4; grid-row: auto / 4;" + data-offset-x="415" data-offset-y="0" data-expected-width="415" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: auto / 5; grid-row: auto / 5;" + data-offset-x="250" data-offset-y="15" data-expected-width="565" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: auto / 5; grid-row: auto / 5;" + data-offset-x="265" data-offset-y="0" data-expected-width="565" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div style="grid-column: auto / 6; grid-row: auto / 6;" + data-offset-x="-15" data-offset-y="15" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +<div class="grid directionRTL"> + <div class="offsets" style="grid-column: auto / 6; grid-row: auto / 6;" + data-offset-x="0" data-offset-y="0" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-gaps.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-gaps.html new file mode 100644 index 0000000..7d8dcff --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-gaps.html
@@ -0,0 +1,305 @@ +<!DOCTYPE html> +<html> +<link href="resources/grid.css" rel="stylesheet"> +<style> + +.grid { + grid-template-columns: 100px 100px 100px 100px; + grid-template-rows: 50px 50px; + grid-gap: 25px 50px; + width: 800px; + height: 200px; + border: 5px solid black; + margin: 30px; + padding: 15px; + /* Ensures that the grid container is the containing block of the absolutely positioned grid children. */ + position: relative; +} + +.grid > div { + position: absolute; + width: 100%; + height: 100%; + background-color: lime; +} + +.offsets { + left: 0; + top: 0; +} + +</style> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../../resources/check-layout-th.js"></script> +<body onload="checkLayout('.grid')"> +<div id="log"></div> + +<p>This test checks the behavior of the positioned items in a grid container with gaps.</p> + +<div class="grid"> + <div style="grid-column: auto / auto; grid-row: auto / auto;" + data-offset-x="15" data-offset-y="15" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: auto / auto; grid-row: auto / auto;" + data-offset-x="0" data-offset-y="0" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 1 / auto; grid-row: 1 / auto;" + data-offset-x="15" data-offset-y="15" data-expected-width="815" data-expected-height="215"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 1 / auto; grid-row: 1 / auto;" + data-offset-x="15" data-offset-y="15" data-expected-width="815" data-expected-height="215"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 1 / 2; grid-row: 1 / 2;" + data-offset-x="15" data-offset-y="15" data-expected-width="100" data-expected-height="50"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 1 / 2; grid-row: 1 / 2;" + data-offset-x="15" data-offset-y="15" data-expected-width="100" data-expected-height="50"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 1 / 3; grid-row: 1 / 3;" + data-offset-x="15" data-offset-y="15" data-expected-width="250" data-expected-height="125"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 1 / 3; grid-row: 1 / 3;" + data-offset-x="15" data-offset-y="15" data-expected-width="250" data-expected-height="125"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 1 / 4; grid-row: 1 / 4;" + data-offset-x="15" data-offset-y="15" data-expected-width="400" data-expected-height="215"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 1 / 4; grid-row: 1 / 4;" + data-offset-x="15" data-offset-y="15" data-expected-width="400" data-expected-height="215"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 1 / 5; grid-row: 1 / 5;" + data-offset-x="15" data-offset-y="15" data-expected-width="550" data-expected-height="215"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 1 / 5; grid-row: 1 / 5;" + data-offset-x="15" data-offset-y="15" data-expected-width="550" data-expected-height="215"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 1 / 6; grid-row: 1 / 6;" + data-offset-x="15" data-offset-y="15" data-expected-width="815" data-expected-height="215"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 1 / 6; grid-row: 1 / 6;" + data-offset-x="15" data-offset-y="15" data-expected-width="815" data-expected-height="215"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 2 / auto; grid-row: 2 / auto;" + data-offset-x="165" data-offset-y="90" data-expected-width="665" data-expected-height="140"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 2 / auto; grid-row: 2 / auto;" + data-offset-x="165" data-offset-y="90" data-expected-width="665" data-expected-height="140"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 2 / 3; grid-row: 2 / 3;" + data-offset-x="165" data-offset-y="90" data-expected-width="100" data-expected-height="50"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 2 / 3; grid-row: 2 / 3;" + data-offset-x="165" data-offset-y="90" data-expected-width="100" data-expected-height="50"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 2 / 4; grid-row: 2 / 4;" + data-offset-x="165" data-offset-y="90" data-expected-width="250" data-expected-height="140"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 2 / 4; grid-row: 2 / 4;" + data-offset-x="165" data-offset-y="90" data-expected-width="250" data-expected-height="140"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 2 / 5; grid-row: 2 / 5;" + data-offset-x="165" data-offset-y="90" data-expected-width="400" data-expected-height="140"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 2 / 5; grid-row: 2 / 5;" + data-offset-x="165" data-offset-y="90" data-expected-width="400" data-expected-height="140"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 2 / 6; grid-row: 2 / 6;" + data-offset-x="165" data-offset-y="90" data-expected-width="665" data-expected-height="140"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 2 / 6; grid-row: 2 / 6;" + data-offset-x="165" data-offset-y="90" data-expected-width="665" data-expected-height="140"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 3 / auto; grid-row: 3 / auto;" + data-offset-x="315" data-offset-y="140" data-expected-width="515" data-expected-height="90"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 3 / auto; grid-row: 3 / auto;" + data-offset-x="315" data-offset-y="140" data-expected-width="515" data-expected-height="90"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 4 / auto; grid-row: 4 / auto;" + data-offset-x="465" data-offset-y="15" data-expected-width="365" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 4 / auto; grid-row: 4 / auto;" + data-offset-x="465" data-offset-y="0" data-expected-width="365" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 5 / auto; grid-row: 5 / auto;" + data-offset-x="565" data-offset-y="15" data-expected-width="265" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 5 / auto; grid-row: 5 / auto;" + data-offset-x="565" data-offset-y="0" data-expected-width="265" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: 6 / auto; grid-row: 6 / auto;" + data-offset-x="15" data-offset-y="15" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: 6 / auto; grid-row: 6 / auto;" + data-offset-x="0" data-offset-y="0" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: auto / 1; grid-row: auto / 1;" + data-offset-x="15" data-offset-y="15" data-expected-width="15" data-expected-height="15"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: auto / 1; grid-row: auto / 1;" + data-offset-x="0" data-offset-y="0" data-expected-width="15" data-expected-height="15"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: auto / 2; grid-row: auto / 2;" + data-offset-x="15" data-offset-y="15" data-expected-width="115" data-expected-height="65"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: auto / 2; grid-row: auto / 2;" + data-offset-x="0" data-offset-y="0" data-expected-width="115" data-expected-height="65"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: auto / 3; grid-row: auto / 3;" + data-offset-x="15" data-offset-y="15" data-expected-width="265" data-expected-height="140"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: auto / 3; grid-row: auto / 3;" + data-offset-x="0" data-offset-y="0" data-expected-width="265" data-expected-height="140"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: auto / 4; grid-row: auto / 4;" + data-offset-x="15" data-offset-y="15" data-expected-width="415" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: auto / 4; grid-row: auto / 4;" + data-offset-x="0" data-offset-y="0" data-expected-width="415" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: auto / 5; grid-row: auto / 5;" + data-offset-x="15" data-offset-y="15" data-expected-width="565" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: auto / 5; grid-row: auto / 5;" + data-offset-x="0" data-offset-y="0" data-expected-width="565" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div style="grid-column: auto / 6; grid-row: auto / 6;" + data-offset-x="15" data-offset-y="15" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +<div class="grid"> + <div class="offsets" style="grid-column: auto / 6; grid-row: auto / 6;" + data-offset-x="0" data-offset-y="0" data-expected-width="830" data-expected-height="230"> + </div> +</div> + +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only-expected.txt b/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only-expected.txt index aca7ed1..dbc6dcb 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only-expected.txt
@@ -7,4 +7,3 @@ PASS PASS PASS -PASS
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only.html index 12ddd5033..861c767 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only.html +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only.html
@@ -81,10 +81,5 @@ <div class="secondRowFirstColumn" data-expected-height="30" data-expected-width="10"></div> </div> -<div class="grid horizontalBT" id="grid6" data-expected-width="100" data-expected-height="200"> - <div class="firstRowFirstColumn" data-expected-height="90" data-expected-width="30"></div> - <div class="secondRowFirstColumn" data-expected-height="110" data-expected-width="30"></div> -</div> - </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only-expected.txt b/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only-expected.txt index 03e4f6f3..da353c5 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only-expected.txt
@@ -7,4 +7,3 @@ PASS PASS PASS -PASS
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only.html index f538a49..1451f3b 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only.html +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/minmax-fixed-logical-width-only.html
@@ -82,10 +82,5 @@ <div class="firstRowSecondColumn" data-expected-height="100" data-expected-width="30"></div> </div> -<div class="grid horizontalBT" id="grid6" data-expected-width="100" data-expected-height="200"> - <div class="firstRowFirstColumn" data-expected-height="30" data-expected-width="40"></div> - <div class="firstRowSecondColumn" data-expected-height="30" data-expected-width="60"></div> -</div> - </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-expected.txt b/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-expected.txt index aa4c209..730993bd 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-expected.txt
@@ -3,4 +3,3 @@ PASS PASS PASS -PASS
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid-expected.txt b/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid-expected.txt index 29f74f8..03ac68c 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid-expected.txt
@@ -3,4 +3,3 @@ PASS PASS PASS -PASS
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid.html index a4c0cc3de..c8b554c 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid.html +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid.html
@@ -50,15 +50,6 @@ </div> <div class="container"> -<div class="grid horizontalBT" data-expected-width="400" data-expected-height="300"> - <div class="firstRowFirstColumn" data-expected-width="160" data-expected-height="15"></div> - <div class="firstRowSecondColumn" data-expected-width="15" data-expected-height="90"></div> - <div class="secondRowFirstColumn" data-expected-width="80" data-expected-height="105"></div> - <div class="secondRowSecondColumn" data-expected-width="240" data-expected-height="210"></div> -</div> -</div> - -<div class="container"> <div class="grid verticalRL" data-expected-width="400" data-expected-height="300"> <div class="firstRowFirstColumn" data-expected-width="120" data-expected-height="15"></div> <div class="firstRowSecondColumn" data-expected-width="15" data-expected-height="180"></div>
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track.html index 411a3bd..9c894ab9 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track.html +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-grid-item-in-percent-grid-track.html
@@ -44,15 +44,6 @@ </div> <div style="position: relative"> -<div class="grid horizontalBT" data-expected-width="400" data-expected-height="300"> - <div class="firstRowFirstColumn" data-expected-width="160" data-expected-height="15"></div> - <div class="firstRowSecondColumn" data-expected-width="15" data-expected-height="90"></div> - <div class="secondRowFirstColumn" data-expected-width="80" data-expected-height="105"></div> - <div class="secondRowSecondColumn" data-expected-width="240" data-expected-height="210"></div> -</div> -</div> - -<div style="position: relative"> <div class="grid verticalRL" data-expected-width="400" data-expected-height="300"> <div class="firstRowFirstColumn" data-expected-width="120" data-expected-height="15"></div> <div class="firstRowSecondColumn" data-expected-width="15" data-expected-height="180"></div>
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid.css b/third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid.css index 6081e0d1..f137a8a4 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid.css +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid.css
@@ -262,19 +262,12 @@ .verticalRL { writing-mode: vertical-rl; - -webkit-writing-mode: vertical-rl; } .verticalLR { writing-mode: vertical-lr; - -webkit-writing-mode: vertical-lr; } .horizontalTB { writing-mode: horizontal-tb; - -webkit-writing-mode: horizontal-tb; -} -.horizontalBT { - writing-mode: horizontal-bt; - -webkit-writing-mode: horizontal-bt; } .directionRTL { direction: rtl;
diff --git a/third_party/WebKit/LayoutTests/fast/css/overflow-btt-border-after-expected.txt b/third_party/WebKit/LayoutTests/fast/css/overflow-btt-border-after-expected.txt deleted file mode 100644 index 24b6717..0000000 --- a/third_party/WebKit/LayoutTests/fast/css/overflow-btt-border-after-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -The word 'HEST' should be seen below, and there should be no red. - -HEST -PASS
diff --git a/third_party/WebKit/LayoutTests/fast/css/overflow-btt-border-after.html b/third_party/WebKit/LayoutTests/fast/css/overflow-btt-border-after.html deleted file mode 100644 index c07c6256..0000000 --- a/third_party/WebKit/LayoutTests/fast/css/overflow-btt-border-after.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title>Border-after in horizontal-bt mode, non-visible overflow</title> - <style> - body { color:black; background:white; } - #container { - -webkit-writing-mode: horizontal-bt; - overflow:scroll; - height:100px; - border-top:150px solid white; - background:red; - } - #inner { height:200px; background:white; } - </style> - <script src="../../resources/check-layout.js"></script> - </head> - <body onload="checkLayout('#container'); inner.scrollIntoView();"> - <!-- We have to set the scroll position, because of https://bugs.webkit.org/show_bug.cgi?id=76129 - This is just to make it look good; checkLayout() doesn't care. --> - <p>The word 'HEST' should be seen below, and there should be no red.</p> - <div id="container" data-expected-scroll-height="200"> - <div id="inner">HEST</div> - </div> - </body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-writing-mode-expected.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-writing-mode-expected.html index aa01c95..e959c3156 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-writing-mode-expected.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-writing-mode-expected.html
@@ -12,6 +12,5 @@ <meter min=0 value=30 max=100></meter> <meter min=0 value=30 max=100></meter> <meter min=0 value=30 max=100></meter> -<meter min=0 value=30 max=100></meter> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-writing-mode.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-writing-mode.html index 9110448..1b83da2a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-writing-mode.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-writing-mode.html
@@ -13,6 +13,5 @@ <meter min=0 value=30 max=100 style="-webkit-writing-mode: vertical-lr;"></meter> <meter min=0 value=30 max=100 style="-webkit-writing-mode: vertical-rl;"></meter> <meter min=0 value=30 max=100 style="-webkit-writing-mode: horizontal-tb;"></meter> -<meter min=0 value=30 max=100 style="-webkit-writing-mode: horizontal-bt;"></meter> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-writing-mode-expected.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-writing-mode-expected.html index ef62afb..fa8e500 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-writing-mode-expected.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-writing-mode-expected.html
@@ -12,6 +12,5 @@ <progress min=0 value=30 max=100></progress> <progress min=0 value=30 max=100></progress> <progress min=0 value=30 max=100></progress> -<progress min=0 value=30 max=100></progress> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-writing-mode.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-writing-mode.html index 59e0774..4ebd6b0 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-writing-mode.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-writing-mode.html
@@ -13,6 +13,5 @@ <progress min=0 value=30 max=100 style="-webkit-writing-mode: vertical-lr;"></progress> <progress min=0 value=30 max=100 style="-webkit-writing-mode: vertical-rl;"></progress> <progress min=0 value=30 max=100 style="-webkit-writing-mode: horizontal-tb;"></progress> -<progress min=0 value=30 max=100 style="-webkit-writing-mode: horizontal-bt;"></progress> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt index af312af..36a4f8a3 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt
@@ -52,8 +52,6 @@ PASS window.cached_navigator_serviceWorker.controller is null PASS window.cached_navigator_serviceWorker.oncontrollerchange is null PASS window.cached_navigator_serviceWorker.onmessage is null -PASS window.cached_navigator_services.onclose is null -PASS window.cached_navigator_services.onmessage is null PASS window.cached_navigator_usb.onconnect is null PASS window.cached_navigator_usb.ondisconnect is null PASS window.cached_performance.onframetimingbufferfull is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt index bec90ae..9d773af 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt
@@ -52,8 +52,6 @@ PASS window.cached_navigator_serviceWorker.controller is null PASS window.cached_navigator_serviceWorker.oncontrollerchange is null PASS window.cached_navigator_serviceWorker.onmessage is null -PASS window.cached_navigator_services.onclose is null -PASS window.cached_navigator_services.onmessage is null PASS window.cached_navigator_usb.onconnect is null PASS window.cached_navigator_usb.ondisconnect is null PASS window.cached_performance.onframetimingbufferfull is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt index 5962ffc..2950276 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt
@@ -52,8 +52,6 @@ PASS window.cached_navigator_serviceWorker.controller is null PASS window.cached_navigator_serviceWorker.oncontrollerchange is null PASS window.cached_navigator_serviceWorker.onmessage is null -PASS window.cached_navigator_services.onclose is null -PASS window.cached_navigator_services.onmessage is null PASS window.cached_navigator_usb.onconnect is null PASS window.cached_navigator_usb.ondisconnect is null PASS window.cached_performance.onframetimingbufferfull is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt index 83de5e5b..c73472f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
@@ -61,8 +61,6 @@ PASS oldChildWindow.navigator.serviceWorker.controller is newChildWindow.navigator.serviceWorker.controller PASS oldChildWindow.navigator.serviceWorker.oncontrollerchange is newChildWindow.navigator.serviceWorker.oncontrollerchange PASS oldChildWindow.navigator.serviceWorker.onmessage is newChildWindow.navigator.serviceWorker.onmessage -PASS oldChildWindow.navigator.services.onclose is newChildWindow.navigator.services.onclose -PASS oldChildWindow.navigator.services.onmessage is newChildWindow.navigator.services.onmessage PASS oldChildWindow.navigator.usb.onconnect is newChildWindow.navigator.usb.onconnect PASS oldChildWindow.navigator.usb.ondisconnect is newChildWindow.navigator.usb.ondisconnect PASS oldChildWindow.navigator.userAgent is newChildWindow.navigator.userAgent
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt index 66e284ac..7a305398 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
@@ -61,8 +61,6 @@ FAIL childWindow.navigator.serviceWorker.controller should be null. Threw exception TypeError: Cannot read property 'controller' of null FAIL childWindow.navigator.serviceWorker.oncontrollerchange should be null. Threw exception TypeError: Cannot read property 'oncontrollerchange' of null FAIL childWindow.navigator.serviceWorker.onmessage should be null. Threw exception TypeError: Cannot read property 'onmessage' of null -PASS childWindow.navigator.services.onclose is null -PASS childWindow.navigator.services.onmessage is null FAIL childWindow.navigator.usb.onconnect should be null. Threw exception TypeError: Cannot read property 'onconnect' of null FAIL childWindow.navigator.usb.ondisconnect should be null. Threw exception TypeError: Cannot read property 'ondisconnect' of null PASS childWindow.navigator.userAgent is ''
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt index ab0cf8a..f375b16 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
@@ -60,8 +60,6 @@ FAIL childWindow.navigator.serviceWorker.controller should be null. Threw exception TypeError: Cannot read property 'controller' of null FAIL childWindow.navigator.serviceWorker.oncontrollerchange should be null. Threw exception TypeError: Cannot read property 'oncontrollerchange' of null FAIL childWindow.navigator.serviceWorker.onmessage should be null. Threw exception TypeError: Cannot read property 'onmessage' of null -PASS childWindow.navigator.services.onclose is null -PASS childWindow.navigator.services.onmessage is null FAIL childWindow.navigator.usb.onconnect should be null. Threw exception TypeError: Cannot read property 'onconnect' of null FAIL childWindow.navigator.usb.ondisconnect should be null. Threw exception TypeError: Cannot read property 'ondisconnect' of null PASS childWindow.navigator.userAgent is ''
diff --git a/third_party/WebKit/LayoutTests/fast/multicol/flipped-blocks-border-after-expected.html b/third_party/WebKit/LayoutTests/fast/multicol/flipped-blocks-border-after-expected.html index 4834927f0..d6e18046 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/flipped-blocks-border-after-expected.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/flipped-blocks-border-after-expected.html
@@ -4,7 +4,6 @@ .pos1 { left: 50px; top: 50px;} .pos2 { left: 250px; top: 50px;} .pos3 { left: 50px; top: 300px;} - .pos4 { left: 250px; top: 300px;} .multicol { border: 0 solid black; @@ -13,7 +12,6 @@ height: 100px; } - .horizontal_bt { border-top-width: 50px; } .horizontal_tb { border-bottom-width: 50px; } .vertical_rl { border-left-width: 50px; } .vertical_lr { border-right-width: 50px; } @@ -23,18 +21,14 @@ indicated. There should be no red. </p> <div class="test pos1"> - <p>Border above</p> - <div class="multicol horizontal_bt"></div> -</div> -<div class="test pos2"> <p>Border below</p> <div class="multicol horizontal_tb"></div> </div> -<div class="test pos3"> +<div class="test pos2"> <p>Border left</p> <div class="multicol vertical_rl"></div> </div> -<div class="test pos4"> +<div class="test pos3"> <p>Border right</p> <div class="multicol vertical_lr"></div> </div>
diff --git a/third_party/WebKit/LayoutTests/fast/multicol/flipped-blocks-border-after.html b/third_party/WebKit/LayoutTests/fast/multicol/flipped-blocks-border-after.html index eaf3d9dd..5fa438d 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/flipped-blocks-border-after.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/flipped-blocks-border-after.html
@@ -4,7 +4,6 @@ .pos1 { left: 50px; top: 50px;} .pos2 { left: 250px; top: 50px;} .pos3 { left: 50px; top: 300px;} - .pos4 { left: 250px; top: 300px;} .multicol { border: 0 solid black; @@ -18,10 +17,6 @@ background-color: green; } - .horizontal_bt { - -webkit-writing-mode: horizontal-bt; - border-top-width: 50px; - } .horizontal_tb { -webkit-writing-mode: horizontal-tb; border-bottom-width: 50px; @@ -49,24 +44,18 @@ indicated. There should be no red. </p> <div class="test pos1"> - <p>Border above</p> - <div class="multicol horizontal_bt"> - <div></div><div class="break_before"></div> - </div> -</div> -<div class="test pos2"> <p>Border below</p> <div class="multicol horizontal_tb"> <div></div><div class="break_before"></div> </div> </div> -<div class="test pos3"> +<div class="test pos2"> <p>Border left</p> <div class="multicol vertical_rl"> <div></div><div class="break_before"></div> </div> </div> -<div class="test pos4"> +<div class="test pos3"> <p>Border right</p> <div class="multicol vertical_lr"> <div></div><div class="break_before"></div>
diff --git a/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped.html b/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped.html index 829f5295..adc5e779 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped.html
@@ -1,17 +1,17 @@ <html> <body style="margin: 0;"> - <div style="-webkit-writing-mode: horizontal-bt; overflow: -webkit-paged-x; -webkit-column-gap: 20px; height: 600px; width: 100px;"> - <div style="height: 50%;"></div> - <div style="height: 50%;"></div> - <div style="height: 50%;"></div> - <div id="target" style="height: 50%;"></div> + <div style="-webkit-writing-mode: vertical-rl; overflow: -webkit-paged-y; -webkit-column-gap: 20px; width: 600px; height: 100px;"> + <div style="width: 50%;"></div> + <div style="width: 50%;"></div> + <div style="width: 50%;"></div> + <div id="target" style="width: 50%;"></div> <div id="result"></div> </div> <script> if (window.testRunner) testRunner.dumpAsText(); // FIXME: This is incorrect. The startContainer should be the 3rd div, not the 4th. - document.getElementById("result").innerText = document.caretRangeFromPoint(115, 550).startContainer === document.getElementById("target") ? "PASS" : "FAIL"; + document.getElementById("result").innerText = document.caretRangeFromPoint(550, 115).startContainer === document.getElementById("target") ? "PASS" : "FAIL"; </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/multicol/nested-with-padding-expected.html b/third_party/WebKit/LayoutTests/fast/multicol/nested-with-padding-expected.html new file mode 100644 index 0000000..711ad726 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/multicol/nested-with-padding-expected.html
@@ -0,0 +1,7 @@ +<!DOCTYPE html> +<p>Below, the word "PASS" should be seen in white on a blue background.</p> +<div style="width:10em; height:20px; line-height:20px; color:white; background:blue;"> + <div style="padding-left:5em;"> + PASS + </div> +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/multicol/nested-with-padding.html b/third_party/WebKit/LayoutTests/fast/multicol/nested-with-padding.html new file mode 100644 index 0000000..5d34638 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/multicol/nested-with-padding.html
@@ -0,0 +1,7 @@ +<!DOCTYPE html> +<p>Below, the word "PASS" should be seen in white on a blue background.</p> +<div style="columns:3; column-fill:auto; column-gap:0; width:15em; height:20px; line-height:20px;"> + <div style="columns:2; column-fill:auto; column-gap:0; padding-top:20px; color:white; background:blue;"> + PASS + </div> +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/table/margins-perpendicular-containing-block-expected.txt b/third_party/WebKit/LayoutTests/fast/table/margins-perpendicular-containing-block-expected.txt index 2694f0ff..e9892dd 100644 --- a/third_party/WebKit/LayoutTests/fast/table/margins-perpendicular-containing-block-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/table/margins-perpendicular-containing-block-expected.txt
@@ -2,11 +2,6 @@ Hello PASS Hello -Hello PASS Hello -Hello -PASS -Hello -Hello PASS
diff --git a/third_party/WebKit/LayoutTests/fast/table/margins-perpendicular-containing-block.html b/third_party/WebKit/LayoutTests/fast/table/margins-perpendicular-containing-block.html index d0c3e61..a1a39a2 100644 --- a/third_party/WebKit/LayoutTests/fast/table/margins-perpendicular-containing-block.html +++ b/third_party/WebKit/LayoutTests/fast/table/margins-perpendicular-containing-block.html
@@ -22,31 +22,16 @@ </table> </div> -<div style="-webkit-writing-mode: horizontal-bt"> -<table data-offset-x=10 style="-webkit-writing-mode: vertical-rl"> - <tr><td>Hello</td></tr> -</table> -<table data-offset-x=10 style="-webkit-writing-mode: vertical-lr"> - <tr><td>Hello</td></tr> -</table> -</div> - <div style="-webkit-writing-mode: vertical-rl"> <table data-offset-y=10 style="-webkit-writing-mode: horizontal-tb"> <tr><td>Hello</td></tr> </table> -<table data-offset-y=10 style="-webkit-writing-mode: horizontal-bt"> - <tr><td>Hello</td></tr> -</table> </div> <div style="-webkit-writing-mode: vertical-lr"> <table data-offset-y=10 style="-webkit-writing-mode: horizontal-tb"> <tr><td>Hello</td></tr> </table> -<table data-offset-y=10 style="-webkit-writing-mode: horizontal-bt"> - <tr><td>Hello</td></tr> -</table> </div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/text/international/text-spliced-font.html b/third_party/WebKit/LayoutTests/fast/text/international/text-spliced-font.html index 23ab6504..6291720 100644 --- a/third_party/WebKit/LayoutTests/fast/text/international/text-spliced-font.html +++ b/third_party/WebKit/LayoutTests/fast/text/international/text-spliced-font.html
@@ -11,9 +11,6 @@ #horizontal_TB { -webkit-writing-mode: horizontal-tb; } -#horizontal_BT { --webkit-writing-mode: horizontal-bt; -} #vertical_RL { -webkit-writing-mode: vertical-rl; } @@ -24,10 +21,6 @@ -webkit-writing-mode: horizontal-tb; text-rendering: optimizelegibility; } -#horizontal_BT_complex { --webkit-writing-mode: horizontal-bt; -text-rendering: optimizelegibility; -} #vertical_RL_complex { -webkit-writing-mode: vertical-rl; text-rendering: optimizelegibility;
diff --git a/third_party/WebKit/LayoutTests/fast/text/international/vertical-text-glyph-test.html b/third_party/WebKit/LayoutTests/fast/text/international/vertical-text-glyph-test.html index adaef65..7ceb2e7 100644 --- a/third_party/WebKit/LayoutTests/fast/text/international/vertical-text-glyph-test.html +++ b/third_party/WebKit/LayoutTests/fast/text/international/vertical-text-glyph-test.html
@@ -11,9 +11,6 @@ #horizontal_TB { -webkit-writing-mode: horizontal-tb; } -#horizontal_BT { - -webkit-writing-mode: horizontal-bt; -} #vertical_RL { -webkit-writing-mode: vertical-rl; } @@ -24,10 +21,6 @@ -webkit-writing-mode: horizontal-tb; text-rendering: optimizelegibility; } -#horizontal_BT_complex { - -webkit-writing-mode: horizontal-bt; - text-rendering: optimizelegibility; -} #vertical_RL_complex { -webkit-writing-mode: vertical-rl; text-rendering: optimizelegibility;
diff --git a/third_party/WebKit/LayoutTests/fast/writing-mode/borders-expected.html b/third_party/WebKit/LayoutTests/fast/writing-mode/borders-expected.html index 064df7c2..b23037a3 100644 --- a/third_party/WebKit/LayoutTests/fast/writing-mode/borders-expected.html +++ b/third_party/WebKit/LayoutTests/fast/writing-mode/borders-expected.html
@@ -23,7 +23,3 @@ <div class="container"> <div class="box"></div> </div> - -<div class="container"> - <div class="box"></div> -</div>
diff --git a/third_party/WebKit/LayoutTests/fast/writing-mode/borders.html b/third_party/WebKit/LayoutTests/fast/writing-mode/borders.html index d31f33e..9fc43df 100644 --- a/third_party/WebKit/LayoutTests/fast/writing-mode/borders.html +++ b/third_party/WebKit/LayoutTests/fast/writing-mode/borders.html
@@ -17,10 +17,6 @@ </div> <div class="container"> - <div class="box" style="-webkit-writing-mode: horizontal-bt;"></div> -</div> - -<div class="container"> <div class="box" style="-webkit-writing-mode: vertical-lr;"></div> </div>
diff --git a/third_party/WebKit/LayoutTests/fast/writing-mode/margin-collapse.html b/third_party/WebKit/LayoutTests/fast/writing-mode/margin-collapse.html index e9ac5a2..51f624a5 100644 --- a/third_party/WebKit/LayoutTests/fast/writing-mode/margin-collapse.html +++ b/third_party/WebKit/LayoutTests/fast/writing-mode/margin-collapse.html
@@ -7,7 +7,7 @@ <div style="border:2px solid black"> <div style="-webkit-writing-mode:vertical-lr" class="block"></div> <div style="-webkit-writing-mode:vertical-rl" class="block"></div> -<div style="-webkit-writing-mode:horizontal-bt" class="block"></div> +<div style="-webkit-writing-mode:horizontal-tb" class="block"></div> <div class="block"></div> </div> </body>
diff --git a/third_party/WebKit/LayoutTests/fast/writing-mode/margins-expected.html b/third_party/WebKit/LayoutTests/fast/writing-mode/margins-expected.html index 8c91d5a..9a18302 100644 --- a/third_party/WebKit/LayoutTests/fast/writing-mode/margins-expected.html +++ b/third_party/WebKit/LayoutTests/fast/writing-mode/margins-expected.html
@@ -26,7 +26,3 @@ <div class="container"> <div class="box"></div> </div> - -<div class="container"> - <div class="box"></div> -</div>
diff --git a/third_party/WebKit/LayoutTests/fast/writing-mode/margins.html b/third_party/WebKit/LayoutTests/fast/writing-mode/margins.html index d7baeb8..fea4e374 100644 --- a/third_party/WebKit/LayoutTests/fast/writing-mode/margins.html +++ b/third_party/WebKit/LayoutTests/fast/writing-mode/margins.html
@@ -20,10 +20,6 @@ </div> <div class="container"> - <div class="box" style="-webkit-writing-mode: horizontal-bt;"></div> -</div> - -<div class="container"> <div class="box" style="-webkit-writing-mode: vertical-lr;"></div> </div>
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect-cross-origin.html b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect-cross-origin.html deleted file mode 100644 index 1a757367..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect-cross-origin.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<title> - Tests accepting and rejecting connections calling navigator.connect from - a cross origin iframe. -</title> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/testharness-helpers.js"></script> -<script src="../../resources/get-host-info.js"></script> -<script src="../serviceworker/resources/test-helpers.js"></script> -<script src="resources/test-helpers.js"></script> -<script src="resources/connect-tests.js"></script> -<body> -<script> -var cross_origin = get_host_info().UNAUTHENTICATED_ORIGIN; -var sw_scope = 'resources/service-worker-scope' + window.location.pathname; - -run_connect_tests(cross_origin_connect); -</script> -</body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect-event.html b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect-event.html deleted file mode 100644 index 733dccc..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect-event.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<title> - Tests the ServicePortConnectEvent API. -</title> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../serviceworker/resources/test-helpers.js"></script> -<script> -service_worker_test('resources/connect-event-worker.js', - 'Verifies the ServicePortConnectEvent API.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect-from-worker.html b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect-from-worker.html deleted file mode 100644 index adfe9346..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect-from-worker.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<title> - Tests accepting and rejecting connections calling navigator.connect from - a web worker. -</title> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/testharness-helpers.js"></script> -<script src="../serviceworker/resources/test-helpers.js"></script> -<script src="resources/test-helpers.js"></script> -<script src="resources/connect-tests.js"></script> -<body> -<script> -var sw_scope = 'resources/service-worker-scope' + window.location.pathname; - -run_connect_tests(connect_from_worker); -</script> -</body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect.html b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect.html deleted file mode 100644 index e0ad006..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/connect.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<title> - Tests accepting and rejecting connections calling navigator.connect from - a same origin page. -</title> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/testharness-helpers.js"></script> -<script src="../serviceworker/resources/test-helpers.js"></script> -<script src="resources/test-helpers.js"></script> -<script src="resources/connect-tests.js"></script> -<script> -var sw_scope = 'resources/service-worker-scope' + window.location.pathname; - -run_connect_tests(function(t, service, options) { - return navigator.services.connect(service, options); - }); -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/postmessage-cross-origin.html b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/postmessage-cross-origin.html deleted file mode 100644 index b83ea0d..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/postmessage-cross-origin.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<title> - Tests posting messages over a navigator.connect initiated channel from a cross - origin iframe. -</title> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/testharness-helpers.js"></script> -<script src="../../resources/get-host-info.js"></script> -<script src="../serviceworker/resources/test-helpers.js"></script> -<script src="resources/test-helpers.js"></script> -<script src="resources/postmessage-tests.js"></script> -<body> -<script> -var cross_origin = get_host_info().UNAUTHENTICATED_ORIGIN; -var sw_scope = 'resources/service-worker-scope' + window.location.pathname; - -run_postmessage_tests(cross_origin, cross_origin_connect); -</script> -</body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/postmessage-from-worker.html b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/postmessage-from-worker.html deleted file mode 100644 index 6590425..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/postmessage-from-worker.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<title> - Tests posting messages over a navigator.connect initiated channel from a web - worker. -</title> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/testharness-helpers.js"></script> -<script src="../serviceworker/resources/test-helpers.js"></script> -<script src="resources/test-helpers.js"></script> -<script src="resources/postmessage-tests.js"></script> -<body> -<script> -var sw_scope = 'resources/service-worker-scope' + window.location.pathname; - -run_postmessage_tests(location.origin, connect_from_worker); -</script> -</body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/postmessage.html b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/postmessage.html deleted file mode 100644 index 534ac26..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/postmessage.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<title> - Tests posting messages over a navigator.connect initiated channel from a same - origin page. -</title> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/testharness-helpers.js"></script> -<script src="../serviceworker/resources/test-helpers.js"></script> -<script src="resources/test-helpers.js"></script> -<script src="resources/postmessage-tests.js"></script> -<script> -var sw_scope = 'resources/service-worker-scope' + window.location.pathname; - -run_postmessage_tests(location.origin, function(t, service, options) { - return wrap_in_port(navigator.services.connect(service, options)); - }); -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/accepting-worker.js b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/accepting-worker.js deleted file mode 100644 index 3e862185..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/accepting-worker.js +++ /dev/null
@@ -1,3 +0,0 @@ -navigator.services.addEventListener('connect', function(event) { - event.respondWith({accept: true}); -});
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/async-connect-worker.js b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/async-connect-worker.js deleted file mode 100644 index 57743c4..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/async-connect-worker.js +++ /dev/null
@@ -1,9 +0,0 @@ -navigator.services.addEventListener('connect', function(event) { - var targetUrl = new URL(event.targetURL); - event.respondWith(new Promise(function(resolve, reject) { - if (targetUrl.search == "?accept") - self.setTimeout(resolve, 1, {accept: true}); - else - self.setTimeout(reject, 1); - })); -});
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-event-worker.js b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-event-worker.js deleted file mode 100644 index 503fc2f4..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-event-worker.js +++ /dev/null
@@ -1,129 +0,0 @@ -importScripts('../../serviceworker/resources/worker-testharness.js'); -importScripts('../../serviceworker/resources/test-helpers.js'); -importScripts('/resources/testharness-helpers.js'); -importScripts('test-helpers.js'); - -// Returns a promise that additionally has |resolve| and |reject| methods. -function NewResolvablePromise() { - var resolveMethod, rejectMethod; - var p = new Promise(function(resolve, reject) { - resolveMethod = resolve; - rejectMethod = reject; - }); - p.resolve = resolveMethod; - p.reject = rejectMethod; - return p; -} - -self.addEventListener('install', function(event) { - event.waitUntil(self.skipWaiting()); -}); - -self.addEventListener('activate', function(event) { - promise_test(function(test) { - return wait_for_state(test, self.registration.active, 'activated'); - }, 'wait for worker to be activated'); - - promise_test(function(test) { - var respondResult = NewResolvablePromise(); - navigator.services.onconnect = test.step_func(function(event) { - respondResult.resolve(event.respondWith({accept: true})); - }); - return Promise.all([respondResult, - navigator.services.connect(self.registration.scope + '/service')]); - }, 'respondWith can synchronously accept a connection without a promise.'); - - promise_test(function(test) { - var respondResult = NewResolvablePromise(); - navigator.services.onconnect = test.step_func(function(event) { - respondResult.resolve( - event.respondWith(Promise.resolve({accept: true}))); - }); - return Promise.all([respondResult, - navigator.services.connect(self.registration.scope + '/service')]); - }, 'respondWith can synchronously accept a connection with a promise.'); - - promise_test(function(test) { - var respondResult = NewResolvablePromise(); - navigator.services.onconnect = test.step_func(function(event) { - respondResult.resolve( - event.respondWith(new Promise(function(resolve) { - self.setTimeout(resolve, 1, {accept: true}); - }))); - }); - return Promise.all([respondResult, - navigator.services.connect(self.registration.scope + '/service')]); - }, 'respondWith can asynchronously accept a connection.'); - - promise_test(function(test) { - var respondResult = NewResolvablePromise(); - navigator.services.onconnect = test.step_func(function(event) { - respondResult.resolve( - promise_rejects(test, "AbortError", - event.respondWith({accept: false}))); - }); - return Promise.all([respondResult, - promise_rejects(test, 'AbortError', - navigator.services.connect(self.registration.scope + '/service')) - ]); - }, 'respondWith can synchronously reject a connection without a promise.'); - - promise_test(function(test) { - var respondResult = NewResolvablePromise(); - navigator.services.onconnect = test.step_func(function(event) { - respondResult.resolve( - promise_rejects(test, "AbortError", - event.respondWith(Promise.resolve({accept: false})))); - }); - return Promise.all([respondResult, - promise_rejects(test, 'AbortError', - navigator.services.connect(self.registration.scope + '/service')) - ]); - }, 'respondWith can synchronously reject a connection with a resolved promise.'); - - promise_test(function(test) { - var respondResult = NewResolvablePromise(); - navigator.services.onconnect = test.step_func(function(event) { - respondResult.resolve( - promise_rejects(test, "AbortError", - event.respondWith(Promise.reject()))); - }); - return Promise.all([respondResult, - promise_rejects(test, 'AbortError', - navigator.services.connect(self.registration.scope + '/service')) - ]); - }, 'respondWith can synchronously reject a connection with a rejected promise.'); - - promise_test(function(test) { - navigator.services.onconnect = test.step_func(function(event) { - }); - return promise_rejects(test, 'AbortError', - navigator.services.connect(self.registration.scope + '/service')); - }, 'Not calling respondWith will reject the connection.'); - - promise_test(function(test) { - var respondResult1 = NewResolvablePromise(); - var respondResult2 = NewResolvablePromise(); - navigator.services.onconnect = test.step_func(function(event) { - respondResult1.resolve(event.respondWith({accept: true})); - respondResult2.resolve( - promise_rejects(test, 'InvalidStateError', - event.respondWith({}))); - }); - return Promise.all([respondResult1, respondResult2, - navigator.services.connect(self.registration.scope + '/service')]); - }, 'Calling respondWith a second time will fail.'); - - promise_test(function(test) { - var respondResult = NewResolvablePromise(); - navigator.services.onconnect = test.step_func(function(event) { - respondResult.resolve( - promise_rejects(test, new TypeError(), - event.respondWith(""))); - }); - return Promise.all([respondResult, - promise_rejects(test, 'AbortError', - navigator.services.connect(self.registration.scope + '/service')) - ]); - }, 'Calling respondWith with something that is not an object rejects.'); -});
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-helper.html b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-helper.html deleted file mode 100644 index 40cf326..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-helper.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness-helpers.js"></script> -<script src="test-helpers.js"></script> -<script src="connect-helper.js"></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-helper.js b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-helper.js deleted file mode 100644 index 7254e50..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-helper.js +++ /dev/null
@@ -1,26 +0,0 @@ -if ("importScripts" in self) { - importScripts("/resources/testharness-helpers.js"); - importScripts("test-helpers.js"); -} - -self.onmessage = function(e) { - var service = e.data.connect; - wrap_in_port(navigator.services.connect(service, e.data.options)) - .then(function(port) { - e.data.port.postMessage({ - success: true, - result: { - port: port, - targetURL: port.targetURL, - name: port.name, - data: port.data - } - }, [port]); - }) - .catch(function(error) { - // Not all errors can be serialized as a SerializedScriptValue, so - // convert to JSON and parse to get just the bits that certainly can. - e.data.port.postMessage( - {success: false, result: JSON.parse(stringifyDOMObject(error))}); - }); -};
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-tests.js b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-tests.js deleted file mode 100644 index 6754d0de..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/connect-tests.js +++ /dev/null
@@ -1,112 +0,0 @@ -// Runs various navigator.connect tests, verifying that connections are accepted -// and rejected in the right circumstances. -// |connect_method| is a function taking a test object as well as the regular -// navigator.connect parameters. This makes it possible to run the same tests -// while wrapping all navigator.connect calls in a helper making the actual -// connection from a cross origin iframe, or a web worker. -function run_connect_tests(connect_method) { - promise_test(function(t) { - return assert_promise_rejects( - connect_method(t, 'https://example.test/service/does/not/exists'), - 'AbortError', - 'navigator.connect should fail with an AbortError'); - }, 'Connection fails to a service that doesn\'t exist.'); - - promise_test(function(t) { - var scope = sw_scope + '/empty'; - var sw_url = 'resources/empty-worker.js'; - return assert_promise_rejects( - service_worker_unregister_and_register(t, sw_url, scope) - .then(function(registration) { - return wait_for_state(t, registration.installing, 'activated'); - }) - .then(function() { - return connect_method(t, scope + '/service'); - }), - 'AbortError', - 'navigator.connect should fail with an AbortError'); - }, 'Connection fails if service worker doesn\'t handle connect event.'); - - promise_test(function(t) { - var scope = sw_scope + '/rejecting'; - var sw_url = 'resources/rejecting-worker.js'; - return assert_promise_rejects( - service_worker_unregister_and_register(t, sw_url, scope) - .then(function(registration) { - return wait_for_state(t, registration.installing, 'activated'); - }) - .then(function() { - return connect_method(t, scope + '/service'); - }), - 'AbortError', - 'navigator.connect should fail with an AbortError'); - }, 'Connection fails if service worker rejects connection event.'); - - promise_test(function(t) { - var scope = sw_scope + '/accepting'; - var sw_url = 'resources/accepting-worker.js'; - return service_worker_unregister_and_register(t, sw_url, scope) - .then(function(registration) { - return wait_for_state(t, registration.installing, 'activated'); - }) - .then(function() { - return connect_method(t, scope + '/service'); - }) - .then(function(port) { - var targetURL = new URL(port.targetURL); - assert_equals(targetURL.pathname, base_path() + scope + '/service'); - return service_worker_unregister(t, scope); - }); - }, 'Connection succeeds if service worker accepts connection event.'); - - promise_test(function(t) { - var scope = sw_scope + '/async-rejecting'; - var sw_url = 'resources/async-connect-worker.js'; - return assert_promise_rejects( - service_worker_unregister_and_register(t, sw_url, scope) - .then(function(registration) { - return wait_for_state(t, registration.installing, 'activated'); - }) - .then(function() { - return connect_method(t, scope + '/service?reject'); - }), - 'AbortError', - 'navigator.connect should fail with an AbortError'); - }, 'Connection fails if service worker rejects connection event async.'); - - promise_test(function(t) { - var scope = sw_scope + '/async-accepting'; - var sw_url = 'resources/async-connect-worker.js'; - return service_worker_unregister_and_register(t, sw_url, scope) - .then(function(registration) { - return wait_for_state(t, registration.installing, 'activated'); - }) - .then(function() { - return connect_method(t, scope + '/service?accept'); - }) - .then(function(port) { - var targetURL = new URL(port.targetURL); - assert_equals(targetURL.pathname, base_path() + scope + '/service'); - return service_worker_unregister(t, scope); - }); - }, 'Connection succeeds if service worker accepts connection event async.'); - - promise_test(function(t) { - var scope = sw_scope + '/accepting-for-name-and-data'; - var sw_url = 'resources/accepting-worker.js'; - return service_worker_unregister_and_register(t, sw_url, scope) - .then(function(registration) { - return wait_for_state(t, registration.installing, 'activated'); - }) - .then(function() { - return connect_method(t, scope + '/service', {name: 'somename', data: 'somedata'}); - }) - .then(function(port) { - var targetURL = new URL(port.targetURL); - assert_equals(targetURL.pathname, base_path() + scope + '/service'); - assert_equals(port.name, 'somename'); - assert_equals(port.data, 'somedata'); - return service_worker_unregister(t, scope); - }); - }, 'Returned port has correct name and data fields'); -}
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/echo-worker.js b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/echo-worker.js deleted file mode 100644 index fa281ec..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/echo-worker.js +++ /dev/null
@@ -1,8 +0,0 @@ -var client; -self.addEventListener('crossoriginmessage', function(event) { - client.postMessage(event.data, event.ports); -}); - -navigator.services.addEventListener('connect', function(event) { - event.respondWith({accept: true}).then(function(port) { client = port; }); -});
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/empty-worker.js b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/empty-worker.js deleted file mode 100644 index 49ceb264..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/empty-worker.js +++ /dev/null
@@ -1 +0,0 @@ -// Do nothing.
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/postmessage-tests.js b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/postmessage-tests.js deleted file mode 100644 index ae5e5a1..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/postmessage-tests.js +++ /dev/null
@@ -1,104 +0,0 @@ -// Runs various navigator.connect tests, verifying that message are sent and -// received correctly. -// |connect_method| is a function taking a test object as well as the regular -// navigator.connect parameters. This makes it possible to run the same tests -// while wrapping all navigator.connect calls in a helper making the actual -// connection from a cross origin iframe, or a web worker. -function run_postmessage_tests(source_origin, connect_method) { - // Helper method that waits for a reply on a port, and resolves a promise with - // the reply. - function wait_for_reply(t, port) { - return new Promise(function(resolve) { - var resolved = false; - port.onmessage = t.step_func(function(event) { - assert_false(resolved); - resolved = true; - resolve(event.data); - }); - }); - } - - // FIXME: Current navigator.connect implementation returns origins with a - // trailing slash, which is probably not correct. - if (source_origin.charAt(source_origin.length - 1) != '/') - source_origin += '/'; - - promise_test(function(t) { - var scope = sw_scope + '/echo'; - var sw_url = 'resources/echo-worker.js'; - var test_message = 'ping over navigator.connect'; - return service_worker_unregister_and_register(t, sw_url, scope) - .then(function(registration) { - return wait_for_state(t, registration.installing, 'activated'); - }) - .then(function() { - return connect_method(t, scope + '/service'); - }) - .then(function(port) { - port.postMessage(test_message); - return wait_for_reply(t, port); - }) - .then(function(response) { - assert_equals(response, test_message); - return service_worker_unregister(t, scope); - }); - }, 'Messages can be sent and received.'); - - promise_test(function(t) { - var scope = sw_scope + '/echo-port'; - var sw_url = 'resources/echo-worker.js'; - var test_message = 'ping over navigator.connect'; - var channel = new MessageChannel(); - return service_worker_unregister_and_register(t, sw_url, scope) - .then(function(registration) { - return wait_for_state(t, registration.installing, 'activated'); - }) - .then(function() { - return connect_method(t, scope + '/service'); - }) - .then(function(port) { - channel.port1.postMessage(test_message); - port.postMessage({port: channel.port2}, [channel.port2]); - return wait_for_reply(t, port); - }) - .then(function(response) { - assert_true('port' in response); - assert_class_string(response.port, 'MessagePort'); - return wait_for_reply(t, response.port); - }) - .then(function(response) { - assert_equals(response, test_message); - return service_worker_unregister(t, scope); - }); - }, 'Ports can be sent and received.'); - - promise_test(function(t) { - var scope = sw_scope + '/reply-client-info'; - var sw_url = 'resources/reply-client-info-worker.js'; - var target_url = scope + '/service'; - var port; - return service_worker_unregister_and_register(t, sw_url, scope) - .then(function(registration) { - return wait_for_state(t, registration.installing, 'activated'); - }) - .then(function() { - return connect_method(t, target_url); - }) - .then(function(p) { - port = p; - return wait_for_reply(t, port) - }) - .then(function(response) { - assert_equals(response.targetUrl, - location.origin + base_path() + target_url); - assert_equals(response.origin, source_origin); - var r = wait_for_reply(t, port); - port.postMessage('ping'); - return r; - }) - .then(function(response) { - assert_equals(response.origin, source_origin); - return service_worker_unregister(t, scope); - }); - }, 'Connect and message events include expected origin and targetUrl.'); -}
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/rejecting-worker.js b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/rejecting-worker.js deleted file mode 100644 index 16dc469..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/rejecting-worker.js +++ /dev/null
@@ -1,3 +0,0 @@ -navigator.services.addEventListener('connect', function(event) { - event.respondWith({accept: false}); -});
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/reply-client-info-worker.js b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/reply-client-info-worker.js deleted file mode 100644 index 8eb2fc0..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/reply-client-info-worker.js +++ /dev/null
@@ -1,12 +0,0 @@ -var client; -self.addEventListener('crossoriginmessage', function(event) { - client.postMessage({origin: event.origin}); -}); - -navigator.services.addEventListener('connect', function(event) { - event.respondWith({accept: true, data: {origin: event.origin}}) - .then(function(port) { - client = port; - client.postMessage({origin: event.origin, targetUrl: event.targetURL}); - }); -});
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/test-helpers.js b/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/test-helpers.js deleted file mode 100644 index f4380ccb..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/navigatorconnect/resources/test-helpers.js +++ /dev/null
@@ -1,89 +0,0 @@ -// Helper method that waits for a {success: <boolean>, result: any} reply on -// a port and returns a promise that resolves (if success is true) or rejects -// the promise with the value of the result attribute. -function reply_as_promise(t, port) { - return new Promise(function(resolve, reject) { - var got_reply = false; - port.onmessage = t.step_func(function(event) { - assert_false(got_reply); - assert_true('success' in event.data); - assert_true('result' in event.data); - got_reply = true; - if (event.data.success) - resolve(event.data.result); - else - reject(event.data.result); - }); - }); -} - -// Method that behaves similarly to navigator.services.connect, but the actual -// connect call is made from a cross origin iframe. Also the returned port is a -// MessagePort instead of a ServicePort, but with targetURL, name and data -// attributes set. -function cross_origin_connect(t, service, options) { - // |service| could be a relative URL, but for this to work from the iframe it - // needs an absolute URL. - var target_url = new URL(service, location.origin + base_path()); - return with_iframe( - cross_origin + base_path() + 'resources/connect-helper.html') - .then(function(iframe) { - var channel = new MessageChannel(); - iframe.contentWindow.postMessage( - {connect: target_url.href, port: channel.port2, options: options}, '*', [channel.port2]); - return reply_as_promise(t, channel.port1); - }) - .then(function(result) { - var port = result.port; - port.targetURL = result.targetURL; - port.name = result.name; - port.data = result.data; - return port; - }); -} - -// Method that behaves similarly to navigator.connect, but the actual connect -// call is made from a worker. Also the returned port is a MessagePort instead -// of a ServicePort, but with targetURL, name and data attributes set. -function connect_from_worker(t, service, options) { - // |service| is a relative URL, but for this to work from the worker it needs - // an absolute URL. - var target_url = location.origin + base_path() + service; - var worker = new Worker('resources/connect-helper.js'); - var channel = new MessageChannel(); - worker.postMessage - ({connect: target_url, port: channel.port2, options: options}, [channel.port2]); - return reply_as_promise(t, channel.port1) - .then(function(result) { - var port = result.port; - port.targetURL = result.targetURL; - port.name = result.name; - port.data = result.data; - return port; - }); -} - -// Takes (a promise resolving to) a ServicePort instance, and returns a Promise -// that resolves to a MessagePort wrapping that ServicePort. Used to simplify -// testing code and to allow forwarding a connection from a cross origin iframe -// or worker to the main test runner. -function wrap_in_port(maybe_port) { - return Promise.resolve(maybe_port).then( - function(port) { - var channel = new MessageChannel(); - channel.port2.onmessage = function(event) { - port.postMessage(event.data, event.ports); - }; - // Should use addEventListener and check source of event, but source isn't - // set yet, so for now just assume only one wrapped port is used at a time. - navigator.services.onmessage = function(event) { - channel.port2.postMessage(event.data, event.ports); - }; - channel.port1.targetURL = port.targetURL; - channel.port1.name = port.name; - channel.port1.data = port.data; - return channel.port1; - } - ); -} -
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-dom-access.php b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-dom-access.php new file mode 100644 index 0000000..f94f44a3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-dom-access.php
@@ -0,0 +1,18 @@ +<?php +header("Suborigin: foobar"); +?> +<!DOCTYPE html> +<html> +<head> +<title>Service Worker access fails from a suborigin</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<script> +var expectedError = new DOMException("TEST EXCEPTION", "SecurityError"); +assert_throws(expectedError, function() { + navigator.serviceWorker; +}); +done(); +</script> +</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-storage-dom-access.php b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-storage-dom-access.php new file mode 100644 index 0000000..a373506 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-storage-dom-access.php
@@ -0,0 +1,28 @@ +<?php +header("Suborigin: foobar"); +?> +<!DOCTYPE html> +<html> +<head> +<title>Verifies that localStorage and sessionStorage are not accessible from within a suborigin</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<script> +var expectedError = new DOMException("TEST EXCEPTION", "SecurityError"); +var localStorageTest = async_test("localStorage must not be accessible from a suborigin"); +var sessionStorageTest = async_test("sessionStorage must not be accessible from a suborigin"); + +function mustThrowSecurityException() { + assert_throws(expectedError, function() { + window.localStorage; + }); + this.done(); +} + +localStorageTest.step(mustThrowSecurityException); +sessionStorageTest.step(mustThrowSecurityException); +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index 811fd1b..8c89d08 100644 --- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -50,11 +50,6 @@ interface CountQueuingStrategy method constructor method size -interface CrossOriginServiceWorkerClient : EventTarget - getter origin - getter targetUrl - method constructor - method postMessage interface Crypto getter subtle method constructor @@ -611,29 +606,6 @@ method constructor method json method text -interface ServicePort - getter data - getter name - getter targetURL - method close - method constructor - method postMessage -interface ServicePortCollection : EventTarget - getter onclose - getter onconnect - getter onmessage - method connect - method constructor - method match - method matchAll - setter onclose - setter onconnect - setter onmessage -interface ServicePortConnectEvent : ExtendableEvent - getter origin - getter targetURL - method constructor - method respondWith interface ServiceWorkerGlobalScope : WorkerGlobalScope method constructor interface ServiceWorkerRegistration : EventTarget @@ -802,7 +774,6 @@ getter permissions getter platform getter product - getter services getter storage getter userAgent getter webkitPersistentStorage @@ -916,7 +887,6 @@ getter caches getter clients getter onactivate - getter oncrossoriginmessage getter onfetch getter onforeignfetch getter ongeofenceenter @@ -933,7 +903,6 @@ method gc method skipWaiting setter onactivate - setter oncrossoriginmessage setter onfetch setter onforeignfetch setter ongeofenceenter
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Document-createEvent-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Document-createEvent-expected.txt index 1ac5cc6..4028007 100644 --- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Document-createEvent-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Document-createEvent-expected.txt
@@ -235,8 +235,7 @@ FAIL Should throw NOT_SUPPORTED_ERR for non-legacy event interface "SecurityPolicyViolationEvent" assert_throws: function "function () { var evt = document.createEvent(eventI..." did not throw PASS Should throw NOT_SUPPORTED_ERR for pluralized non-legacy event interface "SecurityPolicyViolationEvent" -FAIL Should throw NOT_SUPPORTED_ERR for non-legacy event interface "ServicePortConnectEvent" assert_throws: function "function () { - var evt = document.createEvent(eventI..." did not throw +PASS Should throw NOT_SUPPORTED_ERR for non-legacy event interface "ServicePortConnectEvent" PASS Should throw NOT_SUPPORTED_ERR for pluralized non-legacy event interface "ServicePortConnectEvent" FAIL Should throw NOT_SUPPORTED_ERR for non-legacy event interface "ServiceWorkerMessageEvent" assert_throws: function "function () { var evt = document.createEvent(eventI..." did not throw
diff --git a/third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-rendering-expected.txt b/third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-rendering-expected.txt index e7db8692..059f19a 100644 --- a/third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-rendering-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-rendering-expected.txt
@@ -4,32 +4,32 @@ Running: testRenderingInNameOnly filter query: 12 are-shown.js -test/some/very-long-url/which/usually/breaks-rendering/due-to/trancation/so/that/the-path-is-cut-ap… +[test/some/very-long-url/which/usually/breaks-rendering/due-to/trancation/so/that/the-path-is-cut-][appropriately/and-no-horizontal-scrollbars/are-shown.js] -------------------- helloWorld[1][2].js -test/helloWorld12.js +[test][/helloWorld12.js] Running: testRenderingInPathAndName filter query: te12 are-shown.js -test/some/very-long-url/which/usually/breaks-rendering/due-to/trancation/so/that/the-path-is-cut-ap… +[test/some/very-long-url/which/usually/breaks-rendering/due-to/trancation/so/that/the-path-is-cut-][appropriately/and-no-horizontal-scrollbars/are-shown.js] -------------------- helloWorld12.js -[t][e]st/helloWorld[1][2].js +[test][/helloWorld12.js] Running: testRenderingInNameInTruncatedPath filter query: shown.js are-[s][h][o][w][n][.][j][s] -test/some/very-long-url/which/usually/breaks-rendering/due-to/trancation/so/that/the-path-is-cut-ap… +[test/some/very-long-url/which/usually/breaks-rendering/due-to/trancation/so/that/the-path-is-cut-][appropriately/and-no-horizontal-scrollbars/are-shown.js] -------------------- helloWorld12[.][j][s] -test/helloWorld12.js +[test][/helloWorld12.js] Running: testRenderingInTruncatedPath filter query: usually-shown.js are-shown.js -test/some/very-long-url/which/[u][s][u][a][l][l][y]/breaks-rendering/due-to/trancation/so/that/the-path-is-cut-ap… +[test/some/very-long-url/which/usually/breaks-rendering/due-to/trancation/so/that/the-path-is-cut-][appropriately/and-no-horizontal-scrollbars/are-shown.js] -------------------- helloWorld12[.][j][s] -test/helloWorld12.js +[test][/helloWorld12.js]
diff --git a/third_party/WebKit/LayoutTests/inspector/sass/test-find-node-for-position-expected.txt b/third_party/WebKit/LayoutTests/inspector/sass/test-find-node-for-position-expected.txt new file mode 100644 index 0000000..840474d --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector/sass/test-find-node-for-position-expected.txt
@@ -0,0 +1,22 @@ +Verifies findNodeForPosition method works correctly. + +div { + /* display: flex; */ + color: $my-color; + background-color: blue; + /* position: absolute; */ + + .className { + padding: 10px 0 0 10px; + /* font-family: "Times New Roman"; */ + background-image: url(assets/no-image-set.png); + + #test::before { + margin: 10px 10px; + content: "test me"; + /* border: 1px solid black; */ + } + } +} +All nodes found correctly. +
diff --git a/third_party/WebKit/LayoutTests/inspector/sass/test-find-node-for-position.html b/third_party/WebKit/LayoutTests/inspector/sass/test-find-node-for-position.html new file mode 100644 index 0000000..33642a9a --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector/sass/test-find-node-for-position.html
@@ -0,0 +1,83 @@ +<html> +<head> +<script src="../../http/tests/inspector/inspector-test.js"></script> +<script src="../../http/tests/inspector/elements-test.js"></script> +<script src="./sass-test.js"></script> +<style> +pre { + font-family: monospace; +} +</style> +<script> + +function test() +{ + InspectorTest.evaluateInPagePromise("getSASS()") + .then(result => InspectorTest.parseSCSS("", result.value)) + .then(ast => onAST(ast)) + .then(() => InspectorTest.completeTest()); + + function onAST(ast) + { + var text = ast.document.text; + var offsetToNode = new Map(); + ast.visit(onNode); + + function onNode(node) + { + if (!(node instanceof WebInspector.SASSSupport.TextNode)) + return; + var startOffset = text.offsetFromPosition(node.range.startLine, node.range.startColumn); + var endOffset = text.offsetFromPosition(node.range.endLine, node.range.endColumn); + for (var i = startOffset; i <= endOffset; ++i) + offsetToNode.set(i, node); + } + + var cursor = new WebInspector.TextCursor(text.lineEndings()); + for (var i = 0; i < text.value().length; ++i) { + var canonical = offsetToNode.get(i) || null; + cursor.advance(i); + var fastSearch = ast.findNodeForPosition(cursor.lineNumber(), cursor.columnNumber()); + if (fastSearch !== canonical) { + InspectorTest.addResult("Results differ for offset " + i); + return; + } + } + InspectorTest.addResult("All nodes found correctly."); + } +} + +function getSASS() +{ + return document.querySelector(".snippet").textContent; +} + +</script> +</head> + +<body onload="runTest()"> +<p> +Verifies findNodeForPosition method works correctly. +</p> +<pre class="snippet"> +div { + /* display: flex; */ + color: $my-color; + background-color: blue; + /* position: absolute; */ + + .className { + padding: 10px 0 0 10px; + /* font-family: "Times New Roman"; */ + background-image: url(assets/no-image-set.png); + + #test::before { + margin: 10px 10px; + content: "test me"; + /* border: 1px solid black; */ + } + } +} +</pre> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-constants-expected.txt b/third_party/WebKit/LayoutTests/media/track/track-constants-expected.txt deleted file mode 100644 index e5b0940b..0000000 --- a/third_party/WebKit/LayoutTests/media/track/track-constants-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -Test TextTrack constants. - -EXPECTED (HTMLTrackElement.NONE == '0') OK -EXPECTED (HTMLTrackElement.LOADING == '1') OK -EXPECTED (HTMLTrackElement.LOADED == '2') OK -EXPECTED (HTMLTrackElement.ERROR == '3') OK -END OF TEST -
diff --git a/third_party/WebKit/LayoutTests/media/track/track-constants.html b/third_party/WebKit/LayoutTests/media/track/track-constants.html index 7607870..0bea905 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-constants.html +++ b/third_party/WebKit/LayoutTests/media/track/track-constants.html
@@ -1,22 +1,12 @@ <!DOCTYPE html> -<html> -<head> - <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 - (Please avoid writing new tests using video-test.js) --> - <script src=../video-test.js></script> - <script type="text/javascript"> - function doTest () - { - testExpected("HTMLTrackElement.NONE", 0); - testExpected("HTMLTrackElement.LOADING", 1); - testExpected("HTMLTrackElement.LOADED", 2); - testExpected("HTMLTrackElement.ERROR", 3); - - endTest(); - } - </script> -</head> -<body onload="doTest()"> - <p>Test TextTrack constants.</p> -</body> -</html> +<title>Test TextTrack constants</title> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +test(function() { + assert_equals(HTMLTrackElement.NONE, 0); + assert_equals(HTMLTrackElement.LOADING, 1); + assert_equals(HTMLTrackElement.LOADED, 2); + assert_equals(HTMLTrackElement.ERROR, 3); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/platform/android/svg/custom/dynamic-empty-path-expected.png b/third_party/WebKit/LayoutTests/platform/android/svg/custom/dynamic-empty-path-expected.png new file mode 100644 index 0000000..696f9907 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/android/svg/custom/dynamic-empty-path-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/svg/custom/js-update-container-expected.png b/third_party/WebKit/LayoutTests/platform/android/svg/custom/js-update-container-expected.png new file mode 100644 index 0000000..06be02a --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/android/svg/custom/js-update-container-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/svg/custom/use-css-no-effect-on-shadow-tree-expected.png b/third_party/WebKit/LayoutTests/platform/android/svg/custom/use-css-no-effect-on-shadow-tree-expected.png new file mode 100644 index 0000000..64fba06be --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/android/svg/custom/use-css-no-effect-on-shadow-tree-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/svg/custom/viewBox-hit-expected.png b/third_party/WebKit/LayoutTests/platform/android/svg/custom/viewBox-hit-expected.png new file mode 100644 index 0000000..78463cdc --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/android/svg/custom/viewBox-hit-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/svg/zoom/page/zoom-hixie-mixed-009-expected.png b/third_party/WebKit/LayoutTests/platform/android/svg/zoom/page/zoom-hixie-mixed-009-expected.png new file mode 100644 index 0000000..409b9bb --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/android/svg/zoom/page/zoom-hixie-mixed-009-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/svg/zoom/page/zoom-svg-float-border-padding-expected.png b/third_party/WebKit/LayoutTests/platform/android/svg/zoom/page/zoom-svg-float-border-padding-expected.png new file mode 100644 index 0000000..b155f41 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/android/svg/zoom/page/zoom-svg-float-border-padding-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/css3/background/background-large-position-and-size-remains-stable-expected.png b/third_party/WebKit/LayoutTests/platform/linux/css3/background/background-large-position-and-size-remains-stable-expected.png new file mode 100644 index 0000000..2861135 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/css3/background/background-large-position-and-size-remains-stable-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/css3/background/background-large-position-and-size-remains-stable-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/css3/background/background-large-position-and-size-remains-stable-expected.txt new file mode 100644 index 0000000..aac9b6c2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/css3/background/background-large-position-and-size-remains-stable-expected.txt
@@ -0,0 +1,19 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x436 + LayoutBlockFlow {HTML} at (0,0) size 800x436 + LayoutBlockFlow {BODY} at (8,8) size 784x420 + LayoutBlockFlow {DIV} at (0,0) size 671x200 + LayoutBlockFlow {DIV} at (0,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (177,163) size 5x19 + text run at (177,163) width 5: " " + LayoutBlockFlow {DIV} at (181.75,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (0,0) size 0x0 + LayoutBlockFlow (anonymous) at (0,200) size 784x20 + LayoutBR {BR} at (0,0) size 0x19 + LayoutBlockFlow {DIV} at (0,220) size 671x200 + LayoutBlockFlow {DIV} at (0,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (177,163) size 5x19 + text run at (177,163) width 5: " " + LayoutBlockFlow {DIV} at (181.75,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png index edc518b..64d9c27 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/images/color-profile-svg-fill-text-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/images/color-profile-svg-fill-text-expected.png index c2cb2f2..e90077b0 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/images/color-profile-svg-fill-text-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/images/color-profile-svg-fill-text-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-mixed-009-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-mixed-009-expected.png index 409b9bb..1ae8230 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-mixed-009-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-hixie-mixed-009-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-mask-with-percentages-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-mask-with-percentages-expected.png index 9b05ecd..3e50a457 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-mask-with-percentages-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-mask-with-percentages-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png index b155f41..973790fb 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/threaded/printing/quirks-percentage-height-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/printing/quirks-percentage-height-body-expected.png similarity index 100% copy from third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/threaded/printing/quirks-percentage-height-expected.png copy to third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/printing/quirks-percentage-height-body-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/threaded/printing/quirks-percentage-height-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/printing/quirks-percentage-height-expected.png similarity index 100% rename from third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/threaded/printing/quirks-percentage-height-expected.png rename to third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/printing/quirks-percentage-height-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/printing/standards-percentage-heights-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/printing/standards-percentage-heights-expected.png new file mode 100644 index 0000000..c174808 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/printing/standards-percentage-heights-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/printing/subframes-percentage-height-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/printing/subframes-percentage-height-expected.png new file mode 100644 index 0000000..0eb38f7a --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/printing/subframes-percentage-height-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png index 44a64ec..af9ba44d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/images/color-profile-svg-fill-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/images/color-profile-svg-fill-text-expected.png index 30ee5bd1..a19ad410 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/images/color-profile-svg-fill-text-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/images/color-profile-svg-fill-text-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png index de101fb4..954a089 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/images/color-profile-svg-fill-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/images/color-profile-svg-fill-text-expected.png index 9ed0fb2..7540dd26 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/images/color-profile-svg-fill-text-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/images/color-profile-svg-fill-text-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/zoom/page/zoom-mask-with-percentages-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/zoom/page/zoom-mask-with-percentages-expected.png index ff0447de..0f55a4a 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/zoom/page/zoom-mask-with-percentages-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/zoom/page/zoom-mask-with-percentages-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/zoom/page/zoom-svg-float-border-padding-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/zoom/page/zoom-svg-float-border-padding-expected.png index 0d004a14..4a4fe9fb 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/zoom/page/zoom-svg-float-border-padding-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/zoom/page/zoom-svg-float-border-padding-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/threaded/printing/quirks-percentage-height-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/threaded/printing/quirks-percentage-height-expected.png deleted file mode 100644 index d65714b..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/threaded/printing/quirks-percentage-height-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/threaded/printing/quirks-percentage-height-expected.png b/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/threaded/printing/quirks-percentage-height-expected.png deleted file mode 100644 index d65714b..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/threaded/printing/quirks-percentage-height-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/css3/background/background-large-position-and-size-remains-stable-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/css3/background/background-large-position-and-size-remains-stable-expected.txt new file mode 100644 index 0000000..d7b78c8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/css3/background/background-large-position-and-size-remains-stable-expected.txt
@@ -0,0 +1,19 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x434 + LayoutBlockFlow {HTML} at (0,0) size 800x434 + LayoutBlockFlow {BODY} at (8,8) size 784x418 + LayoutBlockFlow {DIV} at (0,0) size 671x200 + LayoutBlockFlow {DIV} at (0,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (177,164) size 5x18 + text run at (177,164) width 5: " " + LayoutBlockFlow {DIV} at (181.75,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (0,0) size 0x0 + LayoutBlockFlow (anonymous) at (0,200) size 784x18 + LayoutBR {BR} at (0,0) size 0x18 + LayoutBlockFlow {DIV} at (0,218) size 671x200 + LayoutBlockFlow {DIV} at (0,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (177,164) size 5x18 + text run at (177,164) width 5: " " + LayoutBlockFlow {DIV} at (181.75,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png index 41cae19..c8190df 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/images/color-profile-svg-fill-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/images/color-profile-svg-fill-text-expected.png index 484c1152..87052a6 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/images/color-profile-svg-fill-text-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/images/color-profile-svg-fill-text-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/printing/quirks-percentage-height-body-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/printing/quirks-percentage-height-body-expected.txt deleted file mode 100644 index 711d7d66..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/printing/quirks-percentage-height-body-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -layer at (0,0) size 1066x799 - LayoutView at (0,0) size 1066x799 -layer at (0,0) size 1066x799 - LayoutBlockFlow {HTML} at (0,0) size 1066x799 - LayoutBlockFlow {BODY} at (0,0) size 543x409.50 [border: (5px solid #FA8072)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/printing/quirks-percentage-height-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/printing/quirks-percentage-height-expected.txt deleted file mode 100644 index da54eb0c..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/printing/quirks-percentage-height-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -layer at (0,0) size 1066x799 - LayoutView at (0,0) size 1066x799 -layer at (0,0) size 1066x799 - LayoutBlockFlow {HTML} at (0,0) size 1066x799 - LayoutBlockFlow {BODY} at (0,0) size 1066x799 - LayoutBlockFlow {DIV} at (0,0) size 543x409.50 [border: (5px solid #FA8072)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/printing/standards-percentage-heights-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/printing/standards-percentage-heights-expected.txt deleted file mode 100644 index 2d1d4646..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/printing/standards-percentage-heights-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -layer at (0,0) size 1066x799 - LayoutView at (0,0) size 1066x799 -layer at (0,0) size 510x510 - LayoutBlockFlow {HTML} at (0,0) size 510x510 [border: (5px solid #FFC0CB)] - LayoutBlockFlow {BODY} at (5,5) size 260x260 [border: (5px solid #FA8072)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/printing/subframes-percentage-height-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/printing/subframes-percentage-height-expected.txt deleted file mode 100644 index 92de9dd5..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/printing/subframes-percentage-height-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -layer at (0,0) size 1066x799 - LayoutView at (0,0) size 1066x799 -layer at (0,0) size 1066x400 - LayoutBlockFlow {HTML} at (0,0) size 1066x400 - LayoutBlockFlow {BODY} at (0,0) size 1066x400 - LayoutText {#text} at (0,0) size 0x0 -layer at (0,0) size 300x150 - LayoutIFrame {IFRAME} at (0,0) size 300x150 - layer at (0,0) size 300x150 - LayoutView at (0,0) size 300x150 - layer at (0,0) size 300x150 - LayoutBlockFlow {HTML} at (0,0) size 300x150 - LayoutBlockFlow {BODY} at (0,0) size 300x150 - LayoutBlockFlow {DIV} at (0,0) size 300x150 [border: (10px solid #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-mixed-009-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-mixed-009-expected.png index 4e2d758..97b30eb 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-mixed-009-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-hixie-mixed-009-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png index 81bc5da..886d83f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-float-border-padding-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-float-border-padding-expected.png index 32116d62..9ff97c9 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-float-border-padding-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-float-border-padding-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/quirks-percentage-height-body-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/quirks-percentage-height-body-expected.txt deleted file mode 100644 index 711d7d66..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/quirks-percentage-height-body-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -layer at (0,0) size 1066x799 - LayoutView at (0,0) size 1066x799 -layer at (0,0) size 1066x799 - LayoutBlockFlow {HTML} at (0,0) size 1066x799 - LayoutBlockFlow {BODY} at (0,0) size 543x409.50 [border: (5px solid #FA8072)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/quirks-percentage-height-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/quirks-percentage-height-expected.txt deleted file mode 100644 index da54eb0c..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/quirks-percentage-height-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -layer at (0,0) size 1066x799 - LayoutView at (0,0) size 1066x799 -layer at (0,0) size 1066x799 - LayoutBlockFlow {HTML} at (0,0) size 1066x799 - LayoutBlockFlow {BODY} at (0,0) size 1066x799 - LayoutBlockFlow {DIV} at (0,0) size 543x409.50 [border: (5px solid #FA8072)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/standards-percentage-heights-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/standards-percentage-heights-expected.txt deleted file mode 100644 index 2d1d4646..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/standards-percentage-heights-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -layer at (0,0) size 1066x799 - LayoutView at (0,0) size 1066x799 -layer at (0,0) size 510x510 - LayoutBlockFlow {HTML} at (0,0) size 510x510 [border: (5px solid #FFC0CB)] - LayoutBlockFlow {BODY} at (5,5) size 260x260 [border: (5px solid #FA8072)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/subframes-percentage-height-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/subframes-percentage-height-expected.txt deleted file mode 100644 index 92de9dd5..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/subframes-percentage-height-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -layer at (0,0) size 1066x799 - LayoutView at (0,0) size 1066x799 -layer at (0,0) size 1066x400 - LayoutBlockFlow {HTML} at (0,0) size 1066x400 - LayoutBlockFlow {BODY} at (0,0) size 1066x400 - LayoutText {#text} at (0,0) size 0x0 -layer at (0,0) size 300x150 - LayoutIFrame {IFRAME} at (0,0) size 300x150 - layer at (0,0) size 300x150 - LayoutView at (0,0) size 300x150 - layer at (0,0) size 300x150 - LayoutBlockFlow {HTML} at (0,0) size 300x150 - LayoutBlockFlow {BODY} at (0,0) size 300x150 - LayoutBlockFlow {DIV} at (0,0) size 300x150 [border: (10px solid #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/platform/win/css3/background/background-large-position-and-size-remains-stable-expected.txt b/third_party/WebKit/LayoutTests/platform/win/css3/background/background-large-position-and-size-remains-stable-expected.txt new file mode 100644 index 0000000..c4810c2d --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/css3/background/background-large-position-and-size-remains-stable-expected.txt
@@ -0,0 +1,19 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x434 + LayoutBlockFlow {HTML} at (0,0) size 800x434 + LayoutBlockFlow {BODY} at (8,8) size 784x418 + LayoutBlockFlow {DIV} at (0,0) size 671x200 + LayoutBlockFlow {DIV} at (0,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (177,164) size 5x17 + text run at (177,164) width 5: " " + LayoutBlockFlow {DIV} at (181.75,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (0,0) size 0x0 + LayoutBlockFlow (anonymous) at (0,200) size 784x18 + LayoutBR {BR} at (0,0) size 0x17 + LayoutBlockFlow {DIV} at (0,218) size 671x200 + LayoutBlockFlow {DIV} at (0,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (177,164) size 5x17 + text run at (177,164) width 5: " " + LayoutBlockFlow {DIV} at (181.75,0) size 177.75x177.75 [border: (5px solid #000000)] + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png index 0a16564..34932f8 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/images/color-profile-svg-fill-text-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/images/color-profile-svg-fill-text-expected.png index cde82ad..f7be344 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/images/color-profile-svg-fill-text-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/images/color-profile-svg-fill-text-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/inline/inline-box-background-repeat-x-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/inline/inline-box-background-repeat-x-expected.png index 08c59aaa..0a195c2 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/inline/inline-box-background-repeat-x-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/inline/inline-box-background-repeat-x-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-mixed-009-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-mixed-009-expected.png index 7b074fa..60f809d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-mixed-009-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-hixie-mixed-009-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-mask-with-percentages-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-mask-with-percentages-expected.png index a9d81498..6434378 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-mask-with-percentages-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-mask-with-percentages-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-float-border-padding-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-float-border-padding-expected.png index a7aeb2a..33ec974 100644 --- a/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-float-border-padding-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-float-border-padding-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png index 43ed64f..712079b1 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/printing/ellipsis-printing-style-expected.png b/third_party/WebKit/LayoutTests/platform/win7/printing/ellipsis-printing-style-expected.png index f534999..518174d 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/printing/ellipsis-printing-style-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/printing/ellipsis-printing-style-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/printing/forced-break-tree-dump-only-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/printing/forced-break-tree-dump-only-expected.txt deleted file mode 100644 index 29b565e..0000000 --- a/third_party/WebKit/LayoutTests/platform/win7/printing/forced-break-tree-dump-only-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -layer at (0,0) size 1000x750 scrollHeight 776 - LayoutView at (0,0) size 1000x750 -layer at (0,0) size 1000x776 backgroundClip at (0,0) size 1000x750 clip at (0,0) size 1000x750 - LayoutBlockFlow {HTML} at (0,0) size 1000x776 - LayoutBlockFlow {BODY} at (8,16) size 984x752 - LayoutBlockFlow {P} at (0,0) size 984x36 - LayoutText {#text} at (0,0) size 982x35 - text run at (0,0) width 566: "This is a test that only dumps the layout tree, and doesn't actually display the page. This " - text run at (565,0) width 417: "tests some peculiarities in the test framework for printing. To run" - text run at (0,18) width 159: "this test manually, run it " - text run at (158,18) width 227: "with content_shell --run-layout-test" - LayoutBlockFlow {DIV} at (0,52) size 984x18 - LayoutText {#text} at (0,0) size 165x17 - text run at (0,0) width 165: "This should be on page 1." - LayoutBlockFlow {DIV} at (0,734) size 984x18 - LayoutText {#text} at (0,0) size 165x17 - text run at (0,0) width 165: "This should be on page 2." -
diff --git a/third_party/WebKit/LayoutTests/platform/win7/printing/iframe-print-expected.png b/third_party/WebKit/LayoutTests/platform/win7/printing/iframe-print-expected.png index c5e773f..b11f7dd 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/printing/iframe-print-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/printing/iframe-print-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/printing/iframe-print-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/printing/iframe-print-expected.txt new file mode 100644 index 0000000..49d26c3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win7/printing/iframe-print-expected.txt
@@ -0,0 +1,41 @@ +layer at (0,0) size 1066x799 + LayoutView at (0,0) size 1066x799 +layer at (0,0) size 1066x799 + LayoutBlockFlow {HTML} at (0,0) size 1066x799 + LayoutBlockFlow {BODY} at (8,8) size 1050x783 + LayoutText {#text} at (304,290) size 4x17 + text run at (304,290) width 4: " " + LayoutText {#text} at (0,0) size 0x0 +layer at (8,208) size 304x104 + LayoutIFrame {IFRAME} at (0,200) size 304x104 [border: (2px inset #EEEEEE)] + layer at (0,0) size 300x100 + LayoutView at (0,0) size 300x100 + layer at (0,0) size 300x34 + LayoutBlockFlow {HTML} at (0,0) size 300x34 + LayoutBlockFlow {BODY} at (8,8) size 284x18 + LayoutText {#text} at (0,0) size 245x17 + text run at (0,0) width 245: "You should see this text when printed." +layer at (316,8) size 304x304 + LayoutIFrame {IFRAME} at (308,0) size 304x304 [border: (2px inset #EEEEEE)] + layer at (0,0) size 300x300 + LayoutView at (0,0) size 300x300 + layer at (40,0) size 260x300 + LayoutBlockFlow {HTML} at (0,0) size 260x300 + LayoutBlockFlow {BODY} at (8,8) size 244x284 + LayoutText {#text} at (0,0) size 17x249 + text run at (0,0) width 249: "You should see this text when printed. " + LayoutBR {BR} at (0,248) size 17x1 + LayoutText {#text} at (18,0) size 17x164 + text run at (18,0) width 164: "Vertical text on the right. " + LayoutBR {BR} at (18,163) size 17x1 + LayoutText {#text} at (0,0) size 0x0 + layer at (52,8) size 204x154 + LayoutIFrame {IFRAME} at (36,0) size 204x154 [border: (2px inset #EEEEEE)] + layer at (0,0) size 200x150 + LayoutView at (0,0) size 200x150 + layer at (0,0) size 200x52 + LayoutBlockFlow {HTML} at (0,0) size 200x52 + LayoutBlockFlow {BODY} at (8,8) size 184x36 + LayoutText {#text} at (0,0) size 153x35 + text run at (0,0) width 153: "You should see this text" + text run at (0,18) width 88: "when printed."
diff --git a/third_party/WebKit/LayoutTests/platform/win7/printing/page-count-relayout-shrink-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/printing/page-count-relayout-shrink-expected.txt deleted file mode 100644 index d2b030b..0000000 --- a/third_party/WebKit/LayoutTests/platform/win7/printing/page-count-relayout-shrink-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -Document has 31 pages.
diff --git a/third_party/WebKit/LayoutTests/platform/win7/printing/quirks-percentage-height-body-expected.png b/third_party/WebKit/LayoutTests/platform/win7/printing/quirks-percentage-height-body-expected.png index 2f64311..d65714b 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/printing/quirks-percentage-height-body-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/printing/quirks-percentage-height-body-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/printing/quirks-percentage-height-expected.png b/third_party/WebKit/LayoutTests/platform/win7/printing/quirks-percentage-height-expected.png index 2f64311..d65714b 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/printing/quirks-percentage-height-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/printing/quirks-percentage-height-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/printing/standards-percentage-heights-expected.png b/third_party/WebKit/LayoutTests/platform/win7/printing/standards-percentage-heights-expected.png index 9cb68b4e..e7c91e11 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/printing/standards-percentage-heights-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/printing/standards-percentage-heights-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/printing/subframes-percentage-height-expected.png b/third_party/WebKit/LayoutTests/platform/win7/printing/subframes-percentage-height-expected.png index b835f0a..0eb38f7a 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/printing/subframes-percentage-height-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/printing/subframes-percentage-height-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/ellipsis-printing-style-expected.png b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/ellipsis-printing-style-expected.png index f534999..518174d 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/ellipsis-printing-style-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/ellipsis-printing-style-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/forced-break-tree-dump-only-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/forced-break-tree-dump-only-expected.txt deleted file mode 100644 index 29b565e..0000000 --- a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/forced-break-tree-dump-only-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -layer at (0,0) size 1000x750 scrollHeight 776 - LayoutView at (0,0) size 1000x750 -layer at (0,0) size 1000x776 backgroundClip at (0,0) size 1000x750 clip at (0,0) size 1000x750 - LayoutBlockFlow {HTML} at (0,0) size 1000x776 - LayoutBlockFlow {BODY} at (8,16) size 984x752 - LayoutBlockFlow {P} at (0,0) size 984x36 - LayoutText {#text} at (0,0) size 982x35 - text run at (0,0) width 566: "This is a test that only dumps the layout tree, and doesn't actually display the page. This " - text run at (565,0) width 417: "tests some peculiarities in the test framework for printing. To run" - text run at (0,18) width 159: "this test manually, run it " - text run at (158,18) width 227: "with content_shell --run-layout-test" - LayoutBlockFlow {DIV} at (0,52) size 984x18 - LayoutText {#text} at (0,0) size 165x17 - text run at (0,0) width 165: "This should be on page 1." - LayoutBlockFlow {DIV} at (0,734) size 984x18 - LayoutText {#text} at (0,0) size 165x17 - text run at (0,0) width 165: "This should be on page 2." -
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/iframe-print-expected.png b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/iframe-print-expected.png index c5e773f..b11f7dd 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/iframe-print-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/iframe-print-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/iframe-print-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/iframe-print-expected.txt index 73e7db0..49d26c3 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/iframe-print-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/iframe-print-expected.txt
@@ -1,8 +1,8 @@ -layer at (0,0) size 1000x750 - LayoutView at (0,0) size 1000x750 -layer at (0,0) size 1000x750 - LayoutBlockFlow {HTML} at (0,0) size 1000x750 - LayoutBlockFlow {BODY} at (8,8) size 984x734 +layer at (0,0) size 1066x799 + LayoutView at (0,0) size 1066x799 +layer at (0,0) size 1066x799 + LayoutBlockFlow {HTML} at (0,0) size 1066x799 + LayoutBlockFlow {BODY} at (8,8) size 1050x783 LayoutText {#text} at (304,290) size 4x17 text run at (304,290) width 4: " " LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/page-count-relayout-shrink-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/page-count-relayout-shrink-expected.txt index d2b030b..f4811bc3 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/page-count-relayout-shrink-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/page-count-relayout-shrink-expected.txt
@@ -1 +1 @@ -Document has 31 pages. +Document has 30 pages.
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/quirks-percentage-height-body-expected.png b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/quirks-percentage-height-body-expected.png index 2f64311..d65714b 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/quirks-percentage-height-body-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/quirks-percentage-height-body-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/quirks-percentage-height-expected.png b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/quirks-percentage-height-expected.png index 2f64311..d65714b 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/quirks-percentage-height-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/quirks-percentage-height-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/standards-percentage-heights-expected.png b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/standards-percentage-heights-expected.png index 9cb68b4e..e7c91e11 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/standards-percentage-heights-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/standards-percentage-heights-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/subframes-percentage-height-expected.png b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/subframes-percentage-height-expected.png index b835f0a..0eb38f7a 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/subframes-percentage-height-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/subframes-percentage-height-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/printing/quirks-percentage-height-body-expected.txt b/third_party/WebKit/LayoutTests/printing/quirks-percentage-height-body-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/platform/linux/printing/quirks-percentage-height-body-expected.txt rename to third_party/WebKit/LayoutTests/printing/quirks-percentage-height-body-expected.txt
diff --git a/third_party/WebKit/LayoutTests/platform/linux/printing/quirks-percentage-height-expected.txt b/third_party/WebKit/LayoutTests/printing/quirks-percentage-height-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/platform/linux/printing/quirks-percentage-height-expected.txt rename to third_party/WebKit/LayoutTests/printing/quirks-percentage-height-expected.txt
diff --git a/third_party/WebKit/LayoutTests/platform/linux/printing/standards-percentage-heights-expected.txt b/third_party/WebKit/LayoutTests/printing/standards-percentage-heights-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/platform/linux/printing/standards-percentage-heights-expected.txt rename to third_party/WebKit/LayoutTests/printing/standards-percentage-heights-expected.txt
diff --git a/third_party/WebKit/LayoutTests/platform/linux/printing/subframes-percentage-height-expected.txt b/third_party/WebKit/LayoutTests/printing/subframes-percentage-height-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/platform/linux/printing/subframes-percentage-height-expected.txt rename to third_party/WebKit/LayoutTests/printing/subframes-percentage-height-expected.txt
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/slot-fallback-focus.html b/third_party/WebKit/LayoutTests/shadow-dom/slot-fallback-focus.html new file mode 100644 index 0000000..7586ff2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/shadow-dom/slot-fallback-focus.html
@@ -0,0 +1,70 @@ +<!DOCTYPE html> +<script src='../resources/testharness.js'></script> +<script src='../resources/testharnessreport.js'></script> +<script src='../fast/dom/shadow/resources/shadow-dom.js'></script> +<script src='resources/shadow-dom.js'></script> +<div id="log"></div> +<p> + document tree: [i0 -> [x-foo]]<br> + x-foo's shadow tree: [j1 -> j2 -> [s1]]<br> + <b>slot #s1: [k1 -> [x-bar] -> k0 -> [s2] -> [s3]]</b><br> + x-bar's shadow tree: [m1 -> m2]<br> + slot #s2: [i1 -> i2]<br> + <b>slot #s3: [l1]<b><br><br> + <b>v1 ideal nav forward: [i0 -> j1 -> j2 -> k1 -> x-bar -> m1 -> m2 -> k0 -> i1 -> i2 -> l1]</b><br> +</p> + +<input id="i0" tabindex=0 value="i0"> +<div id="x-foo"> + <input id="i2" slot="s2" tabindex=2 value="i2"> + <input id="i1" slot="s2" tabindex=1 value="i1"> + <template data-mode="open"> + <input id="j1" tabindex=1 value="j1"> + <slot id="s1" name="s1"> <!-- This slot does not have any assigned elements --> + <input id="k0" tabindex=0 value="k0"> + <input id="k1" tabindex=1 value="k1"> + <slot id="s2" name="s2"> + <input id="should-be-ignored"> + </slot> + <slot id="s3" name="s3"> <!-- This slot does not have any assigned elements --> + <input id="l1" value="l1"> + </slot> + <div id="x-bar" tabindex=2> + <template data-mode="open"> + <input id="m2" value="m2" tabindex=2> + <input id="m1" value="m1" tabindex=1> + </template> + </div> + </slot> + <input id="j2" tabindex=2 value="j2"> + </template> +</div> + +<script> + +test(function() { + var xfoo = document.getElementById('x-foo'); + convertTemplatesToShadowRootsWithin(xfoo); + + var elements = [ + 'i0', + 'x-foo/j1', + 'x-foo/j2', + 'x-foo/k1', + 'x-foo/x-bar', + 'x-foo/x-bar/m1', + 'x-foo/x-bar/m2', + 'x-foo/k0', + 'i1', + 'i2', + 'x-foo/l1' + ]; + + for (var i = 0; i + 1 < elements.length; ++i) + assert_true(shouldNavigateFocus(elements[i], elements[i + 1], 'forward'), elements[i] + ' to ' + elements[i + 1]); + elements.reverse(); + for (var i = 0; i + 1 < elements.length; ++i) + assert_true(shouldNavigateFocus(elements[i], elements[i + 1], 'backward'), elements[i] + ' to ' + elements[i + 1]); +}, 'Focus should jump to fallback elements when a slot does not have any assigned nodes.'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/svg/custom/dynamic-empty-path-expected.png b/third_party/WebKit/LayoutTests/svg/custom/dynamic-empty-path-expected.png index 696f9907..c421ce9f 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/dynamic-empty-path-expected.png +++ b/third_party/WebKit/LayoutTests/svg/custom/dynamic-empty-path-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/fractional-rects-expected.png b/third_party/WebKit/LayoutTests/svg/custom/fractional-rects-expected.png index e707e29..6281303d 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/fractional-rects-expected.png +++ b/third_party/WebKit/LayoutTests/svg/custom/fractional-rects-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/js-update-container-expected.png b/third_party/WebKit/LayoutTests/svg/custom/js-update-container-expected.png index 06be02a..ab106a6 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/js-update-container-expected.png +++ b/third_party/WebKit/LayoutTests/svg/custom/js-update-container-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/use-css-no-effect-on-shadow-tree-expected.png b/third_party/WebKit/LayoutTests/svg/custom/use-css-no-effect-on-shadow-tree-expected.png index 64fba06be..979992d 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/use-css-no-effect-on-shadow-tree-expected.png +++ b/third_party/WebKit/LayoutTests/svg/custom/use-css-no-effect-on-shadow-tree-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/viewBox-hit-expected.png b/third_party/WebKit/LayoutTests/svg/custom/viewBox-hit-expected.png index 78463cdc..b829ff1 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/viewBox-hit-expected.png +++ b/third_party/WebKit/LayoutTests/svg/custom/viewBox-hit-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/zoomed-background-alignment-expected.html b/third_party/WebKit/LayoutTests/svg/custom/zoomed-background-alignment-expected.html new file mode 100644 index 0000000..9f6bd8f --- /dev/null +++ b/third_party/WebKit/LayoutTests/svg/custom/zoomed-background-alignment-expected.html
@@ -0,0 +1,7 @@ +<!DOCTYPE html> +<body style="zoom: 0.66666667"> +<div style="width: 441px; height: 110.062px; margin: 0; padding: 0; border: none;"> + <svg width="100%" height="100%" preserveAspectRatio="none" style="background-color: #008000"> + </svg> +</div> +</body>
diff --git a/third_party/WebKit/LayoutTests/svg/custom/zoomed-background-alignment.html b/third_party/WebKit/LayoutTests/svg/custom/zoomed-background-alignment.html new file mode 100644 index 0000000..a1f9bd3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/svg/custom/zoomed-background-alignment.html
@@ -0,0 +1,8 @@ +<!DOCTYPE html> +<body style="zoom: 0.66666667"> +<div style="width: 441px; height: 110.062px; margin: 0; padding: 0; border: none;"> + <svg width="100%" height="100%" preserveAspectRatio="none" style="background-color: #FF0000"> + <rect width="100%" height="100%" fill="#008000"/> + </svg> +</div> +</body>
diff --git a/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt index 12a2329..075d64f7 100644 --- a/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt
@@ -387,6 +387,7 @@ property height property toBlob property toDataURL + property transferControlToOffscreen property width html element caption property align
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt index 62a012c..13215d5 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -624,24 +624,6 @@ [Worker] method constructor [Worker] method json [Worker] method text -[Worker] interface ServicePort -[Worker] attribute @@toStringTag -[Worker] getter data -[Worker] getter name -[Worker] getter targetURL -[Worker] method close -[Worker] method constructor -[Worker] method postMessage -[Worker] interface ServicePortCollection : EventTarget -[Worker] attribute @@toStringTag -[Worker] getter onclose -[Worker] getter onmessage -[Worker] method connect -[Worker] method constructor -[Worker] method match -[Worker] method matchAll -[Worker] setter onclose -[Worker] setter onmessage [Worker] interface ServiceWorkerRegistration : EventTarget [Worker] attribute @@toStringTag [Worker] getter geofencing @@ -806,7 +788,6 @@ [Worker] getter permissions [Worker] getter platform [Worker] getter product -[Worker] getter services [Worker] getter storage [Worker] getter userAgent [Worker] getter webkitPersistentStorage
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt index ae49885..674aa7a 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -1881,6 +1881,7 @@ method getContext method toBlob method toDataURL + method transferControlToOffscreen setter height setter width interface HTMLCollection @@ -3825,7 +3826,6 @@ getter product getter productSub getter serviceWorker - getter services getter storage getter storageQuota getter usb @@ -5662,24 +5662,6 @@ method setBaseAndExtent method setPosition method toString -interface ServicePort - attribute @@toStringTag - getter data - getter name - getter targetURL - method close - method constructor - method postMessage -interface ServicePortCollection : EventTarget - attribute @@toStringTag - getter onclose - getter onmessage - method connect - method constructor - method match - method matchAll - setter onclose - setter onmessage interface ServiceWorker : EventTarget attribute @@toStringTag getter onerror
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt index 0d50a1f..c1c64a9b 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -611,24 +611,6 @@ [Worker] method constructor [Worker] method json [Worker] method text -[Worker] interface ServicePort -[Worker] attribute @@toStringTag -[Worker] getter data -[Worker] getter name -[Worker] getter targetURL -[Worker] method close -[Worker] method constructor -[Worker] method postMessage -[Worker] interface ServicePortCollection : EventTarget -[Worker] attribute @@toStringTag -[Worker] getter onclose -[Worker] getter onmessage -[Worker] method connect -[Worker] method constructor -[Worker] method match -[Worker] method matchAll -[Worker] setter onclose -[Worker] setter onmessage [Worker] interface ServiceWorkerRegistration : EventTarget [Worker] attribute @@toStringTag [Worker] getter geofencing @@ -798,7 +780,6 @@ [Worker] getter permissions [Worker] getter platform [Worker] getter product -[Worker] getter services [Worker] getter storage [Worker] getter userAgent [Worker] getter webkitPersistentStorage
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h index d827eded..a9fdca3 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
@@ -133,17 +133,6 @@ return containsWrapper(); } - void markAsDependentGroup(ScriptWrappable* groupRoot, v8::Isolate* isolate) - { - ASSERT(containsWrapper()); - ASSERT(groupRoot && groupRoot->containsWrapper()); - - // FIXME: There has to be a better way. - v8::UniqueId groupId(*reinterpret_cast<intptr_t*>(&groupRoot->m_wrapper)); - m_wrapper.MarkPartiallyDependent(); - isolate->SetObjectGroupId(v8::Persistent<v8::Value>::Cast(m_wrapper), groupId); - } - void setReference(const v8::Persistent<v8::Object>& parent, v8::Isolate* isolate) { isolate->SetReference(parent, m_wrapper);
diff --git a/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.h.tmpl index b5fea91..4dbc6f0 100644 --- a/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.h.tmpl
@@ -5,7 +5,6 @@ #define InternalSettingsGenerated_h #include "bindings/core/v8/ScriptWrappable.h" -#include "platform/RefCountedSupplement.h" #include "platform/heap/Handle.h" #include "wtf/PassRefPtr.h" #include "wtf/RefCounted.h"
diff --git a/third_party/WebKit/Source/core/clipboard/DataObject.cpp b/third_party/WebKit/Source/core/clipboard/DataObject.cpp index c651363..9ceb075 100644 --- a/third_party/WebKit/Source/core/clipboard/DataObject.cpp +++ b/third_party/WebKit/Source/core/clipboard/DataObject.cpp
@@ -259,7 +259,7 @@ DEFINE_TRACE(DataObject) { visitor->trace(m_itemList); - HeapSupplementable<DataObject>::trace(visitor); + Supplementable<DataObject>::trace(visitor); } DataObject* DataObject::create(WebDragData data)
diff --git a/third_party/WebKit/Source/core/clipboard/DataObject.h b/third_party/WebKit/Source/core/clipboard/DataObject.h index 19133ae..d1920f7 100644 --- a/third_party/WebKit/Source/core/clipboard/DataObject.h +++ b/third_party/WebKit/Source/core/clipboard/DataObject.h
@@ -50,7 +50,7 @@ // A data object for holding data that would be in a clipboard or moved // during a drag-n-drop operation. This is the data that WebCore is aware // of and is not specific to a platform. -class CORE_EXPORT DataObject : public GarbageCollectedFinalized<DataObject>, public HeapSupplementable<DataObject> { +class CORE_EXPORT DataObject : public GarbageCollectedFinalized<DataObject>, public Supplementable<DataObject> { USING_GARBAGE_COLLECTED_MIXIN(DataObject); public: static DataObject* createFromPasteboard(PasteMode);
diff --git a/third_party/WebKit/Source/core/core.gypi b/third_party/WebKit/Source/core/core.gypi index 189bebd..06f3f85 100644 --- a/third_party/WebKit/Source/core/core.gypi +++ b/third_party/WebKit/Source/core/core.gypi
@@ -2420,6 +2420,9 @@ 'dom/DocumentOrderedList.h', 'dom/DocumentOrderedMap.cpp', 'dom/DocumentParser.cpp', + 'dom/DocumentParser.h', + 'dom/DocumentParserTiming.cpp', + 'dom/DocumentParserTiming.h', 'dom/DocumentStatisticsCollector.cpp', 'dom/DocumentStatisticsCollector.h', 'dom/DocumentStyleSheetCollection.cpp',
diff --git a/third_party/WebKit/Source/core/css/AffectedByFocusTest.cpp b/third_party/WebKit/Source/core/css/AffectedByFocusTest.cpp index 682de1c..635465b74 100644 --- a/third_party/WebKit/Source/core/css/AffectedByFocusTest.cpp +++ b/third_party/WebKit/Source/core/css/AffectedByFocusTest.cpp
@@ -36,7 +36,7 @@ private: OwnPtr<DummyPageHolder> m_dummyPageHolder; - RefPtrWillBePersistent<HTMLDocument> m_document; + Persistent<HTMLDocument> m_document; }; void AffectedByFocusTest::SetUp()
diff --git a/third_party/WebKit/Source/core/css/BasicShapeFunctions.cpp b/third_party/WebKit/Source/core/css/BasicShapeFunctions.cpp index 143d9ba6..1e40b52 100644 --- a/third_party/WebKit/Source/core/css/BasicShapeFunctions.cpp +++ b/third_party/WebKit/Source/core/css/BasicShapeFunctions.cpp
@@ -39,7 +39,7 @@ namespace blink { -static PassRefPtrWillBeRawPtr<CSSValue> valueForCenterCoordinate(CSSValuePool& pool, const ComputedStyle& style, const BasicShapeCenterCoordinate& center, EBoxOrient orientation) +static RawPtr<CSSValue> valueForCenterCoordinate(CSSValuePool& pool, const ComputedStyle& style, const BasicShapeCenterCoordinate& center, EBoxOrient orientation) { if (center.getDirection() == BasicShapeCenterCoordinate::TopLeft) return pool.createValue(center.length(), style); @@ -49,7 +49,7 @@ return CSSValuePair::create(pool.createIdentifierValue(keyword), pool.createValue(center.length(), style), CSSValuePair::DropIdenticalValues); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> basicShapeRadiusToCSSValue(CSSValuePool& pool, const ComputedStyle& style, const BasicShapeRadius& radius) +static RawPtr<CSSPrimitiveValue> basicShapeRadiusToCSSValue(CSSValuePool& pool, const ComputedStyle& style, const BasicShapeRadius& radius) { switch (radius.type()) { case BasicShapeRadius::Value: @@ -64,13 +64,13 @@ return nullptr; } -PassRefPtrWillBeRawPtr<CSSValue> valueForBasicShape(const ComputedStyle& style, const BasicShape* basicShape) +RawPtr<CSSValue> valueForBasicShape(const ComputedStyle& style, const BasicShape* basicShape) { CSSValuePool& pool = cssValuePool(); switch (basicShape->type()) { case BasicShape::BasicShapeCircleType: { const BasicShapeCircle* circle = toBasicShapeCircle(basicShape); - RefPtrWillBeRawPtr<CSSBasicShapeCircleValue> circleValue = CSSBasicShapeCircleValue::create(); + RawPtr<CSSBasicShapeCircleValue> circleValue = CSSBasicShapeCircleValue::create(); circleValue->setCenterX(valueForCenterCoordinate(pool, style, circle->centerX(), HORIZONTAL)); circleValue->setCenterY(valueForCenterCoordinate(pool, style, circle->centerY(), VERTICAL)); @@ -79,7 +79,7 @@ } case BasicShape::BasicShapeEllipseType: { const BasicShapeEllipse* ellipse = toBasicShapeEllipse(basicShape); - RefPtrWillBeRawPtr<CSSBasicShapeEllipseValue> ellipseValue = CSSBasicShapeEllipseValue::create(); + RawPtr<CSSBasicShapeEllipseValue> ellipseValue = CSSBasicShapeEllipseValue::create(); ellipseValue->setCenterX(valueForCenterCoordinate(pool, style, ellipse->centerX(), HORIZONTAL)); ellipseValue->setCenterY(valueForCenterCoordinate(pool, style, ellipse->centerY(), VERTICAL)); @@ -89,7 +89,7 @@ } case BasicShape::BasicShapePolygonType: { const BasicShapePolygon* polygon = toBasicShapePolygon(basicShape); - RefPtrWillBeRawPtr<CSSBasicShapePolygonValue> polygonValue = CSSBasicShapePolygonValue::create(); + RawPtr<CSSBasicShapePolygonValue> polygonValue = CSSBasicShapePolygonValue::create(); polygonValue->setWindRule(polygon->getWindRule()); const Vector<Length>& values = polygon->values(); @@ -100,7 +100,7 @@ } case BasicShape::BasicShapeInsetType: { const BasicShapeInset* inset = toBasicShapeInset(basicShape); - RefPtrWillBeRawPtr<CSSBasicShapeInsetValue> insetValue = CSSBasicShapeInsetValue::create(); + RawPtr<CSSBasicShapeInsetValue> insetValue = CSSBasicShapeInsetValue::create(); insetValue->setTop(pool.createValue(inset->top(), style)); insetValue->setRight(pool.createValue(inset->right(), style)); @@ -173,7 +173,7 @@ return BasicShapeCenterCoordinate(direction, offset); } -static BasicShapeRadius cssValueToBasicShapeRadius(const StyleResolverState& state, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) +static BasicShapeRadius cssValueToBasicShapeRadius(const StyleResolverState& state, RawPtr<CSSPrimitiveValue> radius) { if (!radius) return BasicShapeRadius(BasicShapeRadius::ClosestSide); @@ -221,7 +221,7 @@ RefPtr<BasicShapePolygon> polygon = BasicShapePolygon::create(); polygon->setWindRule(polygonValue.getWindRule()); - const WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>>& values = polygonValue.values(); + const HeapVector<Member<CSSPrimitiveValue>>& values = polygonValue.values(); for (unsigned i = 0; i < values.size(); i += 2) polygon->appendPoint(convertToLength(state, values.at(i).get()), convertToLength(state, values.at(i + 1).get()));
diff --git a/third_party/WebKit/Source/core/css/BasicShapeFunctions.h b/third_party/WebKit/Source/core/css/BasicShapeFunctions.h index 834cb58..9c3807b7 100644 --- a/third_party/WebKit/Source/core/css/BasicShapeFunctions.h +++ b/third_party/WebKit/Source/core/css/BasicShapeFunctions.h
@@ -43,7 +43,7 @@ class StyleResolverState; class ComputedStyle; -PassRefPtrWillBeRawPtr<CSSValue> valueForBasicShape(const ComputedStyle&, const BasicShape*); +RawPtr<CSSValue> valueForBasicShape(const ComputedStyle&, const BasicShape*); PassRefPtr<BasicShape> basicShapeForValue(const StyleResolverState&, const CSSValue&); FloatPoint floatPointForCenterCoordinate(const BasicShapeCenterCoordinate&, const BasicShapeCenterCoordinate&, FloatSize);
diff --git a/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp b/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp index 265a08e..1008e9d 100644 --- a/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp +++ b/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp
@@ -68,10 +68,10 @@ return offset.cssText(); } -static PassRefPtrWillBeRawPtr<CSSValuePair> buildSerializablePositionOffset(PassRefPtrWillBeRawPtr<CSSValue> offset, CSSValueID defaultSide) +static RawPtr<CSSValuePair> buildSerializablePositionOffset(RawPtr<CSSValue> offset, CSSValueID defaultSide) { CSSValueID side = defaultSide; - RefPtrWillBeRawPtr<CSSPrimitiveValue> amount = nullptr; + RawPtr<CSSPrimitiveValue> amount = nullptr; if (!offset) { side = CSSValueCenter; @@ -104,8 +104,8 @@ String CSSBasicShapeCircleValue::customCSSText() const { - RefPtrWillBeRawPtr<CSSValuePair> normalizedCX = buildSerializablePositionOffset(m_centerX, CSSValueLeft); - RefPtrWillBeRawPtr<CSSValuePair> normalizedCY = buildSerializablePositionOffset(m_centerY, CSSValueTop); + RawPtr<CSSValuePair> normalizedCX = buildSerializablePositionOffset(m_centerX, CSSValueLeft); + RawPtr<CSSValuePair> normalizedCY = buildSerializablePositionOffset(m_centerY, CSSValueTop); String radius; if (m_radius && m_radius->getValueID() != CSSValueClosestSide) @@ -164,8 +164,8 @@ String CSSBasicShapeEllipseValue::customCSSText() const { - RefPtrWillBeRawPtr<CSSValuePair> normalizedCX = buildSerializablePositionOffset(m_centerX, CSSValueLeft); - RefPtrWillBeRawPtr<CSSValuePair> normalizedCY = buildSerializablePositionOffset(m_centerY, CSSValueTop); + RawPtr<CSSValuePair> normalizedCX = buildSerializablePositionOffset(m_centerX, CSSValueLeft); + RawPtr<CSSValuePair> normalizedCY = buildSerializablePositionOffset(m_centerY, CSSValueTop); String radiusX; String radiusY;
diff --git a/third_party/WebKit/Source/core/css/CSSBasicShapeValues.h b/third_party/WebKit/Source/core/css/CSSBasicShapeValues.h index 1edd223..1162155 100644 --- a/third_party/WebKit/Source/core/css/CSSBasicShapeValues.h +++ b/third_party/WebKit/Source/core/css/CSSBasicShapeValues.h
@@ -42,7 +42,7 @@ class CSSBasicShapeCircleValue final : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSBasicShapeCircleValue> create() { return adoptRefWillBeNoop(new CSSBasicShapeCircleValue); } + static RawPtr<CSSBasicShapeCircleValue> create() { return adoptRefWillBeNoop(new CSSBasicShapeCircleValue); } String customCSSText() const; bool equals(const CSSBasicShapeCircleValue&) const; @@ -52,9 +52,9 @@ CSSPrimitiveValue* radius() const { return m_radius.get(); } // TODO(sashab): Remove these and pass them as arguments in the constructor. - void setCenterX(PassRefPtrWillBeRawPtr<CSSValue> centerX) { m_centerX = centerX; } - void setCenterY(PassRefPtrWillBeRawPtr<CSSValue> centerY) { m_centerY = centerY; } - void setRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_radius = radius; } + void setCenterX(RawPtr<CSSValue> centerX) { m_centerX = centerX; } + void setCenterY(RawPtr<CSSValue> centerY) { m_centerY = centerY; } + void setRadius(RawPtr<CSSPrimitiveValue> radius) { m_radius = radius; } DECLARE_TRACE_AFTER_DISPATCH(); @@ -63,14 +63,14 @@ : CSSValue(BasicShapeCircleClass) { } - RefPtrWillBeMember<CSSValue> m_centerX; - RefPtrWillBeMember<CSSValue> m_centerY; - RefPtrWillBeMember<CSSPrimitiveValue> m_radius; + Member<CSSValue> m_centerX; + Member<CSSValue> m_centerY; + Member<CSSPrimitiveValue> m_radius; }; class CSSBasicShapeEllipseValue final : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSBasicShapeEllipseValue> create() { return adoptRefWillBeNoop(new CSSBasicShapeEllipseValue); } + static RawPtr<CSSBasicShapeEllipseValue> create() { return adoptRefWillBeNoop(new CSSBasicShapeEllipseValue); } String customCSSText() const; bool equals(const CSSBasicShapeEllipseValue&) const; @@ -81,10 +81,10 @@ CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); } // TODO(sashab): Remove these and pass them as arguments in the constructor. - void setCenterX(PassRefPtrWillBeRawPtr<CSSValue> centerX) { m_centerX = centerX; } - void setCenterY(PassRefPtrWillBeRawPtr<CSSValue> centerY) { m_centerY = centerY; } - void setRadiusX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; } - void setRadiusY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY; } + void setCenterX(RawPtr<CSSValue> centerX) { m_centerX = centerX; } + void setCenterY(RawPtr<CSSValue> centerY) { m_centerY = centerY; } + void setRadiusX(RawPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; } + void setRadiusY(RawPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY; } DECLARE_TRACE_AFTER_DISPATCH(); @@ -93,25 +93,25 @@ : CSSValue(BasicShapeEllipseClass) { } - RefPtrWillBeMember<CSSValue> m_centerX; - RefPtrWillBeMember<CSSValue> m_centerY; - RefPtrWillBeMember<CSSPrimitiveValue> m_radiusX; - RefPtrWillBeMember<CSSPrimitiveValue> m_radiusY; + Member<CSSValue> m_centerX; + Member<CSSValue> m_centerY; + Member<CSSPrimitiveValue> m_radiusX; + Member<CSSPrimitiveValue> m_radiusY; }; class CSSBasicShapePolygonValue final : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSBasicShapePolygonValue> create() { return adoptRefWillBeNoop(new CSSBasicShapePolygonValue); } + static RawPtr<CSSBasicShapePolygonValue> create() { return adoptRefWillBeNoop(new CSSBasicShapePolygonValue); } - void appendPoint(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> x, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> y) + void appendPoint(RawPtr<CSSPrimitiveValue> x, RawPtr<CSSPrimitiveValue> y) { m_values.append(x); m_values.append(y); } - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> getXAt(unsigned i) const { return m_values.at(i * 2); } - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> getYAt(unsigned i) const { return m_values.at(i * 2 + 1); } - const WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>>& values() const { return m_values; } + RawPtr<CSSPrimitiveValue> getXAt(unsigned i) const { return m_values.at(i * 2); } + RawPtr<CSSPrimitiveValue> getYAt(unsigned i) const { return m_values.at(i * 2 + 1); } + const HeapVector<Member<CSSPrimitiveValue>>& values() const { return m_values; } // TODO(sashab): Remove this and pass it as an argument in the constructor. void setWindRule(WindRule w) { m_windRule = w; } @@ -128,13 +128,13 @@ m_windRule(RULE_NONZERO) { } - WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>> m_values; + HeapVector<Member<CSSPrimitiveValue>> m_values; WindRule m_windRule; }; class CSSBasicShapeInsetValue final : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSBasicShapeInsetValue> create() { return adoptRefWillBeNoop(new CSSBasicShapeInsetValue); } + static RawPtr<CSSBasicShapeInsetValue> create() { return adoptRefWillBeNoop(new CSSBasicShapeInsetValue); } CSSPrimitiveValue* top() const { return m_top.get(); } CSSPrimitiveValue* right() const { return m_right.get(); } @@ -147,10 +147,10 @@ CSSValuePair* bottomLeftRadius() const { return m_bottomLeftRadius.get(); } // TODO(sashab): Remove these and pass them as arguments in the constructor. - void setTop(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> top) { m_top = top; } - void setRight(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> right) { m_right = right; } - void setBottom(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> bottom) { m_bottom = bottom; } - void setLeft(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> left) { m_left = left; } + void setTop(RawPtr<CSSPrimitiveValue> top) { m_top = top; } + void setRight(RawPtr<CSSPrimitiveValue> right) { m_right = right; } + void setBottom(RawPtr<CSSPrimitiveValue> bottom) { m_bottom = bottom; } + void setLeft(RawPtr<CSSPrimitiveValue> left) { m_left = left; } void updateShapeSize4Values(CSSPrimitiveValue* top, CSSPrimitiveValue* right, CSSPrimitiveValue* bottom, CSSPrimitiveValue* left) { @@ -175,10 +175,10 @@ updateShapeSize4Values(value1, value2, value3, value2); } - void setTopLeftRadius(PassRefPtrWillBeRawPtr<CSSValuePair> radius) { m_topLeftRadius = radius; } - void setTopRightRadius(PassRefPtrWillBeRawPtr<CSSValuePair> radius) { m_topRightRadius = radius; } - void setBottomRightRadius(PassRefPtrWillBeRawPtr<CSSValuePair> radius) { m_bottomRightRadius = radius; } - void setBottomLeftRadius(PassRefPtrWillBeRawPtr<CSSValuePair> radius) { m_bottomLeftRadius = radius; } + void setTopLeftRadius(RawPtr<CSSValuePair> radius) { m_topLeftRadius = radius; } + void setTopRightRadius(RawPtr<CSSValuePair> radius) { m_topRightRadius = radius; } + void setBottomRightRadius(RawPtr<CSSValuePair> radius) { m_bottomRightRadius = radius; } + void setBottomLeftRadius(RawPtr<CSSValuePair> radius) { m_bottomLeftRadius = radius; } String customCSSText() const; bool equals(const CSSBasicShapeInsetValue&) const; @@ -190,15 +190,15 @@ : CSSValue(BasicShapeInsetClass) { } - RefPtrWillBeMember<CSSPrimitiveValue> m_top; - RefPtrWillBeMember<CSSPrimitiveValue> m_right; - RefPtrWillBeMember<CSSPrimitiveValue> m_bottom; - RefPtrWillBeMember<CSSPrimitiveValue> m_left; + Member<CSSPrimitiveValue> m_top; + Member<CSSPrimitiveValue> m_right; + Member<CSSPrimitiveValue> m_bottom; + Member<CSSPrimitiveValue> m_left; - RefPtrWillBeMember<CSSValuePair> m_topLeftRadius; - RefPtrWillBeMember<CSSValuePair> m_topRightRadius; - RefPtrWillBeMember<CSSValuePair> m_bottomRightRadius; - RefPtrWillBeMember<CSSValuePair> m_bottomLeftRadius; + Member<CSSValuePair> m_topLeftRadius; + Member<CSSValuePair> m_topRightRadius; + Member<CSSValuePair> m_bottomRightRadius; + Member<CSSValuePair> m_bottomLeftRadius; }; DEFINE_CSS_VALUE_TYPE_CASTS(CSSBasicShapeCircleValue, isBasicShapeCircleValue());
diff --git a/third_party/WebKit/Source/core/css/CSSBorderImage.cpp b/third_party/WebKit/Source/core/css/CSSBorderImage.cpp index d1244391..59717db 100644 --- a/third_party/WebKit/Source/core/css/CSSBorderImage.cpp +++ b/third_party/WebKit/Source/core/css/CSSBorderImage.cpp
@@ -21,15 +21,15 @@ namespace blink { -PassRefPtrWillBeRawPtr<CSSValueList> createBorderImageValue(PassRefPtrWillBeRawPtr<CSSValue> image, PassRefPtrWillBeRawPtr<CSSValue> imageSlice, - PassRefPtrWillBeRawPtr<CSSValue> borderSlice, PassRefPtrWillBeRawPtr<CSSValue> outset, PassRefPtrWillBeRawPtr<CSSValue> repeat) +RawPtr<CSSValueList> createBorderImageValue(RawPtr<CSSValue> image, RawPtr<CSSValue> imageSlice, + RawPtr<CSSValue> borderSlice, RawPtr<CSSValue> outset, RawPtr<CSSValue> repeat) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (image) list->append(image); if (borderSlice || outset) { - RefPtrWillBeRawPtr<CSSValueList> listSlash = CSSValueList::createSlashSeparated(); + RawPtr<CSSValueList> listSlash = CSSValueList::createSlashSeparated(); if (imageSlice) listSlash->append(imageSlice);
diff --git a/third_party/WebKit/Source/core/css/CSSBorderImage.h b/third_party/WebKit/Source/core/css/CSSBorderImage.h index c0d8710..da1a179 100644 --- a/third_party/WebKit/Source/core/css/CSSBorderImage.h +++ b/third_party/WebKit/Source/core/css/CSSBorderImage.h
@@ -26,8 +26,8 @@ namespace blink { -PassRefPtrWillBeRawPtr<CSSValueList> createBorderImageValue(PassRefPtrWillBeRawPtr<CSSValue> image, PassRefPtrWillBeRawPtr<CSSValue> imageSlice, PassRefPtrWillBeRawPtr<CSSValue> borderSlice, - PassRefPtrWillBeRawPtr<CSSValue> outset, PassRefPtrWillBeRawPtr<CSSValue> repeat); +RawPtr<CSSValueList> createBorderImageValue(RawPtr<CSSValue> image, RawPtr<CSSValue> imageSlice, RawPtr<CSSValue> borderSlice, + RawPtr<CSSValue> outset, RawPtr<CSSValue> repeat); } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.cpp b/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.cpp index 089f4d8..cb7018b 100644 --- a/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.cpp
@@ -29,7 +29,7 @@ namespace blink { -CSSBorderImageSliceValue::CSSBorderImageSliceValue(PassRefPtrWillBeRawPtr<CSSQuadValue> slices, bool fill) +CSSBorderImageSliceValue::CSSBorderImageSliceValue(RawPtr<CSSQuadValue> slices, bool fill) : CSSValue(BorderImageSliceClass) , m_slices(slices) , m_fill(fill)
diff --git a/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.h b/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.h index 2f05397..3329b58 100644 --- a/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.h +++ b/third_party/WebKit/Source/core/css/CSSBorderImageSliceValue.h
@@ -34,9 +34,9 @@ class CSSBorderImageSliceValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSBorderImageSliceValue> create(PassRefPtrWillBeRawPtr<CSSQuadValue> slices, bool fill) + static RawPtr<CSSBorderImageSliceValue> create(RawPtr<CSSQuadValue> slices, bool fill) { - return adoptRefWillBeNoop(new CSSBorderImageSliceValue(slices, fill)); + return new CSSBorderImageSliceValue(slices, fill); } String customCSSText() const; @@ -49,11 +49,11 @@ DECLARE_TRACE_AFTER_DISPATCH(); private: - CSSBorderImageSliceValue(PassRefPtrWillBeRawPtr<CSSQuadValue> slices, bool fill); + CSSBorderImageSliceValue(RawPtr<CSSQuadValue> slices, bool fill); // These four values are used to make "cuts" in the border image. They can be numbers // or percentages. - RefPtrWillBeMember<CSSQuadValue> m_slices; + Member<CSSQuadValue> m_slices; bool m_fill; };
diff --git a/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp b/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp index c6d29834..58f4167 100644 --- a/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
@@ -170,22 +170,19 @@ return clampToPermittedRange(m_expression->computeLengthPx(conversionData)); } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(CSSCalcExpressionNode) - class CSSCalcPrimitiveValue final : public CSSCalcExpressionNode { - USING_FAST_MALLOC_WILL_BE_REMOVED(CSSCalcPrimitiveValue); public: - static PassRefPtrWillBeRawPtr<CSSCalcPrimitiveValue> create(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> value, bool isInteger) + static RawPtr<CSSCalcPrimitiveValue> create(RawPtr<CSSPrimitiveValue> value, bool isInteger) { - return adoptRefWillBeNoop(new CSSCalcPrimitiveValue(value, isInteger)); + return new CSSCalcPrimitiveValue(value, isInteger); } - static PassRefPtrWillBeRawPtr<CSSCalcPrimitiveValue> create(double value, CSSPrimitiveValue::UnitType type, bool isInteger) + static RawPtr<CSSCalcPrimitiveValue> create(double value, CSSPrimitiveValue::UnitType type, bool isInteger) { if (std::isnan(value) || std::isinf(value)) return nullptr; - return adoptRefWillBeNoop(new CSSCalcPrimitiveValue(CSSPrimitiveValue::create(value, type).get(), isInteger)); + return new CSSCalcPrimitiveValue(CSSPrimitiveValue::create(value, type).get(), isInteger); } bool isZero() const override @@ -270,13 +267,13 @@ } private: - CSSCalcPrimitiveValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> value, bool isInteger) + CSSCalcPrimitiveValue(RawPtr<CSSPrimitiveValue> value, bool isInteger) : CSSCalcExpressionNode(unitCategory(value->typeWithCalcResolved()), isInteger) , m_value(value) { } - RefPtrWillBeMember<CSSPrimitiveValue> m_value; + Member<CSSPrimitiveValue> m_value; }; static const CalculationCategory addSubtractResult[CalcOther][CalcOther] = { @@ -327,7 +324,7 @@ class CSSCalcBinaryOperation final : public CSSCalcExpressionNode { public: - static PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> create(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> leftSide, PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> rightSide, CalcOperator op) + static RawPtr<CSSCalcExpressionNode> create(RawPtr<CSSCalcExpressionNode> leftSide, RawPtr<CSSCalcExpressionNode> rightSide, CalcOperator op) { ASSERT(leftSide->category() != CalcOther && rightSide->category() != CalcOther); @@ -335,10 +332,10 @@ if (newCategory == CalcOther) return nullptr; - return adoptRefWillBeNoop(new CSSCalcBinaryOperation(leftSide, rightSide, op, newCategory)); + return new CSSCalcBinaryOperation(leftSide, rightSide, op, newCategory); } - static PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> createSimplified(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> leftSide, PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> rightSide, CalcOperator op) + static RawPtr<CSSCalcExpressionNode> createSimplified(RawPtr<CSSCalcExpressionNode> leftSide, RawPtr<CSSCalcExpressionNode> rightSide, CalcOperator op) { CalculationCategory leftCategory = leftSide->category(); CalculationCategory rightCategory = rightSide->category(); @@ -537,7 +534,7 @@ } private: - CSSCalcBinaryOperation(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> leftSide, PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> rightSide, CalcOperator op, CalculationCategory category) + CSSCalcBinaryOperation(RawPtr<CSSCalcExpressionNode> leftSide, RawPtr<CSSCalcExpressionNode> rightSide, CalcOperator op, CalculationCategory category) : CSSCalcExpressionNode(category, isIntegerResult(leftSide.get(), rightSide.get(), op)) , m_leftSide(leftSide) , m_rightSide(rightSide) @@ -576,8 +573,8 @@ return 0; } - const RefPtrWillBeMember<CSSCalcExpressionNode> m_leftSide; - const RefPtrWillBeMember<CSSCalcExpressionNode> m_rightSide; + const Member<CSSCalcExpressionNode> m_leftSide; + const Member<CSSCalcExpressionNode> m_rightSide; const CalcOperator m_operator; }; @@ -594,7 +591,7 @@ class CSSCalcExpressionNodeParser { STACK_ALLOCATED(); public: - PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> parseCalc(CSSParserTokenRange tokens) + RawPtr<CSSCalcExpressionNode> parseCalc(CSSParserTokenRange tokens) { Value result; tokens.consumeWhitespace(); @@ -608,7 +605,7 @@ struct Value { STACK_ALLOCATED(); public: - RefPtrWillBeMember<CSSCalcExpressionNode> value; + Member<CSSCalcExpressionNode> value; }; char operatorValue(const CSSParserToken& token) @@ -712,17 +709,17 @@ } }; -PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> CSSCalcValue::createExpressionNode(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> value, bool isInteger) +RawPtr<CSSCalcExpressionNode> CSSCalcValue::createExpressionNode(RawPtr<CSSPrimitiveValue> value, bool isInteger) { return CSSCalcPrimitiveValue::create(value, isInteger); } -PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> CSSCalcValue::createExpressionNode(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> leftSide, PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> rightSide, CalcOperator op) +RawPtr<CSSCalcExpressionNode> CSSCalcValue::createExpressionNode(RawPtr<CSSCalcExpressionNode> leftSide, RawPtr<CSSCalcExpressionNode> rightSide, CalcOperator op) { return CSSCalcBinaryOperation::create(leftSide, rightSide, op); } -PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> CSSCalcValue::createExpressionNode(double pixels, double percent) +RawPtr<CSSCalcExpressionNode> CSSCalcValue::createExpressionNode(double pixels, double percent) { return createExpressionNode( createExpressionNode(CSSPrimitiveValue::create(pixels, CSSPrimitiveValue::UnitType::Pixels), pixels == trunc(pixels)), @@ -730,17 +727,17 @@ CalcAdd); } -PassRefPtrWillBeRawPtr<CSSCalcValue> CSSCalcValue::create(const CSSParserTokenRange& tokens, ValueRange range) +RawPtr<CSSCalcValue> CSSCalcValue::create(const CSSParserTokenRange& tokens, ValueRange range) { CSSCalcExpressionNodeParser parser; - RefPtrWillBeRawPtr<CSSCalcExpressionNode> expression = parser.parseCalc(tokens); + RawPtr<CSSCalcExpressionNode> expression = parser.parseCalc(tokens); - return expression ? adoptRefWillBeNoop(new CSSCalcValue(expression, range)) : nullptr; + return expression ? new CSSCalcValue(expression, range) : nullptr; } -PassRefPtrWillBeRawPtr<CSSCalcValue> CSSCalcValue::create(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> expression, ValueRange range) +RawPtr<CSSCalcValue> CSSCalcValue::create(RawPtr<CSSCalcExpressionNode> expression, ValueRange range) { - return adoptRefWillBeNoop(new CSSCalcValue(expression, range)); + return new CSSCalcValue(expression, range); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSCalculationValue.h b/third_party/WebKit/Source/core/css/CSSCalculationValue.h index 8ce1549..5a0feaae 100644 --- a/third_party/WebKit/Source/core/css/CSSCalculationValue.h +++ b/third_party/WebKit/Source/core/css/CSSCalculationValue.h
@@ -65,8 +65,7 @@ CalcOther }; -class CSSCalcExpressionNode : public RefCountedWillBeGarbageCollected<CSSCalcExpressionNode> { - DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(CSSCalcExpressionNode); +class CSSCalcExpressionNode : public GarbageCollected<CSSCalcExpressionNode> { public: enum Type { CssCalcPrimitiveValue = 1, @@ -100,14 +99,14 @@ bool m_isInteger; }; -class CORE_EXPORT CSSCalcValue : public RefCountedWillBeGarbageCollected<CSSCalcValue> { +class CORE_EXPORT CSSCalcValue : public GarbageCollected<CSSCalcValue> { public: - static PassRefPtrWillBeRawPtr<CSSCalcValue> create(const CSSParserTokenRange&, ValueRange); - static PassRefPtrWillBeRawPtr<CSSCalcValue> create(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode>, ValueRange = ValueRangeAll); + static RawPtr<CSSCalcValue> create(const CSSParserTokenRange&, ValueRange); + static RawPtr<CSSCalcValue> create(RawPtr<CSSCalcExpressionNode>, ValueRange = ValueRangeAll); - static PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> createExpressionNode(PassRefPtrWillBeRawPtr<CSSPrimitiveValue>, bool isInteger = false); - static PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> createExpressionNode(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode>, PassRefPtrWillBeRawPtr<CSSCalcExpressionNode>, CalcOperator); - static PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> createExpressionNode(double pixels, double percent); + static RawPtr<CSSCalcExpressionNode> createExpressionNode(RawPtr<CSSPrimitiveValue>, bool isInteger = false); + static RawPtr<CSSCalcExpressionNode> createExpressionNode(RawPtr<CSSCalcExpressionNode>, RawPtr<CSSCalcExpressionNode>, CalcOperator); + static RawPtr<CSSCalcExpressionNode> createExpressionNode(double pixels, double percent); PassRefPtr<CalculationValue> toCalcValue(const CSSToLengthConversionData& conversionData) const { @@ -133,7 +132,7 @@ } private: - CSSCalcValue(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> expression, ValueRange range) + CSSCalcValue(RawPtr<CSSCalcExpressionNode> expression, ValueRange range) : m_expression(expression) , m_nonNegative(range == ValueRangeNonNegative) { @@ -141,7 +140,7 @@ double clampToPermittedRange(double) const; - const RefPtrWillBeMember<CSSCalcExpressionNode> m_expression; + const Member<CSSCalcExpressionNode> m_expression; const bool m_nonNegative; };
diff --git a/third_party/WebKit/Source/core/css/CSSCalculationValueTest.cpp b/third_party/WebKit/Source/core/css/CSSCalculationValueTest.cpp index 0b0810bc..e1262d13 100644 --- a/third_party/WebKit/Source/core/css/CSSCalculationValueTest.cpp +++ b/third_party/WebKit/Source/core/css/CSSCalculationValueTest.cpp
@@ -47,7 +47,7 @@ namespace { -void testAccumulatePixelsAndPercent(const CSSToLengthConversionData& conversionData, PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> expression, float expectedPixels, float expectedPercent) +void testAccumulatePixelsAndPercent(const CSSToLengthConversionData& conversionData, RawPtr<CSSCalcExpressionNode> expression, float expectedPixels, float expectedPercent) { PixelsAndPercent value(0, 0); expression->accumulatePixelsAndPercent(conversionData, value); @@ -65,7 +65,7 @@ CSSLengthArray& setLengthArray(CSSLengthArray& lengthArray, String text) { initLengthArray(lengthArray); - RefPtrWillBeRawPtr<MutableStylePropertySet> propertySet = MutableStylePropertySet::create(HTMLQuirksMode); + RawPtr<MutableStylePropertySet> propertySet = MutableStylePropertySet::create(HTMLQuirksMode); propertySet->setProperty(CSSPropertyLeft, text); toCSSPrimitiveValue(propertySet->getPropertyCSSValue(CSSPropertyLeft).get())->accumulateLengthArray(lengthArray); return lengthArray;
diff --git a/third_party/WebKit/Source/core/css/CSSColorValue.h b/third_party/WebKit/Source/core/css/CSSColorValue.h index 6b7ce222f..21e6f518 100644 --- a/third_party/WebKit/Source/core/css/CSSColorValue.h +++ b/third_party/WebKit/Source/core/css/CSSColorValue.h
@@ -14,9 +14,9 @@ // Represents the non-keyword subset of <color>. class CSSColorValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSColorValue> create(Color color) + static RawPtr<CSSColorValue> create(Color color) { - return adoptRefWillBeNoop(new CSSColorValue(color)); + return new CSSColorValue(color); } String customCSSText() const
diff --git a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp index 41913fa1..952f98e 100644 --- a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp +++ b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -349,7 +349,7 @@ return properties; } -CSSComputedStyleDeclaration::CSSComputedStyleDeclaration(PassRefPtrWillBeRawPtr<Node> n, bool allowVisitedStyle, const String& pseudoElementName) +CSSComputedStyleDeclaration::CSSComputedStyleDeclaration(RawPtr<Node> n, bool allowVisitedStyle, const String& pseudoElementName) : m_node(n) , m_allowVisitedStyle(allowVisitedStyle) #if !ENABLE(OILPAN) @@ -408,12 +408,12 @@ return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1); } -inline static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(double value, const ComputedStyle& style) +inline static RawPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(double value, const ComputedStyle& style) { return cssValuePool().createValue(adjustFloatForAbsoluteZoom(value, style), CSSPrimitiveValue::UnitType::Pixels); } -PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword() const +RawPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword() const { if (!m_node) return nullptr; @@ -526,7 +526,7 @@ return m_node.get(); } -PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(AtomicString customPropertyName) const +RawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(AtomicString customPropertyName) const { const ComputedStyle* style = computeComputedStyle(); if (!style) @@ -542,7 +542,7 @@ return ComputedStyleCSSValueMapping::getVariables(*style); } -PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID) const +RawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID) const { Node* styledNode = this->styledNode(); if (!styledNode) @@ -575,7 +575,7 @@ if (!style) return nullptr; - RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(propertyID, *style, layoutObject, styledNode, m_allowVisitedStyle); + RawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(propertyID, *style, layoutObject, styledNode, m_allowVisitedStyle); if (value) return value; @@ -585,7 +585,7 @@ String CSSComputedStyleDeclaration::getPropertyValue(CSSPropertyID propertyID) const { - RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID); + RawPtr<CSSValue> value = getPropertyCSSValue(propertyID); if (value) return value->cssText(); return ""; @@ -619,21 +619,21 @@ return true; } } - RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID); + RawPtr<CSSValue> value = getPropertyCSSValue(propertyID); return value && propertyValue && value->equals(*propertyValue); } -PassRefPtrWillBeRawPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyProperties() const +RawPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyProperties() const { return copyPropertiesInSet(computableProperties()); } -PassRefPtrWillBeRawPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyPropertiesInSet(const Vector<CSSPropertyID>& properties) const +RawPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyPropertiesInSet(const Vector<CSSPropertyID>& properties) const { - WillBeHeapVector<CSSProperty, 256> list; + HeapVector<CSSProperty, 256> list; list.reserveInitialCapacity(properties.size()); for (unsigned i = 0; i < properties.size(); ++i) { - RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(properties[i]); + RawPtr<CSSValue> value = getPropertyCSSValue(properties[i]); if (value) list.append(CSSProperty(properties[i], value.release(), false)); } @@ -650,7 +650,7 @@ CSSPropertyID propertyID = cssPropertyID(propertyName); if (!propertyID) { if (RuntimeEnabledFeatures::cssVariablesEnabled() && CSSVariableParser::isValidVariableName(propertyName)) { - RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(AtomicString(propertyName)); + RawPtr<CSSValue> value = getPropertyCSSValue(AtomicString(propertyName)); if (value) return value->cssText(); } @@ -687,7 +687,7 @@ return String(); } -PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID) +RawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID) { return getPropertyCSSValue(propertyID); }
diff --git a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h index 55f312a..d17d52af 100644 --- a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h +++ b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h
@@ -47,9 +47,9 @@ class CORE_EXPORT CSSComputedStyleDeclaration final : public CSSStyleDeclaration { public: - static PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> create(PassRefPtrWillBeRawPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String()) + static RawPtr<CSSComputedStyleDeclaration> create(RawPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String()) { - return adoptRefWillBeNoop(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName)); + return new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName); } ~CSSComputedStyleDeclaration() override; @@ -61,21 +61,21 @@ String getPropertyValue(CSSPropertyID) const; bool getPropertyPriority(CSSPropertyID) const; - PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyProperties() const; + RawPtr<MutableStylePropertySet> copyProperties() const; - PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; - PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValue(AtomicString customPropertyName) const; + RawPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; + RawPtr<CSSValue> getPropertyCSSValue(AtomicString customPropertyName) const; const HashMap<AtomicString, RefPtr<CSSVariableData>>* getVariables() const; - PassRefPtrWillBeRawPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() const; + RawPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() const; bool isMonospaceFont() const; - PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyPropertiesInSet(const Vector<CSSPropertyID>&) const; + RawPtr<MutableStylePropertySet> copyPropertiesInSet(const Vector<CSSPropertyID>&) const; DECLARE_VIRTUAL_TRACE(); private: - CSSComputedStyleDeclaration(PassRefPtrWillBeRawPtr<Node>, bool allowVisitedStyle, const String&); + CSSComputedStyleDeclaration(RawPtr<Node>, bool allowVisitedStyle, const String&); // The styled node is either the node passed into getComputedStyle, or the // PseudoElement for :before and :after if they exist. @@ -99,13 +99,13 @@ void setCSSFloat(const String&, ExceptionState&); String cssText() const override; void setCSSText(const String&, ExceptionState&) override; - PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) override; + RawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) override; String getPropertyValueInternal(CSSPropertyID) override; void setPropertyInternal(CSSPropertyID, const String& customPropertyName, const String& value, bool important, ExceptionState&) override; bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const override; - RefPtrWillBeMember<Node> m_node; + Member<Node> m_node; PseudoId m_pseudoElementSpecifier; bool m_allowVisitedStyle; #if !ENABLE(OILPAN)
diff --git a/third_party/WebKit/Source/core/css/CSSContentDistributionValue.cpp b/third_party/WebKit/Source/core/css/CSSContentDistributionValue.cpp index 9f0d0b8..fa7bd819 100644 --- a/third_party/WebKit/Source/core/css/CSSContentDistributionValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSContentDistributionValue.cpp
@@ -23,7 +23,7 @@ String CSSContentDistributionValue::customCSSText() const { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (m_distribution != CSSValueInvalid) list->append(distribution());
diff --git a/third_party/WebKit/Source/core/css/CSSContentDistributionValue.h b/third_party/WebKit/Source/core/css/CSSContentDistributionValue.h index ba5590b..d6fe0b29 100644 --- a/third_party/WebKit/Source/core/css/CSSContentDistributionValue.h +++ b/third_party/WebKit/Source/core/css/CSSContentDistributionValue.h
@@ -13,17 +13,17 @@ class CSSContentDistributionValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSContentDistributionValue> create(CSSValueID distribution, CSSValueID position, CSSValueID overflow) + static RawPtr<CSSContentDistributionValue> create(CSSValueID distribution, CSSValueID position, CSSValueID overflow) { - return adoptRefWillBeNoop(new CSSContentDistributionValue(distribution, position, overflow)); + return new CSSContentDistributionValue(distribution, position, overflow); } ~CSSContentDistributionValue(); - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> distribution() const { return cssValuePool().createIdentifierValue(m_distribution); } + RawPtr<CSSPrimitiveValue> distribution() const { return cssValuePool().createIdentifierValue(m_distribution); } - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> position() const { return cssValuePool().createIdentifierValue(m_position); } + RawPtr<CSSPrimitiveValue> position() const { return cssValuePool().createIdentifierValue(m_position); } - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> overflow() const { return cssValuePool().createIdentifierValue(m_overflow); } + RawPtr<CSSPrimitiveValue> overflow() const { return cssValuePool().createIdentifierValue(m_overflow); } String customCSSText() const;
diff --git a/third_party/WebKit/Source/core/css/CSSCounterValue.h b/third_party/WebKit/Source/core/css/CSSCounterValue.h index 1e3f2827..fb9c4492 100644 --- a/third_party/WebKit/Source/core/css/CSSCounterValue.h +++ b/third_party/WebKit/Source/core/css/CSSCounterValue.h
@@ -30,9 +30,9 @@ class CSSCounterValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSCounterValue> create(PassRefPtrWillBeRawPtr<CSSCustomIdentValue> identifier, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle, PassRefPtrWillBeRawPtr<CSSCustomIdentValue> separator) + static RawPtr<CSSCounterValue> create(RawPtr<CSSCustomIdentValue> identifier, RawPtr<CSSPrimitiveValue> listStyle, RawPtr<CSSCustomIdentValue> separator) { - return adoptRefWillBeNoop(new CSSCounterValue(identifier, listStyle, separator)); + return new CSSCounterValue(identifier, listStyle, separator); } String identifier() const { return m_identifier->value(); } @@ -51,7 +51,7 @@ DECLARE_TRACE_AFTER_DISPATCH(); private: - CSSCounterValue(PassRefPtrWillBeRawPtr<CSSCustomIdentValue> identifier, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle, PassRefPtrWillBeRawPtr<CSSCustomIdentValue> separator) + CSSCounterValue(RawPtr<CSSCustomIdentValue> identifier, RawPtr<CSSPrimitiveValue> listStyle, RawPtr<CSSCustomIdentValue> separator) : CSSValue(CounterClass) , m_identifier(identifier) , m_listStyle(listStyle) @@ -60,9 +60,9 @@ ASSERT(m_listStyle->isValueID()); } - RefPtrWillBeMember<CSSCustomIdentValue> m_identifier; // string - RefPtrWillBeMember<CSSPrimitiveValue> m_listStyle; // ident - RefPtrWillBeMember<CSSCustomIdentValue> m_separator; // string + Member<CSSCustomIdentValue> m_identifier; // string + Member<CSSPrimitiveValue> m_listStyle; // ident + Member<CSSCustomIdentValue> m_separator; // string }; DEFINE_CSS_VALUE_TYPE_CASTS(CSSCounterValue, isCounterValue());
diff --git a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp index bf557f5..0dc1b250 100644 --- a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
@@ -102,7 +102,7 @@ return KURL(ParsedURLString, toCSSImageValue(*value).url()); } -CSSCrossfadeValue::CSSCrossfadeValue(PassRefPtrWillBeRawPtr<CSSValue> fromValue, PassRefPtrWillBeRawPtr<CSSValue> toValue, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> percentageValue) +CSSCrossfadeValue::CSSCrossfadeValue(RawPtr<CSSValue> fromValue, RawPtr<CSSValue> toValue, RawPtr<CSSPrimitiveValue> percentageValue) : CSSImageGeneratorValue(CrossfadeClass) , m_fromValue(fromValue) , m_toValue(toValue) @@ -148,12 +148,12 @@ return result.toString(); } -PassRefPtrWillBeRawPtr<CSSCrossfadeValue> CSSCrossfadeValue::valueWithURLsMadeAbsolute() +RawPtr<CSSCrossfadeValue> CSSCrossfadeValue::valueWithURLsMadeAbsolute() { - RefPtrWillBeRawPtr<CSSValue> fromValue = m_fromValue; + RawPtr<CSSValue> fromValue = m_fromValue; if (m_fromValue->isImageValue()) fromValue = toCSSImageValue(*m_fromValue).valueWithURLMadeAbsolute(); - RefPtrWillBeRawPtr<CSSValue> toValue = m_toValue; + RawPtr<CSSValue> toValue = m_toValue; if (m_toValue->isImageValue()) toValue = toCSSImageValue(*m_toValue).valueWithURLMadeAbsolute(); return CSSCrossfadeValue::create(fromValue.release(), toValue.release(), m_percentageValue); @@ -200,8 +200,8 @@ void CSSCrossfadeValue::loadSubimages(Document* document) { - RefPtrWillBeRawPtr<ImageResource> oldCachedFromImage = m_cachedFromImage; - RefPtrWillBeRawPtr<ImageResource> oldCachedToImage = m_cachedToImage; + RawPtr<ImageResource> oldCachedFromImage = m_cachedFromImage; + RawPtr<ImageResource> oldCachedToImage = m_cachedToImage; m_cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), document); m_cachedToImage = cachedImageForCSSValue(m_toValue.get(), document);
diff --git a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.h b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.h index 9839551..74026c8 100644 --- a/third_party/WebKit/Source/core/css/CSSCrossfadeValue.h +++ b/third_party/WebKit/Source/core/css/CSSCrossfadeValue.h
@@ -41,11 +41,11 @@ class CORE_EXPORT CSSCrossfadeValue final : public CSSImageGeneratorValue { friend class CrossfadeSubimageObserverProxy; - WILL_BE_USING_PRE_FINALIZER(CSSCrossfadeValue, dispose); + USING_PRE_FINALIZER(CSSCrossfadeValue, dispose); public: - static PassRefPtrWillBeRawPtr<CSSCrossfadeValue> create(PassRefPtrWillBeRawPtr<CSSValue> fromValue, PassRefPtrWillBeRawPtr<CSSValue> toValue, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> percentageValue) + static RawPtr<CSSCrossfadeValue> create(RawPtr<CSSValue> fromValue, RawPtr<CSSValue> toValue, RawPtr<CSSPrimitiveValue> percentageValue) { - return adoptRefWillBeNoop(new CSSCrossfadeValue(fromValue, toValue, percentageValue)); + return new CSSCrossfadeValue(fromValue, toValue, percentageValue); } ~CSSCrossfadeValue(); @@ -65,12 +65,12 @@ bool equals(const CSSCrossfadeValue&) const; - PassRefPtrWillBeRawPtr<CSSCrossfadeValue> valueWithURLsMadeAbsolute(); + RawPtr<CSSCrossfadeValue> valueWithURLsMadeAbsolute(); DECLARE_TRACE_AFTER_DISPATCH(); private: - CSSCrossfadeValue(PassRefPtrWillBeRawPtr<CSSValue> fromValue, PassRefPtrWillBeRawPtr<CSSValue> toValue, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> percentageValue); + CSSCrossfadeValue(RawPtr<CSSValue> fromValue, RawPtr<CSSValue> toValue, RawPtr<CSSPrimitiveValue> percentageValue); void dispose(); @@ -91,18 +91,18 @@ String debugName() const override { return "CrossfadeSubimageObserverProxy"; } void setReady(bool ready) { m_ready = ready; } private: - RawPtrWillBeMember<CSSCrossfadeValue> m_ownerValue; + Member<CSSCrossfadeValue> m_ownerValue; bool m_ready; }; void crossfadeChanged(const IntRect&); - RefPtrWillBeMember<CSSValue> m_fromValue; - RefPtrWillBeMember<CSSValue> m_toValue; - RefPtrWillBeMember<CSSPrimitiveValue> m_percentageValue; + Member<CSSValue> m_fromValue; + Member<CSSValue> m_toValue; + Member<CSSPrimitiveValue> m_percentageValue; - RefPtrWillBeMember<ImageResource> m_cachedFromImage; - RefPtrWillBeMember<ImageResource> m_cachedToImage; + Member<ImageResource> m_cachedFromImage; + Member<ImageResource> m_cachedToImage; CrossfadeSubimageObserverProxy m_crossfadeSubimageObserver; };
diff --git a/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp b/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp index ddec5260..a4d912f 100644 --- a/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp
@@ -42,7 +42,7 @@ return isSVGCursorElement(element) ? toSVGCursorElement(element) : nullptr; } -CSSCursorImageValue::CSSCursorImageValue(PassRefPtrWillBeRawPtr<CSSValue> imageValue, bool hotSpotSpecified, const IntPoint& hotSpot) +CSSCursorImageValue::CSSCursorImageValue(RawPtr<CSSValue> imageValue, bool hotSpotSpecified, const IntPoint& hotSpot) : CSSValue(CursorImageClass) , m_imageValue(imageValue) , m_hotSpotSpecified(hotSpotSpecified) @@ -144,10 +144,10 @@ // to change the URL of the CSSImageValue (which would then change behavior like cssText), // we create an alternate CSSImageValue to use. if (isSVGCursor() && document) { - RefPtrWillBeRawPtr<CSSImageValue> imageValue = toCSSImageValue(m_imageValue.get()); + RawPtr<CSSImageValue> imageValue = toCSSImageValue(m_imageValue.get()); // FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827) if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(imageValue->url(), *document)) { - RefPtrWillBeRawPtr<CSSImageValue> svgImageValue = CSSImageValue::create(document->completeURL(cursorElement->href()->currentValue()->value())); + RawPtr<CSSImageValue> svgImageValue = CSSImageValue::create(document->completeURL(cursorElement->href()->currentValue()->value())); svgImageValue->setReferrer(imageValue->referrer()); m_cachedImage = svgImageValue->cacheImage(document); return m_cachedImage.get(); @@ -166,7 +166,7 @@ bool CSSCursorImageValue::isSVGCursor() const { if (m_imageValue->isImageValue()) { - RefPtrWillBeRawPtr<CSSImageValue> imageValue = toCSSImageValue(m_imageValue.get()); + RawPtr<CSSImageValue> imageValue = toCSSImageValue(m_imageValue.get()); KURL kurl(ParsedURLString, imageValue->url()); return kurl.hasFragmentIdentifier(); }
diff --git a/third_party/WebKit/Source/core/css/CSSCursorImageValue.h b/third_party/WebKit/Source/core/css/CSSCursorImageValue.h index d68685b8..e1e8570 100644 --- a/third_party/WebKit/Source/core/css/CSSCursorImageValue.h +++ b/third_party/WebKit/Source/core/css/CSSCursorImageValue.h
@@ -32,9 +32,9 @@ class CSSCursorImageValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSCursorImageValue> create(PassRefPtrWillBeRawPtr<CSSValue> imageValue, bool hotSpotSpecified, const IntPoint& hotSpot) + static RawPtr<CSSCursorImageValue> create(RawPtr<CSSValue> imageValue, bool hotSpotSpecified, const IntPoint& hotSpot) { - return adoptRefWillBeNoop(new CSSCursorImageValue(imageValue, hotSpotSpecified, hotSpot)); + return new CSSCursorImageValue(imageValue, hotSpotSpecified, hotSpot); } ~CSSCursorImageValue(); @@ -59,18 +59,18 @@ DECLARE_TRACE_AFTER_DISPATCH(); private: - CSSCursorImageValue(PassRefPtrWillBeRawPtr<CSSValue> imageValue, bool hotSpotSpecified, const IntPoint& hotSpot); + CSSCursorImageValue(RawPtr<CSSValue> imageValue, bool hotSpotSpecified, const IntPoint& hotSpot); bool isSVGCursor() const; String cachedImageURL(); void clearImageResource(); - RefPtrWillBeMember<CSSValue> m_imageValue; + Member<CSSValue> m_imageValue; bool m_hotSpotSpecified; IntPoint m_hotSpot; bool m_isCachePending; - RefPtrWillBeMember<StyleImage> m_cachedImage; + Member<StyleImage> m_cachedImage; #if !ENABLE(OILPAN) HashSet<SVGElement*> m_referencedElements;
diff --git a/third_party/WebKit/Source/core/css/CSSCustomFontData.h b/third_party/WebKit/Source/core/css/CSSCustomFontData.h index 227adfcd..d8be8de23 100644 --- a/third_party/WebKit/Source/core/css/CSSCustomFontData.h +++ b/third_party/WebKit/Source/core/css/CSSCustomFontData.h
@@ -69,7 +69,7 @@ // TODO(Oilpan): consider moving (Custom)FontFace hierarchy to the heap, // thereby making this reference a Member<>. - RawPtrWillBeWeakPersistent<RemoteFontFaceSource> m_fontFaceSource; + WeakPersistent<RemoteFontFaceSource> m_fontFaceSource; FallbackVisibility m_fallbackVisibility; mutable bool m_isLoading; };
diff --git a/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h b/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h index df4cce1..835eb70 100644 --- a/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h +++ b/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h
@@ -14,15 +14,15 @@ class CSSCustomIdentValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSCustomIdentValue> create(const String& str) + static RawPtr<CSSCustomIdentValue> create(const String& str) { - return adoptRefWillBeNoop(new CSSCustomIdentValue(str)); + return new CSSCustomIdentValue(str); } // TODO(sashab, timloh): Remove this and lazily parse the CSSPropertyID in isKnownPropertyID(). - static PassRefPtrWillBeRawPtr<CSSCustomIdentValue> create(CSSPropertyID id) + static RawPtr<CSSCustomIdentValue> create(CSSPropertyID id) { - return adoptRefWillBeNoop(new CSSCustomIdentValue(id)); + return new CSSCustomIdentValue(id); } String value() const { ASSERT(!isKnownPropertyID()); return m_string; }
diff --git a/third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.h b/third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.h index 22dc8cd..392ecf6 100644 --- a/third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.h +++ b/third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.h
@@ -14,14 +14,14 @@ class CSSCustomPropertyDeclaration : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSCustomPropertyDeclaration> create(const AtomicString& name, PassRefPtr<CSSVariableData> value) + static RawPtr<CSSCustomPropertyDeclaration> create(const AtomicString& name, PassRefPtr<CSSVariableData> value) { - return adoptRefWillBeNoop(new CSSCustomPropertyDeclaration(name, value)); + return new CSSCustomPropertyDeclaration(name, value); } - static PassRefPtrWillBeRawPtr<CSSCustomPropertyDeclaration> create(const AtomicString& name, CSSValueID id) + static RawPtr<CSSCustomPropertyDeclaration> create(const AtomicString& name, CSSValueID id) { - return adoptRefWillBeNoop(new CSSCustomPropertyDeclaration(name, id)); + return new CSSCustomPropertyDeclaration(name, id); } const AtomicString& name() const { return m_name; }
diff --git a/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp b/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp index 24758d995..70c17aa3 100644 --- a/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp +++ b/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
@@ -45,25 +45,25 @@ CSSDefaultStyleSheets& CSSDefaultStyleSheets::instance() { - DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<CSSDefaultStyleSheets>, cssDefaultStyleSheets, (adoptPtrWillBeNoop(new CSSDefaultStyleSheets()))); + DEFINE_STATIC_LOCAL(Persistent<CSSDefaultStyleSheets>, cssDefaultStyleSheets, (new CSSDefaultStyleSheets())); return *cssDefaultStyleSheets; } static const MediaQueryEvaluator& screenEval() { - DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<MediaQueryEvaluator>, staticScreenEval, (adoptPtrWillBeNoop (new MediaQueryEvaluator("screen")))); + DEFINE_STATIC_LOCAL(Persistent<MediaQueryEvaluator>, staticScreenEval, (new MediaQueryEvaluator("screen"))); return *staticScreenEval; } static const MediaQueryEvaluator& printEval() { - DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<MediaQueryEvaluator>, staticPrintEval, (adoptPtrWillBeNoop (new MediaQueryEvaluator("print")))); + DEFINE_STATIC_LOCAL(Persistent<MediaQueryEvaluator>, staticPrintEval, (new MediaQueryEvaluator("print"))); return *staticPrintEval; } -static PassRefPtrWillBeRawPtr<StyleSheetContents> parseUASheet(const String& str) +static RawPtr<StyleSheetContents> parseUASheet(const String& str) { - RefPtrWillBeRawPtr<StyleSheetContents> sheet = StyleSheetContents::create(CSSParserContext(UASheetMode, 0)); + RawPtr<StyleSheetContents> sheet = StyleSheetContents::create(CSSParserContext(UASheetMode, 0)); sheet->parseString(str); // User Agent stylesheets are parsed once for the lifetime of the renderer // process and are intentionally leaked. @@ -107,7 +107,7 @@ if (!m_defaultViewSourceStyle) { m_defaultViewSourceStyle = RuleSet::create(); // Loaded stylesheet is leaked on purpose. - RefPtrWillBeRawPtr<StyleSheetContents> stylesheet = parseUASheet(loadResourceAsASCIIString("view-source.css")); + RawPtr<StyleSheetContents> stylesheet = parseUASheet(loadResourceAsASCIIString("view-source.css")); m_defaultViewSourceStyle->addRulesFromSheet(stylesheet.release().leakRef(), screenEval()); } return m_defaultViewSourceStyle.get(); @@ -118,7 +118,7 @@ if (!m_defaultXHTMLMobileProfileStyle) { m_defaultXHTMLMobileProfileStyle = RuleSet::create(); // Loaded stylesheet is leaked on purpose. - RefPtrWillBeRawPtr<StyleSheetContents> stylesheet = parseUASheet(loadResourceAsASCIIString("xhtmlmp.css")); + RawPtr<StyleSheetContents> stylesheet = parseUASheet(loadResourceAsASCIIString("xhtmlmp.css")); m_defaultXHTMLMobileProfileStyle->addRulesFromSheet(stylesheet.release().leakRef(), screenEval()); } return m_defaultXHTMLMobileProfileStyle.get();
diff --git a/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.h b/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.h index 4fcef05..0b696ccc 100644 --- a/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.h +++ b/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.h
@@ -32,8 +32,7 @@ class RuleSet; class StyleSheetContents; -class CSSDefaultStyleSheets : public NoBaseWillBeGarbageCollected<CSSDefaultStyleSheets> { - USING_FAST_MALLOC_WILL_BE_REMOVED(CSSDefaultStyleSheets); +class CSSDefaultStyleSheets : public GarbageCollected<CSSDefaultStyleSheets> { WTF_MAKE_NONCOPYABLE(CSSDefaultStyleSheets); public: static CSSDefaultStyleSheets& instance(); @@ -62,20 +61,20 @@ private: CSSDefaultStyleSheets(); - OwnPtrWillBeMember<RuleSet> m_defaultStyle; - OwnPtrWillBeMember<RuleSet> m_defaultMobileViewportStyle; - OwnPtrWillBeMember<RuleSet> m_defaultQuirksStyle; - OwnPtrWillBeMember<RuleSet> m_defaultPrintStyle; - OwnPtrWillBeMember<RuleSet> m_defaultViewSourceStyle; - OwnPtrWillBeMember<RuleSet> m_defaultXHTMLMobileProfileStyle; + Member<RuleSet> m_defaultStyle; + Member<RuleSet> m_defaultMobileViewportStyle; + Member<RuleSet> m_defaultQuirksStyle; + Member<RuleSet> m_defaultPrintStyle; + Member<RuleSet> m_defaultViewSourceStyle; + Member<RuleSet> m_defaultXHTMLMobileProfileStyle; - RefPtrWillBeMember<StyleSheetContents> m_defaultStyleSheet; - RefPtrWillBeMember<StyleSheetContents> m_mobileViewportStyleSheet; - RefPtrWillBeMember<StyleSheetContents> m_quirksStyleSheet; - RefPtrWillBeMember<StyleSheetContents> m_svgStyleSheet; - RefPtrWillBeMember<StyleSheetContents> m_mathmlStyleSheet; - RefPtrWillBeMember<StyleSheetContents> m_mediaControlsStyleSheet; - RefPtrWillBeMember<StyleSheetContents> m_fullscreenStyleSheet; + Member<StyleSheetContents> m_defaultStyleSheet; + Member<StyleSheetContents> m_mobileViewportStyleSheet; + Member<StyleSheetContents> m_quirksStyleSheet; + Member<StyleSheetContents> m_svgStyleSheet; + Member<StyleSheetContents> m_mathmlStyleSheet; + Member<StyleSheetContents> m_mediaControlsStyleSheet; + Member<StyleSheetContents> m_fullscreenStyleSheet; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSFontFace.cpp b/third_party/WebKit/Source/core/css/CSSFontFace.cpp index 6faf1fd1a..402d8dd 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFace.cpp +++ b/third_party/WebKit/Source/core/css/CSSFontFace.cpp
@@ -37,7 +37,7 @@ namespace blink { -void CSSFontFace::addSource(PassOwnPtrWillBeRawPtr<CSSFontFaceSource> source) +void CSSFontFace::addSource(RawPtr<CSSFontFaceSource> source) { source->setFontFace(this); m_sources.append(source); @@ -90,7 +90,7 @@ return nullptr; while (!m_sources.isEmpty()) { - OwnPtrWillBeMember<CSSFontFaceSource>& source = m_sources.first(); + Member<CSSFontFaceSource>& source = m_sources.first(); if (RefPtr<SimpleFontData> result = source->getFontData(fontDescription)) { if (loadStatus() == FontFace::Unloaded && (source->isLoading() || source->isLoaded())) setLoadStatus(FontFace::Loading); @@ -146,7 +146,7 @@ ASSERT(loadStatus() == FontFace::Loading); while (!m_sources.isEmpty()) { - OwnPtrWillBeMember<CSSFontFaceSource>& source = m_sources.first(); + Member<CSSFontFaceSource>& source = m_sources.first(); if (source->isValid()) { if (source->isLocal()) { if (source->isLocalFontAvailable(fontDescription)) {
diff --git a/third_party/WebKit/Source/core/css/CSSFontFace.h b/third_party/WebKit/Source/core/css/CSSFontFace.h index 72d9a655..30dc846 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFace.h +++ b/third_party/WebKit/Source/core/css/CSSFontFace.h
@@ -43,8 +43,7 @@ class RemoteFontFaceSource; class SimpleFontData; -class CORE_EXPORT CSSFontFace final : public NoBaseWillBeGarbageCollectedFinalized<CSSFontFace> { - USING_FAST_MALLOC_WILL_BE_REMOVED(CSSFontFace); +class CORE_EXPORT CSSFontFace final : public GarbageCollectedFinalized<CSSFontFace> { WTF_MAKE_NONCOPYABLE(CSSFontFace); public: CSSFontFace(FontFace* fontFace, Vector<UnicodeRange>& ranges) @@ -64,7 +63,7 @@ bool isValid() const { return !m_sources.isEmpty(); } - void addSource(PassOwnPtrWillBeRawPtr<CSSFontFaceSource>); + void addSource(RawPtr<CSSFontFaceSource>); void didBeginLoad(); void fontLoaded(RemoteFontFaceSource*); @@ -86,9 +85,9 @@ void setLoadStatus(FontFace::LoadStatusType); RefPtr<UnicodeRangeSet> m_ranges; - RawPtrWillBeMember<CSSSegmentedFontFace> m_segmentedFontFace; - WillBeHeapDeque<OwnPtrWillBeMember<CSSFontFaceSource>> m_sources; - RawPtrWillBeMember<FontFace> m_fontFace; + Member<CSSSegmentedFontFace> m_segmentedFontFace; + HeapDeque<Member<CSSFontFaceSource>> m_sources; + Member<FontFace> m_fontFace; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceRule.h b/third_party/WebKit/Source/core/css/CSSFontFaceRule.h index aaa67c7..4b8315b3 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceRule.h +++ b/third_party/WebKit/Source/core/css/CSSFontFaceRule.h
@@ -34,9 +34,9 @@ class CSSFontFaceRule final : public CSSRule { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CSSFontFaceRule> create(StyleRuleFontFace* rule, CSSStyleSheet* sheet) + static RawPtr<CSSFontFaceRule> create(StyleRuleFontFace* rule, CSSStyleSheet* sheet) { - return adoptRefWillBeNoop(new CSSFontFaceRule(rule, sheet)); + return new CSSFontFaceRule(rule, sheet); } ~CSSFontFaceRule() override; @@ -55,8 +55,8 @@ CSSRule::Type type() const override { return FONT_FACE_RULE; } - RefPtrWillBeMember<StyleRuleFontFace> m_fontFaceRule; - mutable RefPtrWillBeMember<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; + Member<StyleRuleFontFace> m_fontFaceRule; + mutable Member<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; }; DEFINE_CSS_RULE_TYPE_CASTS(CSSFontFaceRule, FONT_FACE_RULE);
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSource.h b/third_party/WebKit/Source/core/css/CSSFontFaceSource.h index 5222f27..20a1f6f2 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceSource.h +++ b/third_party/WebKit/Source/core/css/CSSFontFaceSource.h
@@ -36,8 +36,7 @@ class FontDescription; class SimpleFontData; -class CSSFontFaceSource : public NoBaseWillBeGarbageCollectedFinalized<CSSFontFaceSource> { - USING_FAST_MALLOC_WILL_BE_REMOVED(CSSFontFaceSource); +class CSSFontFaceSource : public GarbageCollectedFinalized<CSSFontFaceSource> { WTF_MAKE_NONCOPYABLE(CSSFontFaceSource); public: virtual ~CSSFontFaceSource(); @@ -65,7 +64,7 @@ using FontDataTable = HashMap<unsigned, RefPtr<SimpleFontData>>; // The hash key is composed of size synthetic styles. - RawPtrWillBeMember<CSSFontFace> m_face; // Our owning font face. + Member<CSSFontFace> m_face; // Our owning font face. FontDataTable m_fontDataTable; };
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp index e037017..2703956a 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
@@ -93,7 +93,7 @@ SecurityOrigin* securityOrigin = document->getSecurityOrigin(); setCrossOriginAccessControl(request, securityOrigin); request.mutableResourceRequest().setHTTPReferrer(SecurityPolicy::generateReferrer(m_referrer.referrerPolicy, request.url(), m_referrer.referrer)); - RefPtrWillBeRawPtr<FontResource> resource = FontResource::fetch(request, document->fetcher()); + RawPtr<FontResource> resource = FontResource::fetch(request, document->fetcher()); if (!resource) return nullptr; m_fetched = FontResourceHelper::create(resource.release());
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h index 4170e54..6bae02a 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h +++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h
@@ -39,13 +39,13 @@ class CSSFontFaceSrcValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> create(const String& specifiedResource, const String& absoluteResource, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) + static RawPtr<CSSFontFaceSrcValue> create(const String& specifiedResource, const String& absoluteResource, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) { - return adoptRefWillBeNoop(new CSSFontFaceSrcValue(specifiedResource, absoluteResource, false, shouldCheckContentSecurityPolicy)); + return new CSSFontFaceSrcValue(specifiedResource, absoluteResource, false, shouldCheckContentSecurityPolicy); } - static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> createLocal(const String& absoluteResource, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) + static RawPtr<CSSFontFaceSrcValue> createLocal(const String& absoluteResource, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) { - return adoptRefWillBeNoop(new CSSFontFaceSrcValue(emptyString(), absoluteResource, true, shouldCheckContentSecurityPolicy)); + return new CSSFontFaceSrcValue(emptyString(), absoluteResource, true, shouldCheckContentSecurityPolicy); } const String& resource() const { return m_absoluteResource; } @@ -91,25 +91,25 @@ ContentSecurityPolicyDisposition m_shouldCheckContentSecurityPolicy; - class FontResourceHelper : public NoBaseWillBeGarbageCollectedFinalized<FontResourceHelper>, public ResourceOwner<FontResource> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FontResourceHelper); + class FontResourceHelper : public GarbageCollectedFinalized<FontResourceHelper>, public ResourceOwner<FontResource> { + USING_GARBAGE_COLLECTED_MIXIN(FontResourceHelper); public: - static PassOwnPtrWillBeRawPtr<FontResourceHelper> create(PassRefPtrWillBeRawPtr<FontResource> resource) + static RawPtr<FontResourceHelper> create(RawPtr<FontResource> resource) { - return adoptPtrWillBeNoop(new FontResourceHelper(resource)); + return new FontResourceHelper(resource); } DEFINE_INLINE_VIRTUAL_TRACE() { ResourceOwner<FontResource>::trace(visitor); } private: - FontResourceHelper(PassRefPtrWillBeRawPtr<FontResource> resource) + FontResourceHelper(RawPtr<FontResource> resource) { setResource(resource); } String debugName() const override { return "CSSFontFaceSrcValue::FontResourceHelper"; } }; - OwnPtrWillBeMember<FontResourceHelper> m_fetched; + Member<FontResourceHelper> m_fetched; }; DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue());
diff --git a/third_party/WebKit/Source/core/css/CSSFontFamilyValue.h b/third_party/WebKit/Source/core/css/CSSFontFamilyValue.h index 646d424a..4c4286c8 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFamilyValue.h +++ b/third_party/WebKit/Source/core/css/CSSFontFamilyValue.h
@@ -13,9 +13,9 @@ class CSSFontFamilyValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSFontFamilyValue> create(const String& str) + static RawPtr<CSSFontFamilyValue> create(const String& str) { - return adoptRefWillBeNoop(new CSSFontFamilyValue(str)); + return new CSSFontFamilyValue(str); } String value() const { return m_string; }
diff --git a/third_party/WebKit/Source/core/css/CSSFontFeatureValue.h b/third_party/WebKit/Source/core/css/CSSFontFeatureValue.h index ee27a6e..515a5bc 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFeatureValue.h +++ b/third_party/WebKit/Source/core/css/CSSFontFeatureValue.h
@@ -33,9 +33,9 @@ class CSSFontFeatureValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSFontFeatureValue> create(const AtomicString& tag, int value) + static RawPtr<CSSFontFeatureValue> create(const AtomicString& tag, int value) { - return adoptRefWillBeNoop(new CSSFontFeatureValue(tag, value)); + return new CSSFontFeatureValue(tag, value); } const AtomicString& tag() const { return m_tag; }
diff --git a/third_party/WebKit/Source/core/css/CSSFontSelector.cpp b/third_party/WebKit/Source/core/css/CSSFontSelector.cpp index 9c306a2..536c118 100644 --- a/third_party/WebKit/Source/core/css/CSSFontSelector.cpp +++ b/third_party/WebKit/Source/core/css/CSSFontSelector.cpp
@@ -81,7 +81,7 @@ { m_fontFaceCache.incrementVersion(); - WillBeHeapVector<RawPtrWillBeMember<CSSFontSelectorClient>> clients; + HeapVector<Member<CSSFontSelectorClient>> clients; copyToVector(m_clients, clients); for (auto& client : clients) client->fontsNeedUpdate(this);
diff --git a/third_party/WebKit/Source/core/css/CSSFontSelector.h b/third_party/WebKit/Source/core/css/CSSFontSelector.h index 591e1307..c62fd08 100644 --- a/third_party/WebKit/Source/core/css/CSSFontSelector.h +++ b/third_party/WebKit/Source/core/css/CSSFontSelector.h
@@ -44,9 +44,9 @@ class CORE_EXPORT CSSFontSelector : public FontSelector { public: - static PassRefPtrWillBeRawPtr<CSSFontSelector> create(Document* document) + static RawPtr<CSSFontSelector> create(Document* document) { - return adoptRefWillBeNoop(new CSSFontSelector(document)); + return new CSSFontSelector(document); } ~CSSFontSelector() override; @@ -89,12 +89,12 @@ // FIXME: Oilpan: Ideally this should just be a traced Member but that will // currently leak because ComputedStyle and its data are not on the heap. // See crbug.com/383860 for details. - RawPtrWillBeWeakMember<Document> m_document; + WeakMember<Document> m_document; // FIXME: Move to Document or StyleEngine. FontFaceCache m_fontFaceCache; - WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSFontSelectorClient>> m_clients; + HeapHashSet<WeakMember<CSSFontSelectorClient>> m_clients; - RefPtrWillBeMember<FontLoader> m_fontLoader; + Member<FontLoader> m_fontLoader; GenericFontFamilySettings m_genericFontFamilySettings; };
diff --git a/third_party/WebKit/Source/core/css/CSSFontSelectorClient.h b/third_party/WebKit/Source/core/css/CSSFontSelectorClient.h index 1eb605d..6d0e835 100644 --- a/third_party/WebKit/Source/core/css/CSSFontSelectorClient.h +++ b/third_party/WebKit/Source/core/css/CSSFontSelectorClient.h
@@ -39,7 +39,7 @@ class CSSFontSelector; class Visitor; -class CORE_EXPORT CSSFontSelectorClient : public WillBeGarbageCollectedMixin { +class CORE_EXPORT CSSFontSelectorClient : public GarbageCollectedMixin { public: virtual ~CSSFontSelectorClient() { }
diff --git a/third_party/WebKit/Source/core/css/CSSFunctionValue.h b/third_party/WebKit/Source/core/css/CSSFunctionValue.h index a99f7870..fbd0142 100644 --- a/third_party/WebKit/Source/core/css/CSSFunctionValue.h +++ b/third_party/WebKit/Source/core/css/CSSFunctionValue.h
@@ -12,9 +12,9 @@ class CSSFunctionValue : public CSSValueList { public: - static PassRefPtrWillBeRawPtr<CSSFunctionValue> create(CSSValueID id) + static RawPtr<CSSFunctionValue> create(CSSValueID id) { - return adoptRefWillBeNoop(new CSSFunctionValue(id)); + return new CSSFunctionValue(id); } String customCSSText() const;
diff --git a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp index dc50057..86e41a8 100644 --- a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
@@ -104,7 +104,7 @@ { } }; -static void replaceColorHintsWithColorStops(Vector<GradientStop>& stops, const WillBeHeapVector<CSSGradientColorStop, 2>& cssGradientStops) +static void replaceColorHintsWithColorStops(Vector<GradientStop>& stops, const HeapVector<CSSGradientColorStop, 2>& cssGradientStops) { // This algorithm will replace each color interpolation hint with 9 regular // color stops. The color values for the new color stops will be calculated @@ -573,7 +573,7 @@ return true; } -void CSSGradientValue::getStopColors(WillBeHeapVector<Color>& stopColors, const LayoutObject& object) const +void CSSGradientValue::getStopColors(HeapVector<Color>& stopColors, const LayoutObject& object) const { for (auto& stop : m_stops) { if (!stop.isHint())
diff --git a/third_party/WebKit/Source/core/css/CSSGradientValue.h b/third_party/WebKit/Source/core/css/CSSGradientValue.h index 9d23de8d..182a2cee 100644 --- a/third_party/WebKit/Source/core/css/CSSGradientValue.h +++ b/third_party/WebKit/Source/core/css/CSSGradientValue.h
@@ -58,8 +58,8 @@ DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); public: CSSGradientColorStop() : m_colorIsDerivedFromElement(false) { } - RefPtrWillBeMember<CSSPrimitiveValue> m_position; // percentage or length - RefPtrWillBeMember<CSSValue> m_color; + Member<CSSPrimitiveValue> m_position; // percentage or length + Member<CSSValue> m_color; bool m_colorIsDerivedFromElement; bool operator==(const CSSGradientColorStop& other) const { @@ -88,10 +88,10 @@ public: PassRefPtr<Image> image(const LayoutObject&, const IntSize&); - void setFirstX(PassRefPtrWillBeRawPtr<CSSValue> val) { m_firstX = val; } - void setFirstY(PassRefPtrWillBeRawPtr<CSSValue> val) { m_firstY = val; } - void setSecondX(PassRefPtrWillBeRawPtr<CSSValue> val) { m_secondX = val; } - void setSecondY(PassRefPtrWillBeRawPtr<CSSValue> val) { m_secondY = val; } + void setFirstX(RawPtr<CSSValue> val) { m_firstX = val; } + void setFirstY(RawPtr<CSSValue> val) { m_firstY = val; } + void setSecondX(RawPtr<CSSValue> val) { m_secondX = val; } + void setSecondY(RawPtr<CSSValue> val) { m_secondY = val; } void addStop(const CSSGradientColorStop& stop) { m_stops.append(stop); } @@ -111,7 +111,7 @@ void loadSubimages(Document*) { } - void getStopColors(WillBeHeapVector<Color>& stopColors, const LayoutObject&) const; + void getStopColors(HeapVector<Color>& stopColors, const LayoutObject&) const; DECLARE_TRACE_AFTER_DISPATCH(); @@ -133,14 +133,14 @@ bool isCacheable() const; // Points. Some of these may be null. - RefPtrWillBeMember<CSSValue> m_firstX; - RefPtrWillBeMember<CSSValue> m_firstY; + Member<CSSValue> m_firstX; + Member<CSSValue> m_firstY; - RefPtrWillBeMember<CSSValue> m_secondX; - RefPtrWillBeMember<CSSValue> m_secondY; + Member<CSSValue> m_secondX; + Member<CSSValue> m_secondY; // Stops - WillBeHeapVector<CSSGradientColorStop, 2> m_stops; + HeapVector<CSSGradientColorStop, 2> m_stops; bool m_stopsSorted; CSSGradientType m_gradientType; bool m_repeating; @@ -151,12 +151,12 @@ class CSSLinearGradientValue final : public CSSGradientValue { public: - static PassRefPtrWillBeRawPtr<CSSLinearGradientValue> create(CSSGradientRepeat repeat, CSSGradientType gradientType = CSSLinearGradient) + static RawPtr<CSSLinearGradientValue> create(CSSGradientRepeat repeat, CSSGradientType gradientType = CSSLinearGradient) { - return adoptRefWillBeNoop(new CSSLinearGradientValue(repeat, gradientType)); + return new CSSLinearGradientValue(repeat, gradientType); } - void setAngle(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_angle = val; } + void setAngle(RawPtr<CSSPrimitiveValue> val) { m_angle = val; } String customCSSText() const; @@ -173,28 +173,28 @@ { } - RefPtrWillBeMember<CSSPrimitiveValue> m_angle; // may be null. + Member<CSSPrimitiveValue> m_angle; // may be null. }; DEFINE_CSS_VALUE_TYPE_CASTS(CSSLinearGradientValue, isLinearGradientValue()); class CSSRadialGradientValue final : public CSSGradientValue { public: - static PassRefPtrWillBeRawPtr<CSSRadialGradientValue> create(CSSGradientRepeat repeat, CSSGradientType gradientType = CSSRadialGradient) + static RawPtr<CSSRadialGradientValue> create(CSSGradientRepeat repeat, CSSGradientType gradientType = CSSRadialGradient) { - return adoptRefWillBeNoop(new CSSRadialGradientValue(repeat, gradientType)); + return new CSSRadialGradientValue(repeat, gradientType); } String customCSSText() const; - void setFirstRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_firstRadius = val; } - void setSecondRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_secondRadius = val; } + void setFirstRadius(RawPtr<CSSPrimitiveValue> val) { m_firstRadius = val; } + void setSecondRadius(RawPtr<CSSPrimitiveValue> val) { m_secondRadius = val; } - void setShape(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_shape = val; } - void setSizingBehavior(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_sizingBehavior = val; } + void setShape(RawPtr<CSSPrimitiveValue> val) { m_shape = val; } + void setSizingBehavior(RawPtr<CSSPrimitiveValue> val) { m_sizingBehavior = val; } - void setEndHorizontalSize(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_endHorizontalSize = val; } - void setEndVerticalSize(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_endVerticalSize = val; } + void setEndHorizontalSize(RawPtr<CSSPrimitiveValue> val) { m_endHorizontalSize = val; } + void setEndVerticalSize(RawPtr<CSSPrimitiveValue> val) { m_endVerticalSize = val; } // Create the gradient for a given size. PassRefPtr<Gradient> createGradient(const CSSToLengthConversionData&, const IntSize&, const LayoutObject&); @@ -213,15 +213,15 @@ float resolveRadius(CSSPrimitiveValue*, const CSSToLengthConversionData&, float* widthOrHeight = 0); // These may be null for non-deprecated gradients. - RefPtrWillBeMember<CSSPrimitiveValue> m_firstRadius; - RefPtrWillBeMember<CSSPrimitiveValue> m_secondRadius; + Member<CSSPrimitiveValue> m_firstRadius; + Member<CSSPrimitiveValue> m_secondRadius; // The below are only used for non-deprecated gradients. Any of them may be null. - RefPtrWillBeMember<CSSPrimitiveValue> m_shape; - RefPtrWillBeMember<CSSPrimitiveValue> m_sizingBehavior; + Member<CSSPrimitiveValue> m_shape; + Member<CSSPrimitiveValue> m_sizingBehavior; - RefPtrWillBeMember<CSSPrimitiveValue> m_endHorizontalSize; - RefPtrWillBeMember<CSSPrimitiveValue> m_endVerticalSize; + Member<CSSPrimitiveValue> m_endHorizontalSize; + Member<CSSPrimitiveValue> m_endVerticalSize; }; DEFINE_CSS_VALUE_TYPE_CASTS(CSSRadialGradientValue, isRadialGradientValue());
diff --git a/third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.h b/third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.h index 1b69f935..f8074d7 100644 --- a/third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.h +++ b/third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.h
@@ -23,9 +23,9 @@ // allows us to keep the parsing algorithm almost intact. class CSSGridAutoRepeatValue : public CSSValueList { public: - static PassRefPtrWillBeRawPtr<CSSGridAutoRepeatValue> create(CSSValueID id) + static RawPtr<CSSGridAutoRepeatValue> create(CSSValueID id) { - return adoptRefWillBeNoop(new CSSGridAutoRepeatValue(id)); + return new CSSGridAutoRepeatValue(id); } String customCSSText() const;
diff --git a/third_party/WebKit/Source/core/css/CSSGridLineNamesValue.h b/third_party/WebKit/Source/core/css/CSSGridLineNamesValue.h index b85db6c..96e3a30 100644 --- a/third_party/WebKit/Source/core/css/CSSGridLineNamesValue.h +++ b/third_party/WebKit/Source/core/css/CSSGridLineNamesValue.h
@@ -38,9 +38,9 @@ class CSSGridLineNamesValue : public CSSValueList { public: - static PassRefPtrWillBeRawPtr<CSSGridLineNamesValue> create() + static RawPtr<CSSGridLineNamesValue> create() { - return adoptRefWillBeNoop(new CSSGridLineNamesValue()); + return new CSSGridLineNamesValue(); } String customCSSText() const;
diff --git a/third_party/WebKit/Source/core/css/CSSGridTemplateAreasValue.h b/third_party/WebKit/Source/core/css/CSSGridTemplateAreasValue.h index abddc472..45c6e9e 100644 --- a/third_party/WebKit/Source/core/css/CSSGridTemplateAreasValue.h +++ b/third_party/WebKit/Source/core/css/CSSGridTemplateAreasValue.h
@@ -39,9 +39,9 @@ class CSSGridTemplateAreasValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSGridTemplateAreasValue> create(const NamedGridAreaMap& gridAreaMap, size_t rowCount, size_t columnCount) + static RawPtr<CSSGridTemplateAreasValue> create(const NamedGridAreaMap& gridAreaMap, size_t rowCount, size_t columnCount) { - return adoptRefWillBeNoop(new CSSGridTemplateAreasValue(gridAreaMap, rowCount, columnCount)); + return new CSSGridTemplateAreasValue(gridAreaMap, rowCount, columnCount); } ~CSSGridTemplateAreasValue() { }
diff --git a/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp b/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp index dcfb0f0..c887679 100644 --- a/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp
@@ -69,7 +69,7 @@ CSSStyleSheet* styleSheet = parentStyleSheet(); CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); - RefPtrWillBeRawPtr<StyleRuleBase> newRule = CSSParser::parseRule(context, styleSheet ? styleSheet->contents() : nullptr, ruleString); + RawPtr<StyleRuleBase> newRule = CSSParser::parseRule(context, styleSheet ? styleSheet->contents() : nullptr, ruleString); if (!newRule) { exceptionState.throwDOMException(SyntaxError, "the rule '" + ruleString + "' is invalid and cannot be parsed."); return 0; @@ -90,7 +90,7 @@ m_groupRule->wrapperInsertRule(index, newRule); - m_childRuleCSSOMWrappers.insert(index, RefPtrWillBeMember<CSSRule>(nullptr)); + m_childRuleCSSOMWrappers.insert(index, Member<CSSRule>(nullptr)); return index; } @@ -132,7 +132,7 @@ if (index >= length()) return nullptr; ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size()); - RefPtrWillBeMember<CSSRule>& rule = m_childRuleCSSOMWrappers[index]; + Member<CSSRule>& rule = m_childRuleCSSOMWrappers[index]; if (!rule) rule = m_groupRule->childRules()[index]->createCSSOMWrapper(const_cast<CSSGroupingRule*>(this)); return rule.get();
diff --git a/third_party/WebKit/Source/core/css/CSSGroupingRule.h b/third_party/WebKit/Source/core/css/CSSGroupingRule.h index 3021d55..78a1e9e 100644 --- a/third_party/WebKit/Source/core/css/CSSGroupingRule.h +++ b/third_party/WebKit/Source/core/css/CSSGroupingRule.h
@@ -55,9 +55,9 @@ void appendCSSTextForItems(StringBuilder&) const; - RefPtrWillBeMember<StyleRuleGroup> m_groupRule; - mutable WillBeHeapVector<RefPtrWillBeMember<CSSRule>> m_childRuleCSSOMWrappers; - mutable OwnPtrWillBeMember<CSSRuleList> m_ruleListCSSOMWrapper; + Member<StyleRuleGroup> m_groupRule; + mutable HeapVector<Member<CSSRule>> m_childRuleCSSOMWrappers; + mutable Member<CSSRuleList> m_ruleListCSSOMWrapper; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp index 43981d6..be1fc8c 100644 --- a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp
@@ -65,7 +65,7 @@ } } -PassRefPtrWillBeRawPtr<CSSImageGeneratorValue> CSSImageGeneratorValue::valueWithURLsMadeAbsolute() +RawPtr<CSSImageGeneratorValue> CSSImageGeneratorValue::valueWithURLsMadeAbsolute() { if (isCrossfadeValue()) return toCSSCrossfadeValue(this)->valueWithURLsMadeAbsolute(); @@ -107,7 +107,7 @@ SizeAndCount& sizeCount = it->value; IntSize oldSize = sizeCount.size; if (oldSize != size) { - RefPtrWillBeRawPtr<CSSImageGeneratorValue> protect(this); + RawPtr<CSSImageGeneratorValue> protect(this); removeClient(layoutObject); addClient(layoutObject, size); }
diff --git a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h index 179c933c..345b8253c 100644 --- a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h +++ b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h
@@ -69,7 +69,7 @@ void loadSubimages(Document*); - PassRefPtrWillBeRawPtr<CSSImageGeneratorValue> valueWithURLsMadeAbsolute(); + RawPtr<CSSImageGeneratorValue> valueWithURLsMadeAbsolute(); DEFINE_INLINE_TRACE_AFTER_DISPATCH() { CSSValue::traceAfterDispatch(visitor); }
diff --git a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp index 29560b0..43fc1c7 100644 --- a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
@@ -122,7 +122,7 @@ if (crossOrigin != CrossOriginAttributeNotSet) request.setCrossOriginAccessControl(document->getSecurityOrigin(), crossOrigin); - if (RefPtrWillBeRawPtr<ImageResource> cachedImage = ImageResource::fetch(request, document->fetcher())) + if (RawPtr<ImageResource> cachedImage = ImageResource::fetch(request, document->fetcher())) m_cachedImage = StyleFetchedImageSet::create(cachedImage.get(), image.scaleFactor, this, request.url()); else m_cachedImage = StyleInvalidImage::create(image.imageURL); @@ -177,9 +177,9 @@ CSSValueList::traceAfterDispatch(visitor); } -PassRefPtrWillBeRawPtr<CSSImageSetValue> CSSImageSetValue::valueWithURLsMadeAbsolute() +RawPtr<CSSImageSetValue> CSSImageSetValue::valueWithURLsMadeAbsolute() { - RefPtrWillBeRawPtr<CSSImageSetValue> value = CSSImageSetValue::create(); + RawPtr<CSSImageSetValue> value = CSSImageSetValue::create(); for (auto& item : *this) item->isImageValue() ? value->append(toCSSImageValue(*item).valueWithURLMadeAbsolute()) : value->append(item); return value.release();
diff --git a/third_party/WebKit/Source/core/css/CSSImageSetValue.h b/third_party/WebKit/Source/core/css/CSSImageSetValue.h index d9c4336..55e68a02 100644 --- a/third_party/WebKit/Source/core/css/CSSImageSetValue.h +++ b/third_party/WebKit/Source/core/css/CSSImageSetValue.h
@@ -39,9 +39,9 @@ class CSSImageSetValue : public CSSValueList { public: - static PassRefPtrWillBeRawPtr<CSSImageSetValue> create() + static RawPtr<CSSImageSetValue> create() { - return adoptRefWillBeNoop(new CSSImageSetValue()); + return new CSSImageSetValue(); } ~CSSImageSetValue(); @@ -58,7 +58,7 @@ float scaleFactor; }; - PassRefPtrWillBeRawPtr<CSSImageSetValue> valueWithURLsMadeAbsolute(); + RawPtr<CSSImageSetValue> valueWithURLsMadeAbsolute(); bool hasFailedOrCanceledSubresources() const; @@ -74,7 +74,7 @@ static inline bool compareByScaleFactor(ImageWithScale first, ImageWithScale second) { return first.scaleFactor < second.scaleFactor; } float m_cachedScaleFactor; - RefPtrWillBeMember<StyleImage> m_cachedImage; + Member<StyleImage> m_cachedImage; Vector<ImageWithScale> m_imagesInSet; };
diff --git a/third_party/WebKit/Source/core/css/CSSImageValue.cpp b/third_party/WebKit/Source/core/css/CSSImageValue.cpp index db5e9ba..20d20f3f 100644 --- a/third_party/WebKit/Source/core/css/CSSImageValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSImageValue.cpp
@@ -68,7 +68,7 @@ if (crossOrigin != CrossOriginAttributeNotSet) request.setCrossOriginAccessControl(document->getSecurityOrigin(), crossOrigin); - if (RefPtrWillBeRawPtr<ImageResource> cachedImage = ImageResource::fetch(request, document->fetcher())) + if (RawPtr<ImageResource> cachedImage = ImageResource::fetch(request, document->fetcher())) m_cachedImage = StyleFetchedImage::create(cachedImage.get(), document, request.url()); }
diff --git a/third_party/WebKit/Source/core/css/CSSImageValue.h b/third_party/WebKit/Source/core/css/CSSImageValue.h index 981131e5..513421b 100644 --- a/third_party/WebKit/Source/core/css/CSSImageValue.h +++ b/third_party/WebKit/Source/core/css/CSSImageValue.h
@@ -37,21 +37,21 @@ class CORE_EXPORT CSSImageValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSImageValue> create(const KURL& url, StyleFetchedImage* image = 0) + static RawPtr<CSSImageValue> create(const KURL& url, StyleFetchedImage* image = 0) { return create(url.getString(), url, image); } - static PassRefPtrWillBeRawPtr<CSSImageValue> create(const String& rawValue, const KURL& url, StyleFetchedImage* image = 0) + static RawPtr<CSSImageValue> create(const String& rawValue, const KURL& url, StyleFetchedImage* image = 0) { return create(AtomicString(rawValue), url, image); } - static PassRefPtrWillBeRawPtr<CSSImageValue> create(const AtomicString& rawValue, const KURL& url, StyleFetchedImage* image = 0) + static RawPtr<CSSImageValue> create(const AtomicString& rawValue, const KURL& url, StyleFetchedImage* image = 0) { - return adoptRefWillBeNoop(new CSSImageValue(rawValue, url, image)); + return new CSSImageValue(rawValue, url, image); } - static PassRefPtrWillBeRawPtr<CSSImageValue> create(const AtomicString& absoluteURL) + static RawPtr<CSSImageValue> create(const AtomicString& absoluteURL) { - return adoptRefWillBeNoop(new CSSImageValue(absoluteURL)); + return new CSSImageValue(absoluteURL); } ~CSSImageValue(); @@ -74,7 +74,7 @@ bool knownToBeOpaque(const LayoutObject&) const; - PassRefPtrWillBeRawPtr<CSSImageValue> valueWithURLMadeAbsolute() + RawPtr<CSSImageValue> valueWithURLMadeAbsolute() { return create(KURL(ParsedURLString, m_absoluteURL), m_cachedImage.get()); } @@ -92,7 +92,7 @@ AtomicString m_absoluteURL; Referrer m_referrer; bool m_isCachePending; - RefPtrWillBeMember<StyleFetchedImage> m_cachedImage; + Member<StyleFetchedImage> m_cachedImage; AtomicString m_initiatorName; };
diff --git a/third_party/WebKit/Source/core/css/CSSImportRule.h b/third_party/WebKit/Source/core/css/CSSImportRule.h index 64c357c9..90c51b2 100644 --- a/third_party/WebKit/Source/core/css/CSSImportRule.h +++ b/third_party/WebKit/Source/core/css/CSSImportRule.h
@@ -33,9 +33,9 @@ class CSSImportRule final : public CSSRule { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CSSImportRule> create(StyleRuleImport* rule, CSSStyleSheet* sheet) + static RawPtr<CSSImportRule> create(StyleRuleImport* rule, CSSStyleSheet* sheet) { - return adoptRefWillBeNoop(new CSSImportRule(rule, sheet)); + return new CSSImportRule(rule, sheet); } ~CSSImportRule() override; @@ -54,9 +54,9 @@ CSSRule::Type type() const override { return IMPORT_RULE; } - RefPtrWillBeMember<StyleRuleImport> m_importRule; - mutable RefPtrWillBeMember<MediaList> m_mediaCSSOMWrapper; - mutable RefPtrWillBeMember<CSSStyleSheet> m_styleSheetCSSOMWrapper; + Member<StyleRuleImport> m_importRule; + mutable Member<MediaList> m_mediaCSSOMWrapper; + mutable Member<CSSStyleSheet> m_styleSheetCSSOMWrapper; }; DEFINE_CSS_RULE_TYPE_CASTS(CSSImportRule, IMPORT_RULE);
diff --git a/third_party/WebKit/Source/core/css/CSSInheritedValue.h b/third_party/WebKit/Source/core/css/CSSInheritedValue.h index 9bdc467..ed9b1fb 100644 --- a/third_party/WebKit/Source/core/css/CSSInheritedValue.h +++ b/third_party/WebKit/Source/core/css/CSSInheritedValue.h
@@ -28,7 +28,7 @@ class CSSInheritedValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSInheritedValue> create() + static RawPtr<CSSInheritedValue> create() { return adoptRefWillBeNoop(new CSSInheritedValue); }
diff --git a/third_party/WebKit/Source/core/css/CSSInitialValue.h b/third_party/WebKit/Source/core/css/CSSInitialValue.h index c493c3b..f86da526 100644 --- a/third_party/WebKit/Source/core/css/CSSInitialValue.h +++ b/third_party/WebKit/Source/core/css/CSSInitialValue.h
@@ -28,13 +28,13 @@ class CSSInitialValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSInitialValue> createExplicit() + static RawPtr<CSSInitialValue> createExplicit() { - return adoptRefWillBeNoop(new CSSInitialValue(/* implicit */ false)); + return new CSSInitialValue(/* implicit */ false); } - static PassRefPtrWillBeRawPtr<CSSInitialValue> createImplicit() + static RawPtr<CSSInitialValue> createImplicit() { - return adoptRefWillBeNoop(new CSSInitialValue(/* implicit */ true)); + return new CSSInitialValue(/* implicit */ true); } String customCSSText() const;
diff --git a/third_party/WebKit/Source/core/css/CSSKeyframeRule.h b/third_party/WebKit/Source/core/css/CSSKeyframeRule.h index 49be2d45..f044b30 100644 --- a/third_party/WebKit/Source/core/css/CSSKeyframeRule.h +++ b/third_party/WebKit/Source/core/css/CSSKeyframeRule.h
@@ -56,8 +56,8 @@ CSSRule::Type type() const override { return KEYFRAME_RULE; } - RefPtrWillBeMember<StyleRuleKeyframe> m_keyframe; - mutable RefPtrWillBeMember<KeyframeStyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; + Member<StyleRuleKeyframe> m_keyframe; + mutable Member<KeyframeStyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; friend class CSSKeyframesRule; };
diff --git a/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp b/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp index 9dbadee..45785a8 100644 --- a/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp
@@ -53,14 +53,14 @@ { } -void StyleRuleKeyframes::parserAppendKeyframe(PassRefPtrWillBeRawPtr<StyleRuleKeyframe> keyframe) +void StyleRuleKeyframes::parserAppendKeyframe(RawPtr<StyleRuleKeyframe> keyframe) { if (!keyframe) return; m_keyframes.append(keyframe); } -void StyleRuleKeyframes::wrapperAppendKeyframe(PassRefPtrWillBeRawPtr<StyleRuleKeyframe> keyframe) +void StyleRuleKeyframes::wrapperAppendKeyframe(RawPtr<StyleRuleKeyframe> keyframe) { m_keyframes.append(keyframe); styleChanged(); @@ -122,7 +122,7 @@ CSSStyleSheet* styleSheet = parentStyleSheet(); CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); - RefPtrWillBeRawPtr<StyleRuleKeyframe> keyframe = CSSParser::parseKeyframeRule(context, ruleText); + RawPtr<StyleRuleKeyframe> keyframe = CSSParser::parseKeyframeRule(context, ruleText); if (!keyframe) return; @@ -187,9 +187,9 @@ return nullptr; ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size()); - RefPtrWillBeMember<CSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index]; + Member<CSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index]; if (!rule) - rule = adoptRefWillBeNoop(new CSSKeyframeRule(m_keyframesRule->keyframes()[index].get(), const_cast<CSSKeyframesRule*>(this))); + rule = new CSSKeyframeRule(m_keyframesRule->keyframes()[index].get(), const_cast<CSSKeyframesRule*>(this)); return rule.get(); }
diff --git a/third_party/WebKit/Source/core/css/CSSKeyframesRule.h b/third_party/WebKit/Source/core/css/CSSKeyframesRule.h index 4f7799e..b723248e 100644 --- a/third_party/WebKit/Source/core/css/CSSKeyframesRule.h +++ b/third_party/WebKit/Source/core/css/CSSKeyframesRule.h
@@ -39,14 +39,14 @@ class StyleRuleKeyframes final : public StyleRuleBase { public: - static PassRefPtrWillBeRawPtr<StyleRuleKeyframes> create() { return adoptRefWillBeNoop(new StyleRuleKeyframes()); } + static RawPtr<StyleRuleKeyframes> create() { return new StyleRuleKeyframes(); } ~StyleRuleKeyframes(); - const WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe>>& keyframes() const { return m_keyframes; } + const HeapVector<Member<StyleRuleKeyframe>>& keyframes() const { return m_keyframes; } - void parserAppendKeyframe(PassRefPtrWillBeRawPtr<StyleRuleKeyframe>); - void wrapperAppendKeyframe(PassRefPtrWillBeRawPtr<StyleRuleKeyframe>); + void parserAppendKeyframe(RawPtr<StyleRuleKeyframe>); + void wrapperAppendKeyframe(RawPtr<StyleRuleKeyframe>); void wrapperRemoveKeyframe(unsigned); String name() const { return m_name; } @@ -57,7 +57,7 @@ int findKeyframeIndex(const String& key) const; - PassRefPtrWillBeRawPtr<StyleRuleKeyframes> copy() const { return adoptRefWillBeNoop(new StyleRuleKeyframes(*this)); } + RawPtr<StyleRuleKeyframes> copy() const { return new StyleRuleKeyframes(*this); } DECLARE_TRACE_AFTER_DISPATCH(); @@ -68,7 +68,7 @@ StyleRuleKeyframes(); explicit StyleRuleKeyframes(const StyleRuleKeyframes&); - WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe>> m_keyframes; + HeapVector<Member<StyleRuleKeyframe>> m_keyframes; AtomicString m_name; unsigned m_version : 31; unsigned m_isPrefixed : 1; @@ -79,9 +79,9 @@ class CSSKeyframesRule final : public CSSRule { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CSSKeyframesRule> create(StyleRuleKeyframes* rule, CSSStyleSheet* sheet) + static RawPtr<CSSKeyframesRule> create(StyleRuleKeyframes* rule, CSSStyleSheet* sheet) { - return adoptRefWillBeNoop(new CSSKeyframesRule(rule, sheet)); + return new CSSKeyframesRule(rule, sheet); } ~CSSKeyframesRule() override; @@ -117,9 +117,9 @@ CSSRule::Type type() const override { return KEYFRAMES_RULE; } - RefPtrWillBeMember<StyleRuleKeyframes> m_keyframesRule; - mutable WillBeHeapVector<RefPtrWillBeMember<CSSKeyframeRule>> m_childRuleCSSOMWrappers; - mutable OwnPtrWillBeMember<CSSRuleList> m_ruleListCSSOMWrapper; + Member<StyleRuleKeyframes> m_keyframesRule; + mutable HeapVector<Member<CSSKeyframeRule>> m_childRuleCSSOMWrappers; + mutable Member<CSSRuleList> m_ruleListCSSOMWrapper; bool m_isPrefixed; };
diff --git a/third_party/WebKit/Source/core/css/CSSMatrix.cpp b/third_party/WebKit/Source/core/css/CSSMatrix.cpp index 3c4d5a3..ea9fac2 100644 --- a/third_party/WebKit/Source/core/css/CSSMatrix.cpp +++ b/third_party/WebKit/Source/core/css/CSSMatrix.cpp
@@ -40,10 +40,10 @@ namespace blink { -PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::create(ExecutionContext* executionContext, const String& s, ExceptionState& exceptionState) +RawPtr<CSSMatrix> CSSMatrix::create(ExecutionContext* executionContext, const String& s, ExceptionState& exceptionState) { UseCounter::count(executionContext, UseCounter::WebKitCSSMatrix); - return adoptRefWillBeNoop(new CSSMatrix(s, exceptionState)); + return new CSSMatrix(s, exceptionState); } CSSMatrix::CSSMatrix(const TransformationMatrix& m) @@ -69,7 +69,7 @@ if (string.isEmpty()) return; - if (RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyTransform, string)) { + if (RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyTransform, string)) { // Check for a "none" transform. In these cases we can use the default identity matrix. if (value->isPrimitiveValue() && (toCSSPrimitiveValue(value.get()))->getValueID() == CSSValueNone) return; @@ -90,7 +90,7 @@ } // Perform a concatenation of the matrices (this * secondMatrix) -PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::multiply(CSSMatrix* secondMatrix) const +RawPtr<CSSMatrix> CSSMatrix::multiply(CSSMatrix* secondMatrix) const { if (!secondMatrix) return nullptr; @@ -98,7 +98,7 @@ return CSSMatrix::create(TransformationMatrix(*m_matrix).multiply(*secondMatrix->m_matrix)); } -PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::inverse(ExceptionState& exceptionState) const +RawPtr<CSSMatrix> CSSMatrix::inverse(ExceptionState& exceptionState) const { if (!m_matrix->isInvertible()) { exceptionState.throwDOMException(NotSupportedError, "The matrix is not invertable."); @@ -108,7 +108,7 @@ return CSSMatrix::create(m_matrix->inverse()); } -PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::translate(double x, double y, double z) const +RawPtr<CSSMatrix> CSSMatrix::translate(double x, double y, double z) const { if (std::isnan(x)) x = 0; @@ -119,7 +119,7 @@ return CSSMatrix::create(TransformationMatrix(*m_matrix).translate3d(x, y, z)); } -PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::scale(double scaleX, double scaleY, double scaleZ) const +RawPtr<CSSMatrix> CSSMatrix::scale(double scaleX, double scaleY, double scaleZ) const { if (std::isnan(scaleX)) scaleX = 1; @@ -130,7 +130,7 @@ return CSSMatrix::create(TransformationMatrix(*m_matrix).scale3d(scaleX, scaleY, scaleZ)); } -PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::rotate(double rotX, double rotY, double rotZ) const +RawPtr<CSSMatrix> CSSMatrix::rotate(double rotX, double rotY, double rotZ) const { if (std::isnan(rotX)) rotX = 0; @@ -148,7 +148,7 @@ return CSSMatrix::create(TransformationMatrix(*m_matrix).rotate3d(rotX, rotY, rotZ)); } -PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::rotateAxisAngle(double x, double y, double z, double angle) const +RawPtr<CSSMatrix> CSSMatrix::rotateAxisAngle(double x, double y, double z, double angle) const { if (std::isnan(x)) x = 0; @@ -163,14 +163,14 @@ return CSSMatrix::create(TransformationMatrix(*m_matrix).rotate3d(x, y, z, angle)); } -PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::skewX(double angle) const +RawPtr<CSSMatrix> CSSMatrix::skewX(double angle) const { if (std::isnan(angle)) angle = 0; return CSSMatrix::create(TransformationMatrix(*m_matrix).skewX(angle)); } -PassRefPtrWillBeRawPtr<CSSMatrix> CSSMatrix::skewY(double angle) const +RawPtr<CSSMatrix> CSSMatrix::skewY(double angle) const { if (std::isnan(angle)) angle = 0;
diff --git a/third_party/WebKit/Source/core/css/CSSMatrix.h b/third_party/WebKit/Source/core/css/CSSMatrix.h index fe74507..dde2324 100644 --- a/third_party/WebKit/Source/core/css/CSSMatrix.h +++ b/third_party/WebKit/Source/core/css/CSSMatrix.h
@@ -36,14 +36,14 @@ class ExceptionState; class ExecutionContext; -class CSSMatrix final : public RefCountedWillBeGarbageCollectedFinalized<CSSMatrix>, public ScriptWrappable { +class CSSMatrix final : public GarbageCollectedFinalized<CSSMatrix>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CSSMatrix> create(const TransformationMatrix& m) + static RawPtr<CSSMatrix> create(const TransformationMatrix& m) { - return adoptRefWillBeNoop(new CSSMatrix(m)); + return new CSSMatrix(m); } - static PassRefPtrWillBeRawPtr<CSSMatrix> create(ExecutionContext*, const String&, ExceptionState&); + static RawPtr<CSSMatrix> create(ExecutionContext*, const String&, ExceptionState&); double a() const { return m_matrix->a(); } double b() const { return m_matrix->b(); } @@ -99,48 +99,48 @@ // specified operation applied. The this value is not modified. // Multiply this matrix by secondMatrix, on the right (result = this * secondMatrix) - PassRefPtrWillBeRawPtr<CSSMatrix> multiply(CSSMatrix* secondMatrix) const; + RawPtr<CSSMatrix> multiply(CSSMatrix* secondMatrix) const; // Return the inverse of this matrix. Throw an exception if the matrix is not invertible - PassRefPtrWillBeRawPtr<CSSMatrix> inverse(ExceptionState&) const; + RawPtr<CSSMatrix> inverse(ExceptionState&) const; // Return this matrix translated by the passed values. // Passing a NaN will use a value of 0. This allows the 3D form to used for 2D operations // Operation is performed as though the this matrix is multiplied by a matrix with // the translation values on the left (result = translation(x,y,z) * this) - PassRefPtrWillBeRawPtr<CSSMatrix> translate(double x, double y, double z) const; + RawPtr<CSSMatrix> translate(double x, double y, double z) const; // Returns this matrix scaled by the passed values. // Passing scaleX or scaleZ as NaN uses a value of 1, but passing scaleY of NaN // makes it the same as scaleX. This allows the 3D form to used for 2D operations // Operation is performed as though the this matrix is multiplied by a matrix with // the scale values on the left (result = scale(x,y,z) * this) - PassRefPtrWillBeRawPtr<CSSMatrix> scale(double scaleX, double scaleY, double scaleZ) const; + RawPtr<CSSMatrix> scale(double scaleX, double scaleY, double scaleZ) const; // Returns this matrix rotated by the passed values. // If rotY and rotZ are NaN, rotate about Z (rotX=0, rotateY=0, rotateZ=rotX). // Otherwise use a rotation value of 0 for any passed NaN. // Operation is performed as though the this matrix is multiplied by a matrix with // the rotation values on the left (result = rotation(x,y,z) * this) - PassRefPtrWillBeRawPtr<CSSMatrix> rotate(double rotX, double rotY, double rotZ) const; + RawPtr<CSSMatrix> rotate(double rotX, double rotY, double rotZ) const; // Returns this matrix rotated about the passed axis by the passed angle. // Passing a NaN will use a value of 0. If the axis is (0,0,0) use a value // Operation is performed as though the this matrix is multiplied by a matrix with // the rotation values on the left (result = rotation(x,y,z,angle) * this) - PassRefPtrWillBeRawPtr<CSSMatrix> rotateAxisAngle(double x, double y, double z, double angle) const; + RawPtr<CSSMatrix> rotateAxisAngle(double x, double y, double z, double angle) const; // Return this matrix skewed along the X axis by the passed values. // Passing a NaN will use a value of 0. // Operation is performed as though the this matrix is multiplied by a matrix with // the skew values on the left (result = skewX(angle) * this) - PassRefPtrWillBeRawPtr<CSSMatrix> skewX(double angle) const; + RawPtr<CSSMatrix> skewX(double angle) const; // Return this matrix skewed along the Y axis by the passed values. // Passing a NaN will use a value of 0. // Operation is performed as though the this matrix is multiplied by a matrix with // the skew values on the left (result = skewY(angle) * this) - PassRefPtrWillBeRawPtr<CSSMatrix> skewY(double angle) const; + RawPtr<CSSMatrix> skewY(double angle) const; const TransformationMatrix& transform() const { return *m_matrix; }
diff --git a/third_party/WebKit/Source/core/css/CSSMediaRule.h b/third_party/WebKit/Source/core/css/CSSMediaRule.h index b0f75b0..acd3268 100644 --- a/third_party/WebKit/Source/core/css/CSSMediaRule.h +++ b/third_party/WebKit/Source/core/css/CSSMediaRule.h
@@ -33,9 +33,9 @@ class CSSMediaRule final : public CSSGroupingRule { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CSSMediaRule> create(StyleRuleMedia* rule, CSSStyleSheet* sheet) + static RawPtr<CSSMediaRule> create(StyleRuleMedia* rule, CSSStyleSheet* sheet) { - return adoptRefWillBeNoop(new CSSMediaRule(rule, sheet)); + return new CSSMediaRule(rule, sheet); } ~CSSMediaRule() override; @@ -54,7 +54,7 @@ MediaQuerySet* mediaQueries() const; - mutable RefPtrWillBeMember<MediaList> m_mediaCSSOMWrapper; + mutable Member<MediaList> m_mediaCSSOMWrapper; }; DEFINE_CSS_RULE_TYPE_CASTS(CSSMediaRule, MEDIA_RULE);
diff --git a/third_party/WebKit/Source/core/css/CSSNamespaceRule.h b/third_party/WebKit/Source/core/css/CSSNamespaceRule.h index 547eadf..5048b8e 100644 --- a/third_party/WebKit/Source/core/css/CSSNamespaceRule.h +++ b/third_party/WebKit/Source/core/css/CSSNamespaceRule.h
@@ -15,9 +15,9 @@ class CSSNamespaceRule final : public CSSRule { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CSSNamespaceRule> create(StyleRuleNamespace* rule, CSSStyleSheet* sheet) + static RawPtr<CSSNamespaceRule> create(StyleRuleNamespace* rule, CSSStyleSheet* sheet) { - return adoptRefWillBeNoop(new CSSNamespaceRule(rule, sheet)); + return new CSSNamespaceRule(rule, sheet); } ~CSSNamespaceRule() override; @@ -35,7 +35,7 @@ CSSRule::Type type() const override { return NAMESPACE_RULE; } - RefPtrWillBeMember<StyleRuleNamespace> m_namespaceRule; + Member<StyleRuleNamespace> m_namespaceRule; }; DEFINE_CSS_RULE_TYPE_CASTS(CSSNamespaceRule, NAMESPACE_RULE);
diff --git a/third_party/WebKit/Source/core/css/CSSPageRule.h b/third_party/WebKit/Source/core/css/CSSPageRule.h index f3fc0e7..2c903b3 100644 --- a/third_party/WebKit/Source/core/css/CSSPageRule.h +++ b/third_party/WebKit/Source/core/css/CSSPageRule.h
@@ -35,9 +35,9 @@ class CORE_EXPORT CSSPageRule final : public CSSRule { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CSSPageRule> create(StyleRulePage* rule, CSSStyleSheet* sheet) + static RawPtr<CSSPageRule> create(StyleRulePage* rule, CSSStyleSheet* sheet) { - return adoptRefWillBeNoop(new CSSPageRule(rule, sheet)); + return new CSSPageRule(rule, sheet); } ~CSSPageRule() override; @@ -57,8 +57,8 @@ CSSRule::Type type() const override { return PAGE_RULE; } - RefPtrWillBeMember<StyleRulePage> m_pageRule; - mutable RefPtrWillBeMember<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; + Member<StyleRulePage> m_pageRule; + mutable Member<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; }; DEFINE_CSS_RULE_TYPE_CASTS(CSSPageRule, PAGE_RULE);
diff --git a/third_party/WebKit/Source/core/css/CSSPaintValue.cpp b/third_party/WebKit/Source/core/css/CSSPaintValue.cpp index 11b08d9..89736c2 100644 --- a/third_party/WebKit/Source/core/css/CSSPaintValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSPaintValue.cpp
@@ -10,7 +10,7 @@ namespace blink { -CSSPaintValue::CSSPaintValue(PassRefPtrWillBeRawPtr<CSSCustomIdentValue> name) +CSSPaintValue::CSSPaintValue(RawPtr<CSSCustomIdentValue> name) : CSSImageGeneratorValue(PaintClass) , m_name(name) {
diff --git a/third_party/WebKit/Source/core/css/CSSPaintValue.h b/third_party/WebKit/Source/core/css/CSSPaintValue.h index 3046288..6aa505cc 100644 --- a/third_party/WebKit/Source/core/css/CSSPaintValue.h +++ b/third_party/WebKit/Source/core/css/CSSPaintValue.h
@@ -13,9 +13,9 @@ class CSSPaintValue : public CSSImageGeneratorValue { public: - static PassRefPtrWillBeRawPtr<CSSPaintValue> create(PassRefPtrWillBeRawPtr<CSSCustomIdentValue> name) + static RawPtr<CSSPaintValue> create(RawPtr<CSSCustomIdentValue> name) { - return adoptRefWillBeNoop(new CSSPaintValue(name)); + return new CSSPaintValue(name); } ~CSSPaintValue(); @@ -37,9 +37,9 @@ DECLARE_TRACE_AFTER_DISPATCH(); private: - explicit CSSPaintValue(PassRefPtrWillBeRawPtr<CSSCustomIdentValue> name); + explicit CSSPaintValue(RawPtr<CSSCustomIdentValue> name); - RefPtrWillBeMember<CSSCustomIdentValue> m_name; + Member<CSSCustomIdentValue> m_name; }; DEFINE_CSS_VALUE_TYPE_CASTS(CSSPaintValue, isPaintValue());
diff --git a/third_party/WebKit/Source/core/css/CSSPathValue.cpp b/third_party/WebKit/Source/core/css/CSSPathValue.cpp index e0900ea8e..8b0bab4f 100644 --- a/third_party/WebKit/Source/core/css/CSSPathValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSPathValue.cpp
@@ -9,12 +9,12 @@ namespace blink { -PassRefPtrWillBeRawPtr<CSSPathValue> CSSPathValue::create(PassRefPtr<StylePath> stylePath) +RawPtr<CSSPathValue> CSSPathValue::create(PassRefPtr<StylePath> stylePath) { - return adoptRefWillBeNoop(new CSSPathValue(stylePath)); + return new CSSPathValue(stylePath); } -PassRefPtrWillBeRawPtr<CSSPathValue> CSSPathValue::create(PassOwnPtr<SVGPathByteStream> pathByteStream) +RawPtr<CSSPathValue> CSSPathValue::create(PassOwnPtr<SVGPathByteStream> pathByteStream) { return CSSPathValue::create(StylePath::create(pathByteStream)); } @@ -28,7 +28,7 @@ namespace { -PassRefPtrWillBeRawPtr<CSSPathValue> createPathValue() +RawPtr<CSSPathValue> createPathValue() { OwnPtr<SVGPathByteStream> pathByteStream = SVGPathByteStream::create(); // Need to be registered as LSan ignored, as it will be reachable and @@ -41,7 +41,7 @@ CSSPathValue* CSSPathValue::emptyPathValue() { - DEFINE_STATIC_LOCAL(RefPtrWillBePersistent<CSSPathValue>, empty, (createPathValue())); + DEFINE_STATIC_LOCAL(Persistent<CSSPathValue>, empty, (createPathValue())); return empty.get(); }
diff --git a/third_party/WebKit/Source/core/css/CSSPathValue.h b/third_party/WebKit/Source/core/css/CSSPathValue.h index 5e293c20..ff51d0f 100644 --- a/third_party/WebKit/Source/core/css/CSSPathValue.h +++ b/third_party/WebKit/Source/core/css/CSSPathValue.h
@@ -17,8 +17,8 @@ class CSSPathValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSPathValue> create(PassRefPtr<StylePath>); - static PassRefPtrWillBeRawPtr<CSSPathValue> create(PassOwnPtr<SVGPathByteStream>); + static RawPtr<CSSPathValue> create(PassRefPtr<StylePath>); + static RawPtr<CSSPathValue> create(PassOwnPtr<SVGPathByteStream>); static CSSPathValue* emptyPathValue();
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp index 2eef701..9deb027 100644 --- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
@@ -154,7 +154,7 @@ } } -using CSSTextCache = WillBePersistentHeapHashMap<RawPtrWillBeWeakMember<const CSSPrimitiveValue>, String>; +using CSSTextCache = PersistentHeapHashMap<WeakMember<const CSSPrimitiveValue>, String>; static CSSTextCache& cssTextCache() { @@ -289,7 +289,7 @@ m_primitiveUnitType = static_cast<unsigned>(type); } -void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<CSSCalcValue> c) +void CSSPrimitiveValue::init(RawPtr<CSSCalcValue> c) { init(UnitType::Calc); m_hasCachedCSSText = false;
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h index 546cbdf3..bd24534 100644 --- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h +++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h
@@ -200,22 +200,22 @@ bool isValueID() const { return type() == UnitType::ValueID; } bool colorIsDerivedFromElement() const; - static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifier(CSSValueID valueID) + static RawPtr<CSSPrimitiveValue> createIdentifier(CSSValueID valueID) { - return adoptRefWillBeNoop(new CSSPrimitiveValue(valueID)); + return new CSSPrimitiveValue(valueID); } - static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(double value, UnitType type) + static RawPtr<CSSPrimitiveValue> create(double value, UnitType type) { - return adoptRefWillBeNoop(new CSSPrimitiveValue(value, type)); + return new CSSPrimitiveValue(value, type); } - static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(const Length& value, float zoom) + static RawPtr<CSSPrimitiveValue> create(const Length& value, float zoom) { - return adoptRefWillBeNoop(new CSSPrimitiveValue(value, zoom)); + return new CSSPrimitiveValue(value, zoom); } - template<typename T> static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create(T value) + template<typename T> static RawPtr<CSSPrimitiveValue> create(T value) { static_assert(!std::is_same<T, CSSValueID>::value, "Do not call create() with a CSSValueID; call createIdentifier() instead"); - return adoptRefWillBeNoop(new CSSPrimitiveValue(value)); + return new CSSPrimitiveValue(value); } ~CSSPrimitiveValue(); @@ -265,10 +265,10 @@ template<typename T> CSSPrimitiveValue(T* val) : CSSValue(PrimitiveClass) { - init(PassRefPtrWillBeRawPtr<T>(val)); + init(RawPtr<T>(val)); } - template<typename T> CSSPrimitiveValue(PassRefPtrWillBeRawPtr<T> val) + template<typename T> CSSPrimitiveValue(RawPtr<T> val) : CSSValue(PrimitiveClass) { init(val); @@ -280,7 +280,7 @@ void init(UnitType); void init(const Length&); - void init(PassRefPtrWillBeRawPtr<CSSCalcValue>); + void init(RawPtr<CSSCalcValue>); double computeLengthDouble(const CSSToLengthConversionData&) const;
diff --git a/third_party/WebKit/Source/core/css/CSSProperty.cpp b/third_party/WebKit/Source/core/css/CSSProperty.cpp index 36005d0..94900d4 100644 --- a/third_party/WebKit/Source/core/css/CSSProperty.cpp +++ b/third_party/WebKit/Source/core/css/CSSProperty.cpp
@@ -27,7 +27,7 @@ struct SameSizeAsCSSProperty { uint32_t bitfields; - RawPtrWillBeMember<void*> value; + Member<void*> value; }; static_assert(sizeof(CSSProperty) == sizeof(SameSizeAsCSSProperty), "CSSProperty should stay small");
diff --git a/third_party/WebKit/Source/core/css/CSSProperty.h b/third_party/WebKit/Source/core/css/CSSProperty.h index 45e3694..d2f2f4f 100644 --- a/third_party/WebKit/Source/core/css/CSSProperty.h +++ b/third_party/WebKit/Source/core/css/CSSProperty.h
@@ -58,7 +58,7 @@ class CSSProperty { DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); public: - CSSProperty(CSSPropertyID propertyID, PassRefPtrWillBeRawPtr<CSSValue> value, bool important = false, bool isSetFromShorthand = false, int indexInShorthandsVector = 0, bool implicit = false) + CSSProperty(CSSPropertyID propertyID, RawPtr<CSSValue> value, bool important = false, bool isSetFromShorthand = false, int indexInShorthandsVector = 0, bool implicit = false) : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, important, implicit, CSSPropertyMetadata::isInheritedProperty(propertyID)) , m_value(value) { @@ -89,7 +89,7 @@ private: StylePropertyMetadata m_metadata; - RefPtrWillBeMember<CSSValue> m_value; + Member<CSSValue> m_value; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSPropertySourceData.h b/third_party/WebKit/Source/core/css/CSSPropertySourceData.h index 50440f8..f28b792 100644 --- a/third_party/WebKit/Source/core/css/CSSPropertySourceData.h +++ b/third_party/WebKit/Source/core/css/CSSPropertySourceData.h
@@ -69,10 +69,10 @@ SourceRange range; }; -struct CSSStyleSourceData : public RefCountedWillBeGarbageCollected<CSSStyleSourceData> { - static PassRefPtrWillBeRawPtr<CSSStyleSourceData> create() +struct CSSStyleSourceData : public GarbageCollected<CSSStyleSourceData> { + static RawPtr<CSSStyleSourceData> create() { - return adoptRefWillBeNoop(new CSSStyleSourceData()); + return new CSSStyleSourceData(); } DEFINE_INLINE_TRACE() @@ -82,7 +82,7 @@ #endif } - WillBeHeapVector<CSSPropertySourceData> propertyData; + HeapVector<CSSPropertySourceData> propertyData; }; struct CSSMediaQueryExpSourceData { @@ -96,10 +96,10 @@ SourceRange valueRange; }; -struct CSSMediaQuerySourceData : public RefCountedWillBeGarbageCollected<CSSMediaQuerySourceData> { - static PassRefPtrWillBeRawPtr<CSSMediaQuerySourceData> create() +struct CSSMediaQuerySourceData : public GarbageCollected<CSSMediaQuerySourceData> { + static RawPtr<CSSMediaQuerySourceData> create() { - return adoptRefWillBeNoop(new CSSMediaQuerySourceData()); + return new CSSMediaQuerySourceData(); } DEFINE_INLINE_TRACE() @@ -109,13 +109,13 @@ #endif } - WillBeHeapVector<CSSMediaQueryExpSourceData> expData; + HeapVector<CSSMediaQueryExpSourceData> expData; }; -struct CSSMediaSourceData : public RefCountedWillBeGarbageCollected<CSSMediaSourceData> { - static PassRefPtrWillBeRawPtr<CSSMediaSourceData> create() +struct CSSMediaSourceData : public GarbageCollected<CSSMediaSourceData> { + static RawPtr<CSSMediaSourceData> create() { - return adoptRefWillBeNoop(new CSSMediaSourceData()); + return new CSSMediaSourceData(); } DEFINE_INLINE_TRACE() @@ -125,17 +125,17 @@ #endif } - WillBeHeapVector<RefPtrWillBeMember<CSSMediaQuerySourceData>> queryData; + HeapVector<Member<CSSMediaQuerySourceData>> queryData; }; struct CSSRuleSourceData; -using RuleSourceDataList = WillBeHeapVector<RefPtrWillBeMember<CSSRuleSourceData>>; -using SelectorRangeList = WillBeHeapVector<SourceRange>; +using RuleSourceDataList = HeapVector<Member<CSSRuleSourceData>>; +using SelectorRangeList = HeapVector<SourceRange>; -struct CSSRuleSourceData : public RefCountedWillBeGarbageCollected<CSSRuleSourceData> { - static PassRefPtrWillBeRawPtr<CSSRuleSourceData> create(StyleRule::RuleType type) +struct CSSRuleSourceData : public GarbageCollected<CSSRuleSourceData> { + static RawPtr<CSSRuleSourceData> create(StyleRule::RuleType type) { - return adoptRefWillBeNoop(new CSSRuleSourceData(type)); + return new CSSRuleSourceData(type); } CSSRuleSourceData(StyleRule::RuleType type) @@ -161,13 +161,13 @@ SelectorRangeList selectorRanges; // Only for CSSStyleRules, CSSFontFaceRules, and CSSPageRules. - RefPtrWillBeMember<CSSStyleSourceData> styleSourceData; + Member<CSSStyleSourceData> styleSourceData; // Only for CSSMediaRules. RuleSourceDataList childRules; // Only for CSSMediaRules and CSSImportRules. - RefPtrWillBeMember<CSSMediaSourceData> mediaSourceData; + Member<CSSMediaSourceData> mediaSourceData; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSQuadValue.h b/third_party/WebKit/Source/core/css/CSSQuadValue.h index 538b75e..7bab573 100644 --- a/third_party/WebKit/Source/core/css/CSSQuadValue.h +++ b/third_party/WebKit/Source/core/css/CSSQuadValue.h
@@ -35,9 +35,9 @@ SerializeAsQuad }; - static PassRefPtrWillBeRawPtr<CSSQuadValue> create(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> top, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> right, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> bottom, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> left, TypeForSerialization serializationType) + static RawPtr<CSSQuadValue> create(RawPtr<CSSPrimitiveValue> top, RawPtr<CSSPrimitiveValue> right, RawPtr<CSSPrimitiveValue> bottom, RawPtr<CSSPrimitiveValue> left, TypeForSerialization serializationType) { - return adoptRefWillBeNoop(new CSSQuadValue(top, right, bottom, left, serializationType)); + return new CSSQuadValue(top, right, bottom, left, serializationType); } CSSPrimitiveValue* top() const { return m_top.get(); } @@ -60,7 +60,7 @@ DECLARE_TRACE_AFTER_DISPATCH(); protected: - CSSQuadValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> top, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> right, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> bottom, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> left, TypeForSerialization serializationType) + CSSQuadValue(RawPtr<CSSPrimitiveValue> top, RawPtr<CSSPrimitiveValue> right, RawPtr<CSSPrimitiveValue> bottom, RawPtr<CSSPrimitiveValue> left, TypeForSerialization serializationType) : CSSValue(QuadClass) , m_serializationType(serializationType) , m_top(top) @@ -70,10 +70,10 @@ private: TypeForSerialization m_serializationType; - RefPtrWillBeMember<CSSPrimitiveValue> m_top; - RefPtrWillBeMember<CSSPrimitiveValue> m_right; - RefPtrWillBeMember<CSSPrimitiveValue> m_bottom; - RefPtrWillBeMember<CSSPrimitiveValue> m_left; + Member<CSSPrimitiveValue> m_top; + Member<CSSPrimitiveValue> m_right; + Member<CSSPrimitiveValue> m_bottom; + Member<CSSPrimitiveValue> m_left; }; DEFINE_CSS_VALUE_TYPE_CASTS(CSSQuadValue, isQuadValue());
diff --git a/third_party/WebKit/Source/core/css/CSSReflectValue.h b/third_party/WebKit/Source/core/css/CSSReflectValue.h index 18569543..ac7cb34d 100644 --- a/third_party/WebKit/Source/core/css/CSSReflectValue.h +++ b/third_party/WebKit/Source/core/css/CSSReflectValue.h
@@ -36,10 +36,10 @@ class CSSReflectValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSReflectValue> create(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> direction, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> offset, PassRefPtrWillBeRawPtr<CSSValue> mask) + static RawPtr<CSSReflectValue> create(RawPtr<CSSPrimitiveValue> direction, + RawPtr<CSSPrimitiveValue> offset, RawPtr<CSSValue> mask) { - return adoptRefWillBeNoop(new CSSReflectValue(direction, offset, mask)); + return new CSSReflectValue(direction, offset, mask); } CSSPrimitiveValue* direction() const { return m_direction.get(); } @@ -53,7 +53,7 @@ DECLARE_TRACE_AFTER_DISPATCH(); private: - CSSReflectValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> direction, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> offset, PassRefPtrWillBeRawPtr<CSSValue> mask) + CSSReflectValue(RawPtr<CSSPrimitiveValue> direction, RawPtr<CSSPrimitiveValue> offset, RawPtr<CSSValue> mask) : CSSValue(ReflectClass) , m_direction(direction) , m_offset(offset) @@ -61,9 +61,9 @@ { } - RefPtrWillBeMember<CSSPrimitiveValue> m_direction; - RefPtrWillBeMember<CSSPrimitiveValue> m_offset; - RefPtrWillBeMember<CSSValue> m_mask; + Member<CSSPrimitiveValue> m_direction; + Member<CSSPrimitiveValue> m_offset; + Member<CSSValue> m_mask; }; DEFINE_CSS_VALUE_TYPE_CASTS(CSSReflectValue, isReflectValue());
diff --git a/third_party/WebKit/Source/core/css/CSSRule.cpp b/third_party/WebKit/Source/core/css/CSSRule.cpp index 25a78dac..09c06d3 100644 --- a/third_party/WebKit/Source/core/css/CSSRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSRule.cpp
@@ -27,7 +27,7 @@ namespace blink { -struct SameSizeAsCSSRule : public RefCountedWillBeGarbageCollectedFinalized<SameSizeAsCSSRule>, public ScriptWrappable { +struct SameSizeAsCSSRule : public GarbageCollectedFinalized<SameSizeAsCSSRule>, public ScriptWrappable { virtual ~SameSizeAsCSSRule(); unsigned char bitfields; void* pointerUnion;
diff --git a/third_party/WebKit/Source/core/css/CSSRule.h b/third_party/WebKit/Source/core/css/CSSRule.h index 8b15c31..468871da 100644 --- a/third_party/WebKit/Source/core/css/CSSRule.h +++ b/third_party/WebKit/Source/core/css/CSSRule.h
@@ -35,7 +35,7 @@ class CSSStyleSheet; class StyleRuleBase; -class CORE_EXPORT CSSRule : public RefCountedWillBeGarbageCollectedFinalized<CSSRule>, public ScriptWrappable { +class CORE_EXPORT CSSRule : public GarbageCollectedFinalized<CSSRule>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: virtual ~CSSRule() { }
diff --git a/third_party/WebKit/Source/core/css/CSSRuleList.h b/third_party/WebKit/Source/core/css/CSSRuleList.h index 78c660b..50e54660 100644 --- a/third_party/WebKit/Source/core/css/CSSRuleList.h +++ b/third_party/WebKit/Source/core/css/CSSRuleList.h
@@ -33,9 +33,8 @@ class CSSRule; class CSSStyleSheet; -class CSSRuleList : public NoBaseWillBeGarbageCollectedFinalized<CSSRuleList>, public ScriptWrappable { +class CSSRuleList : public GarbageCollectedFinalized<CSSRuleList>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); - USING_FAST_MALLOC_WILL_BE_REMOVED(CSSRuleList); WTF_MAKE_NONCOPYABLE(CSSRuleList); public: virtual ~CSSRuleList(); @@ -58,9 +57,9 @@ class StaticCSSRuleList final : public CSSRuleList { public: - static PassRefPtrWillBeRawPtr<StaticCSSRuleList> create() + static RawPtr<StaticCSSRuleList> create() { - return adoptRefWillBeNoop(new StaticCSSRuleList()); + return new StaticCSSRuleList(); } #if !ENABLE(OILPAN) @@ -68,7 +67,7 @@ void deref() override; #endif - WillBeHeapVector<RefPtrWillBeMember<CSSRule>>& rules() { return m_rules; } + HeapVector<Member<CSSRule>>& rules() { return m_rules; } CSSStyleSheet* styleSheet() const override { return 0; } @@ -81,7 +80,7 @@ unsigned length() const override { return m_rules.size(); } CSSRule* item(unsigned index) const override { return index < m_rules.size() ? m_rules[index].get() : nullptr; } - WillBeHeapVector<RefPtrWillBeMember<CSSRule>> m_rules; + HeapVector<Member<CSSRule>> m_rules; #if !ENABLE(OILPAN) unsigned m_refCount; #endif @@ -90,9 +89,9 @@ template <class Rule> class LiveCSSRuleList final : public CSSRuleList { public: - static PassOwnPtrWillBeRawPtr<LiveCSSRuleList> create(Rule* rule) + static RawPtr<LiveCSSRuleList> create(Rule* rule) { - return adoptPtrWillBeNoop(new LiveCSSRuleList(rule)); + return new LiveCSSRuleList(rule); } #if !ENABLE(OILPAN) @@ -113,7 +112,7 @@ CSSRule* item(unsigned index) const override { return m_rule->item(index); } CSSStyleSheet* styleSheet() const override { return m_rule->parentStyleSheet(); } - RawPtrWillBeMember<Rule> m_rule; + Member<Rule> m_rule; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.h b/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.h index 11dd452..c53abee 100644 --- a/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.h +++ b/third_party/WebKit/Source/core/css/CSSSVGDocumentValue.h
@@ -34,9 +34,9 @@ class CSSSVGDocumentValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSSVGDocumentValue> create(const String& url) + static RawPtr<CSSSVGDocumentValue> create(const String& url) { - return adoptRefWillBeNoop(new CSSSVGDocumentValue(url)); + return new CSSSVGDocumentValue(url); } ~CSSSVGDocumentValue(); @@ -58,7 +58,7 @@ CSSSVGDocumentValue(const String& url); String m_url; - RefPtrWillBeMember<DocumentResource> m_document; + Member<DocumentResource> m_document; bool m_loadRequested; };
diff --git a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp index 3efce5a3..d3bde98 100644 --- a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp +++ b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp
@@ -76,9 +76,9 @@ pruneTable(); } -void CSSSegmentedFontFace::addFontFace(PassRefPtrWillBeRawPtr<FontFace> prpFontFace, bool cssConnected) +void CSSSegmentedFontFace::addFontFace(RawPtr<FontFace> prpFontFace, bool cssConnected) { - RefPtrWillBeRawPtr<FontFace> fontFace = prpFontFace; + RawPtr<FontFace> fontFace = prpFontFace; pruneTable(); fontFace->cssFontFace()->setSegmentedFontFace(this); if (cssConnected) { @@ -91,9 +91,9 @@ } } -void CSSSegmentedFontFace::removeFontFace(PassRefPtrWillBeRawPtr<FontFace> prpFontFace) +void CSSSegmentedFontFace::removeFontFace(RawPtr<FontFace> prpFontFace) { - RefPtrWillBeRawPtr<FontFace> fontFace = prpFontFace; + RawPtr<FontFace> fontFace = prpFontFace; FontFaceList::iterator it = m_fontFaces.find(fontFace); if (it == m_fontFaces.end()) return; @@ -171,7 +171,7 @@ return true; } -void CSSSegmentedFontFace::match(const String& text, WillBeHeapVector<RefPtrWillBeMember<FontFace>>& faces) const +void CSSSegmentedFontFace::match(const String& text, HeapVector<Member<FontFace>>& faces) const { for (const auto& fontFace : m_fontFaces) { if (fontFace->cssFontFace()->ranges()->intersectsWith(text))
diff --git a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.h b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.h index 66a3f9f..8c9cd9b8 100644 --- a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.h +++ b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.h
@@ -45,11 +45,11 @@ class FontFace; class SegmentedFontData; -class CSSSegmentedFontFace final : public RefCountedWillBeGarbageCollectedFinalized<CSSSegmentedFontFace> { +class CSSSegmentedFontFace final : public GarbageCollectedFinalized<CSSSegmentedFontFace> { public: - static PassRefPtrWillBeRawPtr<CSSSegmentedFontFace> create(CSSFontSelector* selector, FontTraits traits) + static RawPtr<CSSSegmentedFontFace> create(CSSFontSelector* selector, FontTraits traits) { - return adoptRefWillBeNoop(new CSSSegmentedFontFace(selector, traits)); + return new CSSSegmentedFontFace(selector, traits); } ~CSSSegmentedFontFace(); @@ -60,14 +60,14 @@ // so cached FontData must be discarded. void fontFaceInvalidated(); - void addFontFace(PassRefPtrWillBeRawPtr<FontFace>, bool cssConnected); - void removeFontFace(PassRefPtrWillBeRawPtr<FontFace>); + void addFontFace(RawPtr<FontFace>, bool cssConnected); + void removeFontFace(RawPtr<FontFace>); bool isEmpty() const { return m_fontFaces.isEmpty(); } PassRefPtr<FontData> getFontData(const FontDescription&); bool checkFont(const String&) const; - void match(const String&, WillBeHeapVector<RefPtrWillBeMember<FontFace>>&) const; + void match(const String&, HeapVector<Member<FontFace>>&) const; void willUseFontData(const FontDescription&, UChar32); void willUseRange(const FontDescription&, const blink::FontDataForRangeSet&); @@ -79,9 +79,9 @@ void pruneTable(); bool isValid() const; - using FontFaceList = WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>>; + using FontFaceList = HeapListHashSet<Member<FontFace>>; - RawPtrWillBeMember<CSSFontSelector> m_fontSelector; + Member<CSSFontSelector> m_fontSelector; FontTraits m_traits; HashMap<unsigned, RefPtr<SegmentedFontData>> m_fontDataTable; // All non-CSS-connected FontFaces are stored after the CSS-connected ones.
diff --git a/third_party/WebKit/Source/core/css/CSSShadowValue.cpp b/third_party/WebKit/Source/core/css/CSSShadowValue.cpp index 1e9cf6d..8f727289e 100644 --- a/third_party/WebKit/Source/core/css/CSSShadowValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSShadowValue.cpp
@@ -26,12 +26,12 @@ namespace blink { // Used for text-shadow and box-shadow -CSSShadowValue::CSSShadowValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> x, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> y, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> blur, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> spread, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> style, - PassRefPtrWillBeRawPtr<CSSValue> color) +CSSShadowValue::CSSShadowValue(RawPtr<CSSPrimitiveValue> x, + RawPtr<CSSPrimitiveValue> y, + RawPtr<CSSPrimitiveValue> blur, + RawPtr<CSSPrimitiveValue> spread, + RawPtr<CSSPrimitiveValue> style, + RawPtr<CSSValue> color) : CSSValue(ShadowClass) , x(x) , y(y)
diff --git a/third_party/WebKit/Source/core/css/CSSShadowValue.h b/third_party/WebKit/Source/core/css/CSSShadowValue.h index e606c3b9..908e1633 100644 --- a/third_party/WebKit/Source/core/css/CSSShadowValue.h +++ b/third_party/WebKit/Source/core/css/CSSShadowValue.h
@@ -33,36 +33,36 @@ // Used for text-shadow and box-shadow class CORE_EXPORT CSSShadowValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSShadowValue> create(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> x, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> y, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> blur, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> spread, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> style, - PassRefPtrWillBeRawPtr<CSSValue> color) + static RawPtr<CSSShadowValue> create(RawPtr<CSSPrimitiveValue> x, + RawPtr<CSSPrimitiveValue> y, + RawPtr<CSSPrimitiveValue> blur, + RawPtr<CSSPrimitiveValue> spread, + RawPtr<CSSPrimitiveValue> style, + RawPtr<CSSValue> color) { - return adoptRefWillBeNoop(new CSSShadowValue(x, y, blur, spread, style, color)); + return new CSSShadowValue(x, y, blur, spread, style, color); } String customCSSText() const; bool equals(const CSSShadowValue&) const; - RefPtrWillBeMember<CSSPrimitiveValue> x; - RefPtrWillBeMember<CSSPrimitiveValue> y; - RefPtrWillBeMember<CSSPrimitiveValue> blur; - RefPtrWillBeMember<CSSPrimitiveValue> spread; - RefPtrWillBeMember<CSSPrimitiveValue> style; - RefPtrWillBeMember<CSSValue> color; + Member<CSSPrimitiveValue> x; + Member<CSSPrimitiveValue> y; + Member<CSSPrimitiveValue> blur; + Member<CSSPrimitiveValue> spread; + Member<CSSPrimitiveValue> style; + Member<CSSValue> color; DECLARE_TRACE_AFTER_DISPATCH(); private: - CSSShadowValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> x, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> y, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> blur, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> spread, - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> style, - PassRefPtrWillBeRawPtr<CSSValue> color); + CSSShadowValue(RawPtr<CSSPrimitiveValue> x, + RawPtr<CSSPrimitiveValue> y, + RawPtr<CSSPrimitiveValue> blur, + RawPtr<CSSPrimitiveValue> spread, + RawPtr<CSSPrimitiveValue> style, + RawPtr<CSSValue> color); }; DEFINE_CSS_VALUE_TYPE_CASTS(CSSShadowValue, isShadowValue());
diff --git a/third_party/WebKit/Source/core/css/CSSStringValue.h b/third_party/WebKit/Source/core/css/CSSStringValue.h index 06bc70e1..1309f7e 100644 --- a/third_party/WebKit/Source/core/css/CSSStringValue.h +++ b/third_party/WebKit/Source/core/css/CSSStringValue.h
@@ -13,9 +13,9 @@ class CSSStringValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSStringValue> create(const String& str) + static RawPtr<CSSStringValue> create(const String& str) { - return adoptRefWillBeNoop(new CSSStringValue(str)); + return new CSSStringValue(str); } String value() const { return m_string; }
diff --git a/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h b/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h index 808fc944..3e0ba1c 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h +++ b/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h
@@ -35,9 +35,9 @@ class ExceptionState; class MutableStylePropertySet; -class CORE_EXPORT CSSStyleDeclaration : public NoBaseWillBeGarbageCollectedFinalized<CSSStyleDeclaration>, public ScriptWrappable { +class CORE_EXPORT CSSStyleDeclaration : public GarbageCollectedFinalized<CSSStyleDeclaration>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); - WTF_MAKE_NONCOPYABLE(CSSStyleDeclaration); USING_FAST_MALLOC_WILL_BE_REMOVED(CSSStyleDeclaration); + WTF_MAKE_NONCOPYABLE(CSSStyleDeclaration); public: virtual ~CSSStyleDeclaration() { } @@ -69,7 +69,7 @@ // CSSPropertyID versions of the CSSOM functions to support bindings and editing. // Use the non-virtual methods in the concrete subclasses when possible. // The CSSValue returned by this function should not be exposed to the web as it may be used by multiple documents at the same time. - virtual PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) = 0; + virtual RawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) = 0; virtual String getPropertyValueInternal(CSSPropertyID) = 0; virtual void setPropertyInternal(CSSPropertyID, const String& propertyValue, const String& value, bool important, ExceptionState&) = 0;
diff --git a/third_party/WebKit/Source/core/css/CSSStyleRule.cpp b/third_party/WebKit/Source/core/css/CSSStyleRule.cpp index cf2d06ae..701e281c 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSStyleRule.cpp
@@ -31,7 +31,7 @@ namespace blink { -using SelectorTextCache = WillBePersistentHeapHashMap<RawPtrWillBeWeakMember<const CSSStyleRule>, String>; +using SelectorTextCache = PersistentHeapHashMap<WeakMember<const CSSStyleRule>, String>; static SelectorTextCache& selectorTextCache() {
diff --git a/third_party/WebKit/Source/core/css/CSSStyleRule.h b/third_party/WebKit/Source/core/css/CSSStyleRule.h index b12ad31..66a6253 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleRule.h +++ b/third_party/WebKit/Source/core/css/CSSStyleRule.h
@@ -34,9 +34,9 @@ class CORE_EXPORT CSSStyleRule final : public CSSRule { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CSSStyleRule> create(StyleRule* rule, CSSStyleSheet* sheet) + static RawPtr<CSSStyleRule> create(StyleRule* rule, CSSStyleSheet* sheet) { - return adoptRefWillBeNoop(new CSSStyleRule(rule, sheet)); + return new CSSStyleRule(rule, sheet); } ~CSSStyleRule() override; @@ -61,8 +61,8 @@ String generateSelectorText() const; - RefPtrWillBeMember<StyleRule> m_styleRule; - mutable RefPtrWillBeMember<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; + Member<StyleRule> m_styleRule; + mutable Member<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; }; DEFINE_CSS_RULE_TYPE_CASTS(CSSStyleRule, STYLE_RULE);
diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp index fdda719..8da1f377 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp +++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
@@ -46,9 +46,9 @@ class StyleSheetCSSRuleList final : public CSSRuleList { public: - static PassOwnPtrWillBeRawPtr<StyleSheetCSSRuleList> create(CSSStyleSheet* sheet) + static RawPtr<StyleSheetCSSRuleList> create(CSSStyleSheet* sheet) { - return adoptPtrWillBeNoop(new StyleSheetCSSRuleList(sheet)); + return new StyleSheetCSSRuleList(sheet); } DEFINE_INLINE_VIRTUAL_TRACE() @@ -70,7 +70,7 @@ CSSStyleSheet* styleSheet() const override { return m_styleSheet; } - RawPtrWillBeMember<CSSStyleSheet> m_styleSheet; + Member<CSSStyleSheet> m_styleSheet; }; #if ENABLE(ASSERT) @@ -90,30 +90,30 @@ } #endif -PassRefPtrWillBeRawPtr<CSSStyleSheet> CSSStyleSheet::create(PassRefPtrWillBeRawPtr<StyleSheetContents> sheet, CSSImportRule* ownerRule) +RawPtr<CSSStyleSheet> CSSStyleSheet::create(RawPtr<StyleSheetContents> sheet, CSSImportRule* ownerRule) { - return adoptRefWillBeNoop(new CSSStyleSheet(sheet, ownerRule)); + return new CSSStyleSheet(sheet, ownerRule); } -PassRefPtrWillBeRawPtr<CSSStyleSheet> CSSStyleSheet::create(PassRefPtrWillBeRawPtr<StyleSheetContents> sheet, Node* ownerNode) +RawPtr<CSSStyleSheet> CSSStyleSheet::create(RawPtr<StyleSheetContents> sheet, Node* ownerNode) { - return adoptRefWillBeNoop(new CSSStyleSheet(sheet, ownerNode, false, TextPosition::minimumPosition())); + return new CSSStyleSheet(sheet, ownerNode, false, TextPosition::minimumPosition()); } -PassRefPtrWillBeRawPtr<CSSStyleSheet> CSSStyleSheet::createInline(PassRefPtrWillBeRawPtr<StyleSheetContents> sheet, Node* ownerNode, const TextPosition& startPosition) +RawPtr<CSSStyleSheet> CSSStyleSheet::createInline(RawPtr<StyleSheetContents> sheet, Node* ownerNode, const TextPosition& startPosition) { ASSERT(sheet); - return adoptRefWillBeNoop(new CSSStyleSheet(sheet, ownerNode, true, startPosition)); + return new CSSStyleSheet(sheet, ownerNode, true, startPosition); } -PassRefPtrWillBeRawPtr<CSSStyleSheet> CSSStyleSheet::createInline(Node* ownerNode, const KURL& baseURL, const TextPosition& startPosition, const String& encoding) +RawPtr<CSSStyleSheet> CSSStyleSheet::createInline(Node* ownerNode, const KURL& baseURL, const TextPosition& startPosition, const String& encoding) { CSSParserContext parserContext(ownerNode->document(), 0, baseURL, encoding); - RefPtrWillBeRawPtr<StyleSheetContents> sheet = StyleSheetContents::create(baseURL.getString(), parserContext); - return adoptRefWillBeNoop(new CSSStyleSheet(sheet.release(), ownerNode, true, startPosition)); + RawPtr<StyleSheetContents> sheet = StyleSheetContents::create(baseURL.getString(), parserContext); + return new CSSStyleSheet(sheet.release(), ownerNode, true, startPosition); } -CSSStyleSheet::CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> contents, CSSImportRule* ownerRule) +CSSStyleSheet::CSSStyleSheet(RawPtr<StyleSheetContents> contents, CSSImportRule* ownerRule) : m_contents(contents) , m_isInlineStylesheet(false) , m_isDisabled(false) @@ -125,7 +125,7 @@ m_contents->registerClient(this); } -CSSStyleSheet::CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> contents, Node* ownerNode, bool isInlineStylesheet, const TextPosition& startPosition) +CSSStyleSheet::CSSStyleSheet(RawPtr<StyleSheetContents> contents, Node* ownerNode, bool isInlineStylesheet, const TextPosition& startPosition) : m_contents(contents) , m_isInlineStylesheet(isInlineStylesheet) , m_isDisabled(false) @@ -222,7 +222,7 @@ didMutate(); } -void CSSStyleSheet::setMediaQueries(PassRefPtrWillBeRawPtr<MediaQuerySet> mediaQueries) +void CSSStyleSheet::setMediaQueries(RawPtr<MediaQuerySet> mediaQueries) { m_mediaQueries = mediaQueries; if (m_mediaCSSOMWrapper && m_mediaQueries) @@ -245,7 +245,7 @@ m_childRuleCSSOMWrappers.grow(ruleCount); ASSERT(m_childRuleCSSOMWrappers.size() == ruleCount); - RefPtrWillBeMember<CSSRule>& cssRule = m_childRuleCSSOMWrappers[index]; + Member<CSSRule>& cssRule = m_childRuleCSSOMWrappers[index]; if (!cssRule) cssRule = m_contents->ruleAt(index)->createCSSOMWrapper(this); return cssRule.get(); @@ -276,7 +276,7 @@ return false; } -PassRefPtrWillBeRawPtr<CSSRuleList> CSSStyleSheet::rules() +RawPtr<CSSRuleList> CSSStyleSheet::rules() { return cssRules(); } @@ -290,7 +290,7 @@ return 0; } CSSParserContext context(m_contents->parserContext(), UseCounter::getFrom(this)); - RefPtrWillBeRawPtr<StyleRuleBase> rule = CSSParser::parseRule(context, m_contents.get(), ruleString); + RawPtr<StyleRuleBase> rule = CSSParser::parseRule(context, m_contents.get(), ruleString); if (!rule) { exceptionState.throwDOMException(SyntaxError, "Failed to parse the rule '" + ruleString + "'."); @@ -307,7 +307,7 @@ return 0; } if (!m_childRuleCSSOMWrappers.isEmpty()) - m_childRuleCSSOMWrappers.insert(index, RefPtrWillBeMember<CSSRule>(nullptr)); + m_childRuleCSSOMWrappers.insert(index, Member<CSSRule>(nullptr)); return index; } @@ -362,7 +362,7 @@ } -PassRefPtrWillBeRawPtr<CSSRuleList> CSSStyleSheet::cssRules() +RawPtr<CSSRuleList> CSSStyleSheet::cssRules() { if (!canAccessRules()) return nullptr;
diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.h b/third_party/WebKit/Source/core/css/CSSStyleSheet.h index 2bd2368..cbe6791e 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleSheet.h +++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.h
@@ -48,10 +48,10 @@ class CORE_EXPORT CSSStyleSheet final : public StyleSheet { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CSSStyleSheet> create(PassRefPtrWillBeRawPtr<StyleSheetContents>, CSSImportRule* ownerRule = 0); - static PassRefPtrWillBeRawPtr<CSSStyleSheet> create(PassRefPtrWillBeRawPtr<StyleSheetContents>, Node* ownerNode); - static PassRefPtrWillBeRawPtr<CSSStyleSheet> createInline(Node*, const KURL&, const TextPosition& startPosition = TextPosition::minimumPosition(), const String& encoding = String()); - static PassRefPtrWillBeRawPtr<CSSStyleSheet> createInline(PassRefPtrWillBeRawPtr<StyleSheetContents>, Node* ownerNode, const TextPosition& startPosition = TextPosition::minimumPosition()); + static RawPtr<CSSStyleSheet> create(RawPtr<StyleSheetContents>, CSSImportRule* ownerRule = 0); + static RawPtr<CSSStyleSheet> create(RawPtr<StyleSheetContents>, Node* ownerNode); + static RawPtr<CSSStyleSheet> createInline(Node*, const KURL&, const TextPosition& startPosition = TextPosition::minimumPosition(), const String& encoding = String()); + static RawPtr<CSSStyleSheet> createInline(RawPtr<StyleSheetContents>, Node* ownerNode, const TextPosition& startPosition = TextPosition::minimumPosition()); ~CSSStyleSheet() override; @@ -63,13 +63,13 @@ bool disabled() const override { return m_isDisabled; } void setDisabled(bool) override; - PassRefPtrWillBeRawPtr<CSSRuleList> cssRules(); + RawPtr<CSSRuleList> cssRules(); unsigned insertRule(const String& rule, unsigned index, ExceptionState&); unsigned insertRule(const String& rule, ExceptionState&); // Deprecated. void deleteRule(unsigned index, ExceptionState&); // IE Extensions - PassRefPtrWillBeRawPtr<CSSRuleList> rules(); + RawPtr<CSSRuleList> rules(); int addRule(const String& selector, const String& style, int index, ExceptionState&); int addRule(const String& selector, const String& style, ExceptionState&); void removeRule(unsigned index, ExceptionState& exceptionState) { deleteRule(index, exceptionState); } @@ -87,7 +87,7 @@ void clearOwnerRule() { m_ownerRule = nullptr; } Document* ownerDocument() const; MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } - void setMediaQueries(PassRefPtrWillBeRawPtr<MediaQuerySet>); + void setMediaQueries(RawPtr<MediaQuerySet>); void setTitle(const String& title) { m_title = title; } // Set by LinkStyle iff CORS-enabled fetch of stylesheet succeeded from this origin. void setAllowRuleAccessFromOrigin(PassRefPtr<SecurityOrigin> allowedOrigin); @@ -101,7 +101,7 @@ ~RuleMutationScope(); private: - RawPtrWillBeMember<CSSStyleSheet> m_styleSheet; + Member<CSSStyleSheet> m_styleSheet; }; void willMutateRules(); @@ -121,8 +121,8 @@ DECLARE_VIRTUAL_TRACE(); private: - CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents>, CSSImportRule* ownerRule); - CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents>, Node* ownerNode, bool isInlineStylesheet, const TextPosition& startPosition); + CSSStyleSheet(RawPtr<StyleSheetContents>, CSSImportRule* ownerRule); + CSSStyleSheet(RawPtr<StyleSheetContents>, Node* ownerNode, bool isInlineStylesheet, const TextPosition& startPosition); bool isCSSStyleSheet() const override { return true; } String type() const override { return "text/css"; } @@ -133,22 +133,22 @@ void setLoadCompleted(bool); - RefPtrWillBeMember<StyleSheetContents> m_contents; + Member<StyleSheetContents> m_contents; bool m_isInlineStylesheet; bool m_isDisabled; String m_title; - RefPtrWillBeMember<MediaQuerySet> m_mediaQueries; + Member<MediaQuerySet> m_mediaQueries; RefPtr<SecurityOrigin> m_allowRuleAccessFromOrigin; - RawPtrWillBeMember<Node> m_ownerNode; - RawPtrWillBeMember<CSSRule> m_ownerRule; + Member<Node> m_ownerNode; + Member<CSSRule> m_ownerRule; TextPosition m_startPosition; bool m_loadCompleted; - mutable RefPtrWillBeMember<MediaList> m_mediaCSSOMWrapper; - mutable WillBeHeapVector<RefPtrWillBeMember<CSSRule>> m_childRuleCSSOMWrappers; - mutable OwnPtrWillBeMember<CSSRuleList> m_ruleListCSSOMWrapper; + mutable Member<MediaList> m_mediaCSSOMWrapper; + mutable HeapVector<Member<CSSRule>> m_childRuleCSSOMWrappers; + mutable Member<CSSRuleList> m_ruleListCSSOMWrapper; }; inline CSSStyleSheet::RuleMutationScope::RuleMutationScope(CSSStyleSheet* sheet)
diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp index c9b3a264..2497f35 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp +++ b/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp
@@ -71,15 +71,15 @@ // the image resource. document()->fetcher()->setAutoLoadImages(false); - RefPtrWillBeRawPtr<CSSStyleSheetResource> cssResource = CSSStyleSheetResource::createForTest(ResourceRequest(cssURL), "utf-8"); + RawPtr<CSSStyleSheetResource> cssResource = CSSStyleSheetResource::createForTest(ResourceRequest(cssURL), "utf-8"); memoryCache()->add(cssResource.get()); cssResource->responseReceived(ResourceResponse(cssURL, "style/css", 0, nullAtom, String()), nullptr); cssResource->finish(); - RefPtrWillBeRawPtr<StyleSheetContents> contents = StyleSheetContents::create(CSSParserContext(HTMLStandardMode, nullptr)); - RefPtrWillBeRawPtr<CSSStyleSheet> sheet = CSSStyleSheet::create(contents, document()); + RawPtr<StyleSheetContents> contents = StyleSheetContents::create(CSSParserContext(HTMLStandardMode, nullptr)); + RawPtr<CSSStyleSheet> sheet = CSSStyleSheet::create(contents, document()); EXPECT_TRUE(sheet); - RefPtrWillBeRawPtr<CSSCrossfadeValue> crossfade = CSSCrossfadeValue::create( + RawPtr<CSSCrossfadeValue> crossfade = CSSCrossfadeValue::create( CSSImageValue::create(String("image"), imageURL), CSSImageValue::create(String("image"), imageURL), CSSPrimitiveValue::create(1.0, CSSPrimitiveValue::UnitType::Number)); @@ -92,7 +92,7 @@ StyleRule::create(CSSSelectorList::adoptSelectorVector(selectors), ImmutableStylePropertySet::create(&property, 1, HTMLStandardMode))); crossfade->loadSubimages(document()); - RefPtrWillBeRawPtr<Resource> imageResource = memoryCache()->resourceForURL(imageURL, MemoryCache::defaultCacheIdentifier()); + RawPtr<Resource> imageResource = memoryCache()->resourceForURL(imageURL, MemoryCache::defaultCacheIdentifier()); ASSERT_TRUE(imageResource); ResourceResponse imageResponse; imageResponse.setURL(imageURL); @@ -126,17 +126,17 @@ // Emulate using <img> to do async stylesheet preloads. - RefPtrWillBeRawPtr<Resource> imageResource = ImageResource::create(ResourceRequest(imageURL), nullptr); + RawPtr<Resource> imageResource = ImageResource::create(ResourceRequest(imageURL), nullptr); ASSERT_TRUE(imageResource); memoryCache()->add(imageResource.get()); ASSERT_TRUE(memoryCache()->contains(imageResource.get())); - RefPtrWillBeRawPtr<CSSStyleSheetResource> cssResource = CSSStyleSheetResource::createForTest(ResourceRequest(cssURL), "utf-8"); + RawPtr<CSSStyleSheetResource> cssResource = CSSStyleSheetResource::createForTest(ResourceRequest(cssURL), "utf-8"); cssResource->responseReceived(ResourceResponse(cssURL, "style/css", 0, nullAtom, String()), nullptr); cssResource->finish(); - RefPtrWillBeRawPtr<StyleSheetContents> contents = StyleSheetContents::create(CSSParserContext(HTMLStandardMode, nullptr)); - RefPtrWillBeRawPtr<CSSStyleSheet> sheet = CSSStyleSheet::create(contents, document()); + RawPtr<StyleSheetContents> contents = StyleSheetContents::create(CSSParserContext(HTMLStandardMode, nullptr)); + RawPtr<CSSStyleSheet> sheet = CSSStyleSheet::create(contents, document()); EXPECT_TRUE(sheet); contents->checkLoaded();
diff --git a/third_party/WebKit/Source/core/css/CSSSupportsRule.h b/third_party/WebKit/Source/core/css/CSSSupportsRule.h index 2f39536..b2a89d7 100644 --- a/third_party/WebKit/Source/core/css/CSSSupportsRule.h +++ b/third_party/WebKit/Source/core/css/CSSSupportsRule.h
@@ -38,9 +38,9 @@ class CSSSupportsRule final : public CSSGroupingRule { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CSSSupportsRule> create(StyleRuleSupports* rule, CSSStyleSheet* sheet) + static RawPtr<CSSSupportsRule> create(StyleRuleSupports* rule, CSSStyleSheet* sheet) { - return adoptRefWillBeNoop(new CSSSupportsRule(rule, sheet)); + return new CSSSupportsRule(rule, sheet); } ~CSSSupportsRule() override { }
diff --git a/third_party/WebKit/Source/core/css/CSSTestHelper.h b/third_party/WebKit/Source/core/css/CSSTestHelper.h index fe55f979..1e17c20 100644 --- a/third_party/WebKit/Source/core/css/CSSTestHelper.h +++ b/third_party/WebKit/Source/core/css/CSSTestHelper.h
@@ -57,8 +57,8 @@ CSSRuleList* cssRules(); private: - RefPtrWillBePersistent<Document> m_document; - RefPtrWillBePersistent<CSSStyleSheet> m_styleSheet; + Persistent<Document> m_document; + Persistent<CSSStyleSheet> m_styleSheet; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h b/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h index bad1f87..f2d159a 100644 --- a/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h +++ b/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h
@@ -34,9 +34,9 @@ class CSSCubicBezierTimingFunctionValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSCubicBezierTimingFunctionValue> create(double x1, double y1, double x2, double y2) + static RawPtr<CSSCubicBezierTimingFunctionValue> create(double x1, double y1, double x2, double y2) { - return adoptRefWillBeNoop(new CSSCubicBezierTimingFunctionValue(x1, y1, x2, y2)); + return new CSSCubicBezierTimingFunctionValue(x1, y1, x2, y2); } String customCSSText() const; @@ -70,9 +70,9 @@ class CSSStepsTimingFunctionValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSStepsTimingFunctionValue> create(int steps, StepsTimingFunction::StepAtPosition stepAtPosition) + static RawPtr<CSSStepsTimingFunctionValue> create(int steps, StepsTimingFunction::StepAtPosition stepAtPosition) { - return adoptRefWillBeNoop(new CSSStepsTimingFunctionValue(steps, stepAtPosition)); + return new CSSStepsTimingFunctionValue(steps, stepAtPosition); } int numberOfSteps() const { return m_steps; }
diff --git a/third_party/WebKit/Source/core/css/CSSURIValue.h b/third_party/WebKit/Source/core/css/CSSURIValue.h index 72f2684..f773787 100644 --- a/third_party/WebKit/Source/core/css/CSSURIValue.h +++ b/third_party/WebKit/Source/core/css/CSSURIValue.h
@@ -13,9 +13,9 @@ class CSSURIValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSURIValue> create(const String& str) + static RawPtr<CSSURIValue> create(const String& str) { - return adoptRefWillBeNoop(new CSSURIValue(str)); + return new CSSURIValue(str); } String value() const { return m_string; }
diff --git a/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.h b/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.h index eabe25fd..10a783d 100644 --- a/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.h +++ b/third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.h
@@ -33,9 +33,9 @@ class CSSUnicodeRangeValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSUnicodeRangeValue> create(UChar32 from, UChar32 to) + static RawPtr<CSSUnicodeRangeValue> create(UChar32 from, UChar32 to) { - return adoptRefWillBeNoop(new CSSUnicodeRangeValue(from, to)); + return new CSSUnicodeRangeValue(from, to); } UChar32 from() const { return m_from; }
diff --git a/third_party/WebKit/Source/core/css/CSSUnsetValue.h b/third_party/WebKit/Source/core/css/CSSUnsetValue.h index d9be326..705eea6 100644 --- a/third_party/WebKit/Source/core/css/CSSUnsetValue.h +++ b/third_party/WebKit/Source/core/css/CSSUnsetValue.h
@@ -12,7 +12,7 @@ class CSSUnsetValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSUnsetValue> create() + static RawPtr<CSSUnsetValue> create() { return adoptRefWillBeNoop(new CSSUnsetValue); }
diff --git a/third_party/WebKit/Source/core/css/CSSValue.cpp b/third_party/WebKit/Source/core/css/CSSValue.cpp index 29e8ec2..710fe5b 100644 --- a/third_party/WebKit/Source/core/css/CSSValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSValue.cpp
@@ -65,7 +65,7 @@ namespace blink { -struct SameSizeAsCSSValue : public RefCountedWillBeGarbageCollectedFinalized<SameSizeAsCSSValue> { +struct SameSizeAsCSSValue : public GarbageCollectedFinalized<SameSizeAsCSSValue> { uint32_t bitfields; };
diff --git a/third_party/WebKit/Source/core/css/CSSValue.h b/third_party/WebKit/Source/core/css/CSSValue.h index 5aa5b5a..d8c14eb 100644 --- a/third_party/WebKit/Source/core/css/CSSValue.h +++ b/third_party/WebKit/Source/core/css/CSSValue.h
@@ -31,7 +31,7 @@ namespace blink { -class CORE_EXPORT CSSValue : public RefCountedWillBeGarbageCollectedFinalized<CSSValue> { +class CORE_EXPORT CSSValue : public GarbageCollectedFinalized<CSSValue> { #if ENABLE(OILPAN) public: // Override operator new to allocate CSSValue subtype objects onto @@ -229,15 +229,15 @@ }; template<typename CSSValueType, size_t inlineCapacity> -inline bool compareCSSValueVector(const WillBeHeapVector<RefPtrWillBeMember<CSSValueType>, inlineCapacity>& firstVector, const WillBeHeapVector<RefPtrWillBeMember<CSSValueType>, inlineCapacity>& secondVector) +inline bool compareCSSValueVector(const HeapVector<Member<CSSValueType>, inlineCapacity>& firstVector, const HeapVector<Member<CSSValueType>, inlineCapacity>& secondVector) { size_t size = firstVector.size(); if (size != secondVector.size()) return false; for (size_t i = 0; i < size; i++) { - const RefPtrWillBeMember<CSSValueType>& firstPtr = firstVector[i]; - const RefPtrWillBeMember<CSSValueType>& secondPtr = secondVector[i]; + const Member<CSSValueType>& firstPtr = firstVector[i]; + const Member<CSSValueType>& secondPtr = secondVector[i]; if (firstPtr == secondPtr || (firstPtr && secondPtr && firstPtr->equals(*secondPtr))) continue; return false;
diff --git a/third_party/WebKit/Source/core/css/CSSValueList.cpp b/third_party/WebKit/Source/core/css/CSSValueList.cpp index 2573fb9..b83cfa2 100644 --- a/third_party/WebKit/Source/core/css/CSSValueList.cpp +++ b/third_party/WebKit/Source/core/css/CSSValueList.cpp
@@ -41,7 +41,7 @@ { bool found = false; for (int index = m_values.size() - 1; index >= 0; --index) { - RefPtrWillBeMember<CSSValue>& value = m_values.at(index); + Member<CSSValue>& value = m_values.at(index); if (value && val && value->equals(*val)) { m_values.remove(index); found = true; @@ -54,16 +54,16 @@ bool CSSValueList::hasValue(CSSValue* val) const { for (size_t index = 0; index < m_values.size(); index++) { - const RefPtrWillBeMember<CSSValue>& value = m_values.at(index); + const Member<CSSValue>& value = m_values.at(index); if (value && val && value->equals(*val)) return true; } return false; } -PassRefPtrWillBeRawPtr<CSSValueList> CSSValueList::copy() +RawPtr<CSSValueList> CSSValueList::copy() { - RefPtrWillBeRawPtr<CSSValueList> newList = nullptr; + RawPtr<CSSValueList> newList = nullptr; switch (m_valueListSeparator) { case SpaceSeparator: newList = createSpaceSeparated();
diff --git a/third_party/WebKit/Source/core/css/CSSValueList.h b/third_party/WebKit/Source/core/css/CSSValueList.h index ad0713bf..2a88943 100644 --- a/third_party/WebKit/Source/core/css/CSSValueList.h +++ b/third_party/WebKit/Source/core/css/CSSValueList.h
@@ -30,20 +30,20 @@ class CORE_EXPORT CSSValueList : public CSSValue { public: - using iterator = WillBeHeapVector<RefPtrWillBeMember<CSSValue>, 4>::iterator; - using const_iterator = WillBeHeapVector<RefPtrWillBeMember<CSSValue>, 4>::const_iterator; + using iterator = HeapVector<Member<CSSValue>, 4>::iterator; + using const_iterator = HeapVector<Member<CSSValue>, 4>::const_iterator; - static PassRefPtrWillBeRawPtr<CSSValueList> createCommaSeparated() + static RawPtr<CSSValueList> createCommaSeparated() { - return adoptRefWillBeNoop(new CSSValueList(CommaSeparator)); + return new CSSValueList(CommaSeparator); } - static PassRefPtrWillBeRawPtr<CSSValueList> createSpaceSeparated() + static RawPtr<CSSValueList> createSpaceSeparated() { - return adoptRefWillBeNoop(new CSSValueList(SpaceSeparator)); + return new CSSValueList(SpaceSeparator); } - static PassRefPtrWillBeRawPtr<CSSValueList> createSlashSeparated() + static RawPtr<CSSValueList> createSlashSeparated() { - return adoptRefWillBeNoop(new CSSValueList(SlashSeparator)); + return new CSSValueList(SlashSeparator); } iterator begin() { return m_values.begin(); } @@ -57,11 +57,11 @@ CSSValue* itemWithBoundsCheck(size_t index) { return index < m_values.size() ? m_values[index].get() : nullptr; } const CSSValue* itemWithBoundsCheck(size_t index) const { return index < m_values.size() ? m_values[index].get() : nullptr; } - void append(PassRefPtrWillBeRawPtr<CSSValue> value) { m_values.append(value); } - void prepend(PassRefPtrWillBeRawPtr<CSSValue> value) { m_values.prepend(value); } + void append(RawPtr<CSSValue> value) { m_values.append(value); } + void prepend(RawPtr<CSSValue> value) { m_values.prepend(value); } bool removeAll(CSSValue*); bool hasValue(CSSValue*) const; - PassRefPtrWillBeRawPtr<CSSValueList> copy(); + RawPtr<CSSValueList> copy(); String customCSSText() const; bool equals(const CSSValueList&) const; @@ -76,7 +76,7 @@ private: explicit CSSValueList(ValueListSeparator); - WillBeHeapVector<RefPtrWillBeMember<CSSValue>, 4> m_values; + HeapVector<Member<CSSValue>, 4> m_values; }; DEFINE_CSS_VALUE_TYPE_CASTS(CSSValueList, isValueList());
diff --git a/third_party/WebKit/Source/core/css/CSSValuePair.h b/third_party/WebKit/Source/core/css/CSSValuePair.h index 307b88a2..d9a5634 100644 --- a/third_party/WebKit/Source/core/css/CSSValuePair.h +++ b/third_party/WebKit/Source/core/css/CSSValuePair.h
@@ -36,15 +36,15 @@ public: enum IdenticalValuesPolicy { DropIdenticalValues, KeepIdenticalValues }; - static PassRefPtrWillBeRawPtr<CSSValuePair> create(PassRefPtrWillBeRawPtr<CSSValue> first, PassRefPtrWillBeRawPtr<CSSValue> second, + static RawPtr<CSSValuePair> create(RawPtr<CSSValue> first, RawPtr<CSSValue> second, IdenticalValuesPolicy identicalValuesPolicy) { - return adoptRefWillBeNoop(new CSSValuePair(first, second, identicalValuesPolicy)); + return new CSSValuePair(first, second, identicalValuesPolicy); } - static PassRefPtrWillBeRawPtr<CSSValuePair> create(const LengthSize& lengthSize, const ComputedStyle& style) + static RawPtr<CSSValuePair> create(const LengthSize& lengthSize, const ComputedStyle& style) { - return adoptRefWillBeNoop(new CSSValuePair(CSSPrimitiveValue::create(lengthSize.width(), style.effectiveZoom()), CSSPrimitiveValue::create(lengthSize.height(), style.effectiveZoom()), KeepIdenticalValues)); + return new CSSValuePair(CSSPrimitiveValue::create(lengthSize.width(), style.effectiveZoom()), CSSPrimitiveValue::create(lengthSize.height(), style.effectiveZoom()), KeepIdenticalValues); } // TODO(sashab): Remove these non-const versions. @@ -72,7 +72,7 @@ DECLARE_TRACE_AFTER_DISPATCH(); private: - CSSValuePair(PassRefPtrWillBeRawPtr<CSSValue> first, PassRefPtrWillBeRawPtr<CSSValue> second, IdenticalValuesPolicy identicalValuesPolicy) + CSSValuePair(RawPtr<CSSValue> first, RawPtr<CSSValue> second, IdenticalValuesPolicy identicalValuesPolicy) : CSSValue(ValuePairClass) , m_first(first) , m_second(second) @@ -82,8 +82,8 @@ ASSERT(m_second); } - RefPtrWillBeMember<CSSValue> m_first; - RefPtrWillBeMember<CSSValue> m_second; + Member<CSSValue> m_first; + Member<CSSValue> m_second; IdenticalValuesPolicy m_identicalValuesPolicy; };
diff --git a/third_party/WebKit/Source/core/css/CSSValuePool.cpp b/third_party/WebKit/Source/core/css/CSSValuePool.cpp index cb89241..49522024b 100644 --- a/third_party/WebKit/Source/core/css/CSSValuePool.cpp +++ b/third_party/WebKit/Source/core/css/CSSValuePool.cpp
@@ -34,7 +34,7 @@ CSSValuePool& cssValuePool() { - DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<CSSValuePool>, pool, (adoptPtrWillBeNoop(new CSSValuePool()))); + DEFINE_STATIC_LOCAL(Persistent<CSSValuePool>, pool, (new CSSValuePool())); return *pool; } @@ -53,7 +53,7 @@ m_numberValueCache.resize(maximumCacheableIntegerValue + 1); } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSValuePool::createIdentifierValue(CSSValueID ident) +RawPtr<CSSPrimitiveValue> CSSValuePool::createIdentifierValue(CSSValueID ident) { if (ident <= 0) return CSSPrimitiveValue::createIdentifier(ident); @@ -63,12 +63,12 @@ return m_identifierValueCache[ident]; } -PassRefPtrWillBeRawPtr<CSSCustomIdentValue> CSSValuePool::createIdentifierValue(CSSPropertyID ident) +RawPtr<CSSCustomIdentValue> CSSValuePool::createIdentifierValue(CSSPropertyID ident) { return CSSCustomIdentValue::create(ident); } -PassRefPtrWillBeRawPtr<CSSColorValue> CSSValuePool::createColorValue(RGBA32 rgbValue) +RawPtr<CSSColorValue> CSSValuePool::createColorValue(RGBA32 rgbValue) { // These are the empty and deleted values of the hash table. if (rgbValue == Color::transparent) @@ -92,7 +92,7 @@ if (m_colorValueCache.size() > maximumColorCacheSize) m_colorValueCache.clear(); - RefPtrWillBeRawPtr<CSSColorValue> dummyValue = nullptr; + RawPtr<CSSColorValue> dummyValue = nullptr; ColorValueCache::AddResult entry = m_colorValueCache.add(rgbValue, dummyValue); if (entry.isNewEntry) entry.storedValue->value = CSSColorValue::create(rgbValue); @@ -100,7 +100,7 @@ return entry.storedValue->value; } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSValuePool::createValue(double value, CSSPrimitiveValue::UnitType type) +RawPtr<CSSPrimitiveValue> CSSValuePool::createValue(double value, CSSPrimitiveValue::UnitType type) { if (std::isinf(value)) value = 0; @@ -131,31 +131,31 @@ } } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSValuePool::createValue(const Length& value, const ComputedStyle& style) +RawPtr<CSSPrimitiveValue> CSSValuePool::createValue(const Length& value, const ComputedStyle& style) { return CSSPrimitiveValue::create(value, style.effectiveZoom()); } -PassRefPtrWillBeRawPtr<CSSFontFamilyValue> CSSValuePool::createFontFamilyValue(const String& familyName) +RawPtr<CSSFontFamilyValue> CSSValuePool::createFontFamilyValue(const String& familyName) { if (familyName.isNull()) return CSSFontFamilyValue::create(familyName); - RefPtrWillBeMember<CSSFontFamilyValue>& value = m_fontFamilyValueCache.add(familyName, nullptr).storedValue->value; + Member<CSSFontFamilyValue>& value = m_fontFamilyValueCache.add(familyName, nullptr).storedValue->value; if (!value) value = CSSFontFamilyValue::create(familyName); return value; } -PassRefPtrWillBeRawPtr<CSSValueList> CSSValuePool::createFontFaceValue(const AtomicString& string) +RawPtr<CSSValueList> CSSValuePool::createFontFaceValue(const AtomicString& string) { // Just wipe out the cache and start rebuilding if it gets too big. const unsigned maximumFontFaceCacheSize = 128; if (m_fontFaceValueCache.size() > maximumFontFaceCacheSize) m_fontFaceValueCache.clear(); - RefPtrWillBeMember<CSSValueList>& value = m_fontFaceValueCache.add(string, nullptr).storedValue->value; + Member<CSSValueList>& value = m_fontFaceValueCache.add(string, nullptr).storedValue->value; if (!value) { - RefPtrWillBeRawPtr<CSSValue> parsedValue = CSSParser::parseSingleValue(CSSPropertyFontFamily, string); + RawPtr<CSSValue> parsedValue = CSSParser::parseSingleValue(CSSPropertyFontFamily, string); if (parsedValue && parsedValue->isValueList()) value = toCSSValueList(parsedValue.get()); }
diff --git a/third_party/WebKit/Source/core/css/CSSValuePool.h b/third_party/WebKit/Source/core/css/CSSValuePool.h index 7b70c7e..7d40d63 100644 --- a/third_party/WebKit/Source/core/css/CSSValuePool.h +++ b/third_party/WebKit/Source/core/css/CSSValuePool.h
@@ -43,51 +43,50 @@ namespace blink { -class CORE_EXPORT CSSValuePool : public NoBaseWillBeGarbageCollectedFinalized<CSSValuePool> { - USING_FAST_MALLOC_WILL_BE_REMOVED(CSSValuePool); +class CORE_EXPORT CSSValuePool : public GarbageCollectedFinalized<CSSValuePool> { public: - PassRefPtrWillBeRawPtr<CSSValueList> createFontFaceValue(const AtomicString&); - PassRefPtrWillBeRawPtr<CSSFontFamilyValue> createFontFamilyValue(const String&); - PassRefPtrWillBeRawPtr<CSSInheritedValue> createInheritedValue() { return m_inheritedValue; } - PassRefPtrWillBeRawPtr<CSSInitialValue> createImplicitInitialValue() { return m_implicitInitialValue; } - PassRefPtrWillBeRawPtr<CSSInitialValue> createExplicitInitialValue() { return m_explicitInitialValue; } - PassRefPtrWillBeRawPtr<CSSUnsetValue> createUnsetValue() { return m_unsetValue; } - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifierValue(CSSValueID identifier); - PassRefPtrWillBeRawPtr<CSSCustomIdentValue> createIdentifierValue(CSSPropertyID identifier); - PassRefPtrWillBeRawPtr<CSSColorValue> createColorValue(RGBA32 rgbValue); - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(double value, CSSPrimitiveValue::UnitType); - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, const ComputedStyle&); - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, float zoom) { return CSSPrimitiveValue::create(value, zoom); } - template<typename T> static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(T value) { return CSSPrimitiveValue::create(value); } + RawPtr<CSSValueList> createFontFaceValue(const AtomicString&); + RawPtr<CSSFontFamilyValue> createFontFamilyValue(const String&); + RawPtr<CSSInheritedValue> createInheritedValue() { return m_inheritedValue; } + RawPtr<CSSInitialValue> createImplicitInitialValue() { return m_implicitInitialValue; } + RawPtr<CSSInitialValue> createExplicitInitialValue() { return m_explicitInitialValue; } + RawPtr<CSSUnsetValue> createUnsetValue() { return m_unsetValue; } + RawPtr<CSSPrimitiveValue> createIdentifierValue(CSSValueID identifier); + RawPtr<CSSCustomIdentValue> createIdentifierValue(CSSPropertyID identifier); + RawPtr<CSSColorValue> createColorValue(RGBA32 rgbValue); + RawPtr<CSSPrimitiveValue> createValue(double value, CSSPrimitiveValue::UnitType); + RawPtr<CSSPrimitiveValue> createValue(const Length& value, const ComputedStyle&); + RawPtr<CSSPrimitiveValue> createValue(const Length& value, float zoom) { return CSSPrimitiveValue::create(value, zoom); } + template<typename T> static RawPtr<CSSPrimitiveValue> createValue(T value) { return CSSPrimitiveValue::create(value); } DECLARE_TRACE(); private: CSSValuePool(); - RefPtrWillBeMember<CSSInheritedValue> m_inheritedValue; - RefPtrWillBeMember<CSSInitialValue> m_implicitInitialValue; - RefPtrWillBeMember<CSSInitialValue> m_explicitInitialValue; - RefPtrWillBeMember<CSSUnsetValue> m_unsetValue; + Member<CSSInheritedValue> m_inheritedValue; + Member<CSSInitialValue> m_implicitInitialValue; + Member<CSSInitialValue> m_explicitInitialValue; + Member<CSSUnsetValue> m_unsetValue; - WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, numCSSValueKeywords> m_identifierValueCache; + HeapVector<Member<CSSPrimitiveValue>, numCSSValueKeywords> m_identifierValueCache; - using ColorValueCache = WillBeHeapHashMap<unsigned, RefPtrWillBeMember<CSSColorValue>>; + using ColorValueCache = HeapHashMap<unsigned, Member<CSSColorValue>>; ColorValueCache m_colorValueCache; - RefPtrWillBeMember<CSSColorValue> m_colorTransparent; - RefPtrWillBeMember<CSSColorValue> m_colorWhite; - RefPtrWillBeMember<CSSColorValue> m_colorBlack; + Member<CSSColorValue> m_colorTransparent; + Member<CSSColorValue> m_colorWhite; + Member<CSSColorValue> m_colorBlack; static const int maximumCacheableIntegerValue = 255; - WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_pixelValueCache; - WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_percentValueCache; - WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_numberValueCache; + HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_pixelValueCache; + HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_percentValueCache; + HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_numberValueCache; - using FontFaceValueCache = WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<CSSValueList>>; + using FontFaceValueCache = HeapHashMap<AtomicString, Member<CSSValueList>>; FontFaceValueCache m_fontFaceValueCache; - using FontFamilyValueCache = WillBeHeapHashMap<String, RefPtrWillBeMember<CSSFontFamilyValue>>; + using FontFamilyValueCache = HeapHashMap<String, Member<CSSFontFamilyValue>>; FontFamilyValueCache m_fontFamilyValueCache; friend CORE_EXPORT CSSValuePool& cssValuePool();
diff --git a/third_party/WebKit/Source/core/css/CSSVariableData.h b/third_party/WebKit/Source/core/css/CSSVariableData.h index 1de3837a..b7b669f4 100644 --- a/third_party/WebKit/Source/core/css/CSSVariableData.h +++ b/third_party/WebKit/Source/core/css/CSSVariableData.h
@@ -62,7 +62,7 @@ // Parsed representation for @apply bool m_cachedPropertySet; - RefPtrWillBePersistent<StylePropertySet> m_propertySet; + Persistent<StylePropertySet> m_propertySet; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSVariableReferenceValue.h b/third_party/WebKit/Source/core/css/CSSVariableReferenceValue.h index 187c8fb..d61356a 100644 --- a/third_party/WebKit/Source/core/css/CSSVariableReferenceValue.h +++ b/third_party/WebKit/Source/core/css/CSSVariableReferenceValue.h
@@ -13,9 +13,9 @@ class CSSVariableReferenceValue : public CSSValue { public: - static PassRefPtrWillBeRawPtr<CSSVariableReferenceValue> create(PassRefPtr<CSSVariableData> data) + static RawPtr<CSSVariableReferenceValue> create(PassRefPtr<CSSVariableData> data) { - return adoptRefWillBeNoop(new CSSVariableReferenceValue(data)); + return new CSSVariableReferenceValue(data); } CSSVariableData* variableDataValue() const
diff --git a/third_party/WebKit/Source/core/css/CSSViewportRule.h b/third_party/WebKit/Source/core/css/CSSViewportRule.h index 1675a3a..ebb191c 100644 --- a/third_party/WebKit/Source/core/css/CSSViewportRule.h +++ b/third_party/WebKit/Source/core/css/CSSViewportRule.h
@@ -43,9 +43,9 @@ class CSSViewportRule final: public CSSRule { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CSSViewportRule> create(StyleRuleViewport* viewportRule, CSSStyleSheet* sheet) + static RawPtr<CSSViewportRule> create(StyleRuleViewport* viewportRule, CSSStyleSheet* sheet) { - return adoptRefWillBeNoop(new CSSViewportRule(viewportRule, sheet)); + return new CSSViewportRule(viewportRule, sheet); } ~CSSViewportRule() override; @@ -61,8 +61,8 @@ CSSRule::Type type() const override { return VIEWPORT_RULE; } - RefPtrWillBeMember<StyleRuleViewport> m_viewportRule; - mutable RefPtrWillBeMember<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; + Member<StyleRuleViewport> m_viewportRule; + mutable Member<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; }; DEFINE_CSS_RULE_TYPE_CASTS(CSSViewportRule, VIEWPORT_RULE);
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp index eeb5134..098c11f 100644 --- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp +++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -65,24 +65,24 @@ return style && style->isDisplayFlexibleOrGridBox(); } -inline static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(double value, const ComputedStyle& style) +inline static RawPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(double value, const ComputedStyle& style) { return cssValuePool().createValue(adjustFloatForAbsoluteZoom(value, style), CSSPrimitiveValue::UnitType::Pixels); } -inline static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value, const ComputedStyle& style) +inline static RawPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value, const ComputedStyle& style) { return cssValuePool().createValue(value / style.effectiveZoom(), CSSPrimitiveValue::UnitType::Number); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength(const Length& length, const ComputedStyle& style) +static RawPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength(const Length& length, const ComputedStyle& style) { if (length.isFixed()) return zoomAdjustedPixelValue(length.value(), style); return cssValuePool().createValue(length, style); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> pixelValueForUnzoomedLength(const UnzoomedLength& unzoomedLength, const ComputedStyle& style) +static RawPtr<CSSPrimitiveValue> pixelValueForUnzoomedLength(const UnzoomedLength& unzoomedLength, const ComputedStyle& style) { const Length& length = unzoomedLength.length(); if (length.isFixed()) @@ -90,9 +90,9 @@ return cssValuePool().createValue(length, style); } -static PassRefPtrWillBeRawPtr<CSSValueList> createPositionListForLayer(CSSPropertyID propertyID, const FillLayer& layer, const ComputedStyle& style) +static RawPtr<CSSValueList> createPositionListForLayer(CSSPropertyID propertyID, const FillLayer& layer, const ComputedStyle& style) { - RefPtrWillBeRawPtr<CSSValueList> positionList = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> positionList = CSSValueList::createSpaceSeparated(); if (layer.isBackgroundXOriginSet()) { ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition || propertyID == CSSPropertyWebkitMaskPosition); positionList->append(cssValuePool().createValue(layer.backgroundXOrigin())); @@ -106,13 +106,13 @@ return positionList.release(); } -PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::currentColorOrValidColor(const ComputedStyle& style, const StyleColor& color) +RawPtr<CSSValue> ComputedStyleCSSValueMapping::currentColorOrValidColor(const ComputedStyle& style, const StyleColor& color) { // This function does NOT look at visited information, so that computed style doesn't expose that. return cssValuePool().createColorValue(color.resolve(style.color()).rgb()); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForFillSize(const FillSize& fillSize, const ComputedStyle& style) +static RawPtr<CSSValue> valueForFillSize(const FillSize& fillSize, const ComputedStyle& style) { if (fillSize.type == Contain) return cssValuePool().createIdentifierValue(CSSValueContain); @@ -123,13 +123,13 @@ if (fillSize.size.height().isAuto()) return zoomAdjustedPixelValueForLength(fillSize.size.width(), style); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(zoomAdjustedPixelValueForLength(fillSize.size.width(), style)); list->append(zoomAdjustedPixelValueForLength(fillSize.size.height(), style)); return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForFillRepeat(EFillRepeat xRepeat, EFillRepeat yRepeat) +static RawPtr<CSSValue> valueForFillRepeat(EFillRepeat xRepeat, EFillRepeat yRepeat) { // For backwards compatibility, if both values are equal, just return one of them. And // if the two values are equivalent to repeat-x or repeat-y, just return the shorthand. @@ -140,13 +140,13 @@ if (xRepeat == NoRepeatFill && yRepeat == RepeatFill) return cssValuePool().createIdentifierValue(CSSValueRepeatY); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(cssValuePool().createValue(xRepeat)); list->append(cssValuePool().createValue(yRepeat)); return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForFillSourceType(EMaskSourceType type) +static RawPtr<CSSValue> valueForFillSourceType(EMaskSourceType type) { switch (type) { case MaskAlpha: @@ -160,7 +160,7 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> valueForPositionOffset(const ComputedStyle& style, CSSPropertyID propertyID, const LayoutObject* layoutObject) +static RawPtr<CSSValue> valueForPositionOffset(const ComputedStyle& style, CSSPropertyID propertyID, const LayoutObject* layoutObject) { Length offset; switch (propertyID) { @@ -196,13 +196,13 @@ return zoomAdjustedPixelValueForLength(offset, style); } -static PassRefPtrWillBeRawPtr<CSSBorderImageSliceValue> valueForNinePieceImageSlice(const NinePieceImage& image) +static RawPtr<CSSBorderImageSliceValue> valueForNinePieceImageSlice(const NinePieceImage& image) { // Create the slices. - RefPtrWillBeRawPtr<CSSPrimitiveValue> top = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> right = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> left = nullptr; + RawPtr<CSSPrimitiveValue> top = nullptr; + RawPtr<CSSPrimitiveValue> right = nullptr; + RawPtr<CSSPrimitiveValue> bottom = nullptr; + RawPtr<CSSPrimitiveValue> left = nullptr; // TODO(alancutter): Make this code aware of calc lengths. if (image.imageSlices().top().hasPercent()) @@ -244,13 +244,13 @@ return CSSBorderImageSliceValue::create(CSSQuadValue::create(top.release(), right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsQuad), image.fill()); } -static PassRefPtrWillBeRawPtr<CSSQuadValue> valueForNinePieceImageQuad(const BorderImageLengthBox& box, const ComputedStyle& style) +static RawPtr<CSSQuadValue> valueForNinePieceImageQuad(const BorderImageLengthBox& box, const ComputedStyle& style) { // Create the slices. - RefPtrWillBeRawPtr<CSSPrimitiveValue> top = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> right = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> left = nullptr; + RawPtr<CSSPrimitiveValue> top = nullptr; + RawPtr<CSSPrimitiveValue> right = nullptr; + RawPtr<CSSPrimitiveValue> bottom = nullptr; + RawPtr<CSSPrimitiveValue> left = nullptr; if (box.top().isNumber()) top = cssValuePool().createValue(box.top().number(), CSSPrimitiveValue::UnitType::Number); @@ -304,10 +304,10 @@ } } -static PassRefPtrWillBeRawPtr<CSSValue> valueForNinePieceImageRepeat(const NinePieceImage& image) +static RawPtr<CSSValue> valueForNinePieceImageRepeat(const NinePieceImage& image) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontalRepeat = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> verticalRepeat = nullptr; + RawPtr<CSSPrimitiveValue> horizontalRepeat = nullptr; + RawPtr<CSSPrimitiveValue> verticalRepeat = nullptr; horizontalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(image.horizontalRule())); if (image.horizontalRule() == image.verticalRule()) @@ -317,44 +317,44 @@ return CSSValuePair::create(horizontalRepeat.release(), verticalRepeat.release(), CSSValuePair::DropIdenticalValues); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image, const ComputedStyle& style) +static RawPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image, const ComputedStyle& style) { if (!image.hasImage()) return cssValuePool().createIdentifierValue(CSSValueNone); // Image first. - RefPtrWillBeRawPtr<CSSValue> imageValue = nullptr; + RawPtr<CSSValue> imageValue = nullptr; if (image.image()) imageValue = image.image()->computedCSSValue(); // Create the image slice. - RefPtrWillBeRawPtr<CSSBorderImageSliceValue> imageSlices = valueForNinePieceImageSlice(image); + RawPtr<CSSBorderImageSliceValue> imageSlices = valueForNinePieceImageSlice(image); // Create the border area slices. - RefPtrWillBeRawPtr<CSSValue> borderSlices = valueForNinePieceImageQuad(image.borderSlices(), style); + RawPtr<CSSValue> borderSlices = valueForNinePieceImageQuad(image.borderSlices(), style); // Create the border outset. - RefPtrWillBeRawPtr<CSSValue> outset = valueForNinePieceImageQuad(image.outset(), style); + RawPtr<CSSValue> outset = valueForNinePieceImageQuad(image.outset(), style); // Create the repeat rules. - RefPtrWillBeRawPtr<CSSValue> repeat = valueForNinePieceImageRepeat(image); + RawPtr<CSSValue> repeat = valueForNinePieceImageRepeat(image); return createBorderImageValue(imageValue.release(), imageSlices.release(), borderSlices.release(), outset.release(), repeat.release()); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForReflection(const StyleReflection* reflection, const ComputedStyle& style) +static RawPtr<CSSValue> valueForReflection(const StyleReflection* reflection, const ComputedStyle& style) { if (!reflection) return cssValuePool().createIdentifierValue(CSSValueNone); - RefPtrWillBeRawPtr<CSSPrimitiveValue> offset = nullptr; + RawPtr<CSSPrimitiveValue> offset = nullptr; // TODO(alancutter): Make this work correctly for calc lengths. if (reflection->offset().hasPercent()) offset = cssValuePool().createValue(reflection->offset().percent(), CSSPrimitiveValue::UnitType::Percentage); else offset = zoomAdjustedPixelValue(reflection->offset().value(), style); - RefPtrWillBeRawPtr<CSSPrimitiveValue> direction = nullptr; + RawPtr<CSSPrimitiveValue> direction = nullptr; switch (reflection->direction()) { case ReflectionBelow: direction = cssValuePool().createIdentifierValue(CSSValueBelow); @@ -384,9 +384,9 @@ return isFlexOrGrid(style) ? ItemPositionStretch : ItemPositionStart; } -static PassRefPtrWillBeRawPtr<CSSValueList> valueForItemPositionWithOverflowAlignment(ItemPosition itemPosition, OverflowAlignment overflowAlignment, ItemPositionType positionType) +static RawPtr<CSSValueList> valueForItemPositionWithOverflowAlignment(ItemPosition itemPosition, OverflowAlignment overflowAlignment, ItemPositionType positionType) { - RefPtrWillBeRawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); if (positionType == LegacyPosition) result->append(CSSPrimitiveValue::createIdentifier(CSSValueLegacy)); result->append(CSSPrimitiveValue::create(itemPosition)); @@ -396,37 +396,37 @@ return result.release(); } -static PassRefPtrWillBeRawPtr<CSSValueList> valuesForGridShorthand(const StylePropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) +static RawPtr<CSSValueList> valuesForGridShorthand(const StylePropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); for (size_t i = 0; i < shorthand.length(); ++i) { - RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle); + RawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle); ASSERT(value); list->append(value.release()); } return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValueList> valuesForShorthandProperty(const StylePropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) +static RawPtr<CSSValueList> valuesForShorthandProperty(const StylePropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); for (size_t i = 0; i < shorthand.length(); ++i) { - RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle); + RawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle); ASSERT(value); list->append(value); } return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBackgroundShorthand(const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) +static RawPtr<CSSValueList> valuesForBackgroundShorthand(const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) { - RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); const FillLayer* currLayer = &style.backgroundLayers(); for (; currLayer; currLayer = currLayer->next()) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); - RefPtrWillBeRawPtr<CSSValueList> beforeSlash = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); + RawPtr<CSSValueList> beforeSlash = CSSValueList::createSpaceSeparated(); if (!currLayer->next()) { // color only for final layer - RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(CSSPropertyBackgroundColor, style, layoutObject, styledNode, allowVisitedStyle); + RawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(CSSPropertyBackgroundColor, style, layoutObject, styledNode, allowVisitedStyle); ASSERT(value); beforeSlash->append(value); } @@ -435,7 +435,7 @@ beforeSlash->append(cssValuePool().createValue(currLayer->attachment())); beforeSlash->append(createPositionListForLayer(CSSPropertyBackgroundPosition, *currLayer, style)); list->append(beforeSlash); - RefPtrWillBeRawPtr<CSSValueList> afterSlash = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> afterSlash = CSSValueList::createSpaceSeparated(); afterSlash->append(valueForFillSize(currLayer->size(), style)); afterSlash->append(cssValuePool().createValue(currLayer->origin())); afterSlash->append(cssValuePool().createValue(currLayer->clip())); @@ -445,9 +445,9 @@ return ret.release(); } -static PassRefPtrWillBeRawPtr<CSSValueList> valueForContentPositionAndDistributionWithOverflowAlignment(const StyleContentAlignmentData& data) +static RawPtr<CSSValueList> valueForContentPositionAndDistributionWithOverflowAlignment(const StyleContentAlignmentData& data) { - RefPtrWillBeRawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); if (data.distribution() != ContentDistributionDefault) result->append(CSSPrimitiveValue::create(data.distribution())); if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal) @@ -459,7 +459,7 @@ return result.release(); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForLineHeight(const ComputedStyle& style) +static RawPtr<CSSPrimitiveValue> valueForLineHeight(const ComputedStyle& style) { Length length = style.lineHeight(); if (length.isNegative()) @@ -485,48 +485,48 @@ return CSSValueInvalid; } -static PassRefPtrWillBeRawPtr<CSSValue> valueForFamily(const AtomicString& family) +static RawPtr<CSSValue> valueForFamily(const AtomicString& family) { if (CSSValueID familyIdentifier = identifierForFamily(family)) return cssValuePool().createIdentifierValue(familyIdentifier); return cssValuePool().createFontFamilyValue(family.getString()); } -static PassRefPtrWillBeRawPtr<CSSValueList> valueForFontFamily(const ComputedStyle& style) +static RawPtr<CSSValueList> valueForFontFamily(const ComputedStyle& style) { const FontFamily& firstFamily = style.getFontDescription().family(); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); for (const FontFamily* family = &firstFamily; family; family = family->next()) list->append(valueForFamily(family->family())); return list.release(); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontSize(const ComputedStyle& style) +static RawPtr<CSSPrimitiveValue> valueForFontSize(const ComputedStyle& style) { return zoomAdjustedPixelValue(style.getFontDescription().computedSize(), style); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontStretch(const ComputedStyle& style) +static RawPtr<CSSPrimitiveValue> valueForFontStretch(const ComputedStyle& style) { return cssValuePool().createValue(style.getFontDescription().stretch()); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontStyle(const ComputedStyle& style) +static RawPtr<CSSPrimitiveValue> valueForFontStyle(const ComputedStyle& style) { return cssValuePool().createValue(style.getFontDescription().style()); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontVariant(const ComputedStyle& style) +static RawPtr<CSSPrimitiveValue> valueForFontVariant(const ComputedStyle& style) { return cssValuePool().createValue(style.getFontDescription().variant()); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFontWeight(const ComputedStyle& style) +static RawPtr<CSSPrimitiveValue> valueForFontWeight(const ComputedStyle& style) { return cssValuePool().createValue(style.getFontDescription().weight()); } -static PassRefPtrWillBeRawPtr<CSSValue> specifiedValueForGridTrackBreadth(const GridLength& trackBreadth, const ComputedStyle& style) +static RawPtr<CSSValue> specifiedValueForGridTrackBreadth(const GridLength& trackBreadth, const ComputedStyle& style) { if (!trackBreadth.isLength()) return cssValuePool().createValue(trackBreadth.flex(), CSSPrimitiveValue::UnitType::Fraction); @@ -537,13 +537,13 @@ return zoomAdjustedPixelValueForLength(trackBreadthLength, style); } -static PassRefPtrWillBeRawPtr<CSSValue> specifiedValueForGridTrackSize(const GridTrackSize& trackSize, const ComputedStyle& style) +static RawPtr<CSSValue> specifiedValueForGridTrackSize(const GridTrackSize& trackSize, const ComputedStyle& style) { switch (trackSize.type()) { case LengthTrackSizing: return specifiedValueForGridTrackBreadth(trackSize.length(), style); case MinMaxTrackSizing: - RefPtrWillBeRawPtr<CSSFunctionValue> minMaxTrackBreadths = CSSFunctionValue::create(CSSValueMinmax); + RawPtr<CSSFunctionValue> minMaxTrackBreadths = CSSFunctionValue::create(CSSValueMinmax); minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.minTrackBreadth(), style)); minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.maxTrackBreadth(), style)); return minMaxTrackBreadths.release(); @@ -558,13 +558,13 @@ if (namedGridLines.isEmpty()) return; - RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue::create(); + RawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue::create(); for (size_t j = 0; j < namedGridLines.size(); ++j) lineNames->append(CSSCustomIdentValue::create(namedGridLines[j])); list.append(lineNames.release()); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDirection direction, const LayoutObject* layoutObject, const ComputedStyle& style) +static RawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDirection direction, const LayoutObject* layoutObject, const ComputedStyle& style) { bool isRowAxis = direction == ForColumns; const Vector<GridTrackSize>& trackSizes = isRowAxis ? style.gridTemplateColumns() : style.gridTemplateRows(); @@ -587,7 +587,7 @@ return cssValuePool().createIdentifierValue(CSSValueNone); } - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); size_t insertionIndex; if (isLayoutGrid) { const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? toLayoutGrid(layoutObject)->columnPositions() : toLayoutGrid(layoutObject)->rowPositions(); @@ -617,7 +617,7 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForGridPosition(const GridPosition& position) +static RawPtr<CSSValue> valueForGridPosition(const GridPosition& position) { if (position.isAuto()) return cssValuePool().createIdentifierValue(CSSValueAuto); @@ -625,7 +625,7 @@ if (position.isNamedGridArea()) return CSSCustomIdentValue::create(position.namedGridLine()); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (position.isSpan()) { list->append(cssValuePool().createIdentifierValue(CSSValueSpan)); list->append(cssValuePool().createValue(position.spanPosition(), CSSPrimitiveValue::UnitType::Number)); @@ -647,10 +647,10 @@ return box->style()->boxSizing() == BoxSizingBorderBox ? box->borderBoxRect() : box->computedCSSContentBoxRect(); } -static PassRefPtrWillBeRawPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecoration) +static RawPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecoration) { // Blink value is ignored. - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (textDecoration & TextDecorationUnderline) list->append(cssValuePool().createIdentifierValue(CSSValueUnderline)); if (textDecoration & TextDecorationOverline) @@ -663,7 +663,7 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForTextDecorationStyle(TextDecorationStyle textDecorationStyle) +static RawPtr<CSSValue> valueForTextDecorationStyle(TextDecorationStyle textDecorationStyle) { switch (textDecorationStyle) { case TextDecorationStyleSolid: @@ -682,9 +682,9 @@ return cssValuePool().createExplicitInitialValue(); } -static PassRefPtrWillBeRawPtr<CSSValue> touchActionFlagsToCSSValue(TouchAction touchAction) +static RawPtr<CSSValue> touchActionFlagsToCSSValue(TouchAction touchAction) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (touchAction == TouchActionAuto) { list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); } else if (touchAction == TouchActionNone) { @@ -710,9 +710,9 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForWillChange(const Vector<CSSPropertyID>& willChangeProperties, bool willChangeContents, bool willChangeScrollPosition) +static RawPtr<CSSValue> valueForWillChange(const Vector<CSSPropertyID>& willChangeProperties, bool willChangeContents, bool willChangeScrollPosition) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); if (willChangeContents) list->append(cssValuePool().createIdentifierValue(CSSValueContents)); if (willChangeScrollPosition) @@ -724,9 +724,9 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationDelay(const CSSTimingData* timingData) +static RawPtr<CSSValue> valueForAnimationDelay(const CSSTimingData* timingData) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); if (timingData) { for (size_t i = 0; i < timingData->delayList().size(); ++i) list->append(cssValuePool().createValue(timingData->delayList()[i], CSSPrimitiveValue::UnitType::Seconds)); @@ -736,7 +736,7 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationDirection(Timing::PlaybackDirection direction) +static RawPtr<CSSValue> valueForAnimationDirection(Timing::PlaybackDirection direction) { switch (direction) { case Timing::PlaybackDirectionNormal: @@ -753,9 +753,9 @@ } } -static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationDuration(const CSSTimingData* timingData) +static RawPtr<CSSValue> valueForAnimationDuration(const CSSTimingData* timingData) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); if (timingData) { for (size_t i = 0; i < timingData->durationList().size(); ++i) list->append(cssValuePool().createValue(timingData->durationList()[i], CSSPrimitiveValue::UnitType::Seconds)); @@ -765,7 +765,7 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationFillMode(Timing::FillMode fillMode) +static RawPtr<CSSValue> valueForAnimationFillMode(Timing::FillMode fillMode) { switch (fillMode) { case Timing::FillModeNone: @@ -782,14 +782,14 @@ } } -static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationIterationCount(double iterationCount) +static RawPtr<CSSValue> valueForAnimationIterationCount(double iterationCount) { if (iterationCount == std::numeric_limits<double>::infinity()) return cssValuePool().createIdentifierValue(CSSValueInfinite); return cssValuePool().createValue(iterationCount, CSSPrimitiveValue::UnitType::Number); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationPlayState(EAnimPlayState playState) +static RawPtr<CSSValue> valueForAnimationPlayState(EAnimPlayState playState) { if (playState == AnimPlayStatePlaying) return cssValuePool().createIdentifierValue(CSSValueRunning); @@ -797,7 +797,7 @@ return cssValuePool().createIdentifierValue(CSSValuePaused); } -static PassRefPtrWillBeRawPtr<CSSValue> createTimingFunctionValue(const TimingFunction* timingFunction) +static RawPtr<CSSValue> createTimingFunctionValue(const TimingFunction* timingFunction) { switch (timingFunction->type()) { case TimingFunction::kCubicBezierFunction: @@ -845,9 +845,9 @@ } } -static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationTimingFunction(const CSSTimingData* timingData) +static RawPtr<CSSValue> valueForAnimationTimingFunction(const CSSTimingData* timingData) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); if (timingData) { for (size_t i = 0; i < timingData->timingFunctionList().size(); ++i) list->append(createTimingFunctionValue(timingData->timingFunctionList()[i].get())); @@ -857,9 +857,9 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBorderRadiusCorner(LengthSize radius, const ComputedStyle& style) +static RawPtr<CSSValueList> valuesForBorderRadiusCorner(LengthSize radius, const ComputedStyle& style) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (radius.width().type() == Percent) list->append(cssValuePool().createValue(radius.width().percent(), CSSPrimitiveValue::UnitType::Percentage)); else @@ -871,17 +871,17 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForBorderRadiusCorner(LengthSize radius, const ComputedStyle& style) +static RawPtr<CSSValue> valueForBorderRadiusCorner(LengthSize radius, const ComputedStyle& style) { - RefPtrWillBeRawPtr<CSSValueList> list = valuesForBorderRadiusCorner(radius, style); + RawPtr<CSSValueList> list = valuesForBorderRadiusCorner(radius, style); if (list->item(0)->equals(*list->item(1))) return list->item(0); return list.release(); } -static PassRefPtrWillBeRawPtr<CSSFunctionValue> valueForMatrixTransform(const TransformationMatrix& transform, const ComputedStyle& style) +static RawPtr<CSSFunctionValue> valueForMatrixTransform(const TransformationMatrix& transform, const ComputedStyle& style) { - RefPtrWillBeRawPtr<CSSFunctionValue> transformValue = nullptr; + RawPtr<CSSFunctionValue> transformValue = nullptr; if (transform.isAffine()) { transformValue = CSSFunctionValue::create(CSSValueMatrix); @@ -918,7 +918,7 @@ return transformValue.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> computedTransform(const LayoutObject* layoutObject, const ComputedStyle& style) +static RawPtr<CSSValue> computedTransform(const LayoutObject* layoutObject, const ComputedStyle& style) { if (!layoutObject || !style.hasTransform()) return cssValuePool().createIdentifierValue(CSSValueNone); @@ -931,13 +931,13 @@ style.applyTransform(transform, LayoutSize(box.size()), ComputedStyle::ExcludeTransformOrigin, ComputedStyle::ExcludeMotionPath, ComputedStyle::ExcludeIndependentTransformProperties); // FIXME: Need to print out individual functions (https://bugs.webkit.org/show_bug.cgi?id=23924) - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(valueForMatrixTransform(transform, style)); return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> createTransitionPropertyValue(const CSSTransitionData::TransitionProperty& property) +static RawPtr<CSSValue> createTransitionPropertyValue(const CSSTransitionData::TransitionProperty& property) { if (property.propertyType == CSSTransitionData::TransitionNone) return cssValuePool().createIdentifierValue(CSSValueNone); @@ -947,9 +947,9 @@ return CSSCustomIdentValue::create(getPropertyNameString(property.unresolvedProperty)); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForTransitionProperty(const CSSTransitionData* transitionData) +static RawPtr<CSSValue> valueForTransitionProperty(const CSSTransitionData* transitionData) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); if (transitionData) { for (size_t i = 0; i < transitionData->propertyList().size(); ++i) list->append(createTransitionPropertyValue(transitionData->propertyList()[i])); @@ -975,19 +975,19 @@ return CSSValueInvalid; } -static PassRefPtrWillBeRawPtr<CSSValue> valueForContentData(const ComputedStyle& style) +static RawPtr<CSSValue> valueForContentData(const ComputedStyle& style) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); for (const ContentData* contentData = style.contentData(); contentData; contentData = contentData->next()) { if (contentData->isCounter()) { const CounterContent* counter = toCounterContentData(contentData)->counter(); ASSERT(counter); - RefPtrWillBeRawPtr<CSSCustomIdentValue> identifier = CSSCustomIdentValue::create(counter->identifier()); - RefPtrWillBeRawPtr<CSSCustomIdentValue> separator = CSSCustomIdentValue::create(counter->separator()); + RawPtr<CSSCustomIdentValue> identifier = CSSCustomIdentValue::create(counter->identifier()); + RawPtr<CSSCustomIdentValue> separator = CSSCustomIdentValue::create(counter->separator()); CSSValueID listStyleIdent = CSSValueNone; if (counter->listStyle() != NoneListStyle) listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter->listStyle()); - RefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle = cssValuePool().createIdentifierValue(listStyleIdent); + RawPtr<CSSPrimitiveValue> listStyle = cssValuePool().createIdentifierValue(listStyleIdent); list->append(CSSCounterValue::create(identifier.release(), listStyle.release(), separator.release())); } else if (contentData->isImage()) { const StyleImage* image = toImageContentData(contentData)->image(); @@ -1005,13 +1005,13 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const ComputedStyle& style, CSSPropertyID propertyID) +static RawPtr<CSSValue> valueForCounterDirectives(const ComputedStyle& style, CSSPropertyID propertyID) { const CounterDirectiveMap* map = style.counterDirectives(); if (!map) return cssValuePool().createIdentifierValue(CSSValueNone); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); for (const auto& item : *map) { bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? item.value.isIncrement() : item.value.isReset(); if (!isValidCounterValue) @@ -1028,7 +1028,7 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForShape(const ComputedStyle& style, ShapeValue* shapeValue) +static RawPtr<CSSValue> valueForShape(const ComputedStyle& style, ShapeValue* shapeValue) { if (!shapeValue) return cssValuePool().createIdentifierValue(CSSValueNone); @@ -1042,21 +1042,21 @@ ASSERT(shapeValue->type() == ShapeValue::Shape); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(valueForBasicShape(style, shapeValue->shape())); if (shapeValue->cssBox() != BoxMissing) list->append(cssValuePool().createValue(shapeValue->cssBox())); return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValueList> valuesForSidesShorthand(const StylePropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) +static RawPtr<CSSValueList> valuesForSidesShorthand(const StylePropertyShorthand& shorthand, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); // Assume the properties are in the usual order top, right, bottom, left. - RefPtrWillBeRawPtr<CSSValue> topValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[0], style, layoutObject, styledNode, allowVisitedStyle); - RefPtrWillBeRawPtr<CSSValue> rightValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[1], style, layoutObject, styledNode, allowVisitedStyle); - RefPtrWillBeRawPtr<CSSValue> bottomValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[2], style, layoutObject, styledNode, allowVisitedStyle); - RefPtrWillBeRawPtr<CSSValue> leftValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[3], style, layoutObject, styledNode, allowVisitedStyle); + RawPtr<CSSValue> topValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[0], style, layoutObject, styledNode, allowVisitedStyle); + RawPtr<CSSValue> rightValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[1], style, layoutObject, styledNode, allowVisitedStyle); + RawPtr<CSSValue> bottomValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[2], style, layoutObject, styledNode, allowVisitedStyle); + RawPtr<CSSValue> leftValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[3], style, layoutObject, styledNode, allowVisitedStyle); // All 4 properties must be specified. if (!topValue || !rightValue || !bottomValue || !leftValue) @@ -1077,9 +1077,9 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValueList> valueForBorderRadiusShorthand(const ComputedStyle& style) +static RawPtr<CSSValueList> valueForBorderRadiusShorthand(const ComputedStyle& style) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); bool showHorizontalBottomLeft = style.borderTopRightRadius().width() != style.borderBottomLeftRadius().width(); bool showHorizontalBottomRight = showHorizontalBottomLeft || (style.borderBottomRightRadius().width() != style.borderTopLeftRadius().width()); @@ -1089,12 +1089,12 @@ bool showVerticalBottomRight = showVerticalBottomLeft || (style.borderBottomRightRadius().height() != style.borderTopLeftRadius().height()); bool showVerticalTopRight = showVerticalBottomRight || (style.borderTopRightRadius().height() != style.borderTopLeftRadius().height()); - RefPtrWillBeRawPtr<CSSValueList> topLeftRadius = valuesForBorderRadiusCorner(style.borderTopLeftRadius(), style); - RefPtrWillBeRawPtr<CSSValueList> topRightRadius = valuesForBorderRadiusCorner(style.borderTopRightRadius(), style); - RefPtrWillBeRawPtr<CSSValueList> bottomRightRadius = valuesForBorderRadiusCorner(style.borderBottomRightRadius(), style); - RefPtrWillBeRawPtr<CSSValueList> bottomLeftRadius = valuesForBorderRadiusCorner(style.borderBottomLeftRadius(), style); + RawPtr<CSSValueList> topLeftRadius = valuesForBorderRadiusCorner(style.borderTopLeftRadius(), style); + RawPtr<CSSValueList> topRightRadius = valuesForBorderRadiusCorner(style.borderTopRightRadius(), style); + RawPtr<CSSValueList> bottomRightRadius = valuesForBorderRadiusCorner(style.borderBottomRightRadius(), style); + RawPtr<CSSValueList> bottomLeftRadius = valuesForBorderRadiusCorner(style.borderBottomLeftRadius(), style); - RefPtrWillBeRawPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated(); horizontalRadii->append(topLeftRadius->item(0)); if (showHorizontalTopRight) horizontalRadii->append(topRightRadius->item(0)); @@ -1105,7 +1105,7 @@ list->append(horizontalRadii.release()); - RefPtrWillBeRawPtr<CSSValueList> verticalRadii = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> verticalRadii = CSSValueList::createSpaceSeparated(); verticalRadii->append(topLeftRadius->item(1)); if (showVerticalTopRight) verticalRadii->append(topRightRadius->item(1)); @@ -1120,21 +1120,21 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> strokeDashArrayToCSSValueList(const SVGDashArray& dashes, const ComputedStyle& style) +static RawPtr<CSSValue> strokeDashArrayToCSSValueList(const SVGDashArray& dashes, const ComputedStyle& style) { if (dashes.isEmpty()) return CSSPrimitiveValue::createIdentifier(CSSValueNone); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); for (const Length& dashLength : dashes.vector()) list->append(zoomAdjustedPixelValueForLength(dashLength, style)); return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> paintOrderToCSSValueList(const SVGComputedStyle& svgStyle) +static RawPtr<CSSValue> paintOrderToCSSValueList(const SVGComputedStyle& svgStyle) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); for (int i = 0; i < 3; i++) { EPaintOrderType paintOrderType = svgStyle.paintOrderType(i); switch (paintOrderType) { @@ -1153,10 +1153,10 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintType paintType, const String& url, const Color& color, const Color& currentColor) +static RawPtr<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintType paintType, const String& url, const Color& color, const Color& currentColor) { if (paintType >= SVG_PAINTTYPE_URI_NONE) { - RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); values->append(CSSURIValue::create(url)); if (paintType == SVG_PAINTTYPE_URI_NONE) values->append(CSSPrimitiveValue::createIdentifier(CSSValueNone)); @@ -1179,37 +1179,37 @@ return "#" + resource; } -PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForShadowData(const ShadowData& shadow, const ComputedStyle& style, bool useSpread) +RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForShadowData(const ShadowData& shadow, const ComputedStyle& style, bool useSpread) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(shadow.x(), style); - RefPtrWillBeRawPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(shadow.y(), style); - RefPtrWillBeRawPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(shadow.blur(), style); - RefPtrWillBeRawPtr<CSSPrimitiveValue> spread = useSpread ? zoomAdjustedPixelValue(shadow.spread(), style) : PassRefPtrWillBeRawPtr<CSSPrimitiveValue>(nullptr); - RefPtrWillBeRawPtr<CSSPrimitiveValue> shadowStyle = shadow.style() == Normal ? PassRefPtrWillBeRawPtr<CSSPrimitiveValue>(nullptr) : cssValuePool().createIdentifierValue(CSSValueInset); - RefPtrWillBeRawPtr<CSSValue> color = currentColorOrValidColor(style, shadow.color()); + RawPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(shadow.x(), style); + RawPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(shadow.y(), style); + RawPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(shadow.blur(), style); + RawPtr<CSSPrimitiveValue> spread = useSpread ? zoomAdjustedPixelValue(shadow.spread(), style) : RawPtr<CSSPrimitiveValue>(nullptr); + RawPtr<CSSPrimitiveValue> shadowStyle = shadow.style() == Normal ? RawPtr<CSSPrimitiveValue>(nullptr) : cssValuePool().createIdentifierValue(CSSValueInset); + RawPtr<CSSValue> color = currentColorOrValidColor(style, shadow.color()); return CSSShadowValue::create(x.release(), y.release(), blur.release(), spread.release(), shadowStyle.release(), color.release()); } -PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForShadowList(const ShadowList* shadowList, const ComputedStyle& style, bool useSpread) +RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForShadowList(const ShadowList* shadowList, const ComputedStyle& style, bool useSpread) { if (!shadowList) return cssValuePool().createIdentifierValue(CSSValueNone); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); size_t shadowCount = shadowList->shadows().size(); for (size_t i = 0; i < shadowCount; ++i) list->append(valueForShadowData(shadowList->shadows()[i], style, useSpread)); return list.release(); } -PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForFilter(const ComputedStyle& style, const FilterOperations& filterOperations) +RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForFilter(const ComputedStyle& style, const FilterOperations& filterOperations) { if (filterOperations.operations().isEmpty()) return cssValuePool().createIdentifierValue(CSSValueNone); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); - RefPtrWillBeRawPtr<CSSFunctionValue> filterValue = nullptr; + RawPtr<CSSFunctionValue> filterValue = nullptr; for (const auto& operation : filterOperations.operations()) { FilterOperation* filterOperation = operation.get(); @@ -1272,14 +1272,14 @@ return list.release(); } -PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForFont(const ComputedStyle& style) +RawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForFont(const ComputedStyle& style) { // Add a slash between size and line-height. - RefPtrWillBeRawPtr<CSSValueList> sizeAndLineHeight = CSSValueList::createSlashSeparated(); + RawPtr<CSSValueList> sizeAndLineHeight = CSSValueList::createSlashSeparated(); sizeAndLineHeight->append(valueForFontSize(style)); sizeAndLineHeight->append(valueForLineHeight(style)); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(valueForFontStyle(style)); list->append(valueForFontVariant(style)); list->append(valueForFontWeight(style)); @@ -1290,18 +1290,18 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForScrollSnapDestination(const LengthPoint& destination, const ComputedStyle& style) +static RawPtr<CSSValue> valueForScrollSnapDestination(const LengthPoint& destination, const ComputedStyle& style) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(zoomAdjustedPixelValueForLength(destination.x(), style)); list->append(zoomAdjustedPixelValueForLength(destination.y(), style)); return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForScrollSnapPoints(const ScrollSnapPoints& points, const ComputedStyle& style) +static RawPtr<CSSValue> valueForScrollSnapPoints(const ScrollSnapPoints& points, const ComputedStyle& style) { if (points.hasRepeat) { - RefPtrWillBeRawPtr<CSSFunctionValue> repeat = CSSFunctionValue::create(CSSValueRepeat); + RawPtr<CSSFunctionValue> repeat = CSSFunctionValue::create(CSSValueRepeat); repeat->append(zoomAdjustedPixelValueForLength(points.repeatOffset, style)); return repeat.release(); } @@ -1309,12 +1309,12 @@ return cssValuePool().createIdentifierValue(CSSValueNone); } -static PassRefPtrWillBeRawPtr<CSSValue> valueForScrollSnapCoordinate(const Vector<LengthPoint>& coordinates, const ComputedStyle& style) +static RawPtr<CSSValue> valueForScrollSnapCoordinate(const Vector<LengthPoint>& coordinates, const ComputedStyle& style) { if (coordinates.isEmpty()) return cssValuePool().createIdentifierValue(CSSValueNone); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); for (auto& coordinate : coordinates) { auto pair = CSSValueList::createSpaceSeparated(); @@ -1362,7 +1362,7 @@ } } -PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(const AtomicString customPropertyName, const ComputedStyle& style) +RawPtr<CSSValue> ComputedStyleCSSValueMapping::get(const AtomicString customPropertyName, const ComputedStyle& style) { StyleVariableData* variables = style.variables(); if (!variables) @@ -1383,7 +1383,7 @@ return nullptr; } -PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) +RawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle) { const SVGComputedStyle& svgStyle = style.svgStyle(); propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.direction(), style.getWritingMode()); @@ -1395,7 +1395,7 @@ return allowVisitedStyle ? cssValuePool().createColorValue(style.visitedDependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(style, style.backgroundColor()); case CSSPropertyBackgroundImage: case CSSPropertyWebkitMaskImage: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImage ? &style.maskLayers() : &style.backgroundLayers(); for (; currLayer; currLayer = currLayer->next()) { if (currLayer->image()) @@ -1407,7 +1407,7 @@ } case CSSPropertyBackgroundSize: case CSSPropertyWebkitMaskSize: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskSize ? &style.maskLayers() : &style.backgroundLayers(); for (; currLayer; currLayer = currLayer->next()) list->append(valueForFillSize(currLayer->size(), style)); @@ -1415,27 +1415,27 @@ } case CSSPropertyBackgroundRepeat: case CSSPropertyWebkitMaskRepeat: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskRepeat ? &style.maskLayers() : &style.backgroundLayers(); for (; currLayer; currLayer = currLayer->next()) list->append(valueForFillRepeat(currLayer->repeatX(), currLayer->repeatY())); return list.release(); } case CSSPropertyMaskSourceType: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); for (const FillLayer* currLayer = &style.maskLayers(); currLayer; currLayer = currLayer->next()) list->append(valueForFillSourceType(currLayer->maskSourceType())); return list.release(); } case CSSPropertyWebkitMaskComposite: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskComposite ? &style.maskLayers() : &style.backgroundLayers(); for (; currLayer; currLayer = currLayer->next()) list->append(cssValuePool().createValue(currLayer->composite())); return list.release(); } case CSSPropertyBackgroundAttachment: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer; currLayer = currLayer->next()) list->append(cssValuePool().createValue(currLayer->attachment())); return list.release(); @@ -1447,7 +1447,7 @@ case CSSPropertyWebkitMaskClip: case CSSPropertyWebkitMaskOrigin: { bool isClip = propertyID == CSSPropertyBackgroundClip || propertyID == CSSPropertyWebkitBackgroundClip || propertyID == CSSPropertyWebkitMaskClip; - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const FillLayer* currLayer = (propertyID == CSSPropertyWebkitMaskClip || propertyID == CSSPropertyWebkitMaskOrigin) ? &style.maskLayers() : &style.backgroundLayers(); for (; currLayer; currLayer = currLayer->next()) { EFillBox box = isClip ? currLayer->clip() : currLayer->origin(); @@ -1457,7 +1457,7 @@ } case CSSPropertyBackgroundPosition: case CSSPropertyWebkitMaskPosition: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPosition ? &style.maskLayers() : &style.backgroundLayers(); for (; currLayer; currLayer = currLayer->next()) list->append(createPositionListForLayer(propertyID, *currLayer, style)); @@ -1465,7 +1465,7 @@ } case CSSPropertyBackgroundPositionX: case CSSPropertyWebkitMaskPositionX: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPositionX ? &style.maskLayers() : &style.backgroundLayers(); for (; currLayer; currLayer = currLayer->next()) list->append(zoomAdjustedPixelValueForLength(currLayer->xPosition(), style)); @@ -1473,7 +1473,7 @@ } case CSSPropertyBackgroundPositionY: case CSSPropertyWebkitMaskPositionY: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskPositionY ? &style.maskLayers() : &style.backgroundLayers(); for (; currLayer; currLayer = currLayer->next()) list->append(zoomAdjustedPixelValueForLength(currLayer->yPosition(), style)); @@ -1484,7 +1484,7 @@ return cssValuePool().createIdentifierValue(CSSValueCollapse); return cssValuePool().createIdentifierValue(CSSValueSeparate); case CSSPropertyBorderSpacing: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style)); list->append(zoomAdjustedPixelValue(style.verticalBorderSpacing(), style)); return list.release(); @@ -1588,7 +1588,7 @@ return cssValuePool().createValue( style.getTabSize().getPixelSize(1.0), style.getTabSize().isSpaces() ? CSSPrimitiveValue::UnitType::Number : CSSPrimitiveValue::UnitType::Pixels); case CSSPropertyCursor: { - RefPtrWillBeRawPtr<CSSValueList> list = nullptr; + RawPtr<CSSValueList> list = nullptr; CursorList* cursors = style.cursors(); if (cursors && cursors->size() > 0) { list = CSSValueList::createCommaSeparated(); @@ -1597,7 +1597,7 @@ list->append(image->computedCSSValue()); } } - RefPtrWillBeRawPtr<CSSValue> value = cssValuePool().createValue(style.cursor()); + RawPtr<CSSValue> value = cssValuePool().createValue(style.cursor()); if (list) { list->append(value.release()); return list.release(); @@ -1667,16 +1667,16 @@ const FontFeatureSettings* featureSettings = style.getFontDescription().featureSettings(); if (!featureSettings || !featureSettings->size()) return cssValuePool().createIdentifierValue(CSSValueNormal); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); for (unsigned i = 0; i < featureSettings->size(); ++i) { const FontFeature& feature = featureSettings->at(i); - RefPtrWillBeRawPtr<CSSFontFeatureValue> featureValue = CSSFontFeatureValue::create(feature.tag(), feature.value()); + RawPtr<CSSFontFeatureValue> featureValue = CSSFontFeatureValue::create(feature.tag(), feature.value()); list->append(featureValue.release()); } return list.release(); } case CSSPropertyGridAutoFlow: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); switch (style.getGridAutoFlow()) { case AutoFlowRow: case AutoFlowRowDense: @@ -1942,7 +1942,7 @@ return nullptr; } if (style.quotes()->size()) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); for (int i = 0; i < style.quotes()->size(); i++) { list->append(CSSStringValue::create(style.quotes()->getOpenQuote(i))); list->append(CSSStringValue::create(style.quotes()->getCloseQuote(i))); @@ -1998,14 +1998,14 @@ case TextEmphasisMarkDoubleCircle: case TextEmphasisMarkTriangle: case TextEmphasisMarkSesame: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(cssValuePool().createValue(style.getTextEmphasisFill())); list->append(cssValuePool().createValue(style.getTextEmphasisMark())); return list.release(); } } case CSSPropertyTextIndent: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(zoomAdjustedPixelValueForLength(style.textIndent(), style)); if (RuntimeEnabledFeatures::css3TextEnabled() && (style.getTextIndentLine() == TextIndentEachLine || style.getTextIndentType() == TextIndentHanging)) { if (style.getTextIndentLine() == TextIndentEachLine) @@ -2102,7 +2102,7 @@ && historicalLigaturesState == FontDescription::NormalLigaturesState && contextualLigaturesState == FontDescription::NormalLigaturesState) return cssValuePool().createIdentifierValue(CSSValueNormal); - RefPtrWillBeRawPtr<CSSValueList> valueList = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> valueList = CSSValueList::createSpaceSeparated(); if (commonLigaturesState != FontDescription::NormalLigaturesState) valueList->append(cssValuePool().createIdentifierValue(commonLigaturesState == FontDescription::DisabledLigaturesState ? CSSValueNoCommonLigatures : CSSValueCommonLigatures)); if (discretionaryLigaturesState != FontDescription::NormalLigaturesState) @@ -2128,7 +2128,7 @@ case CSSPropertyAnimationDelay: return valueForAnimationDelay(style.animations()); case CSSPropertyAnimationDirection: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const CSSAnimationData* animationData = style.animations(); if (animationData) { for (size_t i = 0; i < animationData->directionList().size(); ++i) @@ -2141,7 +2141,7 @@ case CSSPropertyAnimationDuration: return valueForAnimationDuration(style.animations()); case CSSPropertyAnimationFillMode: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const CSSAnimationData* animationData = style.animations(); if (animationData) { for (size_t i = 0; i < animationData->fillModeList().size(); ++i) @@ -2152,7 +2152,7 @@ return list.release(); } case CSSPropertyAnimationIterationCount: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const CSSAnimationData* animationData = style.animations(); if (animationData) { for (size_t i = 0; i < animationData->iterationCountList().size(); ++i) @@ -2163,7 +2163,7 @@ return list.release(); } case CSSPropertyAnimationName: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const CSSAnimationData* animationData = style.animations(); if (animationData) { for (size_t i = 0; i < animationData->nameList().size(); ++i) @@ -2174,7 +2174,7 @@ return list.release(); } case CSSPropertyAnimationPlayState: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); const CSSAnimationData* animationData = style.animations(); if (animationData) { for (size_t i = 0; i < animationData->playStateList().size(); ++i) @@ -2189,9 +2189,9 @@ case CSSPropertyAnimation: { const CSSAnimationData* animationData = style.animations(); if (animationData) { - RefPtrWillBeRawPtr<CSSValueList> animationsList = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> animationsList = CSSValueList::createCommaSeparated(); for (size_t i = 0; i < animationData->nameList().size(); ++i) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(CSSCustomIdentValue::create(animationData->nameList()[i])); list->append(cssValuePool().createValue(CSSTimingData::getRepeated(animationData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); list->append(createTimingFunctionValue(CSSTimingData::getRepeated(animationData->timingFunctionList(), i).get())); @@ -2205,7 +2205,7 @@ return animationsList.release(); } - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); // animation-name default value. list->append(cssValuePool().createIdentifierValue(CSSValueNone)); list->append(cssValuePool().createValue(CSSAnimationData::initialDuration(), CSSPrimitiveValue::UnitType::Seconds)); @@ -2260,7 +2260,7 @@ return cssValuePool().createIdentifierValue(CSSValueNone); return zoomAdjustedPixelValue(style.perspective(), style); case CSSPropertyPerspectiveOrigin: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (layoutObject) { LayoutRect box; if (layoutObject->isBox()) @@ -2293,16 +2293,16 @@ case CSSPropertyClip: { if (style.hasAutoClip()) return cssValuePool().createIdentifierValue(CSSValueAuto); - RefPtrWillBeRawPtr<CSSPrimitiveValue> top = style.clip().top().isAuto() + RawPtr<CSSPrimitiveValue> top = style.clip().top().isAuto() ? cssValuePool().createIdentifierValue(CSSValueAuto) : zoomAdjustedPixelValue(style.clip().top().value(), style); - RefPtrWillBeRawPtr<CSSPrimitiveValue> right = style.clip().right().isAuto() + RawPtr<CSSPrimitiveValue> right = style.clip().right().isAuto() ? cssValuePool().createIdentifierValue(CSSValueAuto) : zoomAdjustedPixelValue(style.clip().right().value(), style); - RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = style.clip().bottom().isAuto() + RawPtr<CSSPrimitiveValue> bottom = style.clip().bottom().isAuto() ? cssValuePool().createIdentifierValue(CSSValueAuto) : zoomAdjustedPixelValue(style.clip().bottom().value(), style); - RefPtrWillBeRawPtr<CSSPrimitiveValue> left = style.clip().left().isAuto() + RawPtr<CSSPrimitiveValue> left = style.clip().left().isAuto() ? cssValuePool().createIdentifierValue(CSSValueAuto) : zoomAdjustedPixelValue(style.clip().left().value(), style); return CSSQuadValue::create(top.release(), right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsRect); @@ -2312,7 +2312,7 @@ case CSSPropertyTransform: return computedTransform(layoutObject, style); case CSSPropertyTransformOrigin: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (layoutObject) { LayoutRect box; if (layoutObject->isBox()) @@ -2343,9 +2343,9 @@ case CSSPropertyTransition: { const CSSTransitionData* transitionData = style.transitions(); if (transitionData) { - RefPtrWillBeRawPtr<CSSValueList> transitionsList = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> transitionsList = CSSValueList::createCommaSeparated(); for (size_t i = 0; i < transitionData->propertyList().size(); ++i) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(createTransitionPropertyValue(transitionData->propertyList()[i])); list->append(cssValuePool().createValue(CSSTimingData::getRepeated(transitionData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); list->append(createTimingFunctionValue(CSSTimingData::getRepeated(transitionData->timingFunctionList(), i).get())); @@ -2355,7 +2355,7 @@ return transitionsList.release(); } - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); // transition-property default value. list->append(cssValuePool().createIdentifierValue(CSSValueAll)); list->append(cssValuePool().createValue(CSSTransitionData::initialDuration(), CSSPrimitiveValue::UnitType::Seconds)); @@ -2410,7 +2410,7 @@ return cssValuePool().createValue(style.blendMode()); case CSSPropertyBackgroundBlendMode: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); for (const FillLayer* currLayer = &style.backgroundLayers(); currLayer; currLayer = currLayer->next()) list->append(cssValuePool().createValue(currLayer->blendMode())); return list.release(); @@ -2418,7 +2418,7 @@ case CSSPropertyBackground: return valuesForBackgroundShorthand(style, layoutObject, styledNode, allowVisitedStyle); case CSSPropertyBorder: { - RefPtrWillBeRawPtr<CSSValue> value = get(CSSPropertyBorderTop, style, layoutObject, styledNode, allowVisitedStyle); + RawPtr<CSSValue> value = get(CSSPropertyBorderTop, style, layoutObject, styledNode, allowVisitedStyle); const CSSPropertyID properties[] = { CSSPropertyBorderRight, CSSPropertyBorderBottom, @@ -2477,7 +2477,7 @@ return zoomAdjustedPixelValueForLength(style.motionOffset(), style); case CSSPropertyMotionRotation: { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (style.motionRotation().type == MotionRotationAuto) list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); list->append(cssValuePool().createValue(style.motionRotation().angle, CSSPrimitiveValue::UnitType::Degrees)); @@ -2680,7 +2680,7 @@ if (!style.translate()) return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Pixels); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (layoutObject && layoutObject->isBox()) { LayoutRect box = toLayoutBox(layoutObject)->borderBoxRect(); list->append(zoomAdjustedPixelValue(floatValueForLength(style.translate()->x(), box.width().toFloat()), style)); @@ -2705,7 +2705,7 @@ if (!style.rotate()) return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Degrees); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(cssValuePool().createValue(style.rotate()->angle(), CSSPrimitiveValue::UnitType::Degrees)); if (style.rotate()->x() != 0 || style.rotate()->y() != 0 || style.rotate()->z() != 1) { list->append(cssValuePool().createValue(style.rotate()->x(), CSSPrimitiveValue::UnitType::Number)); @@ -2717,7 +2717,7 @@ case CSSPropertyScale: { if (!style.scale()) return cssValuePool().createValue(1, CSSPrimitiveValue::UnitType::Number); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(cssValuePool().createValue(style.scale()->x(), CSSPrimitiveValue::UnitType::Number)); if (style.scale()->y() == 1 && style.scale()->z() == 1) return list.release(); @@ -2732,7 +2732,7 @@ if (style.contain() == ContainsStrict) return cssValuePool().createIdentifierValue(CSSValueStrict); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (style.containsStyle()) list->append(cssValuePool().createIdentifierValue(CSSValueStyle)); if (style.contain() & ContainsLayout) @@ -2745,7 +2745,7 @@ case CSSPropertySnapHeight: { if (!style.snapHeightUnit()) return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Pixels); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(cssValuePool().createValue(style.snapHeightUnit(), CSSPrimitiveValue::UnitType::Pixels)); if (style.snapHeightPosition()) list->append(cssValuePool().createValue(style.snapHeightPosition(), CSSPrimitiveValue::UnitType::Integer));
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.h b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.h index 65266563..9e18b78 100644 --- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.h +++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.h
@@ -24,15 +24,15 @@ STATIC_ONLY(ComputedStyleCSSValueMapping); public: // FIXME: Resolve computed auto alignment in applyProperty/ComputedStyle and remove this non-const styledNode parameter. - static PassRefPtrWillBeRawPtr<CSSValue> get(CSSPropertyID, const ComputedStyle&, const LayoutObject* = nullptr, Node* styledNode = nullptr, bool allowVisitedStyle = false); - static PassRefPtrWillBeRawPtr<CSSValue> get(const AtomicString customPropertyName, const ComputedStyle&); + static RawPtr<CSSValue> get(CSSPropertyID, const ComputedStyle&, const LayoutObject* = nullptr, Node* styledNode = nullptr, bool allowVisitedStyle = false); + static RawPtr<CSSValue> get(const AtomicString customPropertyName, const ComputedStyle&); static const HashMap<AtomicString, RefPtr<CSSVariableData>>* getVariables(const ComputedStyle&); private: - static PassRefPtrWillBeRawPtr<CSSValue> currentColorOrValidColor(const ComputedStyle&, const StyleColor&); - static PassRefPtrWillBeRawPtr<CSSValue> valueForShadowData(const ShadowData&, const ComputedStyle&, bool useSpread); - static PassRefPtrWillBeRawPtr<CSSValue> valueForShadowList(const ShadowList*, const ComputedStyle&, bool useSpread); - static PassRefPtrWillBeRawPtr<CSSValue> valueForFilter(const ComputedStyle&, const FilterOperations&); - static PassRefPtrWillBeRawPtr<CSSValue> valueForFont(const ComputedStyle&); + static RawPtr<CSSValue> currentColorOrValidColor(const ComputedStyle&, const StyleColor&); + static RawPtr<CSSValue> valueForShadowData(const ShadowData&, const ComputedStyle&, bool useSpread); + static RawPtr<CSSValue> valueForShadowList(const ShadowList*, const ComputedStyle&, bool useSpread); + static RawPtr<CSSValue> valueForFilter(const ComputedStyle&, const FilterOperations&); + static RawPtr<CSSValue> valueForFont(const ComputedStyle&); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/DOMWindowCSS.cpp b/third_party/WebKit/Source/core/css/DOMWindowCSS.cpp index a94ee84..3c5aff72 100644 --- a/third_party/WebKit/Source/core/css/DOMWindowCSS.cpp +++ b/third_party/WebKit/Source/core/css/DOMWindowCSS.cpp
@@ -44,7 +44,7 @@ CSSPropertyID unresolvedProperty = unresolvedCSSPropertyID(property); if (unresolvedProperty == CSSPropertyInvalid) { if (RuntimeEnabledFeatures::cssVariablesEnabled() && CSSVariableParser::isValidVariableName(property)) { - RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create(HTMLStandardMode); + RawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create(HTMLStandardMode); return CSSParser::parseValueForCustomProperty(dummyStyle.get(), "--valid", value, false, 0); } return false; @@ -53,7 +53,7 @@ ASSERT(CSSPropertyMetadata::isEnabledProperty(unresolvedProperty)); // This will return false when !important is present - RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create(HTMLStandardMode); + RawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create(HTMLStandardMode); return CSSParser::parseValue(dummyStyle.get(), unresolvedProperty, value, false, 0); }
diff --git a/third_party/WebKit/Source/core/css/DOMWindowCSS.h b/third_party/WebKit/Source/core/css/DOMWindowCSS.h index 8f87267..1378336 100644 --- a/third_party/WebKit/Source/core/css/DOMWindowCSS.h +++ b/third_party/WebKit/Source/core/css/DOMWindowCSS.h
@@ -38,7 +38,7 @@ namespace blink { -class DOMWindowCSS : public RefCountedWillBeGarbageCollected<DOMWindowCSS>, public ScriptWrappable { +class DOMWindowCSS : public GarbageCollected<DOMWindowCSS>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: static bool supports(const String& property, const String& value);
diff --git a/third_party/WebKit/Source/core/css/DocumentFontFaceSet.cpp b/third_party/WebKit/Source/core/css/DocumentFontFaceSet.cpp index a074f10..12ed95f1 100644 --- a/third_party/WebKit/Source/core/css/DocumentFontFaceSet.cpp +++ b/third_party/WebKit/Source/core/css/DocumentFontFaceSet.cpp
@@ -29,7 +29,7 @@ namespace blink { -PassRefPtrWillBeRawPtr<FontFaceSet> DocumentFontFaceSet::fonts(Document& document) +RawPtr<FontFaceSet> DocumentFontFaceSet::fonts(Document& document) { return FontFaceSet::from(document); }
diff --git a/third_party/WebKit/Source/core/css/DocumentFontFaceSet.h b/third_party/WebKit/Source/core/css/DocumentFontFaceSet.h index 21b65ea..d16eca3 100644 --- a/third_party/WebKit/Source/core/css/DocumentFontFaceSet.h +++ b/third_party/WebKit/Source/core/css/DocumentFontFaceSet.h
@@ -38,7 +38,7 @@ class DocumentFontFaceSet { STATIC_ONLY(DocumentFontFaceSet); public: - static PassRefPtrWillBeRawPtr<FontFaceSet> fonts(Document&); + static RawPtr<FontFaceSet> fonts(Document&); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp b/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp index ef8eb07..0f502af 100644 --- a/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp +++ b/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp
@@ -68,13 +68,13 @@ return m_result; } -PassRefPtrWillBeRawPtr<StyleRuleList> ElementRuleCollector::matchedStyleRuleList() +RawPtr<StyleRuleList> ElementRuleCollector::matchedStyleRuleList() { ASSERT(m_mode == SelectorChecker::CollectingStyleRules); return m_styleRuleList.release(); } -PassRefPtrWillBeRawPtr<CSSRuleList> ElementRuleCollector::matchedCSSRuleList() +RawPtr<CSSRuleList> ElementRuleCollector::matchedCSSRuleList() { ASSERT(m_mode == SelectorChecker::CollectingCSSRules); return m_cssRuleList.release(); @@ -254,7 +254,7 @@ // |parentStyleSheet| is 0 if and only if the |rule| is coming from User Agent. In this case, // it is safe to create CSSOM wrappers without parentStyleSheets as they will be used only // by inspector which will not try to edit them. - RefPtrWillBeRawPtr<CSSRule> cssRule = nullptr; + RawPtr<CSSRule> cssRule = nullptr; if (parentStyleSheet) cssRule = findStyleRule(parentStyleSheet, rule); else
diff --git a/third_party/WebKit/Source/core/css/ElementRuleCollector.h b/third_party/WebKit/Source/core/css/ElementRuleCollector.h index dc92aef..cafcce96 100644 --- a/third_party/WebKit/Source/core/css/ElementRuleCollector.h +++ b/third_party/WebKit/Source/core/css/ElementRuleCollector.h
@@ -75,7 +75,7 @@ const RuleData* m_ruleData; unsigned m_specificity; uint64_t m_position; - RawPtrWillBeMember<const CSSStyleSheet> m_parentStyleSheet; + Member<const CSSStyleSheet> m_parentStyleSheet; }; } // namespace blink @@ -118,8 +118,8 @@ bool hasAnyMatchingRules(RuleSet*); const MatchResult& matchedResult() const; - PassRefPtrWillBeRawPtr<StyleRuleList> matchedStyleRuleList(); - PassRefPtrWillBeRawPtr<CSSRuleList> matchedCSSRuleList(); + RawPtr<StyleRuleList> matchedStyleRuleList(); + RawPtr<CSSRuleList> matchedCSSRuleList(); void collectMatchingRules(const MatchRequest&, CascadeOrder = ignoreCascadeOrder, bool matchingTreeBoundaryRules = false); void collectMatchingShadowHostRules(const MatchRequest&, CascadeOrder = ignoreCascadeOrder); @@ -159,11 +159,11 @@ bool m_matchingUARules; bool m_includeEmptyRules; - WillBeHeapVector<MatchedRule, 32> m_matchedRules; + HeapVector<MatchedRule, 32> m_matchedRules; // Output. - RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList; - RefPtrWillBeMember<StyleRuleList> m_styleRuleList; + Member<StaticCSSRuleList> m_cssRuleList; + Member<StyleRuleList> m_styleRuleList; MatchResult m_result; };
diff --git a/third_party/WebKit/Source/core/css/FontFace.cpp b/third_party/WebKit/Source/core/css/FontFace.cpp index 023975e2f8..b84aa66 100644 --- a/third_party/WebKit/Source/core/css/FontFace.cpp +++ b/third_party/WebKit/Source/core/css/FontFace.cpp
@@ -63,13 +63,13 @@ namespace blink { -static PassRefPtrWillBeRawPtr<CSSValue> parseCSSValue(const Document* document, const String& value, CSSPropertyID propertyID) +static RawPtr<CSSValue> parseCSSValue(const Document* document, const String& value, CSSPropertyID propertyID) { CSSParserContext context(*document, UseCounter::getFrom(document)); return CSSParser::parseFontFaceDescriptor(propertyID, value, context); } -PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, StringOrArrayBufferOrArrayBufferView& source, const FontFaceDescriptors& descriptors) +RawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, StringOrArrayBufferOrArrayBufferView& source, const FontFaceDescriptors& descriptors) { if (source.isString()) return create(context, family, source.getAsString(), descriptors); @@ -81,11 +81,11 @@ return nullptr; } -PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, const String& source, const FontFaceDescriptors& descriptors) +RawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, const String& source, const FontFaceDescriptors& descriptors) { - RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(context, family, descriptors)); + RawPtr<FontFace> fontFace = new FontFace(context, family, descriptors); - RefPtrWillBeRawPtr<CSSValue> src = parseCSSValue(toDocument(context), source, CSSPropertySrc); + RawPtr<CSSValue> src = parseCSSValue(toDocument(context), source, CSSPropertySrc); if (!src || !src->isValueList()) fontFace->setError(DOMException::create(SyntaxError, "The source provided ('" + source + "') could not be parsed as a value list.")); @@ -93,33 +93,33 @@ return fontFace.release(); } -PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<DOMArrayBuffer> source, const FontFaceDescriptors& descriptors) +RawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<DOMArrayBuffer> source, const FontFaceDescriptors& descriptors) { - RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(context, family, descriptors)); + RawPtr<FontFace> fontFace = new FontFace(context, family, descriptors); fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->data()), source->byteLength()); return fontFace.release(); } -PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<DOMArrayBufferView> source, const FontFaceDescriptors& descriptors) +RawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<DOMArrayBufferView> source, const FontFaceDescriptors& descriptors) { - RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(context, family, descriptors)); + RawPtr<FontFace> fontFace = new FontFace(context, family, descriptors); fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->baseAddress()), source->byteLength()); return fontFace.release(); } -PassRefPtrWillBeRawPtr<FontFace> FontFace::create(Document* document, const StyleRuleFontFace* fontFaceRule) +RawPtr<FontFace> FontFace::create(Document* document, const StyleRuleFontFace* fontFaceRule) { const StylePropertySet& properties = fontFaceRule->properties(); // Obtain the font-family property and the src property. Both must be defined. - RefPtrWillBeRawPtr<CSSValue> family = properties.getPropertyCSSValue(CSSPropertyFontFamily); + RawPtr<CSSValue> family = properties.getPropertyCSSValue(CSSPropertyFontFamily); if (!family || (!family->isFontFamilyValue() && !family->isPrimitiveValue())) return nullptr; - RefPtrWillBeRawPtr<CSSValue> src = properties.getPropertyCSSValue(CSSPropertySrc); + RawPtr<CSSValue> src = properties.getPropertyCSSValue(CSSPropertySrc); if (!src || !src->isValueList()) return nullptr; - RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(document)); + RawPtr<FontFace> fontFace = new FontFace(document); if (fontFace->setFamilyValue(*family) && fontFace->setPropertyFromStyle(properties, CSSPropertyFontStyle) @@ -228,7 +228,7 @@ void FontFace::setPropertyFromString(const Document* document, const String& s, CSSPropertyID propertyID, ExceptionState* exceptionState) { - RefPtrWillBeRawPtr<CSSValue> value = parseCSSValue(document, s, propertyID); + RawPtr<CSSValue> value = parseCSSValue(document, s, propertyID); if (value && setPropertyValue(value, propertyID)) return; @@ -244,7 +244,7 @@ return setPropertyValue(properties.getPropertyCSSValue(propertyID), propertyID); } -bool FontFace::setPropertyValue(PassRefPtrWillBeRawPtr<CSSValue> value, CSSPropertyID propertyID) +bool FontFace::setPropertyValue(RawPtr<CSSValue> value, CSSPropertyID propertyID) { switch (propertyID) { case CSSPropertyFontStyle: @@ -342,7 +342,7 @@ m_loadedProperty->reject(m_error.get()); } - WillBeHeapVector<RefPtrWillBeMember<LoadFontCallback>> callbacks; + HeapVector<Member<LoadFontCallback>> callbacks; m_callbacks.swap(callbacks); for (size_t i = 0; i < callbacks.size(); ++i) { if (m_status == Loaded) @@ -378,7 +378,7 @@ return fontStatusPromise(scriptState); } -void FontFace::loadWithCallback(PassRefPtrWillBeRawPtr<LoadFontCallback> callback, ExecutionContext* context) +void FontFace::loadWithCallback(RawPtr<LoadFontCallback> callback, ExecutionContext* context) { loadInternal(context); if (m_status == Loaded) @@ -502,10 +502,10 @@ } FontVariant variant = FontVariantNormal; - if (RefPtrWillBeRawPtr<CSSValue> fontVariant = m_variant) { + if (RawPtr<CSSValue> fontVariant = m_variant) { // font-variant descriptor can be a value list. if (fontVariant->isPrimitiveValue()) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); list->append(fontVariant); fontVariant = list; } else if (!fontVariant->isValueList()) { @@ -555,7 +555,7 @@ return FontDisplayAuto; } -static PassOwnPtrWillBeRawPtr<CSSFontFace> createCSSFontFace(FontFace* fontFace, CSSValue* unicodeRange) +static RawPtr<CSSFontFace> createCSSFontFace(FontFace* fontFace, CSSValue* unicodeRange) { Vector<UnicodeRange> ranges; if (CSSValueList* rangeList = toCSSValueList(unicodeRange)) { @@ -566,10 +566,10 @@ } } - return adoptPtrWillBeNoop(new CSSFontFace(fontFace, ranges)); + return new CSSFontFace(fontFace, ranges); } -void FontFace::initCSSFontFace(Document* document, PassRefPtrWillBeRawPtr<CSSValue> src) +void FontFace::initCSSFontFace(Document* document, RawPtr<CSSValue> src) { m_cssFontFace = createCSSFontFace(this, m_unicodeRange.get()); if (m_error) @@ -584,20 +584,20 @@ for (int i = 0; i < srcLength; i++) { // An item in the list either specifies a string (local font name) or a URL (remote font to download). CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->item(i)); - OwnPtrWillBeRawPtr<CSSFontFaceSource> source = nullptr; + RawPtr<CSSFontFaceSource> source = nullptr; if (!item->isLocal()) { const Settings* settings = document ? document->settings() : nullptr; bool allowDownloading = settings && settings->downloadableBinaryFontsEnabled(); if (allowDownloading && item->isSupportedFormat() && document) { - RefPtrWillBeRawPtr<FontResource> fetched = item->fetch(document); + RawPtr<FontResource> fetched = item->fetch(document); if (fetched) { FontLoader* fontLoader = document->styleEngine().fontSelector()->fontLoader(); - source = adoptPtrWillBeNoop(new RemoteFontFaceSource(fetched.release(), fontLoader, CSSValueToFontDisplay(m_display.get()))); + source = new RemoteFontFaceSource(fetched.release(), fontLoader, CSSValueToFontDisplay(m_display.get())); } } } else { - source = adoptPtrWillBeNoop(new LocalFontFaceSource(item->resource())); + source = new LocalFontFaceSource(item->resource()); } if (source) @@ -617,7 +617,7 @@ return; RefPtr<SharedBuffer> buffer = SharedBuffer::create(data, size); - OwnPtrWillBeRawPtr<BinaryDataFontFaceSource> source = adoptPtrWillBeNoop(new BinaryDataFontFaceSource(buffer.get(), m_otsParseMessage)); + RawPtr<BinaryDataFontFaceSource> source = new BinaryDataFontFaceSource(buffer.get(), m_otsParseMessage); if (source->isValid()) setLoadStatus(Loaded); else
diff --git a/third_party/WebKit/Source/core/css/FontFace.h b/third_party/WebKit/Source/core/css/FontFace.h index abef4064..bce984d 100644 --- a/third_party/WebKit/Source/core/css/FontFace.h +++ b/third_party/WebKit/Source/core/css/FontFace.h
@@ -57,14 +57,14 @@ class StylePropertySet; class StyleRuleFontFace; -class FontFace : public RefCountedWillBeGarbageCollectedFinalized<FontFace>, public ScriptWrappable, public ActiveScriptWrappable, public ActiveDOMObject { +class FontFace : public GarbageCollectedFinalized<FontFace>, public ScriptWrappable, public ActiveScriptWrappable, public ActiveDOMObject { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FontFace); + USING_GARBAGE_COLLECTED_MIXIN(FontFace); public: enum LoadStatusType { Unloaded, Loading, Loaded, Error }; - static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, StringOrArrayBufferOrArrayBufferView&, const FontFaceDescriptors&); - static PassRefPtrWillBeRawPtr<FontFace> create(Document*, const StyleRuleFontFace*); + static RawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, StringOrArrayBufferOrArrayBufferView&, const FontFaceDescriptors&); + static RawPtr<FontFace> create(Document*, const StyleRuleFontFace*); ~FontFace(); @@ -101,55 +101,55 @@ bool hadBlankText() const; - class LoadFontCallback : public RefCountedWillBeGarbageCollectedFinalized<LoadFontCallback> { + class LoadFontCallback : public GarbageCollectedFinalized<LoadFontCallback> { public: virtual ~LoadFontCallback() { } virtual void notifyLoaded(FontFace*) = 0; virtual void notifyError(FontFace*) = 0; DEFINE_INLINE_VIRTUAL_TRACE() { } }; - void loadWithCallback(PassRefPtrWillBeRawPtr<LoadFontCallback>, ExecutionContext*); + void loadWithCallback(RawPtr<LoadFontCallback>, ExecutionContext*); // ActiveScriptWrappable. bool hasPendingActivity() const final; private: - static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, PassRefPtr<DOMArrayBuffer> source, const FontFaceDescriptors&); - static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, PassRefPtr<DOMArrayBufferView>, const FontFaceDescriptors&); - static PassRefPtrWillBeRawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, const String& source, const FontFaceDescriptors&); + static RawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, PassRefPtr<DOMArrayBuffer> source, const FontFaceDescriptors&); + static RawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, PassRefPtr<DOMArrayBufferView>, const FontFaceDescriptors&); + static RawPtr<FontFace> create(ExecutionContext*, const AtomicString& family, const String& source, const FontFaceDescriptors&); explicit FontFace(ExecutionContext*); FontFace(ExecutionContext*, const AtomicString& family, const FontFaceDescriptors&); - void initCSSFontFace(Document*, PassRefPtrWillBeRawPtr<CSSValue> src); + void initCSSFontFace(Document*, RawPtr<CSSValue> src); void initCSSFontFace(const unsigned char* data, size_t); void setPropertyFromString(const Document*, const String&, CSSPropertyID, ExceptionState* = 0); bool setPropertyFromStyle(const StylePropertySet&, CSSPropertyID); - bool setPropertyValue(PassRefPtrWillBeRawPtr<CSSValue>, CSSPropertyID); + bool setPropertyValue(RawPtr<CSSValue>, CSSPropertyID); bool setFamilyValue(const CSSValue&); void loadInternal(ExecutionContext*); ScriptPromise fontStatusPromise(ScriptState*); - using LoadedProperty = ScriptPromiseProperty<RawPtrWillBeMember<FontFace>, RawPtrWillBeMember<FontFace>, Member<DOMException>>; + using LoadedProperty = ScriptPromiseProperty<Member<FontFace>, Member<FontFace>, Member<DOMException>>; AtomicString m_family; String m_otsParseMessage; - RefPtrWillBeMember<CSSValue> m_style; - RefPtrWillBeMember<CSSValue> m_weight; - RefPtrWillBeMember<CSSValue> m_stretch; - RefPtrWillBeMember<CSSValue> m_unicodeRange; - RefPtrWillBeMember<CSSValue> m_variant; - RefPtrWillBeMember<CSSValue> m_featureSettings; - RefPtrWillBeMember<CSSValue> m_display; + Member<CSSValue> m_style; + Member<CSSValue> m_weight; + Member<CSSValue> m_stretch; + Member<CSSValue> m_unicodeRange; + Member<CSSValue> m_variant; + Member<CSSValue> m_featureSettings; + Member<CSSValue> m_display; LoadStatusType m_status; - PersistentWillBeMember<DOMException> m_error; + Member<DOMException> m_error; - PersistentWillBeMember<LoadedProperty> m_loadedProperty; - OwnPtrWillBeMember<CSSFontFace> m_cssFontFace; - WillBeHeapVector<RefPtrWillBeMember<LoadFontCallback>> m_callbacks; + Member<LoadedProperty> m_loadedProperty; + Member<CSSFontFace> m_cssFontFace; + HeapVector<Member<LoadFontCallback>> m_callbacks; }; -using FontFaceArray = WillBeHeapVector<RefPtrWillBeMember<FontFace>>; +using FontFaceArray = HeapVector<Member<FontFace>>; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/FontFaceCache.cpp b/third_party/WebKit/Source/core/css/FontFaceCache.cpp index 512cdec11..dcc3346 100644 --- a/third_party/WebKit/Source/core/css/FontFaceCache.cpp +++ b/third_party/WebKit/Source/core/css/FontFaceCache.cpp
@@ -47,17 +47,17 @@ { } -void FontFaceCache::add(CSSFontSelector* cssFontSelector, const StyleRuleFontFace* fontFaceRule, PassRefPtrWillBeRawPtr<FontFace> prpFontFace) +void FontFaceCache::add(CSSFontSelector* cssFontSelector, const StyleRuleFontFace* fontFaceRule, RawPtr<FontFace> prpFontFace) { - RefPtrWillBeRawPtr<FontFace> fontFace = prpFontFace; + RawPtr<FontFace> fontFace = prpFontFace; if (!m_styleRuleToFontFace.add(fontFaceRule, fontFace).isNewEntry) return; addFontFace(cssFontSelector, fontFace, true); } -void FontFaceCache::addFontFace(CSSFontSelector* cssFontSelector, PassRefPtrWillBeRawPtr<FontFace> prpFontFace, bool cssConnected) +void FontFaceCache::addFontFace(CSSFontSelector* cssFontSelector, RawPtr<FontFace> prpFontFace, bool cssConnected) { - RefPtrWillBeRawPtr<FontFace> fontFace = prpFontFace; + RawPtr<FontFace> fontFace = prpFontFace; FamilyToTraitsMap::AddResult traitsResult = m_fontFaces.add(fontFace->family(), nullptr); if (!traitsResult.storedValue->value) @@ -94,7 +94,7 @@ TraitsMap::iterator familyFontFacesIter = familyFontFaces->find(fontFace->traits().bitfield()); if (familyFontFacesIter == familyFontFaces->end()) return; - RefPtrWillBeRawPtr<CSSSegmentedFontFace> segmentedFontFace = familyFontFacesIter->value; + RawPtr<CSSSegmentedFontFace> segmentedFontFace = familyFontFacesIter->value; segmentedFontFace->removeFontFace(fontFace); if (segmentedFontFace->isEmpty()) {
diff --git a/third_party/WebKit/Source/core/css/FontFaceCache.h b/third_party/WebKit/Source/core/css/FontFaceCache.h index 8db2cb3..11ea8555 100644 --- a/third_party/WebKit/Source/core/css/FontFaceCache.h +++ b/third_party/WebKit/Source/core/css/FontFaceCache.h
@@ -48,18 +48,18 @@ // FIXME: Remove CSSFontSelector as argument. Passing CSSFontSelector here is // a result of egregious spaghettification in FontFace/FontFaceSet. - void add(CSSFontSelector*, const StyleRuleFontFace*, PassRefPtrWillBeRawPtr<FontFace>); + void add(CSSFontSelector*, const StyleRuleFontFace*, RawPtr<FontFace>); void remove(const StyleRuleFontFace*); void clearCSSConnected(); void clearAll(); - void addFontFace(CSSFontSelector*, PassRefPtrWillBeRawPtr<FontFace>, bool cssConnected); + void addFontFace(CSSFontSelector*, RawPtr<FontFace>, bool cssConnected); void removeFontFace(FontFace*, bool cssConnected); // FIXME: It's sort of weird that add/remove uses StyleRuleFontFace* as key, // but this function uses FontDescription/family pair. CSSSegmentedFontFace* get(const FontDescription&, const AtomicString& family); - const WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>>& cssConnectedFontFaces() const { return m_cssConnectedFontFaces; } + const HeapListHashSet<Member<FontFace>>& cssConnectedFontFaces() const { return m_cssConnectedFontFaces; } unsigned version() const { return m_version; } void incrementVersion() { ++m_version; } @@ -67,13 +67,13 @@ DECLARE_TRACE(); private: - using TraitsMap = WillBeHeapHashMap<unsigned, RefPtrWillBeMember<CSSSegmentedFontFace>>; - using FamilyToTraitsMap = WillBeHeapHashMap<String, OwnPtrWillBeMember<TraitsMap>, CaseFoldingHash>; - using StyleRuleToFontFace = WillBeHeapHashMap<RawPtrWillBeMember<const StyleRuleFontFace>, RefPtrWillBeMember<FontFace>>; + using TraitsMap = HeapHashMap<unsigned, Member<CSSSegmentedFontFace>>; + using FamilyToTraitsMap = HeapHashMap<String, Member<TraitsMap>, CaseFoldingHash>; + using StyleRuleToFontFace = HeapHashMap<Member<const StyleRuleFontFace>, Member<FontFace>>; FamilyToTraitsMap m_fontFaces; FamilyToTraitsMap m_fonts; StyleRuleToFontFace m_styleRuleToFontFace; - WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>> m_cssConnectedFontFaces; + HeapListHashSet<Member<FontFace>> m_cssConnectedFontFaces; // FIXME: See if this could be ditched // Used to compare Font instances, and the usage seems suspect.
diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.cpp b/third_party/WebKit/Source/core/css/FontFaceSet.cpp index bf70d830..63d430f 100644 --- a/third_party/WebKit/Source/core/css/FontFaceSet.cpp +++ b/third_party/WebKit/Source/core/css/FontFaceSet.cpp
@@ -49,9 +49,9 @@ class LoadFontPromiseResolver final : public FontFace::LoadFontCallback { public: - static PassRefPtrWillBeRawPtr<LoadFontPromiseResolver> create(FontFaceArray faces, ScriptState* scriptState) + static RawPtr<LoadFontPromiseResolver> create(FontFaceArray faces, ScriptState* scriptState) { - return adoptRefWillBeNoop(new LoadFontPromiseResolver(faces, scriptState)); + return new LoadFontPromiseResolver(faces, scriptState); } void loadFonts(ExecutionContext*); @@ -71,10 +71,10 @@ m_fontFaces.swap(faces); } - WillBeHeapVector<RefPtrWillBeMember<FontFace>> m_fontFaces; + HeapVector<Member<FontFace>> m_fontFaces; int m_numLoading; bool m_errorOccured; - PersistentWillBeMember<ScriptPromiseResolver> m_resolver; + Member<ScriptPromiseResolver> m_resolver; }; void LoadFontPromiseResolver::loadFonts(ExecutionContext* context) @@ -235,7 +235,7 @@ removeFromLoadingFonts(fontFace); } -void FontFaceSet::addToLoadingFonts(PassRefPtrWillBeRawPtr<FontFace> fontFace) +void FontFaceSet::addToLoadingFonts(RawPtr<FontFace> fontFace) { if (!m_isLoading) { m_isLoading = true; @@ -247,7 +247,7 @@ m_loadingFonts.add(fontFace); } -void FontFaceSet::removeFromLoadingFonts(PassRefPtrWillBeRawPtr<FontFace> fontFace) +void FontFaceSet::removeFromLoadingFonts(RawPtr<FontFace> fontFace) { m_loadingFonts.remove(fontFace); if (m_loadingFonts.isEmpty()) @@ -259,7 +259,7 @@ return m_ready->promise(scriptState->world()); } -PassRefPtrWillBeRawPtr<FontFaceSet> FontFaceSet::addForBinding(ScriptState*, FontFace* fontFace, ExceptionState&) +RawPtr<FontFaceSet> FontFaceSet::addForBinding(ScriptState*, FontFace* fontFace, ExceptionState&) { ASSERT(fontFace); if (!inActiveDocumentContext()) @@ -297,7 +297,7 @@ ASSERT(fontFace); if (!inActiveDocumentContext()) return false; - WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>>::iterator it = m_nonCSSConnectedFaces.find(fontFace); + HeapListHashSet<Member<FontFace>>::iterator it = m_nonCSSConnectedFaces.find(fontFace); if (it != m_nonCSSConnectedFaces.end()) { m_nonCSSConnectedFaces.remove(it); CSSFontSelector* fontSelector = document()->styleEngine().fontSelector(); @@ -318,7 +318,7 @@ return m_nonCSSConnectedFaces.contains(fontFace) || isCSSConnectedFontFace(fontFace); } -const WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>>& FontFaceSet::cssConnectedFontFaceList() const +const HeapListHashSet<Member<FontFace>>& FontFaceSet::cssConnectedFontFaceList() const { Document* d = document(); d->ensureStyleResolver(); // Flush pending style changes. @@ -352,8 +352,8 @@ return; if (m_isLoading) { - RefPtrWillBeRawPtr<FontFaceSetLoadEvent> doneEvent = nullptr; - RefPtrWillBeRawPtr<FontFaceSetLoadEvent> errorEvent = nullptr; + RawPtr<FontFaceSetLoadEvent> doneEvent = nullptr; + RawPtr<FontFaceSetLoadEvent> errorEvent = nullptr; doneEvent = FontFaceSetLoadEvent::createForFontFaces(EventTypeNames::loadingdone, m_loadedFonts); m_loadedFonts.clear(); if (!m_failedFonts.isEmpty()) { @@ -391,7 +391,7 @@ segmentedFontFace->match(text, faces); } - RefPtrWillBeRawPtr<LoadFontPromiseResolver> resolver = LoadFontPromiseResolver::create(faces, scriptState); + RawPtr<LoadFontPromiseResolver> resolver = LoadFontPromiseResolver::create(faces, scriptState); ScriptPromise promise = resolver->promise(); resolver->loadFonts(getExecutionContext()); // After this, resolver->promise() may return null. return promise; @@ -435,7 +435,7 @@ return false; // Interpret fontString in the same way as the 'font' attribute of CanvasRenderingContext2D. - RefPtrWillBeRawPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::create(HTMLStandardMode); + RawPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::create(HTMLStandardMode); CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, 0); if (parsedStyle->isEmpty()) return false; @@ -494,12 +494,12 @@ return "FontFaceSet"; } -PassRefPtrWillBeRawPtr<FontFaceSet> FontFaceSet::from(Document& document) +RawPtr<FontFaceSet> FontFaceSet::from(Document& document) { - RefPtrWillBeRawPtr<FontFaceSet> fonts = static_cast<FontFaceSet*>(SupplementType::from(document, supplementName())); + RawPtr<FontFaceSet> fonts = static_cast<FontFaceSet*>(Supplement<Document>::from(document, supplementName())); if (!fonts) { fonts = FontFaceSet::create(document); - SupplementType::provideTo(document, supplementName(), fonts); + Supplement<Document>::provideTo(document, supplementName(), fonts); } return fonts.release(); @@ -507,7 +507,7 @@ void FontFaceSet::didLayout(Document& document) { - if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(document, supplementName()))) + if (FontFaceSet* fonts = static_cast<FontFaceSet*>(Supplement<Document>::from(document, supplementName()))) fonts->didLayout(); } @@ -516,9 +516,9 @@ // Setlike should iterate each item in insertion order, and items should // be keep on up to date. But since blink does not have a way to hook up CSS // modification, take a snapshot here, and make it ordered as follows. - WillBeHeapVector<RefPtrWillBeMember<FontFace>> fontFaces; + HeapVector<Member<FontFace>> fontFaces; if (inActiveDocumentContext()) { - const WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>>& cssConnectedFaces = cssConnectedFontFaceList(); + const HeapListHashSet<Member<FontFace>>& cssConnectedFaces = cssConnectedFontFaceList(); fontFaces.reserveInitialCapacity(cssConnectedFaces.size() + m_nonCSSConnectedFaces.size()); for (const auto& fontFace : cssConnectedFaces) fontFaces.append(fontFace); @@ -528,7 +528,7 @@ return new IterationSource(fontFaces); } -bool FontFaceSet::IterationSource::next(ScriptState*, RefPtrWillBeMember<FontFace>& key, RefPtrWillBeMember<FontFace>& value, ExceptionState&) +bool FontFaceSet::IterationSource::next(ScriptState*, Member<FontFace>& key, Member<FontFace>& value, ExceptionState&) { if (m_fontFaces.size() <= m_index) return false; @@ -538,16 +538,14 @@ DEFINE_TRACE(FontFaceSet) { -#if ENABLE(OILPAN) visitor->trace(m_ready); visitor->trace(m_loadingFonts); visitor->trace(m_loadedFonts); visitor->trace(m_failedFonts); visitor->trace(m_nonCSSConnectedFaces); visitor->trace(m_asyncRunner); - HeapSupplement<Document>::trace(visitor); -#endif EventTargetWithInlineData::trace(visitor); + Supplement<Document>::trace(visitor); ActiveDOMObject::trace(visitor); }
diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.h b/third_party/WebKit/Source/core/css/FontFaceSet.h index 223864d..91fd731 100644 --- a/third_party/WebKit/Source/core/css/FontFaceSet.h +++ b/third_party/WebKit/Source/core/css/FontFaceSet.h
@@ -34,7 +34,6 @@ #include "core/events/EventListener.h" #include "core/events/EventTarget.h" #include "platform/AsyncMethodRunner.h" -#include "platform/RefCountedSupplement.h" #include "platform/heap/Handle.h" #include "wtf/Allocator.h" #include "wtf/PassRefPtr.h" @@ -58,17 +57,10 @@ class FontResource; class ExecutionContext; -using FontFaceSetIterable = PairIterable<RefPtrWillBeMember<FontFace>, RefPtrWillBeMember<FontFace>>; +using FontFaceSetIterable = PairIterable<Member<FontFace>, Member<FontFace>>; -#if ENABLE(OILPAN) -class FontFaceSet final : public EventTargetWithInlineData, public HeapSupplement<Document>, public ActiveDOMObject, public FontFaceSetIterable { +class FontFaceSet final : public EventTargetWithInlineData, public Supplement<Document>, public ActiveDOMObject, public FontFaceSetIterable { USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet); - using SupplementType = HeapSupplement<Document>; -#else -class FontFaceSet final : public EventTargetWithInlineData, public RefCountedSupplement<Document, FontFaceSet>, public ActiveDOMObject, public FontFaceSetIterable { - REFCOUNTED_EVENT_TARGET(FontFaceSet); - using SupplementType = RefCountedSupplement<Document, FontFaceSet>; -#endif DEFINE_WRAPPERTYPEINFO(); public: ~FontFaceSet() override; @@ -81,7 +73,7 @@ ScriptPromise load(ScriptState*, const String& font, const String& text); ScriptPromise ready(ScriptState*); - PassRefPtrWillBeRawPtr<FontFaceSet> addForBinding(ScriptState*, FontFace*, ExceptionState&); + RawPtr<FontFaceSet> addForBinding(ScriptState*, FontFace*, ExceptionState&); void clearForBinding(ScriptState*, ExceptionState&); bool deleteForBinding(ScriptState*, FontFace*, ExceptionState&); bool hasForBinding(ScriptState*, FontFace*, ExceptionState&) const; @@ -104,7 +96,7 @@ void resume() override; void stop() override; - static PassRefPtrWillBeRawPtr<FontFaceSet> from(Document&); + static RawPtr<FontFaceSet> from(Document&); static void didLayout(Document&); void addFontFacesToFontFaceCache(FontFaceCache*, CSSFontSelector*); @@ -112,19 +104,19 @@ DECLARE_VIRTUAL_TRACE(); private: - static PassRefPtrWillBeRawPtr<FontFaceSet> create(Document& document) + static RawPtr<FontFaceSet> create(Document& document) { - return adoptRefWillBeNoop(new FontFaceSet(document)); + return new FontFaceSet(document); } FontFaceSetIterable::IterationSource* startIteration(ScriptState*, ExceptionState&) override; class IterationSource final : public FontFaceSetIterable::IterationSource { public: - explicit IterationSource(const WillBeHeapVector<RefPtrWillBeMember<FontFace>>& fontFaces) + explicit IterationSource(const HeapVector<Member<FontFace>>& fontFaces) : m_index(0) , m_fontFaces(fontFaces) { } - bool next(ScriptState*, RefPtrWillBeMember<FontFace>&, RefPtrWillBeMember<FontFace>&, ExceptionState&) override; + bool next(ScriptState*, Member<FontFace>&, Member<FontFace>&, ExceptionState&) override; DEFINE_INLINE_VIRTUAL_TRACE() { @@ -134,7 +126,7 @@ private: size_t m_index; - WillBeHeapVector<RefPtrWillBeMember<FontFace>> m_fontFaces; + HeapVector<Member<FontFace>> m_fontFaces; }; class FontLoadHistogram { @@ -155,28 +147,28 @@ FontFaceSet(Document&); bool inActiveDocumentContext() const; - void addToLoadingFonts(PassRefPtrWillBeRawPtr<FontFace>); - void removeFromLoadingFonts(PassRefPtrWillBeRawPtr<FontFace>); + void addToLoadingFonts(RawPtr<FontFace>); + void removeFromLoadingFonts(RawPtr<FontFace>); void fireLoadingEvent(); void fireDoneEventIfPossible(); bool resolveFontStyle(const String&, Font&); void handlePendingEventsAndPromisesSoon(); void handlePendingEventsAndPromises(); - const WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>>& cssConnectedFontFaceList() const; + const HeapListHashSet<Member<FontFace>>& cssConnectedFontFaceList() const; bool isCSSConnectedFontFace(FontFace*) const; bool shouldSignalReady() const; - using ReadyProperty = ScriptPromiseProperty<RawPtrWillBeMember<FontFaceSet>, RawPtrWillBeMember<FontFaceSet>, Member<DOMException>>; + using ReadyProperty = ScriptPromiseProperty<Member<FontFaceSet>, Member<FontFaceSet>, Member<DOMException>>; - WillBeHeapHashSet<RefPtrWillBeMember<FontFace>> m_loadingFonts; + HeapHashSet<Member<FontFace>> m_loadingFonts; bool m_shouldFireLoadingEvent; bool m_isLoading; - PersistentWillBeMember<ReadyProperty> m_ready; + Member<ReadyProperty> m_ready; FontFaceArray m_loadedFonts; FontFaceArray m_failedFonts; - WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>> m_nonCSSConnectedFaces; + HeapListHashSet<Member<FontFace>> m_nonCSSConnectedFaces; - PersistentWillBeMember<AsyncMethodRunner<FontFaceSet>> m_asyncRunner; + Member<AsyncMethodRunner<FontFaceSet>> m_asyncRunner; FontLoadHistogram m_histogram; };
diff --git a/third_party/WebKit/Source/core/css/FontFaceSetLoadEvent.h b/third_party/WebKit/Source/core/css/FontFaceSetLoadEvent.h index e8ed883..bd4357d 100644 --- a/third_party/WebKit/Source/core/css/FontFaceSetLoadEvent.h +++ b/third_party/WebKit/Source/core/css/FontFaceSetLoadEvent.h
@@ -43,19 +43,19 @@ class FontFaceSetLoadEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<FontFaceSetLoadEvent> create() + static RawPtr<FontFaceSetLoadEvent> create() { - return adoptRefWillBeNoop(new FontFaceSetLoadEvent()); + return new FontFaceSetLoadEvent(); } - static PassRefPtrWillBeRawPtr<FontFaceSetLoadEvent> create(const AtomicString& type, const FontFaceSetLoadEventInit& initializer) + static RawPtr<FontFaceSetLoadEvent> create(const AtomicString& type, const FontFaceSetLoadEventInit& initializer) { - return adoptRefWillBeNoop(new FontFaceSetLoadEvent(type, initializer)); + return new FontFaceSetLoadEvent(type, initializer); } - static PassRefPtrWillBeRawPtr<FontFaceSetLoadEvent> createForFontFaces(const AtomicString& type, const FontFaceArray& fontfaces = FontFaceArray()) + static RawPtr<FontFaceSetLoadEvent> createForFontFaces(const AtomicString& type, const FontFaceArray& fontfaces = FontFaceArray()) { - return adoptRefWillBeNoop(new FontFaceSetLoadEvent(type, fontfaces)); + return new FontFaceSetLoadEvent(type, fontfaces); } ~FontFaceSetLoadEvent() override;
diff --git a/third_party/WebKit/Source/core/css/FontLoader.cpp b/third_party/WebKit/Source/core/css/FontLoader.cpp index 54958908..98d9ce9 100644 --- a/third_party/WebKit/Source/core/css/FontLoader.cpp +++ b/third_party/WebKit/Source/core/css/FontLoader.cpp
@@ -12,11 +12,11 @@ namespace blink { -struct FontLoader::FontToLoad : public NoBaseWillBeGarbageCollectedFinalized<FontLoader::FontToLoad> { +struct FontLoader::FontToLoad : public GarbageCollectedFinalized<FontLoader::FontToLoad> { public: - static PassOwnPtrWillBeRawPtr<FontToLoad> create(FontResource* fontResource, Document& document) + static RawPtr<FontToLoad> create(FontResource* fontResource, Document& document) { - return adoptPtrWillBeNoop(new FontToLoad(fontResource, document)); + return new FontToLoad(fontResource, document); } virtual ~FontToLoad() @@ -24,7 +24,7 @@ ASSERT(!fontResource); } - RefPtrWillBeMember<FontResource> fontResource; + Member<FontResource> fontResource; OwnPtr<IncrementLoadEventDelayCount> delay; void dispose()
diff --git a/third_party/WebKit/Source/core/css/FontLoader.h b/third_party/WebKit/Source/core/css/FontLoader.h index 9221b4f5..181630a8 100644 --- a/third_party/WebKit/Source/core/css/FontLoader.h +++ b/third_party/WebKit/Source/core/css/FontLoader.h
@@ -16,11 +16,11 @@ class Document; class FontResource; -class FontLoader : public RefCountedWillBeGarbageCollectedFinalized<FontLoader> { +class FontLoader : public GarbageCollectedFinalized<FontLoader> { public: - static PassRefPtrWillBeRawPtr<FontLoader> create(CSSFontSelector* fontSelector, Document* document) + static RawPtr<FontLoader> create(CSSFontSelector* fontSelector, Document* document) { - return adoptRefWillBeNoop(new FontLoader(fontSelector, document)); + return new FontLoader(fontSelector, document); } ~FontLoader(); @@ -43,10 +43,10 @@ Timer<FontLoader> m_beginLoadingTimer; struct FontToLoad; - using FontsToLoadVector = WillBeHeapVector<OwnPtrWillBeMember<FontToLoad>>; + using FontsToLoadVector = HeapVector<Member<FontToLoad>>; FontsToLoadVector m_fontsToBeginLoading; - RawPtrWillBeMember<CSSFontSelector> m_fontSelector; - RawPtrWillBeWeakMember<Document> m_document; + Member<CSSFontSelector> m_fontSelector; + WeakMember<Document> m_document; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/KeyframeStyleRuleCSSStyleDeclaration.h b/third_party/WebKit/Source/core/css/KeyframeStyleRuleCSSStyleDeclaration.h index 58576de..f0b3897 100644 --- a/third_party/WebKit/Source/core/css/KeyframeStyleRuleCSSStyleDeclaration.h +++ b/third_party/WebKit/Source/core/css/KeyframeStyleRuleCSSStyleDeclaration.h
@@ -13,9 +13,9 @@ class KeyframeStyleRuleCSSStyleDeclaration final : public StyleRuleCSSStyleDeclaration { public: - static PassRefPtrWillBeRawPtr<KeyframeStyleRuleCSSStyleDeclaration> create(MutableStylePropertySet& propertySet, CSSKeyframeRule* parentRule) + static RawPtr<KeyframeStyleRuleCSSStyleDeclaration> create(MutableStylePropertySet& propertySet, CSSKeyframeRule* parentRule) { - return adoptRefWillBeNoop(new KeyframeStyleRuleCSSStyleDeclaration(propertySet, parentRule)); + return new KeyframeStyleRuleCSSStyleDeclaration(propertySet, parentRule); } private:
diff --git a/third_party/WebKit/Source/core/css/MediaList.cpp b/third_party/WebKit/Source/core/css/MediaList.cpp index 1c82585..9dbd736 100644 --- a/third_party/WebKit/Source/core/css/MediaList.cpp +++ b/third_party/WebKit/Source/core/css/MediaList.cpp
@@ -59,9 +59,7 @@ m_queries[i] = o.m_queries[i]->copy(); } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MediaQuerySet); - -PassRefPtrWillBeRawPtr<MediaQuerySet> MediaQuerySet::create(const String& mediaString) +RawPtr<MediaQuerySet> MediaQuerySet::create(const String& mediaString) { if (mediaString.isEmpty()) return MediaQuerySet::create(); @@ -69,7 +67,7 @@ return MediaQueryParser::parseMediaQuerySet(mediaString); } -PassRefPtrWillBeRawPtr<MediaQuerySet> MediaQuerySet::createOffMainThread(const String& mediaString) +RawPtr<MediaQuerySet> MediaQuerySet::createOffMainThread(const String& mediaString) { if (mediaString.isEmpty()) return MediaQuerySet::create(); @@ -79,7 +77,7 @@ bool MediaQuerySet::set(const String& mediaString) { - RefPtrWillBeRawPtr<MediaQuerySet> result = create(mediaString); + RawPtr<MediaQuerySet> result = create(mediaString); m_queries.swap(result->m_queries); return true; } @@ -89,13 +87,13 @@ // To "parse a media query" for a given string means to follow "the parse // a media query list" steps and return "null" if more than one media query // is returned, or else the returned media query. - RefPtrWillBeRawPtr<MediaQuerySet> result = create(queryString); + RawPtr<MediaQuerySet> result = create(queryString); // Only continue if exactly one media query is found, as described above. if (result->m_queries.size() != 1) return true; - OwnPtrWillBeRawPtr<MediaQuery> newQuery = result->m_queries[0].release(); + RawPtr<MediaQuery> newQuery = result->m_queries[0].release(); ASSERT(newQuery); // If comparing with any of the media queries in the collection of media @@ -115,13 +113,13 @@ // To "parse a media query" for a given string means to follow "the parse // a media query list" steps and return "null" if more than one media query // is returned, or else the returned media query. - RefPtrWillBeRawPtr<MediaQuerySet> result = create(queryStringToRemove); + RawPtr<MediaQuerySet> result = create(queryStringToRemove); // Only continue if exactly one media query is found, as described above. if (result->m_queries.size() != 1) return true; - OwnPtrWillBeRawPtr<MediaQuery> newQuery = result->m_queries[0].release(); + RawPtr<MediaQuery> newQuery = result->m_queries[0].release(); ASSERT(newQuery); // Remove any media query from the collection of media queries for which @@ -139,7 +137,7 @@ return found; } -void MediaQuerySet::addMediaQuery(PassOwnPtrWillBeRawPtr<MediaQuery> mediaQuery) +void MediaQuerySet::addMediaQuery(RawPtr<MediaQuery> mediaQuery) { m_queries.append(mediaQuery); } @@ -182,8 +180,6 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MediaList); - void MediaList::setMediaText(const String& value) { CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule); @@ -196,7 +192,7 @@ String MediaList::item(unsigned index) const { - const WillBeHeapVector<OwnPtrWillBeMember<MediaQuery>>& queries = m_mediaQueries->queryVector(); + const HeapVector<Member<MediaQuery>>& queries = m_mediaQueries->queryVector(); if (index < queries.size()) return queries[index]->cssText(); return String();
diff --git a/third_party/WebKit/Source/core/css/MediaList.h b/third_party/WebKit/Source/core/css/MediaList.h index 7595acf0..2c480f4d 100644 --- a/third_party/WebKit/Source/core/css/MediaList.h +++ b/third_party/WebKit/Source/core/css/MediaList.h
@@ -39,27 +39,26 @@ class MediaList; class MediaQuery; -class CORE_EXPORT MediaQuerySet : public RefCountedWillBeGarbageCollected<MediaQuerySet> { - DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MediaQuerySet); +class CORE_EXPORT MediaQuerySet : public GarbageCollected<MediaQuerySet> { public: - static PassRefPtrWillBeRawPtr<MediaQuerySet> create() + static RawPtr<MediaQuerySet> create() { - return adoptRefWillBeNoop(new MediaQuerySet()); + return new MediaQuerySet(); } - static PassRefPtrWillBeRawPtr<MediaQuerySet> create(const String& mediaString); - static PassRefPtrWillBeRawPtr<MediaQuerySet> createOffMainThread(const String& mediaString); + static RawPtr<MediaQuerySet> create(const String& mediaString); + static RawPtr<MediaQuerySet> createOffMainThread(const String& mediaString); bool set(const String&); bool add(const String&); bool remove(const String&); - void addMediaQuery(PassOwnPtrWillBeRawPtr<MediaQuery>); + void addMediaQuery(RawPtr<MediaQuery>); - const WillBeHeapVector<OwnPtrWillBeMember<MediaQuery>>& queryVector() const { return m_queries; } + const HeapVector<Member<MediaQuery>>& queryVector() const { return m_queries; } String mediaText() const; - PassRefPtrWillBeRawPtr<MediaQuerySet> copy() const { return adoptRefWillBeNoop(new MediaQuerySet(*this)); } + RawPtr<MediaQuerySet> copy() const { return new MediaQuerySet(*this); } DECLARE_TRACE(); @@ -67,21 +66,20 @@ MediaQuerySet(); MediaQuerySet(const MediaQuerySet&); - WillBeHeapVector<OwnPtrWillBeMember<MediaQuery>> m_queries; + HeapVector<Member<MediaQuery>> m_queries; }; -class MediaList final : public RefCountedWillBeGarbageCollected<MediaList>, public ScriptWrappable { +class MediaList final : public GarbageCollected<MediaList>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); - DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MediaList); public: - static PassRefPtrWillBeRawPtr<MediaList> create(MediaQuerySet* mediaQueries, CSSStyleSheet* parentSheet) + static RawPtr<MediaList> create(MediaQuerySet* mediaQueries, CSSStyleSheet* parentSheet) { - return adoptRefWillBeNoop(new MediaList(mediaQueries, parentSheet)); + return new MediaList(mediaQueries, parentSheet); } - static PassRefPtrWillBeRawPtr<MediaList> create(MediaQuerySet* mediaQueries, CSSRule* parentRule) + static RawPtr<MediaList> create(MediaQuerySet* mediaQueries, CSSRule* parentRule) { - return adoptRefWillBeNoop(new MediaList(mediaQueries, parentRule)); + return new MediaList(mediaQueries, parentRule); } unsigned length() const { return m_mediaQueries->queryVector().size(); } @@ -111,11 +109,11 @@ MediaList(MediaQuerySet*, CSSStyleSheet* parentSheet); MediaList(MediaQuerySet*, CSSRule* parentRule); - RefPtrWillBeMember<MediaQuerySet> m_mediaQueries; + Member<MediaQuerySet> m_mediaQueries; // Cleared in ~CSSStyleSheet destructor when oilpan is not enabled. - RawPtrWillBeMember<CSSStyleSheet> m_parentStyleSheet; + Member<CSSStyleSheet> m_parentStyleSheet; // Cleared in the ~CSSMediaRule and ~CSSImportRule destructors when oilpan is not enabled. - RawPtrWillBeMember<CSSRule> m_parentRule; + Member<CSSRule> m_parentRule; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/MediaQuery.cpp b/third_party/WebKit/Source/core/css/MediaQuery.cpp index 07552af..f6ab5195 100644 --- a/third_party/WebKit/Source/core/css/MediaQuery.cpp +++ b/third_party/WebKit/Source/core/css/MediaQuery.cpp
@@ -69,19 +69,19 @@ return result.toString(); } -static bool expressionCompare(const OwnPtrWillBeMember<MediaQueryExp>& a, const OwnPtrWillBeMember<MediaQueryExp>& b) +static bool expressionCompare(const Member<MediaQueryExp>& a, const Member<MediaQueryExp>& b) { return codePointCompare(a->serialize(), b->serialize()) < 0; } -PassOwnPtrWillBeRawPtr<MediaQuery> MediaQuery::createNotAll() +RawPtr<MediaQuery> MediaQuery::createNotAll() { - return adoptPtrWillBeNoop(new MediaQuery(MediaQuery::Not, MediaTypeNames::all, ExpressionHeapVector())); + return new MediaQuery(MediaQuery::Not, MediaTypeNames::all, ExpressionHeapVector()); } -PassOwnPtrWillBeRawPtr<MediaQuery> MediaQuery::create(RestrictorType restrictor, String mediaType, ExpressionHeapVector expressions) +RawPtr<MediaQuery> MediaQuery::create(RestrictorType restrictor, String mediaType, ExpressionHeapVector expressions) { - return adoptPtrWillBeNoop(new MediaQuery(restrictor, std::move(mediaType), std::move(expressions))); + return new MediaQuery(restrictor, std::move(mediaType), std::move(expressions)); } MediaQuery::MediaQuery(RestrictorType restrictor, String mediaType, ExpressionHeapVector expressions)
diff --git a/third_party/WebKit/Source/core/css/MediaQuery.h b/third_party/WebKit/Source/core/css/MediaQuery.h index 2820d2d8..08a997a 100644 --- a/third_party/WebKit/Source/core/css/MediaQuery.h +++ b/third_party/WebKit/Source/core/css/MediaQuery.h
@@ -40,17 +40,16 @@ namespace blink { class MediaQueryExp; -using ExpressionHeapVector = WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp>>; +using ExpressionHeapVector = HeapVector<Member<MediaQueryExp>>; -class CORE_EXPORT MediaQuery : public NoBaseWillBeGarbageCollectedFinalized<MediaQuery> { - USING_FAST_MALLOC_WILL_BE_REMOVED(MediaQuery); +class CORE_EXPORT MediaQuery : public GarbageCollectedFinalized<MediaQuery> { public: enum RestrictorType { Only, Not, None }; - static PassOwnPtrWillBeRawPtr<MediaQuery> create(RestrictorType, String mediaType, ExpressionHeapVector); - static PassOwnPtrWillBeRawPtr<MediaQuery> createNotAll(); + static RawPtr<MediaQuery> create(RestrictorType, String mediaType, ExpressionHeapVector); + static RawPtr<MediaQuery> createNotAll(); ~MediaQuery(); @@ -60,7 +59,7 @@ bool operator==(const MediaQuery& other) const; String cssText() const; - PassOwnPtrWillBeRawPtr<MediaQuery> copy() const { return adoptPtrWillBeNoop(new MediaQuery(*this)); } + RawPtr<MediaQuery> copy() const { return new MediaQuery(*this); } DECLARE_TRACE();
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp index 2fbde7bb..92f06db 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
@@ -131,9 +131,9 @@ for (; i < expressions.size(); ++i) { bool exprResult = eval(expressions.at(i).get()); if (viewportDependentMediaQueryResults && expressions.at(i)->isViewportDependent()) - viewportDependentMediaQueryResults->append(adoptRefWillBeNoop(new MediaQueryResult(*expressions.at(i), exprResult))); + viewportDependentMediaQueryResults->append(new MediaQueryResult(*expressions.at(i), exprResult)); if (deviceDependentMediaQueryResults && expressions.at(i)->isDeviceDependent()) - deviceDependentMediaQueryResults->append(adoptRefWillBeNoop(new MediaQueryResult(*expressions.at(i), exprResult))); + deviceDependentMediaQueryResults->append(new MediaQueryResult(*expressions.at(i), exprResult)); if (!exprResult) break; } @@ -147,7 +147,7 @@ if (!querySet) return true; - const WillBeHeapVector<OwnPtrWillBeMember<MediaQuery>>& queries = querySet->queryVector(); + const HeapVector<Member<MediaQuery>>& queries = querySet->queryVector(); if (!queries.size()) return true; // Empty query list evaluates to true.
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.h b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.h index 343567b..f4e71a2 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.h +++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.h
@@ -40,7 +40,7 @@ class MediaQuerySet; class MediaValues; -using MediaQueryResultList = WillBeHeapVector<RefPtrWillBeMember<MediaQueryResult>>; +using MediaQueryResultList = HeapVector<Member<MediaQueryResult>>; // Class that evaluates css media queries as defined in // CSS3 Module "Media Queries" (http://www.w3.org/TR/css3-mediaqueries/) @@ -53,9 +53,8 @@ // the device characteristics are not known. This can be used to prune the loading // of stylesheets to only those which are probable to match. -class CORE_EXPORT MediaQueryEvaluator final : public NoBaseWillBeGarbageCollectedFinalized<MediaQueryEvaluator> { +class CORE_EXPORT MediaQueryEvaluator final : public GarbageCollectedFinalized<MediaQueryEvaluator> { WTF_MAKE_NONCOPYABLE(MediaQueryEvaluator); - USING_FAST_MALLOC_WILL_BE_REMOVED(MediaQueryEvaluator); public: // Creates evaluator which evaluates only simple media queries // Evaluator returns true for "all", and returns value of \mediaFeatureResult @@ -95,7 +94,7 @@ String m_mediaType; bool m_expectedResult; - RefPtrWillBeMember<MediaValues> m_mediaValues; + Member<MediaValues> m_mediaValues; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp index 72f26a0..b0b905d 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
@@ -124,7 +124,7 @@ void testMQEvaluator(TestCase* testCases, const MediaQueryEvaluator& mediaQueryEvaluator) { - RefPtrWillBePersistent<MediaQuerySet> querySet = nullptr; + Persistent<MediaQuerySet> querySet = nullptr; for (unsigned i = 0; testCases[i].input; ++i) { querySet = MediaQuerySet::create(testCases[i].input); ASSERT_EQ(testCases[i].output, mediaQueryEvaluator.eval(querySet.get())); @@ -148,7 +148,7 @@ data.mediaType = MediaTypeNames::screen; data.strictMode = true; data.displayMode = WebDisplayModeBrowser; - RefPtrWillBeRawPtr<MediaValues> mediaValues = MediaValuesCached::create(data); + RawPtr<MediaValues> mediaValues = MediaValuesCached::create(data); MediaQueryEvaluator mediaQueryEvaluator(*mediaValues); testMQEvaluator(screenTestCases, mediaQueryEvaluator); @@ -174,11 +174,11 @@ TEST(MediaQueryEvaluatorTest, DynamicNoView) { OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(500, 500)); - RefPtrWillBeRawPtr<LocalFrame> frame = &pageHolder->frame(); + RawPtr<LocalFrame> frame = &pageHolder->frame(); pageHolder.clear(); ASSERT_EQ(nullptr, frame->view()); MediaQueryEvaluator mediaQueryEvaluator(frame.get()); - RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create("foobar"); + RawPtr<MediaQuerySet> querySet = MediaQuerySet::create("foobar"); EXPECT_FALSE(mediaQueryEvaluator.eval(querySet.get())); } @@ -187,7 +187,7 @@ MediaValuesCached::MediaValuesCachedData data; data.viewportWidth = 600.5; data.viewportHeight = 700.125; - RefPtrWillBeRawPtr<MediaValues> mediaValues = MediaValuesCached::create(data); + RawPtr<MediaValues> mediaValues = MediaValuesCached::create(data); MediaQueryEvaluator mediaQueryEvaluator(*mediaValues); testMQEvaluator(floatViewportTestCases, mediaQueryEvaluator);
diff --git a/third_party/WebKit/Source/core/css/MediaQueryExp.cpp b/third_party/WebKit/Source/core/css/MediaQueryExp.cpp index a0678d2..b429550 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryExp.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryExp.cpp
@@ -203,7 +203,7 @@ { } -PassOwnPtrWillBeRawPtr<MediaQueryExp> MediaQueryExp::createIfValid(const String& mediaFeature, const Vector<CSSParserToken, 4>& tokenList) +RawPtr<MediaQueryExp> MediaQueryExp::createIfValid(const String& mediaFeature, const Vector<CSSParserToken, 4>& tokenList) { ASSERT(!mediaFeature.isNull()); @@ -267,7 +267,7 @@ return nullptr; } - return adoptPtrWillBeNoop(new MediaQueryExp(lowerMediaFeature, expValue)); + return new MediaQueryExp(lowerMediaFeature, expValue); } MediaQueryExp::~MediaQueryExp()
diff --git a/third_party/WebKit/Source/core/css/MediaQueryExp.h b/third_party/WebKit/Source/core/css/MediaQueryExp.h index f4b8619..39bbefce 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryExp.h +++ b/third_party/WebKit/Source/core/css/MediaQueryExp.h
@@ -80,10 +80,9 @@ } }; -class CORE_EXPORT MediaQueryExp : public NoBaseWillBeGarbageCollectedFinalized<MediaQueryExp> { - USING_FAST_MALLOC_WILL_BE_REMOVED(MediaQueryExp); +class CORE_EXPORT MediaQueryExp : public GarbageCollectedFinalized<MediaQueryExp> { public: - static PassOwnPtrWillBeRawPtr<MediaQueryExp> createIfValid(const String& mediaFeature, const Vector<CSSParserToken, 4>&); + static RawPtr<MediaQueryExp> createIfValid(const String& mediaFeature, const Vector<CSSParserToken, 4>&); ~MediaQueryExp(); const String& mediaFeature() const { return m_mediaFeature; } @@ -98,7 +97,7 @@ String serialize() const; - PassOwnPtrWillBeRawPtr<MediaQueryExp> copy() const { return adoptPtrWillBeNoop(new MediaQueryExp(*this)); } + RawPtr<MediaQueryExp> copy() const { return new MediaQueryExp(*this); } MediaQueryExp(const MediaQueryExp& other);
diff --git a/third_party/WebKit/Source/core/css/MediaQueryList.cpp b/third_party/WebKit/Source/core/css/MediaQueryList.cpp index 931c63f0..f73268c 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryList.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryList.cpp
@@ -27,14 +27,14 @@ namespace blink { -PassRefPtrWillBeRawPtr<MediaQueryList> MediaQueryList::create(ExecutionContext* context, PassRefPtrWillBeRawPtr<MediaQueryMatcher> matcher, PassRefPtrWillBeRawPtr<MediaQuerySet> media) +RawPtr<MediaQueryList> MediaQueryList::create(ExecutionContext* context, RawPtr<MediaQueryMatcher> matcher, RawPtr<MediaQuerySet> media) { - RefPtrWillBeRawPtr<MediaQueryList> list = adoptRefWillBeNoop(new MediaQueryList(context, matcher, media)); + RawPtr<MediaQueryList> list = new MediaQueryList(context, matcher, media); list->suspendIfNeeded(); return list.release(); } -MediaQueryList::MediaQueryList(ExecutionContext* context, PassRefPtrWillBeRawPtr<MediaQueryMatcher> matcher, PassRefPtrWillBeRawPtr<MediaQuerySet> media) +MediaQueryList::MediaQueryList(ExecutionContext* context, RawPtr<MediaQueryMatcher> matcher, RawPtr<MediaQuerySet> media) : ActiveScriptWrappable(this) , ActiveDOMObject(context) , m_matcher(matcher) @@ -58,7 +58,7 @@ return m_media->mediaText(); } -void MediaQueryList::addDeprecatedListener(PassRefPtrWillBeRawPtr<EventListener> listener) +void MediaQueryList::addDeprecatedListener(RawPtr<EventListener> listener) { if (!listener) return; @@ -66,7 +66,7 @@ addEventListener(EventTypeNames::change, listener, false); } -void MediaQueryList::removeDeprecatedListener(PassRefPtrWillBeRawPtr<EventListener> listener) +void MediaQueryList::removeDeprecatedListener(RawPtr<EventListener> listener) { if (!listener) return; @@ -74,7 +74,7 @@ removeEventListener(EventTypeNames::change, listener, false); } -void MediaQueryList::addListener(PassRefPtrWillBeRawPtr<MediaQueryListListener> listener) +void MediaQueryList::addListener(RawPtr<MediaQueryListListener> listener) { if (!listener) return; @@ -82,12 +82,12 @@ m_listeners.add(listener); } -void MediaQueryList::removeListener(PassRefPtrWillBeRawPtr<MediaQueryListListener> listener) +void MediaQueryList::removeListener(RawPtr<MediaQueryListListener> listener) { if (!listener) return; - RefPtrWillBeRawPtr<MediaQueryList> protect(this); + RawPtr<MediaQueryList> protect(this); m_listeners.remove(listener); } @@ -99,12 +99,12 @@ void MediaQueryList::stop() { // m_listeners.clear() can drop the last ref to this MediaQueryList. - RefPtrWillBeRawPtr<MediaQueryList> protect(this); + RawPtr<MediaQueryList> protect(this); m_listeners.clear(); removeAllEventListeners(); } -bool MediaQueryList::mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<MediaQueryListListener>>* listenersToNotify) +bool MediaQueryList::mediaFeaturesChanged(HeapVector<Member<MediaQueryListListener>>* listenersToNotify) { m_matchesDirty = true; if (!updateMatches())
diff --git a/third_party/WebKit/Source/core/css/MediaQueryList.h b/third_party/WebKit/Source/core/css/MediaQueryList.h index 1e5645fe..26bab243f 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryList.h +++ b/third_party/WebKit/Source/core/css/MediaQueryList.h
@@ -42,12 +42,12 @@ // retrieve the current value of the given media query and to add/remove listeners that // will be called whenever the value of the query changes. -class CORE_EXPORT MediaQueryList final : public EventTargetWithInlineData, public RefCountedWillBeNoBase<MediaQueryList>, public ActiveScriptWrappable, public ActiveDOMObject { +class CORE_EXPORT MediaQueryList final : public EventTargetWithInlineData, public ActiveScriptWrappable, public ActiveDOMObject { REFCOUNTED_EVENT_TARGET(MediaQueryList); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaQueryList); + USING_GARBAGE_COLLECTED_MIXIN(MediaQueryList); public: - static PassRefPtrWillBeRawPtr<MediaQueryList> create(ExecutionContext*, PassRefPtrWillBeRawPtr<MediaQueryMatcher>, PassRefPtrWillBeRawPtr<MediaQuerySet>); + static RawPtr<MediaQueryList> create(ExecutionContext*, RawPtr<MediaQueryMatcher>, RawPtr<MediaQuerySet>); ~MediaQueryList() override; String media() const; @@ -57,15 +57,15 @@ // These two functions are provided for compatibility with JS code // written before the change listener became a DOM event. - void addDeprecatedListener(PassRefPtrWillBeRawPtr<EventListener>); - void removeDeprecatedListener(PassRefPtrWillBeRawPtr<EventListener>); + void addDeprecatedListener(RawPtr<EventListener>); + void removeDeprecatedListener(RawPtr<EventListener>); // C++ code can use these functions to listen to changes instead of having to use DOM event listeners. - void addListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>); - void removeListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>); + void addListener(RawPtr<MediaQueryListListener>); + void removeListener(RawPtr<MediaQueryListListener>); // Will return true if a DOM event should be scheduled. - bool mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<MediaQueryListListener>>* listenersToNotify); + bool mediaFeaturesChanged(HeapVector<Member<MediaQueryListListener>>* listenersToNotify); DECLARE_VIRTUAL_TRACE(); @@ -79,13 +79,13 @@ ExecutionContext* getExecutionContext() const override; private: - MediaQueryList(ExecutionContext*, PassRefPtrWillBeRawPtr<MediaQueryMatcher>, PassRefPtrWillBeRawPtr<MediaQuerySet>); + MediaQueryList(ExecutionContext*, RawPtr<MediaQueryMatcher>, RawPtr<MediaQuerySet>); bool updateMatches(); - RefPtrWillBeMember<MediaQueryMatcher> m_matcher; - RefPtrWillBeMember<MediaQuerySet> m_media; - using ListenerList = WillBeHeapListHashSet<RefPtrWillBeMember<MediaQueryListListener>>; + Member<MediaQueryMatcher> m_matcher; + Member<MediaQuerySet> m_media; + using ListenerList = HeapListHashSet<Member<MediaQueryListListener>>; ListenerList m_listeners; bool m_matchesDirty; bool m_matches;
diff --git a/third_party/WebKit/Source/core/css/MediaQueryListEvent.h b/third_party/WebKit/Source/core/css/MediaQueryListEvent.h index 6a6e5dc4..f18d744 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryListEvent.h +++ b/third_party/WebKit/Source/core/css/MediaQueryListEvent.h
@@ -14,24 +14,24 @@ class MediaQueryListEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<MediaQueryListEvent> create() + static RawPtr<MediaQueryListEvent> create() { return adoptRefWillBeNoop(new MediaQueryListEvent); } - static PassRefPtrWillBeRawPtr<MediaQueryListEvent> create(PassRefPtrWillBeRawPtr<MediaQueryList> list) + static RawPtr<MediaQueryListEvent> create(RawPtr<MediaQueryList> list) { - return adoptRefWillBeNoop(new MediaQueryListEvent(list)); + return new MediaQueryListEvent(list); } - static PassRefPtrWillBeRawPtr<MediaQueryListEvent> create(const String& media, bool matches) + static RawPtr<MediaQueryListEvent> create(const String& media, bool matches) { - return adoptRefWillBeNoop(new MediaQueryListEvent(media, matches)); + return new MediaQueryListEvent(media, matches); } - static PassRefPtrWillBeRawPtr<MediaQueryListEvent> create(const AtomicString& eventType, const MediaQueryListEventInit& initializer) + static RawPtr<MediaQueryListEvent> create(const AtomicString& eventType, const MediaQueryListEventInit& initializer) { - return adoptRefWillBeNoop(new MediaQueryListEvent(eventType, initializer)); + return new MediaQueryListEvent(eventType, initializer); } String media() const { return m_mediaQueryList ? m_mediaQueryList->media() : m_media; } @@ -54,7 +54,7 @@ , m_media(media) , m_matches(matches) { } - explicit MediaQueryListEvent(PassRefPtrWillBeRawPtr<MediaQueryList> list) + explicit MediaQueryListEvent(RawPtr<MediaQueryList> list) : Event(EventTypeNames::change, false, false) , m_mediaQueryList(list) , m_matches(false) { } @@ -71,7 +71,7 @@ // We have m_media/m_matches for JS-created events; we use m_mediaQueryList // for events that blink generates. - RefPtrWillBeMember<MediaQueryList> m_mediaQueryList; + Member<MediaQueryList> m_mediaQueryList; String m_media; bool m_matches; };
diff --git a/third_party/WebKit/Source/core/css/MediaQueryListListener.cpp b/third_party/WebKit/Source/core/css/MediaQueryListListener.cpp index 95c0b13..5f0daaca 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryListListener.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryListListener.cpp
@@ -26,6 +26,4 @@ // only for use by subclasses } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(MediaQueryListListener); - }
diff --git a/third_party/WebKit/Source/core/css/MediaQueryListListener.h b/third_party/WebKit/Source/core/css/MediaQueryListListener.h index a7df1a6..f7f3b7b8 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryListListener.h +++ b/third_party/WebKit/Source/core/css/MediaQueryListListener.h
@@ -28,8 +28,7 @@ namespace blink { // See http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface -class CORE_EXPORT MediaQueryListListener : public RefCountedWillBeGarbageCollected<MediaQueryListListener> { - DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(MediaQueryListListener); +class CORE_EXPORT MediaQueryListListener : public GarbageCollected<MediaQueryListListener> { public: virtual void notifyMediaQueryChanged() = 0;
diff --git a/third_party/WebKit/Source/core/css/MediaQueryListTest.cpp b/third_party/WebKit/Source/core/css/MediaQueryListTest.cpp index b703b374..7605e2e4 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryListTest.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryListTest.cpp
@@ -23,9 +23,9 @@ TEST(MediaQueryListTest, CrashInStop) { - RefPtrWillBeRawPtr<Document> document = Document::create(); - RefPtrWillBeRawPtr<MediaQueryList> list = MediaQueryList::create(document.get(), MediaQueryMatcher::create(*document), MediaQuerySet::create()); - list->addListener(adoptRefWillBeNoop(new TestListener())); + RawPtr<Document> document = Document::create(); + RawPtr<MediaQueryList> list = MediaQueryList::create(document.get(), MediaQueryMatcher::create(*document), MediaQuerySet::create()); + list->addListener(new TestListener()); list->stop(); // This test passes if it's not crashed. }
diff --git a/third_party/WebKit/Source/core/css/MediaQueryMatcher.cpp b/third_party/WebKit/Source/core/css/MediaQueryMatcher.cpp index 73a4b6e..444af68 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryMatcher.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryMatcher.cpp
@@ -32,9 +32,9 @@ namespace blink { -PassRefPtrWillBeRawPtr<MediaQueryMatcher> MediaQueryMatcher::create(Document& document) +RawPtr<MediaQueryMatcher> MediaQueryMatcher::create(Document& document) { - return adoptRefWillBeNoop(new MediaQueryMatcher(document)); + return new MediaQueryMatcher(document); } MediaQueryMatcher::MediaQueryMatcher(Document& document) @@ -53,12 +53,12 @@ m_evaluator = nullptr; } -PassOwnPtrWillBeRawPtr<MediaQueryEvaluator> MediaQueryMatcher::createEvaluator() const +RawPtr<MediaQueryEvaluator> MediaQueryMatcher::createEvaluator() const { if (!m_document || !m_document->frame()) return nullptr; - return adoptPtrWillBeNoop(new MediaQueryEvaluator(m_document->frame())); + return new MediaQueryEvaluator(m_document->frame()); } bool MediaQueryMatcher::evaluate(const MediaQuerySet* media) @@ -78,12 +78,12 @@ return false; } -PassRefPtrWillBeRawPtr<MediaQueryList> MediaQueryMatcher::matchMedia(const String& query) +RawPtr<MediaQueryList> MediaQueryMatcher::matchMedia(const String& query) { if (!m_document) return nullptr; - RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create(query); + RawPtr<MediaQuerySet> media = MediaQuerySet::create(query); return MediaQueryList::create(m_document, this, media); } @@ -101,14 +101,14 @@ m_mediaLists.remove(query); } -void MediaQueryMatcher::addViewportListener(PassRefPtrWillBeRawPtr<MediaQueryListListener> listener) +void MediaQueryMatcher::addViewportListener(RawPtr<MediaQueryListListener> listener) { if (!m_document) return; m_viewportListeners.add(listener); } -void MediaQueryMatcher::removeViewportListener(PassRefPtrWillBeRawPtr<MediaQueryListListener> listener) +void MediaQueryMatcher::removeViewportListener(RawPtr<MediaQueryListListener> listener) { if (!m_document) return; @@ -120,10 +120,10 @@ if (!m_document) return; - WillBeHeapVector<RefPtrWillBeMember<MediaQueryListListener>> listenersToNotify; + HeapVector<Member<MediaQueryListListener>> listenersToNotify; for (const auto& list : m_mediaLists) { if (list->mediaFeaturesChanged(&listenersToNotify)) { - RefPtrWillBeRawPtr<Event> event(MediaQueryListEvent::create(list)); + RawPtr<Event> event(MediaQueryListEvent::create(list)); event->setTarget(list); m_document->enqueueUniqueAnimationFrameEvent(event); } @@ -136,7 +136,7 @@ if (!m_document) return; - WillBeHeapVector<RefPtrWillBeMember<MediaQueryListListener>> listenersToNotify; + HeapVector<Member<MediaQueryListListener>> listenersToNotify; for (const auto& listener : m_viewportListeners) listenersToNotify.append(listener);
diff --git a/third_party/WebKit/Source/core/css/MediaQueryMatcher.h b/third_party/WebKit/Source/core/css/MediaQueryMatcher.h index e3cdb2c..76412be 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryMatcher.h +++ b/third_party/WebKit/Source/core/css/MediaQueryMatcher.h
@@ -38,10 +38,10 @@ // whenever it is needed and to call the listeners if the corresponding query has changed. // The listeners must be called in the very same order in which they have been added. -class CORE_EXPORT MediaQueryMatcher final : public RefCountedWillBeGarbageCollectedFinalized<MediaQueryMatcher> { +class CORE_EXPORT MediaQueryMatcher final : public GarbageCollectedFinalized<MediaQueryMatcher> { WTF_MAKE_NONCOPYABLE(MediaQueryMatcher); public: - static PassRefPtrWillBeRawPtr<MediaQueryMatcher> create(Document&); + static RawPtr<MediaQueryMatcher> create(Document&); ~MediaQueryMatcher(); void documentDetached(); @@ -49,10 +49,10 @@ void addMediaQueryList(MediaQueryList*); void removeMediaQueryList(MediaQueryList*); - void addViewportListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>); - void removeViewportListener(PassRefPtrWillBeRawPtr<MediaQueryListListener>); + void addViewportListener(RawPtr<MediaQueryListListener>); + void removeViewportListener(RawPtr<MediaQueryListListener>); - PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&); + RawPtr<MediaQueryList> matchMedia(const String&); void mediaFeaturesChanged(); void viewportChanged(); @@ -63,15 +63,15 @@ private: explicit MediaQueryMatcher(Document&); - PassOwnPtrWillBeRawPtr<MediaQueryEvaluator> createEvaluator() const; + RawPtr<MediaQueryEvaluator> createEvaluator() const; - RawPtrWillBeMember<Document> m_document; - OwnPtrWillBeMember<MediaQueryEvaluator> m_evaluator; + Member<Document> m_document; + Member<MediaQueryEvaluator> m_evaluator; - using MediaQueryListSet = WillBeHeapLinkedHashSet<RawPtrWillBeWeakMember<MediaQueryList>>; + using MediaQueryListSet = HeapLinkedHashSet<WeakMember<MediaQueryList>>; MediaQueryListSet m_mediaLists; - using ViewportListenerSet = WillBeHeapLinkedHashSet<RefPtrWillBeMember<MediaQueryListListener>>; + using ViewportListenerSet = HeapLinkedHashSet<Member<MediaQueryListListener>>; ViewportListenerSet m_viewportListeners; };
diff --git a/third_party/WebKit/Source/core/css/MediaQueryMatcherTest.cpp b/third_party/WebKit/Source/core/css/MediaQueryMatcherTest.cpp index 8d669b6..8d8c155 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryMatcherTest.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryMatcherTest.cpp
@@ -14,8 +14,8 @@ TEST(MediaQueryMatcherTest, LostFrame) { OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(500, 500)); - RefPtrWillBeRawPtr<MediaQueryMatcher> matcher = MediaQueryMatcher::create(pageHolder->document()); - RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create(MediaTypeNames::all); + RawPtr<MediaQueryMatcher> matcher = MediaQueryMatcher::create(pageHolder->document()); + RawPtr<MediaQuerySet> querySet = MediaQuerySet::create(MediaTypeNames::all); ASSERT_TRUE(matcher->evaluate(querySet.get())); matcher->documentDetached();
diff --git a/third_party/WebKit/Source/core/css/MediaQuerySetTest.cpp b/third_party/WebKit/Source/core/css/MediaQuerySetTest.cpp index c53eada..7ce16e1 100644 --- a/third_party/WebKit/Source/core/css/MediaQuerySetTest.cpp +++ b/third_party/WebKit/Source/core/css/MediaQuerySetTest.cpp
@@ -171,8 +171,8 @@ }; for (unsigned i = 0; testCases[i].input; ++i) { - RefPtrWillBeRawPtr<MediaQuerySet> oldParserQuerySet = MediaQuerySet::create(testCases[i].input); - RefPtrWillBeRawPtr<MediaQuerySet> threadSafeQuerySet = MediaQuerySet::createOffMainThread(testCases[i].input); + RawPtr<MediaQuerySet> oldParserQuerySet = MediaQuerySet::create(testCases[i].input); + RawPtr<MediaQuerySet> threadSafeQuerySet = MediaQuerySet::createOffMainThread(testCases[i].input); testMediaQuery(testCases[i], *oldParserQuerySet, true); testMediaQuery(testCases[i], *threadSafeQuerySet, false); }
diff --git a/third_party/WebKit/Source/core/css/MediaValues.cpp b/third_party/WebKit/Source/core/css/MediaValues.cpp index 6f699a2..91ed0b7 100644 --- a/third_party/WebKit/Source/core/css/MediaValues.cpp +++ b/third_party/WebKit/Source/core/css/MediaValues.cpp
@@ -24,7 +24,7 @@ namespace blink { -PassRefPtrWillBeRawPtr<MediaValues> MediaValues::createDynamicIfFrameExists(LocalFrame* frame) +RawPtr<MediaValues> MediaValues::createDynamicIfFrameExists(LocalFrame* frame) { if (frame) return MediaValuesDynamic::create(frame);
diff --git a/third_party/WebKit/Source/core/css/MediaValues.h b/third_party/WebKit/Source/core/css/MediaValues.h index 4e485b2..90b6bcc 100644 --- a/third_party/WebKit/Source/core/css/MediaValues.h +++ b/third_party/WebKit/Source/core/css/MediaValues.h
@@ -18,14 +18,14 @@ class CSSPrimitiveValue; class LocalFrame; -class CORE_EXPORT MediaValues : public RefCountedWillBeGarbageCollectedFinalized<MediaValues> { +class CORE_EXPORT MediaValues : public GarbageCollectedFinalized<MediaValues> { public: virtual ~MediaValues() { } DEFINE_INLINE_VIRTUAL_TRACE() { } - static PassRefPtrWillBeRawPtr<MediaValues> createDynamicIfFrameExists(LocalFrame*); - virtual PassRefPtrWillBeRawPtr<MediaValues> copy() const = 0; + static RawPtr<MediaValues> createDynamicIfFrameExists(LocalFrame*); + virtual RawPtr<MediaValues> copy() const = 0; static bool computeLengthImpl(double value, CSSPrimitiveValue::UnitType, unsigned defaultFontSize, double viewportWidth, double viewportHeight, double& result); template<typename T>
diff --git a/third_party/WebKit/Source/core/css/MediaValuesCached.cpp b/third_party/WebKit/Source/core/css/MediaValuesCached.cpp index e101a24..b935d766 100644 --- a/third_party/WebKit/Source/core/css/MediaValuesCached.cpp +++ b/third_party/WebKit/Source/core/css/MediaValuesCached.cpp
@@ -42,14 +42,14 @@ } } -PassRefPtrWillBeRawPtr<MediaValuesCached> MediaValuesCached::create() +RawPtr<MediaValuesCached> MediaValuesCached::create() { - return adoptRefWillBeNoop(new MediaValuesCached()); + return new MediaValuesCached(); } -PassRefPtrWillBeRawPtr<MediaValuesCached> MediaValuesCached::create(const MediaValuesCachedData& data) +RawPtr<MediaValuesCached> MediaValuesCached::create(const MediaValuesCachedData& data) { - return adoptRefWillBeNoop(new MediaValuesCached(data)); + return new MediaValuesCached(data); } MediaValuesCached::MediaValuesCached() @@ -61,9 +61,9 @@ { } -PassRefPtrWillBeRawPtr<MediaValues> MediaValuesCached::copy() const +RawPtr<MediaValues> MediaValuesCached::copy() const { - return adoptRefWillBeNoop(new MediaValuesCached(m_data)); + return new MediaValuesCached(m_data); } bool MediaValuesCached::computeLength(double value, CSSPrimitiveValue::UnitType type, int& result) const
diff --git a/third_party/WebKit/Source/core/css/MediaValuesCached.h b/third_party/WebKit/Source/core/css/MediaValuesCached.h index 9c4686ac..3b21f18 100644 --- a/third_party/WebKit/Source/core/css/MediaValuesCached.h +++ b/third_party/WebKit/Source/core/css/MediaValuesCached.h
@@ -76,9 +76,9 @@ } }; - static PassRefPtrWillBeRawPtr<MediaValuesCached> create(); - static PassRefPtrWillBeRawPtr<MediaValuesCached> create(const MediaValuesCachedData&); - PassRefPtrWillBeRawPtr<MediaValues> copy() const override; + static RawPtr<MediaValuesCached> create(); + static RawPtr<MediaValuesCached> create(const MediaValuesCachedData&); + RawPtr<MediaValues> copy() const override; bool computeLength(double value, CSSPrimitiveValue::UnitType, int& result) const override; bool computeLength(double value, CSSPrimitiveValue::UnitType, double& result) const override;
diff --git a/third_party/WebKit/Source/core/css/MediaValuesDynamic.cpp b/third_party/WebKit/Source/core/css/MediaValuesDynamic.cpp index 0e4c4dc7..c51389b 100644 --- a/third_party/WebKit/Source/core/css/MediaValuesDynamic.cpp +++ b/third_party/WebKit/Source/core/css/MediaValuesDynamic.cpp
@@ -13,16 +13,16 @@ namespace blink { -PassRefPtrWillBeRawPtr<MediaValues> MediaValuesDynamic::create(Document& document) +RawPtr<MediaValues> MediaValuesDynamic::create(Document& document) { return MediaValuesDynamic::create(frameFrom(document)); } -PassRefPtrWillBeRawPtr<MediaValues> MediaValuesDynamic::create(LocalFrame* frame) +RawPtr<MediaValues> MediaValuesDynamic::create(LocalFrame* frame) { if (!frame || !frame->view() || !frame->document() || !frame->document()->layoutView()) return MediaValuesCached::create(); - return adoptRefWillBeNoop(new MediaValuesDynamic(frame)); + return new MediaValuesDynamic(frame); } MediaValuesDynamic::MediaValuesDynamic(LocalFrame* frame) @@ -43,9 +43,9 @@ ASSERT(m_frame); } -PassRefPtrWillBeRawPtr<MediaValues> MediaValuesDynamic::copy() const +RawPtr<MediaValues> MediaValuesDynamic::copy() const { - return adoptRefWillBeNoop(new MediaValuesDynamic(m_frame, m_viewportDimensionsOverridden, m_viewportWidthOverride, m_viewportHeightOverride)); + return new MediaValuesDynamic(m_frame, m_viewportDimensionsOverridden, m_viewportWidthOverride, m_viewportHeightOverride); } bool MediaValuesDynamic::computeLength(double value, CSSPrimitiveValue::UnitType type, int& result) const
diff --git a/third_party/WebKit/Source/core/css/MediaValuesDynamic.h b/third_party/WebKit/Source/core/css/MediaValuesDynamic.h index c6d2d9ee..945c2c55 100644 --- a/third_party/WebKit/Source/core/css/MediaValuesDynamic.h +++ b/third_party/WebKit/Source/core/css/MediaValuesDynamic.h
@@ -13,9 +13,9 @@ class MediaValuesDynamic final : public MediaValues { public: - static PassRefPtrWillBeRawPtr<MediaValues> create(Document&); - static PassRefPtrWillBeRawPtr<MediaValues> create(LocalFrame*); - PassRefPtrWillBeRawPtr<MediaValues> copy() const override; + static RawPtr<MediaValues> create(Document&); + static RawPtr<MediaValues> create(LocalFrame*); + RawPtr<MediaValues> copy() const override; bool computeLength(double value, CSSPrimitiveValue::UnitType, int& result) const override; bool computeLength(double value, CSSPrimitiveValue::UnitType, double& result) const override; @@ -46,7 +46,7 @@ // This raw ptr is safe, as MediaValues would not outlive MediaQueryEvaluator, and // MediaQueryEvaluator is reset on |Document::detach|. - RawPtrWillBeMember<LocalFrame> m_frame; + Member<LocalFrame> m_frame; bool m_viewportDimensionsOverridden; double m_viewportWidthOverride; double m_viewportHeightOverride;
diff --git a/third_party/WebKit/Source/core/css/PageRuleCollector.cpp b/third_party/WebKit/Source/core/css/PageRuleCollector.cpp index b7f11de..6e39d96b 100644 --- a/third_party/WebKit/Source/core/css/PageRuleCollector.cpp +++ b/third_party/WebKit/Source/core/css/PageRuleCollector.cpp
@@ -73,7 +73,7 @@ return; rules->compactRulesIfNeeded(); - WillBeHeapVector<RawPtrWillBeMember<StyleRulePage>> matchedPageRules; + HeapVector<Member<StyleRulePage>> matchedPageRules; matchPageRulesForList(matchedPageRules, rules->pageRules(), m_isLeftPage, m_isFirstPage, m_pageName); if (matchedPageRules.isEmpty()) return; @@ -104,7 +104,7 @@ return true; } -void PageRuleCollector::matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage>>& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage>>& rules, bool isLeftPage, bool isFirstPage, const String& pageName) +void PageRuleCollector::matchPageRulesForList(HeapVector<Member<StyleRulePage>>& matchedRules, const HeapVector<Member<StyleRulePage>>& rules, bool isLeftPage, bool isFirstPage, const String& pageName) { for (unsigned i = 0; i < rules.size(); ++i) { StyleRulePage* rule = rules[i];
diff --git a/third_party/WebKit/Source/core/css/PageRuleCollector.h b/third_party/WebKit/Source/core/css/PageRuleCollector.h index 90976b3..bb862ebb 100644 --- a/third_party/WebKit/Source/core/css/PageRuleCollector.h +++ b/third_party/WebKit/Source/core/css/PageRuleCollector.h
@@ -43,7 +43,7 @@ bool isFirstPage(int pageIndex) const; String pageName(int pageIndex) const; - void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage>>& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage>>& rules, bool isLeftPage, bool isFirstPage, const String& pageName); + void matchPageRulesForList(HeapVector<Member<StyleRulePage>>& matchedRules, const HeapVector<Member<StyleRulePage>>& rules, bool isLeftPage, bool isFirstPage, const String& pageName); const bool m_isLeftPage; const bool m_isFirstPage;
diff --git a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp index 2680fad..d135b7b 100644 --- a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp +++ b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp
@@ -115,8 +115,8 @@ static bool s_shouldNotifyInspector; static bool s_shouldDeliver; - OwnPtrWillBeMember<MutationObserverInterestGroup> m_mutationRecipients; - RefPtrWillBeMember<MutationRecord> m_mutation; + Member<MutationObserverInterestGroup> m_mutationRecipients; + Member<MutationRecord> m_mutation; }; unsigned StyleAttributeMutationScope::s_scopeCount = 0; @@ -270,7 +270,7 @@ return result; } -PassRefPtrWillBeRawPtr<CSSValue> AbstractPropertySetCSSStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID) +RawPtr<CSSValue> AbstractPropertySetCSSStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID) { return propertySet().getPropertyCSSValue(propertyID); }
diff --git a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h index 5018599a..7d50cf37 100644 --- a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h +++ b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h
@@ -60,7 +60,7 @@ void setCSSFloat(const String&, ExceptionState&); String cssText() const final; void setCSSText(const String&, ExceptionState&) final; - PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) final; + RawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) final; String getPropertyValueInternal(CSSPropertyID) final; void setPropertyInternal(CSSPropertyID, const String& customPropertyName, const String& value, bool important, ExceptionState&) final; @@ -87,14 +87,14 @@ protected: MutableStylePropertySet& propertySet() const final { ASSERT(m_propertySet); return *m_propertySet; } - RawPtrWillBeMember<MutableStylePropertySet> m_propertySet; // Cannot be null + Member<MutableStylePropertySet> m_propertySet; // Cannot be null }; class StyleRuleCSSStyleDeclaration : public PropertySetCSSStyleDeclaration { public: - static PassRefPtrWillBeRawPtr<StyleRuleCSSStyleDeclaration> create(MutableStylePropertySet& propertySet, CSSRule* parentRule) + static RawPtr<StyleRuleCSSStyleDeclaration> create(MutableStylePropertySet& propertySet, CSSRule* parentRule) { - return adoptRefWillBeNoop(new StyleRuleCSSStyleDeclaration(propertySet, parentRule)); + return new StyleRuleCSSStyleDeclaration(propertySet, parentRule); } #if !ENABLE(OILPAN) @@ -122,7 +122,7 @@ #if !ENABLE(OILPAN) unsigned m_refCount; #endif - RawPtrWillBeMember<CSSRule> m_parentRule; + Member<CSSRule> m_parentRule; }; class InlineCSSStyleDeclaration final : public AbstractPropertySetCSSStyleDeclaration { @@ -145,7 +145,7 @@ void didMutate(MutationType) override; - RawPtrWillBeMember<Element> m_parentElement; + Member<Element> m_parentElement; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/PseudoStyleRequest.h b/third_party/WebKit/Source/core/css/PseudoStyleRequest.h index 363ba497..2378482f 100644 --- a/third_party/WebKit/Source/core/css/PseudoStyleRequest.h +++ b/third_party/WebKit/Source/core/css/PseudoStyleRequest.h
@@ -66,7 +66,7 @@ PseudoId pseudoId; RequestType type; ScrollbarPart scrollbarPart; - RawPtrWillBeMember<LayoutScrollbar> scrollbar; + Member<LayoutScrollbar> scrollbar; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp index 7561d04..764cf173 100644 --- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp +++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
@@ -17,7 +17,7 @@ namespace blink { -RemoteFontFaceSource::RemoteFontFaceSource(PassRefPtrWillBeRawPtr<FontResource> font, PassRefPtrWillBeRawPtr<FontLoader> fontLoader, FontDisplay display) +RemoteFontFaceSource::RemoteFontFaceSource(RawPtr<FontResource> font, RawPtr<FontLoader> fontLoader, FontDisplay display) : m_font(font) , m_fontLoader(fontLoader) , m_display(display)
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h index 92582ea..88f2566 100644 --- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h +++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h
@@ -23,11 +23,11 @@ }; class RemoteFontFaceSource final : public CSSFontFaceSource, public FontResourceClient { - WILL_BE_USING_PRE_FINALIZER(RemoteFontFaceSource, dispose); + USING_PRE_FINALIZER(RemoteFontFaceSource, dispose); public: enum DisplayPeriod { BlockPeriod, SwapPeriod, FailurePeriod }; - explicit RemoteFontFaceSource(PassRefPtrWillBeRawPtr<FontResource>, PassRefPtrWillBeRawPtr<FontLoader>, FontDisplay); + explicit RemoteFontFaceSource(RawPtr<FontResource>, RawPtr<FontLoader>, FontDisplay); ~RemoteFontFaceSource() override; void dispose(); @@ -78,8 +78,8 @@ void switchToSwapPeriod(); void switchToFailurePeriod(); - RefPtrWillBeMember<FontResource> m_font; - RefPtrWillBeMember<FontLoader> m_fontLoader; + Member<FontResource> m_font; + Member<FontLoader> m_fontLoader; const FontDisplay m_display; DisplayPeriod m_period; FontLoadHistograms m_histograms;
diff --git a/third_party/WebKit/Source/core/css/RuleFeature.h b/third_party/WebKit/Source/core/css/RuleFeature.h index 77502aa9..ff963bdc 100644 --- a/third_party/WebKit/Source/core/css/RuleFeature.h +++ b/third_party/WebKit/Source/core/css/RuleFeature.h
@@ -45,7 +45,7 @@ DECLARE_TRACE(); - RawPtrWillBeMember<StyleRule> rule; + Member<StyleRule> rule; unsigned selectorIndex; bool hasDocumentSecurityOrigin; }; @@ -96,8 +96,8 @@ DECLARE_TRACE(); - WillBeHeapVector<RuleFeature> siblingRules; - WillBeHeapVector<RuleFeature> uncommonAttributeRules; + HeapVector<RuleFeature> siblingRules; + HeapVector<RuleFeature> uncommonAttributeRules; protected: InvalidationSet* invalidationSetForSelector(const CSSSelector&, InvalidationType);
diff --git a/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp b/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp index a40834f..eecbec14 100644 --- a/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp +++ b/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp
@@ -28,7 +28,7 @@ void SetUp() { m_document = HTMLDocument::create(); - RefPtrWillBeRawPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(*m_document); + RawPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(*m_document); html->appendChild(HTMLBodyElement::create(*m_document)); m_document->appendChild(html.release()); @@ -39,7 +39,7 @@ { CSSSelectorList selectorList = CSSParser::parseSelector(strictCSSParserContext(), nullptr, selectorText); - RefPtrWillBeRawPtr<StyleRule> styleRule = StyleRule::create(std::move(selectorList), MutableStylePropertySet::create(HTMLStandardMode)); + RawPtr<StyleRule> styleRule = StyleRule::create(std::move(selectorList), MutableStylePropertySet::create(HTMLStandardMode)); RuleData ruleData(styleRule.get(), 0, 0, RuleHasNoSpecialState); return m_ruleFeatureSet.collectFeaturesFromRuleData(ruleData); } @@ -190,7 +190,7 @@ private: RuleFeatureSet m_ruleFeatureSet; - RefPtrWillBePersistent<Document> m_document; + Persistent<Document> m_document; }; TEST_F(RuleFeatureSetTest, interleavedDescendantSibling1)
diff --git a/third_party/WebKit/Source/core/css/RuleSet.cpp b/third_party/WebKit/Source/core/css/RuleSet.cpp index fddc6659..d5e59cda 100644 --- a/third_party/WebKit/Source/core/css/RuleSet.cpp +++ b/third_party/WebKit/Source/core/css/RuleSet.cpp
@@ -122,9 +122,9 @@ void RuleSet::addToRuleSet(const AtomicString& key, PendingRuleMap& map, const RuleData& ruleData) { - OwnPtrWillBeMember<WillBeHeapLinkedStack<RuleData>>& rules = map.add(key, nullptr).storedValue->value; + Member<HeapLinkedStack<RuleData>>& rules = map.add(key, nullptr).storedValue->value; if (!rules) - rules = adoptPtrWillBeNoop(new WillBeHeapLinkedStack<RuleData>); + rules = adoptPtrWillBeNoop(new HeapLinkedStack<RuleData>); rules->push(ruleData); } @@ -251,7 +251,7 @@ m_keyframesRules.append(rule); } -void RuleSet::addChildRules(const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& rules, const MediaQueryEvaluator& medium, AddRuleFlags addRuleFlags) +void RuleSet::addChildRules(const HeapVector<Member<StyleRuleBase>>& rules, const MediaQueryEvaluator& medium, AddRuleFlags addRuleFlags) { for (unsigned i = 0; i < rules.size(); ++i) { StyleRuleBase* rule = rules[i].get(); @@ -295,7 +295,7 @@ ASSERT(sheet); - const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>>& importRules = sheet->importRules(); + const HeapVector<Member<StyleRuleImport>>& importRules = sheet->importRules(); for (unsigned i = 0; i < importRules.size(); ++i) { StyleRuleImport* importRule = importRules[i].get(); if (importRule->styleSheet() && (!importRule->mediaQueries() || medium.eval(importRule->mediaQueries(), &m_viewportDependentMediaQueryResults, &m_deviceDependentMediaQueryResults))) @@ -314,10 +314,10 @@ void RuleSet::compactPendingRules(PendingRuleMap& pendingMap, CompactRuleMap& compactMap) { for (auto& item : pendingMap) { - OwnPtrWillBeRawPtr<WillBeHeapLinkedStack<RuleData>> pendingRules = item.value.release(); + RawPtr<HeapLinkedStack<RuleData>> pendingRules = item.value.release(); CompactRuleMap::ValueType* compactRules = compactMap.add(item.key, nullptr).storedValue; - WillBeHeapTerminatedArrayBuilder<RuleData> builder(compactRules->value.release()); + HeapTerminatedArrayBuilder<RuleData> builder(compactRules->value.release()); builder.grow(pendingRules->size()); while (!pendingRules->isEmpty()) { builder.append(pendingRules->peek()); @@ -331,7 +331,7 @@ void RuleSet::compactRules() { ASSERT(m_pendingRules); - OwnPtrWillBeRawPtr<PendingRuleMaps> pendingRules = m_pendingRules.release(); + RawPtr<PendingRuleMaps> pendingRules = m_pendingRules.release(); compactPendingRules(pendingRules->idRules, m_idRules); compactPendingRules(pendingRules->classRules, m_classRules); compactPendingRules(pendingRules->tagRules, m_tagRules);
diff --git a/third_party/WebKit/Source/core/css/RuleSet.h b/third_party/WebKit/Source/core/css/RuleSet.h index 7f74542..fb2b6aa5 100644 --- a/third_party/WebKit/Source/core/css/RuleSet.h +++ b/third_party/WebKit/Source/core/css/RuleSet.h
@@ -64,7 +64,7 @@ DECLARE_TRACE(); - RawPtrWillBeMember<StyleRule> m_rule; + Member<StyleRule> m_rule; unsigned m_selectorIndex; AddRuleFlags m_flags; }; @@ -94,7 +94,7 @@ DECLARE_TRACE(); private: - RawPtrWillBeMember<StyleRule> m_rule; + Member<StyleRule> m_rule; unsigned m_selectorIndex : 13; unsigned m_isLastInArray : 1; // We store an array of RuleData objects in a primitive array. // This number was picked fairly arbitrarily. We can probably lower it if we need to. @@ -111,7 +111,7 @@ struct SameSizeAsRuleData { DISALLOW_NEW(); - RawPtrWillBeMember<void*> a; + Member<void*> a; unsigned b; unsigned c; unsigned d[4]; @@ -119,11 +119,10 @@ static_assert(sizeof(RuleData) == sizeof(SameSizeAsRuleData), "RuleData should stay small"); -class CORE_EXPORT RuleSet : public NoBaseWillBeGarbageCollectedFinalized<RuleSet> { +class CORE_EXPORT RuleSet : public GarbageCollectedFinalized<RuleSet> { WTF_MAKE_NONCOPYABLE(RuleSet); - USING_FAST_MALLOC_WILL_BE_REMOVED(RuleSet); public: - static PassOwnPtrWillBeRawPtr<RuleSet> create() { return adoptPtrWillBeNoop(new RuleSet); } + static RawPtr<RuleSet> create() { return adoptPtrWillBeNoop(new RuleSet); } void addRulesFromSheet(StyleSheetContents*, const MediaQueryEvaluator&, AddRuleFlags = RuleHasNoSpecialState); void addStyleRule(StyleRule*, AddRuleFlags); @@ -131,22 +130,22 @@ const RuleFeatureSet& features() const { return m_features; } - const WillBeHeapTerminatedArray<RuleData>* idRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_idRules.get(key); } - const WillBeHeapTerminatedArray<RuleData>* classRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_classRules.get(key); } - const WillBeHeapTerminatedArray<RuleData>* tagRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_tagRules.get(key); } - const WillBeHeapTerminatedArray<RuleData>* shadowPseudoElementRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_shadowPseudoElementRules.get(key); } - const WillBeHeapVector<RuleData>* linkPseudoClassRules() const { ASSERT(!m_pendingRules); return &m_linkPseudoClassRules; } - const WillBeHeapVector<RuleData>* cuePseudoRules() const { ASSERT(!m_pendingRules); return &m_cuePseudoRules; } - const WillBeHeapVector<RuleData>* focusPseudoClassRules() const { ASSERT(!m_pendingRules); return &m_focusPseudoClassRules; } - const WillBeHeapVector<RuleData>* universalRules() const { ASSERT(!m_pendingRules); return &m_universalRules; } - const WillBeHeapVector<RuleData>* shadowHostRules() const { ASSERT(!m_pendingRules); return &m_shadowHostRules; } - const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage>>& pageRules() const { ASSERT(!m_pendingRules); return m_pageRules; } - const WillBeHeapVector<RawPtrWillBeMember<StyleRuleViewport>>& viewportRules() const { ASSERT(!m_pendingRules); return m_viewportRules; } - const WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace>>& fontFaceRules() const { return m_fontFaceRules; } - const WillBeHeapVector<RawPtrWillBeMember<StyleRuleKeyframes>>& keyframesRules() const { return m_keyframesRules; } - const WillBeHeapVector<MinimalRuleData>& deepCombinatorOrShadowPseudoRules() const { return m_deepCombinatorOrShadowPseudoRules; } - const WillBeHeapVector<MinimalRuleData>& contentPseudoElementRules() const { return m_contentPseudoElementRules; } - const WillBeHeapVector<MinimalRuleData>& slottedPseudoElementRules() const { return m_slottedPseudoElementRules; } + const HeapTerminatedArray<RuleData>* idRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_idRules.get(key); } + const HeapTerminatedArray<RuleData>* classRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_classRules.get(key); } + const HeapTerminatedArray<RuleData>* tagRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_tagRules.get(key); } + const HeapTerminatedArray<RuleData>* shadowPseudoElementRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_shadowPseudoElementRules.get(key); } + const HeapVector<RuleData>* linkPseudoClassRules() const { ASSERT(!m_pendingRules); return &m_linkPseudoClassRules; } + const HeapVector<RuleData>* cuePseudoRules() const { ASSERT(!m_pendingRules); return &m_cuePseudoRules; } + const HeapVector<RuleData>* focusPseudoClassRules() const { ASSERT(!m_pendingRules); return &m_focusPseudoClassRules; } + const HeapVector<RuleData>* universalRules() const { ASSERT(!m_pendingRules); return &m_universalRules; } + const HeapVector<RuleData>* shadowHostRules() const { ASSERT(!m_pendingRules); return &m_shadowHostRules; } + const HeapVector<Member<StyleRulePage>>& pageRules() const { ASSERT(!m_pendingRules); return m_pageRules; } + const HeapVector<Member<StyleRuleViewport>>& viewportRules() const { ASSERT(!m_pendingRules); return m_viewportRules; } + const HeapVector<Member<StyleRuleFontFace>>& fontFaceRules() const { return m_fontFaceRules; } + const HeapVector<Member<StyleRuleKeyframes>>& keyframesRules() const { return m_keyframesRules; } + const HeapVector<MinimalRuleData>& deepCombinatorOrShadowPseudoRules() const { return m_deepCombinatorOrShadowPseudoRules; } + const HeapVector<MinimalRuleData>& contentPseudoElementRules() const { return m_contentPseudoElementRules; } + const HeapVector<MinimalRuleData>& slottedPseudoElementRules() const { return m_slottedPseudoElementRules; } const MediaQueryResultList& viewportDependentMediaQueryResults() const { return m_viewportDependentMediaQueryResults; } const MediaQueryResultList& deviceDependentMediaQueryResults() const { return m_deviceDependentMediaQueryResults; } @@ -166,8 +165,8 @@ DECLARE_TRACE(); private: - using PendingRuleMap = WillBeHeapHashMap<AtomicString, OwnPtrWillBeMember<WillBeHeapLinkedStack<RuleData>>>; - using CompactRuleMap = WillBeHeapHashMap<AtomicString, OwnPtrWillBeMember<WillBeHeapTerminatedArray<RuleData>>>; + using PendingRuleMap = HeapHashMap<AtomicString, Member<HeapLinkedStack<RuleData>>>; + using CompactRuleMap = HeapHashMap<AtomicString, Member<HeapTerminatedArray<RuleData>>>; RuleSet() : m_ruleCount(0) @@ -180,15 +179,15 @@ void addFontFaceRule(StyleRuleFontFace*); void addKeyframesRule(StyleRuleKeyframes*); - void addChildRules(const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>&, const MediaQueryEvaluator& medium, AddRuleFlags); + void addChildRules(const HeapVector<Member<StyleRuleBase>>&, const MediaQueryEvaluator& medium, AddRuleFlags); bool findBestRuleSetAndAdd(const CSSSelector&, RuleData&); void compactRules(); static void compactPendingRules(PendingRuleMap&, CompactRuleMap&); - class PendingRuleMaps : public NoBaseWillBeGarbageCollected<PendingRuleMaps> { + class PendingRuleMaps : public GarbageCollected<PendingRuleMaps> { public: - static PassOwnPtrWillBeRawPtr<PendingRuleMaps> create() { return adoptPtrWillBeNoop(new PendingRuleMaps); } + static RawPtr<PendingRuleMaps> create() { return adoptPtrWillBeNoop(new PendingRuleMaps); } PendingRuleMap idRules; PendingRuleMap classRules; @@ -212,28 +211,28 @@ CompactRuleMap m_classRules; CompactRuleMap m_tagRules; CompactRuleMap m_shadowPseudoElementRules; - WillBeHeapVector<RuleData> m_linkPseudoClassRules; - WillBeHeapVector<RuleData> m_cuePseudoRules; - WillBeHeapVector<RuleData> m_focusPseudoClassRules; - WillBeHeapVector<RuleData> m_universalRules; - WillBeHeapVector<RuleData> m_shadowHostRules; + HeapVector<RuleData> m_linkPseudoClassRules; + HeapVector<RuleData> m_cuePseudoRules; + HeapVector<RuleData> m_focusPseudoClassRules; + HeapVector<RuleData> m_universalRules; + HeapVector<RuleData> m_shadowHostRules; RuleFeatureSet m_features; - WillBeHeapVector<RawPtrWillBeMember<StyleRulePage>> m_pageRules; - WillBeHeapVector<RawPtrWillBeMember<StyleRuleViewport>> m_viewportRules; - WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace>> m_fontFaceRules; - WillBeHeapVector<RawPtrWillBeMember<StyleRuleKeyframes>> m_keyframesRules; - WillBeHeapVector<MinimalRuleData> m_deepCombinatorOrShadowPseudoRules; - WillBeHeapVector<MinimalRuleData> m_contentPseudoElementRules; - WillBeHeapVector<MinimalRuleData> m_slottedPseudoElementRules; + HeapVector<Member<StyleRulePage>> m_pageRules; + HeapVector<Member<StyleRuleViewport>> m_viewportRules; + HeapVector<Member<StyleRuleFontFace>> m_fontFaceRules; + HeapVector<Member<StyleRuleKeyframes>> m_keyframesRules; + HeapVector<MinimalRuleData> m_deepCombinatorOrShadowPseudoRules; + HeapVector<MinimalRuleData> m_contentPseudoElementRules; + HeapVector<MinimalRuleData> m_slottedPseudoElementRules; MediaQueryResultList m_viewportDependentMediaQueryResults; MediaQueryResultList m_deviceDependentMediaQueryResults; unsigned m_ruleCount; - OwnPtrWillBeMember<PendingRuleMaps> m_pendingRules; + Member<PendingRuleMaps> m_pendingRules; #ifndef NDEBUG - WillBeHeapVector<RuleData> m_allRules; + HeapVector<RuleData> m_allRules; #endif };
diff --git a/third_party/WebKit/Source/core/css/RuleSetTest.cpp b/third_party/WebKit/Source/core/css/RuleSetTest.cpp index 99459b1..25e6643 100644 --- a/third_party/WebKit/Source/core/css/RuleSetTest.cpp +++ b/third_party/WebKit/Source/core/css/RuleSetTest.cpp
@@ -141,7 +141,7 @@ helper.addCSSRules(":host { }"); RuleSet& ruleSet = helper.ruleSet(); - const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules(); + const HeapVector<RuleData>* rules = ruleSet.shadowHostRules(); ASSERT_EQ(1u, rules->size()); } @@ -151,7 +151,7 @@ helper.addCSSRules(":host(#x) { }"); RuleSet& ruleSet = helper.ruleSet(); - const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules(); + const HeapVector<RuleData>* rules = ruleSet.shadowHostRules(); ASSERT_EQ(1u, rules->size()); } @@ -161,7 +161,7 @@ helper.addCSSRules(":host-context(*) { }"); RuleSet& ruleSet = helper.ruleSet(); - const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules(); + const HeapVector<RuleData>* rules = ruleSet.shadowHostRules(); ASSERT_EQ(1u, rules->size()); } @@ -171,7 +171,7 @@ helper.addCSSRules(":host-context(#x) { }"); RuleSet& ruleSet = helper.ruleSet(); - const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules(); + const HeapVector<RuleData>* rules = ruleSet.shadowHostRules(); ASSERT_EQ(1u, rules->size()); } @@ -181,7 +181,7 @@ helper.addCSSRules(":host-context(#x) .y, :host(.a) > #b { }"); RuleSet& ruleSet = helper.ruleSet(); - const WillBeHeapVector<RuleData>* shadowRules = ruleSet.shadowHostRules(); + const HeapVector<RuleData>* shadowRules = ruleSet.shadowHostRules(); const TerminatedArray<RuleData>* idRules = ruleSet.idRules("b"); const TerminatedArray<RuleData>* classRules = ruleSet.classRules("y"); ASSERT_EQ(0u, shadowRules->size()); @@ -195,7 +195,7 @@ helper.addCSSRules(".foo:host { }"); RuleSet& ruleSet = helper.ruleSet(); - const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules(); + const HeapVector<RuleData>* rules = ruleSet.shadowHostRules(); ASSERT_EQ(0u, rules->size()); } @@ -205,7 +205,7 @@ helper.addCSSRules(".foo:host-context(*) { }"); RuleSet& ruleSet = helper.ruleSet(); - const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules(); + const HeapVector<RuleData>* rules = ruleSet.shadowHostRules(); ASSERT_EQ(0u, rules->size()); }
diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp index 24a9987..c5d4b4d5 100644 --- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp +++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -406,7 +406,7 @@ SelectorChecker::Match SelectorChecker::matchForPseudoContent(const SelectorCheckingContext& context, const Element& element, MatchResult& result) const { - WillBeHeapVector<RawPtrWillBeMember<InsertionPoint>, 8> insertionPoints; + HeapVector<Member<InsertionPoint>, 8> insertionPoints; collectDestinationInsertionPoints(element, insertionPoints); SelectorCheckingContext nextContext(context); for (const auto& insertionPoint : insertionPoints) {
diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.h b/third_party/WebKit/Source/core/css/SelectorChecker.h index 0d9fabe..84fbfdf0 100644 --- a/third_party/WebKit/Source/core/css/SelectorChecker.h +++ b/third_party/WebKit/Source/core/css/SelectorChecker.h
@@ -54,7 +54,7 @@ bool isUARule = false; bool isQuerySelector = false; ComputedStyle* elementStyle = nullptr; - RawPtrWillBeMember<LayoutScrollbar> scrollbar = nullptr; + Member<LayoutScrollbar> scrollbar = nullptr; ScrollbarPart scrollbarPart = NoPart; }; @@ -88,9 +88,9 @@ } const CSSSelector* selector; - RawPtrWillBeMember<Element> element; - RawPtrWillBeMember<Element> previousElement; - RawPtrWillBeMember<const ContainerNode> scope; + Member<Element> element; + Member<Element> previousElement; + Member<const ContainerNode> scope; VisitedMatchType visitedMatchType; PseudoId pseudoId; bool isSubSelector; @@ -144,7 +144,7 @@ bool m_isUARule; bool m_isQuerySelector; ComputedStyle* m_elementStyle; - RawPtrWillBeMember<LayoutScrollbar> m_scrollbar; + Member<LayoutScrollbar> m_scrollbar; ScrollbarPart m_scrollbarPart; };
diff --git a/third_party/WebKit/Source/core/css/SelectorFilter.h b/third_party/WebKit/Source/core/css/SelectorFilter.h index 3adbeef..04a586e93 100644 --- a/third_party/WebKit/Source/core/css/SelectorFilter.h +++ b/third_party/WebKit/Source/core/css/SelectorFilter.h
@@ -48,7 +48,7 @@ DECLARE_TRACE(); - RawPtrWillBeMember<Element> element; + Member<Element> element; Vector<unsigned, 4> identifierHashes; }; @@ -67,7 +67,7 @@ void pushParentStackFrame(Element& parent); void popParentStackFrame(); - WillBeHeapVector<ParentStackFrame> m_parentStack; + HeapVector<ParentStackFrame> m_parentStack; // With 100 unique strings in the filter, 2^12 slot table has false positive rate of ~0.2%. using IdentifierFilter = BloomFilter<12>;
diff --git a/third_party/WebKit/Source/core/css/StyleMedia.cpp b/third_party/WebKit/Source/core/css/StyleMedia.cpp index 570ced1..9c1c562 100644 --- a/third_party/WebKit/Source/core/css/StyleMedia.cpp +++ b/third_party/WebKit/Source/core/css/StyleMedia.cpp
@@ -58,7 +58,7 @@ if (!documentElement) return false; - RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create(); + RawPtr<MediaQuerySet> media = MediaQuerySet::create(); if (!media->set(query)) return false;
diff --git a/third_party/WebKit/Source/core/css/StyleMedia.h b/third_party/WebKit/Source/core/css/StyleMedia.h index d158c64..7c16c64 100644 --- a/third_party/WebKit/Source/core/css/StyleMedia.h +++ b/third_party/WebKit/Source/core/css/StyleMedia.h
@@ -37,11 +37,11 @@ class LocalFrame; -class StyleMedia final : public RefCountedWillBeGarbageCollected<StyleMedia>, public DOMWindowProperty, public ScriptWrappable { +class StyleMedia final : public GarbageCollected<StyleMedia>, public DOMWindowProperty, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StyleMedia); + USING_GARBAGE_COLLECTED_MIXIN(StyleMedia); public: - static PassRefPtrWillBeRawPtr<StyleMedia> create(LocalFrame* frame) { return adoptRefWillBeNoop(new StyleMedia(frame));} + static RawPtr<StyleMedia> create(LocalFrame* frame) { return new StyleMedia(frame);} AtomicString type() const; bool matchMedium(const String&) const;
diff --git a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp index 9f006d3..1681995 100644 --- a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp +++ b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
@@ -647,7 +647,7 @@ const unsigned size = shorthand.length(); // Begin by collecting the properties into a vector. - WillBeHeapVector<RawPtrWillBeMember<const CSSValue>> values(size); + HeapVector<Member<const CSSValue>> values(size); // If the below loop succeeds, there should always be at minimum 1 layer. size_t numLayers = 1U;
diff --git a/third_party/WebKit/Source/core/css/StylePropertySerializer.h b/third_party/WebKit/Source/core/css/StylePropertySerializer.h index b751f0e9..ef843157 100644 --- a/third_party/WebKit/Source/core/css/StylePropertySerializer.h +++ b/third_party/WebKit/Source/core/css/StylePropertySerializer.h
@@ -82,7 +82,7 @@ bool isValid() const { return m_value; } private: - RawPtrWillBeMember<const CSSValue> m_value; + Member<const CSSValue> m_value; CSSPropertyID m_id; bool m_isImportant; bool m_isImplicit; @@ -111,7 +111,7 @@ bool hasExpandedAllProperty() const { return hasAllProperty() && m_needToExpandAll; } bool hasAllProperty() const { return m_allIndex != -1; } - RawPtrWillBeMember<const StylePropertySet> m_propertySet; + Member<const StylePropertySet> m_propertySet; int m_allIndex; BitArray<numCSSProperties> m_longhandPropertyUsed; bool m_needToExpandAll;
diff --git a/third_party/WebKit/Source/core/css/StylePropertySet.cpp b/third_party/WebKit/Source/core/css/StylePropertySet.cpp index 028481bd..79da67495 100644 --- a/third_party/WebKit/Source/core/css/StylePropertySet.cpp +++ b/third_party/WebKit/Source/core/css/StylePropertySet.cpp
@@ -42,10 +42,10 @@ static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count) { - return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(RawPtrWillBeMember<CSSValue>) * count + sizeof(StylePropertyMetadata) * count; + return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(Member<CSSValue>) * count + sizeof(StylePropertyMetadata) * count; } -PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::create(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode) +RawPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::create(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode) { ASSERT(count <= MaxArraySize); #if ENABLE(OILPAN) @@ -56,7 +56,7 @@ return adoptRefWillBeNoop(new (slot) ImmutableStylePropertySet(properties, count, cssParserMode)); } -PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> StylePropertySet::immutableCopyIfNeeded() const +RawPtr<ImmutableStylePropertySet> StylePropertySet::immutableCopyIfNeeded() const { if (!isMutable()) return toImmutableStylePropertySet(const_cast<StylePropertySet*>(this)); @@ -81,7 +81,7 @@ : StylePropertySet(cssParserMode, length) { StylePropertyMetadata* metadataArray = const_cast<StylePropertyMetadata*>(this->metadataArray()); - RawPtrWillBeMember<CSSValue>* valueArray = const_cast<RawPtrWillBeMember<CSSValue>*>(this->valueArray()); + Member<CSSValue>* valueArray = const_cast<Member<CSSValue>*>(this->valueArray()); for (unsigned i = 0; i < m_arraySize; ++i) { metadataArray[i] = properties[i].metadata(); valueArray[i] = properties[i].value(); @@ -94,7 +94,7 @@ ImmutableStylePropertySet::~ImmutableStylePropertySet() { #if !ENABLE(OILPAN) - RawPtrWillBeMember<CSSValue>* valueArray = const_cast<RawPtrWillBeMember<CSSValue>*>(this->valueArray()); + Member<CSSValue>* valueArray = const_cast<Member<CSSValue>*>(this->valueArray()); for (unsigned i = 0; i < m_arraySize; ++i) { // Checking for nullptr here is a workaround to prevent crashing. http://crbug.com/449032 if (valueArray[i]) @@ -147,7 +147,7 @@ DEFINE_TRACE_AFTER_DISPATCH(ImmutableStylePropertySet) { - const RawPtrWillBeMember<CSSValue>* values = valueArray(); + const Member<CSSValue>* values = valueArray(); for (unsigned i = 0; i < m_arraySize; i++) visitor->trace(values[i]); StylePropertySet::traceAfterDispatch(visitor); @@ -179,7 +179,7 @@ template<typename T> String StylePropertySet::getPropertyValue(T property) const { - RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(property); + RawPtr<CSSValue> value = getPropertyCSSValue(property); if (value) return value->cssText(); return serializeShorthand(*this, property); @@ -188,15 +188,15 @@ template CORE_EXPORT String StylePropertySet::getPropertyValue<AtomicString>(AtomicString) const; template<typename T> -PassRefPtrWillBeRawPtr<CSSValue> StylePropertySet::getPropertyCSSValue(T property) const +RawPtr<CSSValue> StylePropertySet::getPropertyCSSValue(T property) const { int foundPropertyIndex = findPropertyIndex(property); if (foundPropertyIndex == -1) return nullptr; return propertyAt(foundPropertyIndex).value(); } -template CORE_EXPORT PassRefPtrWillBeRawPtr<CSSValue> StylePropertySet::getPropertyCSSValue<CSSPropertyID>(CSSPropertyID) const; -template CORE_EXPORT PassRefPtrWillBeRawPtr<CSSValue> StylePropertySet::getPropertyCSSValue<AtomicString>(AtomicString) const; +template CORE_EXPORT RawPtr<CSSValue> StylePropertySet::getPropertyCSSValue<CSSPropertyID>(CSSPropertyID) const; +template CORE_EXPORT RawPtr<CSSValue> StylePropertySet::getPropertyCSSValue<AtomicString>(AtomicString) const; DEFINE_TRACE(StylePropertySet) { @@ -324,7 +324,7 @@ return CSSParser::parseValueForCustomProperty(this, customPropertyName, value, important, contextStyleSheet); } -void MutableStylePropertySet::setProperty(CSSPropertyID propertyID, PassRefPtrWillBeRawPtr<CSSValue> prpValue, bool important) +void MutableStylePropertySet::setProperty(CSSPropertyID propertyID, RawPtr<CSSValue> prpValue, bool important) { StylePropertyShorthand shorthand = shorthandForProperty(propertyID); if (!shorthand.length()) { @@ -334,7 +334,7 @@ removePropertiesInSet(shorthand.properties(), shorthand.length()); - RefPtrWillBeRawPtr<CSSValue> value = prpValue; + RawPtr<CSSValue> value = prpValue; for (unsigned i = 0; i < shorthand.length(); ++i) m_propertyVector.append(CSSProperty(shorthand.properties()[i], value, important)); } @@ -375,7 +375,7 @@ CSSParser::parseDeclarationList(context, this, styleDeclaration); } -bool MutableStylePropertySet::addParsedProperties(const WillBeHeapVector<CSSProperty, 256>& properties) +bool MutableStylePropertySet::addParsedProperties(const HeapVector<CSSProperty, 256>& properties) { bool changed = false; m_propertyVector.reserveCapacity(m_propertyVector.size() + properties.size()); @@ -509,17 +509,17 @@ removeProperty(propertiesToRemove[i]); } -PassRefPtrWillBeRawPtr<MutableStylePropertySet> StylePropertySet::mutableCopy() const +RawPtr<MutableStylePropertySet> StylePropertySet::mutableCopy() const { - return adoptRefWillBeNoop(new MutableStylePropertySet(*this)); + return new MutableStylePropertySet(*this); } -PassRefPtrWillBeRawPtr<MutableStylePropertySet> StylePropertySet::copyPropertiesInSet(const Vector<CSSPropertyID>& properties) const +RawPtr<MutableStylePropertySet> StylePropertySet::copyPropertiesInSet(const Vector<CSSPropertyID>& properties) const { - WillBeHeapVector<CSSProperty, 256> list; + HeapVector<CSSProperty, 256> list; list.reserveInitialCapacity(properties.size()); for (unsigned i = 0; i < properties.size(); ++i) { - RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(properties[i]); + RawPtr<CSSValue> value = getPropertyCSSValue(properties[i]); if (value) list.append(CSSProperty(properties[i], value.release(), false)); } @@ -535,7 +535,7 @@ ASSERT(!m_cssomWrapper->parentElement()); return m_cssomWrapper.get(); } - m_cssomWrapper = adoptPtrWillBeNoop(new PropertySetCSSStyleDeclaration(*this)); + m_cssomWrapper = new PropertySetCSSStyleDeclaration(*this); return m_cssomWrapper.get(); } @@ -572,7 +572,7 @@ } // See the function above if you need to update this. -struct SameSizeAsStylePropertySet : public RefCountedWillBeGarbageCollectedFinalized<SameSizeAsStylePropertySet> { +struct SameSizeAsStylePropertySet : public GarbageCollectedFinalized<SameSizeAsStylePropertySet> { unsigned bitfield; }; static_assert(sizeof(StylePropertySet) == sizeof(SameSizeAsStylePropertySet), "StylePropertySet should stay small"); @@ -584,14 +584,14 @@ } #endif -PassRefPtrWillBeRawPtr<MutableStylePropertySet> MutableStylePropertySet::create(CSSParserMode cssParserMode) +RawPtr<MutableStylePropertySet> MutableStylePropertySet::create(CSSParserMode cssParserMode) { - return adoptRefWillBeNoop(new MutableStylePropertySet(cssParserMode)); + return new MutableStylePropertySet(cssParserMode); } -PassRefPtrWillBeRawPtr<MutableStylePropertySet> MutableStylePropertySet::create(const CSSProperty* properties, unsigned count) +RawPtr<MutableStylePropertySet> MutableStylePropertySet::create(const CSSProperty* properties, unsigned count) { - return adoptRefWillBeNoop(new MutableStylePropertySet(properties, count)); + return new MutableStylePropertySet(properties, count); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/StylePropertySet.h b/third_party/WebKit/Source/core/css/StylePropertySet.h index 40aff7c..2245a4a9 100644 --- a/third_party/WebKit/Source/core/css/StylePropertySet.h +++ b/third_party/WebKit/Source/core/css/StylePropertySet.h
@@ -40,7 +40,7 @@ class MutableStylePropertySet; class StyleSheetContents; -class CORE_EXPORT StylePropertySet : public RefCountedWillBeGarbageCollectedFinalized<StylePropertySet> { +class CORE_EXPORT StylePropertySet : public GarbageCollectedFinalized<StylePropertySet> { WTF_MAKE_NONCOPYABLE(StylePropertySet); friend class PropertyReference; public: @@ -84,7 +84,7 @@ private: const CSSValue* propertyValue() const; - RawPtrWillBeMember<const StylePropertySet> m_propertySet; + Member<const StylePropertySet> m_propertySet; unsigned m_index; }; @@ -98,7 +98,7 @@ bool hasProperty(CSSPropertyID property) const { return findPropertyIndex(property) != -1; } template<typename T> // CSSPropertyID or AtomicString - PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValue(T property) const; + RawPtr<CSSValue> getPropertyCSSValue(T property) const; template<typename T> // CSSPropertyID or AtomicString String getPropertyValue(T property) const; @@ -114,10 +114,10 @@ CSSParserMode cssParserMode() const { return static_cast<CSSParserMode>(m_cssParserMode); } - PassRefPtrWillBeRawPtr<MutableStylePropertySet> mutableCopy() const; - PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> immutableCopyIfNeeded() const; + RawPtr<MutableStylePropertySet> mutableCopy() const; + RawPtr<ImmutableStylePropertySet> immutableCopyIfNeeded() const; - PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyPropertiesInSet(const Vector<CSSPropertyID>&) const; + RawPtr<MutableStylePropertySet> copyPropertiesInSet(const Vector<CSSPropertyID>&) const; String asText() const; @@ -162,11 +162,11 @@ class CORE_EXPORT ImmutableStylePropertySet : public StylePropertySet { public: ~ImmutableStylePropertySet(); - static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> create(const CSSProperty* properties, unsigned count, CSSParserMode); + static RawPtr<ImmutableStylePropertySet> create(const CSSProperty* properties, unsigned count, CSSParserMode); unsigned propertyCount() const { return m_arraySize; } - const RawPtrWillBeMember<CSSValue>* valueArray() const; + const Member<CSSValue>* valueArray() const; const StylePropertyMetadata* metadataArray() const; template<typename T> // CSSPropertyID or AtomicString @@ -185,14 +185,14 @@ ImmutableStylePropertySet(const CSSProperty*, unsigned count, CSSParserMode); }; -inline const RawPtrWillBeMember<CSSValue>* ImmutableStylePropertySet::valueArray() const +inline const Member<CSSValue>* ImmutableStylePropertySet::valueArray() const { - return reinterpret_cast<const RawPtrWillBeMember<CSSValue>*>(const_cast<const void**>(&(this->m_storage))); + return reinterpret_cast<const Member<CSSValue>*>(const_cast<const void**>(&(this->m_storage))); } inline const StylePropertyMetadata* ImmutableStylePropertySet::metadataArray() const { - return reinterpret_cast<const StylePropertyMetadata*>(&reinterpret_cast<const char*>(&(this->m_storage))[m_arraySize * sizeof(RawPtrWillBeMember<CSSValue>)]); + return reinterpret_cast<const StylePropertyMetadata*>(&reinterpret_cast<const char*>(&(this->m_storage))[m_arraySize * sizeof(Member<CSSValue>)]); } DEFINE_TYPE_CASTS(ImmutableStylePropertySet, StylePropertySet, set, !set->isMutable(), !set.isMutable()); @@ -200,19 +200,19 @@ class CORE_EXPORT MutableStylePropertySet : public StylePropertySet { public: ~MutableStylePropertySet() { } - static PassRefPtrWillBeRawPtr<MutableStylePropertySet> create(CSSParserMode); - static PassRefPtrWillBeRawPtr<MutableStylePropertySet> create(const CSSProperty* properties, unsigned count); + static RawPtr<MutableStylePropertySet> create(CSSParserMode); + static RawPtr<MutableStylePropertySet> create(const CSSProperty* properties, unsigned count); unsigned propertyCount() const { return m_propertyVector.size(); } // Returns whether this style set was changed. - bool addParsedProperties(const WillBeHeapVector<CSSProperty, 256>&); + bool addParsedProperties(const HeapVector<CSSProperty, 256>&); bool addRespectingCascade(const CSSProperty&); // These expand shorthand properties into multiple properties. bool setProperty(CSSPropertyID unresolvedProperty, const String& value, bool important = false, StyleSheetContents* contextStyleSheet = 0); bool setProperty(const AtomicString& customPropertyName, const String& value, bool important = false, StyleSheetContents* contextStyleSheet = 0); - void setProperty(CSSPropertyID, PassRefPtrWillBeRawPtr<CSSValue>, bool important = false); + void setProperty(CSSPropertyID, RawPtr<CSSValue>, bool important = false); // These do not. FIXME: This is too messy, we can do better. bool setProperty(CSSPropertyID, CSSValueID identifier, bool important = false); @@ -246,16 +246,16 @@ bool removeShorthandProperty(CSSPropertyID); bool removeShorthandProperty(const AtomicString& customPropertyName) { return false; } CSSProperty* findCSSPropertyWithID(CSSPropertyID, const AtomicString& customPropertyName = nullAtom); - OwnPtrWillBeMember<PropertySetCSSStyleDeclaration> m_cssomWrapper; + Member<PropertySetCSSStyleDeclaration> m_cssomWrapper; friend class StylePropertySet; - WillBeHeapVector<CSSProperty, 4> m_propertyVector; + HeapVector<CSSProperty, 4> m_propertyVector; }; DEFINE_TYPE_CASTS(MutableStylePropertySet, StylePropertySet, set, set->isMutable(), set.isMutable()); -inline MutableStylePropertySet* toMutableStylePropertySet(const RefPtrWillBeRawPtr<StylePropertySet>& set) +inline MutableStylePropertySet* toMutableStylePropertySet(const RawPtr<StylePropertySet>& set) { return toMutableStylePropertySet(set.get()); }
diff --git a/third_party/WebKit/Source/core/css/StyleRule.cpp b/third_party/WebKit/Source/core/css/StyleRule.cpp index 636f2cbb..e353850 100644 --- a/third_party/WebKit/Source/core/css/StyleRule.cpp +++ b/third_party/WebKit/Source/core/css/StyleRule.cpp
@@ -36,18 +36,18 @@ namespace blink { -struct SameSizeAsStyleRuleBase : public RefCountedWillBeGarbageCollectedFinalized<SameSizeAsStyleRuleBase> { +struct SameSizeAsStyleRuleBase : public GarbageCollectedFinalized<SameSizeAsStyleRuleBase> { unsigned bitfields; }; static_assert(sizeof(StyleRuleBase) <= sizeof(SameSizeAsStyleRuleBase), "StyleRuleBase should stay small"); -PassRefPtrWillBeRawPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet) const +RawPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet) const { return createCSSOMWrapper(parentSheet, 0); } -PassRefPtrWillBeRawPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSRule* parentRule) const +RawPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSRule* parentRule) const { return createCSSOMWrapper(0, parentRule); } @@ -172,7 +172,7 @@ ASSERT_NOT_REACHED(); } -PassRefPtrWillBeRawPtr<StyleRuleBase> StyleRuleBase::copy() const +RawPtr<StyleRuleBase> StyleRuleBase::copy() const { switch (type()) { case Style: @@ -203,9 +203,9 @@ return nullptr; } -PassRefPtrWillBeRawPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const +RawPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const { - RefPtrWillBeRawPtr<CSSRule> rule = nullptr; + RawPtr<CSSRule> rule = nullptr; StyleRuleBase* self = const_cast<StyleRuleBase*>(this); switch (type()) { case Style: @@ -250,7 +250,7 @@ return sizeof(StyleRule) + sizeof(CSSSelector) + StylePropertySet::averageSizeInBytes(); } -StyleRule::StyleRule(CSSSelectorList selectorList, PassRefPtrWillBeRawPtr<StylePropertySet> properties) +StyleRule::StyleRule(CSSSelectorList selectorList, RawPtr<StylePropertySet> properties) : StyleRuleBase(Style) , m_properties(properties) { @@ -281,7 +281,7 @@ StyleRuleBase::traceAfterDispatch(visitor); } -StyleRulePage::StyleRulePage(CSSSelectorList selectorList, PassRefPtrWillBeRawPtr<StylePropertySet> properties) +StyleRulePage::StyleRulePage(CSSSelectorList selectorList, RawPtr<StylePropertySet> properties) : StyleRuleBase(Page) , m_properties(properties) , m_selectorList(std::move(selectorList)) @@ -312,7 +312,7 @@ StyleRuleBase::traceAfterDispatch(visitor); } -StyleRuleFontFace::StyleRuleFontFace(PassRefPtrWillBeRawPtr<StylePropertySet> properties) +StyleRuleFontFace::StyleRuleFontFace(RawPtr<StylePropertySet> properties) : StyleRuleBase(FontFace) , m_properties(properties) { @@ -341,7 +341,7 @@ StyleRuleBase::traceAfterDispatch(visitor); } -StyleRuleGroup::StyleRuleGroup(RuleType type, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adoptRule) +StyleRuleGroup::StyleRuleGroup(RuleType type, HeapVector<Member<StyleRuleBase>>& adoptRule) : StyleRuleBase(type) { m_childRules.swap(adoptRule); @@ -355,7 +355,7 @@ m_childRules[i] = o.m_childRules[i]->copy(); } -void StyleRuleGroup::wrapperInsertRule(unsigned index, PassRefPtrWillBeRawPtr<StyleRuleBase> rule) +void StyleRuleGroup::wrapperInsertRule(unsigned index, RawPtr<StyleRuleBase> rule) { m_childRules.insert(index, rule); } @@ -371,7 +371,7 @@ StyleRuleBase::traceAfterDispatch(visitor); } -StyleRuleMedia::StyleRuleMedia(PassRefPtrWillBeRawPtr<MediaQuerySet> media, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adoptRules) +StyleRuleMedia::StyleRuleMedia(RawPtr<MediaQuerySet> media, HeapVector<Member<StyleRuleBase>>& adoptRules) : StyleRuleGroup(Media, adoptRules) , m_mediaQueries(media) { @@ -390,7 +390,7 @@ StyleRuleGroup::traceAfterDispatch(visitor); } -StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adoptRules) +StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, HeapVector<Member<StyleRuleBase>>& adoptRules) : StyleRuleGroup(Supports, adoptRules) , m_conditionText(conditionText) , m_conditionIsSupported(conditionIsSupported) @@ -404,7 +404,7 @@ { } -StyleRuleViewport::StyleRuleViewport(PassRefPtrWillBeRawPtr<StylePropertySet> properties) +StyleRuleViewport::StyleRuleViewport(RawPtr<StylePropertySet> properties) : StyleRuleBase(Viewport) , m_properties(properties) {
diff --git a/third_party/WebKit/Source/core/css/StyleRule.h b/third_party/WebKit/Source/core/css/StyleRule.h index 4f46bea0..7b034bd 100644 --- a/third_party/WebKit/Source/core/css/StyleRule.h +++ b/third_party/WebKit/Source/core/css/StyleRule.h
@@ -34,8 +34,7 @@ class CSSRule; class CSSStyleSheet; -class CORE_EXPORT StyleRuleBase : public RefCountedWillBeGarbageCollectedFinalized<StyleRuleBase> { - USING_FAST_MALLOC_WITH_TYPE_NAME_WILL_BE_REMOVED(blink::StyleRuleBase); +class CORE_EXPORT StyleRuleBase : public GarbageCollectedFinalized<StyleRuleBase> { public: enum RuleType { Charset, @@ -65,7 +64,7 @@ bool isViewportRule() const { return type() == Viewport; } bool isImportRule() const { return type() == Import; } - PassRefPtrWillBeRawPtr<StyleRuleBase> copy() const; + RawPtr<StyleRuleBase> copy() const; #if !ENABLE(OILPAN) void deref() @@ -76,8 +75,8 @@ #endif // !ENABLE(OILPAN) // FIXME: There shouldn't be any need for the null parent version. - PassRefPtrWillBeRawPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet = 0) const; - PassRefPtrWillBeRawPtr<CSSRule> createCSSOMWrapper(CSSRule* parentRule) const; + RawPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet = 0) const; + RawPtr<CSSRule> createCSSOMWrapper(CSSRule* parentRule) const; DECLARE_TRACE(); DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } @@ -96,18 +95,17 @@ private: void destroy(); - PassRefPtrWillBeRawPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const; + RawPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const; unsigned m_type : 5; }; class CORE_EXPORT StyleRule : public StyleRuleBase { - USING_FAST_MALLOC_WITH_TYPE_NAME_WILL_BE_REMOVED(blink::StyleRule); public: // Adopts the selector list - static PassRefPtrWillBeRawPtr<StyleRule> create(CSSSelectorList selectorList, PassRefPtrWillBeRawPtr<StylePropertySet> properties) + static RawPtr<StyleRule> create(CSSSelectorList selectorList, RawPtr<StylePropertySet> properties) { - return adoptRefWillBeNoop(new StyleRule(std::move(selectorList), properties)); + return new StyleRule(std::move(selectorList), properties); } ~StyleRule(); @@ -118,25 +116,25 @@ void wrapperAdoptSelectorList(CSSSelectorList selectors) { m_selectorList = std::move(selectors); } - PassRefPtrWillBeRawPtr<StyleRule> copy() const { return adoptRefWillBeNoop(new StyleRule(*this)); } + RawPtr<StyleRule> copy() const { return new StyleRule(*this); } static unsigned averageSizeInBytes(); DECLARE_TRACE_AFTER_DISPATCH(); private: - StyleRule(CSSSelectorList, PassRefPtrWillBeRawPtr<StylePropertySet>); + StyleRule(CSSSelectorList, RawPtr<StylePropertySet>); StyleRule(const StyleRule&); - RefPtrWillBeMember<StylePropertySet> m_properties; // Cannot be null. + Member<StylePropertySet> m_properties; // Cannot be null. CSSSelectorList m_selectorList; }; class StyleRuleFontFace : public StyleRuleBase { public: - static PassRefPtrWillBeRawPtr<StyleRuleFontFace> create(PassRefPtrWillBeRawPtr<StylePropertySet> properties) + static RawPtr<StyleRuleFontFace> create(RawPtr<StylePropertySet> properties) { - return adoptRefWillBeNoop(new StyleRuleFontFace(properties)); + return new StyleRuleFontFace(properties); } ~StyleRuleFontFace(); @@ -144,23 +142,23 @@ const StylePropertySet& properties() const { return *m_properties; } MutableStylePropertySet& mutableProperties(); - PassRefPtrWillBeRawPtr<StyleRuleFontFace> copy() const { return adoptRefWillBeNoop(new StyleRuleFontFace(*this)); } + RawPtr<StyleRuleFontFace> copy() const { return new StyleRuleFontFace(*this); } DECLARE_TRACE_AFTER_DISPATCH(); private: - StyleRuleFontFace(PassRefPtrWillBeRawPtr<StylePropertySet>); + StyleRuleFontFace(RawPtr<StylePropertySet>); StyleRuleFontFace(const StyleRuleFontFace&); - RefPtrWillBeMember<StylePropertySet> m_properties; // Cannot be null. + Member<StylePropertySet> m_properties; // Cannot be null. }; class StyleRulePage : public StyleRuleBase { public: // Adopts the selector list - static PassRefPtrWillBeRawPtr<StyleRulePage> create(CSSSelectorList selectorList, PassRefPtrWillBeRawPtr<StylePropertySet> properties) + static RawPtr<StyleRulePage> create(CSSSelectorList selectorList, RawPtr<StylePropertySet> properties) { - return adoptRefWillBeNoop(new StyleRulePage(std::move(selectorList), properties)); + return new StyleRulePage(std::move(selectorList), properties); } ~StyleRulePage(); @@ -171,70 +169,70 @@ void wrapperAdoptSelectorList(CSSSelectorList selectors) { m_selectorList = std::move(selectors); } - PassRefPtrWillBeRawPtr<StyleRulePage> copy() const { return adoptRefWillBeNoop(new StyleRulePage(*this)); } + RawPtr<StyleRulePage> copy() const { return new StyleRulePage(*this); } DECLARE_TRACE_AFTER_DISPATCH(); private: - StyleRulePage(CSSSelectorList, PassRefPtrWillBeRawPtr<StylePropertySet>); + StyleRulePage(CSSSelectorList, RawPtr<StylePropertySet>); StyleRulePage(const StyleRulePage&); - RefPtrWillBeMember<StylePropertySet> m_properties; // Cannot be null. + Member<StylePropertySet> m_properties; // Cannot be null. CSSSelectorList m_selectorList; }; class StyleRuleGroup : public StyleRuleBase { public: - const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& childRules() const { return m_childRules; } + const HeapVector<Member<StyleRuleBase>>& childRules() const { return m_childRules; } - void wrapperInsertRule(unsigned, PassRefPtrWillBeRawPtr<StyleRuleBase>); + void wrapperInsertRule(unsigned, RawPtr<StyleRuleBase>); void wrapperRemoveRule(unsigned); DECLARE_TRACE_AFTER_DISPATCH(); protected: - StyleRuleGroup(RuleType, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adoptRule); + StyleRuleGroup(RuleType, HeapVector<Member<StyleRuleBase>>& adoptRule); StyleRuleGroup(const StyleRuleGroup&); private: - WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> m_childRules; + HeapVector<Member<StyleRuleBase>> m_childRules; }; class StyleRuleMedia : public StyleRuleGroup { public: - static PassRefPtrWillBeRawPtr<StyleRuleMedia> create(PassRefPtrWillBeRawPtr<MediaQuerySet> media, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adoptRules) + static RawPtr<StyleRuleMedia> create(RawPtr<MediaQuerySet> media, HeapVector<Member<StyleRuleBase>>& adoptRules) { - return adoptRefWillBeNoop(new StyleRuleMedia(media, adoptRules)); + return new StyleRuleMedia(media, adoptRules); } MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } - PassRefPtrWillBeRawPtr<StyleRuleMedia> copy() const { return adoptRefWillBeNoop(new StyleRuleMedia(*this)); } + RawPtr<StyleRuleMedia> copy() const { return new StyleRuleMedia(*this); } DECLARE_TRACE_AFTER_DISPATCH(); private: - StyleRuleMedia(PassRefPtrWillBeRawPtr<MediaQuerySet>, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adoptRules); + StyleRuleMedia(RawPtr<MediaQuerySet>, HeapVector<Member<StyleRuleBase>>& adoptRules); StyleRuleMedia(const StyleRuleMedia&); - RefPtrWillBeMember<MediaQuerySet> m_mediaQueries; + Member<MediaQuerySet> m_mediaQueries; }; class StyleRuleSupports : public StyleRuleGroup { public: - static PassRefPtrWillBeRawPtr<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adoptRules) + static RawPtr<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, HeapVector<Member<StyleRuleBase>>& adoptRules) { - return adoptRefWillBeNoop(new StyleRuleSupports(conditionText, conditionIsSupported, adoptRules)); + return new StyleRuleSupports(conditionText, conditionIsSupported, adoptRules); } String conditionText() const { return m_conditionText; } bool conditionIsSupported() const { return m_conditionIsSupported; } - PassRefPtrWillBeRawPtr<StyleRuleSupports> copy() const { return adoptRefWillBeNoop(new StyleRuleSupports(*this)); } + RawPtr<StyleRuleSupports> copy() const { return new StyleRuleSupports(*this); } DEFINE_INLINE_TRACE_AFTER_DISPATCH() { StyleRuleGroup::traceAfterDispatch(visitor); } private: - StyleRuleSupports(const String& conditionText, bool conditionIsSupported, WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& adoptRules); + StyleRuleSupports(const String& conditionText, bool conditionIsSupported, HeapVector<Member<StyleRuleBase>>& adoptRules); StyleRuleSupports(const StyleRuleSupports&); String m_conditionText; @@ -243,9 +241,9 @@ class StyleRuleViewport : public StyleRuleBase { public: - static PassRefPtrWillBeRawPtr<StyleRuleViewport> create(PassRefPtrWillBeRawPtr<StylePropertySet> properties) + static RawPtr<StyleRuleViewport> create(RawPtr<StylePropertySet> properties) { - return adoptRefWillBeNoop(new StyleRuleViewport(properties)); + return new StyleRuleViewport(properties); } ~StyleRuleViewport(); @@ -253,22 +251,21 @@ const StylePropertySet& properties() const { return *m_properties; } MutableStylePropertySet& mutableProperties(); - PassRefPtrWillBeRawPtr<StyleRuleViewport> copy() const { return adoptRefWillBeNoop(new StyleRuleViewport(*this)); } + RawPtr<StyleRuleViewport> copy() const { return new StyleRuleViewport(*this); } DECLARE_TRACE_AFTER_DISPATCH(); private: - StyleRuleViewport(PassRefPtrWillBeRawPtr<StylePropertySet>); + StyleRuleViewport(RawPtr<StylePropertySet>); StyleRuleViewport(const StyleRuleViewport&); - RefPtrWillBeMember<StylePropertySet> m_properties; // Cannot be null + Member<StylePropertySet> m_properties; // Cannot be null }; // This should only be used within the CSS Parser class StyleRuleCharset : public StyleRuleBase { - USING_FAST_MALLOC_WILL_BE_REMOVED(StyleRuleCharset); public: - static PassRefPtrWillBeRawPtr<StyleRuleCharset> create() { return adoptRefWillBeNoop(new StyleRuleCharset()); } + static RawPtr<StyleRuleCharset> create() { return new StyleRuleCharset(); } DEFINE_INLINE_TRACE_AFTER_DISPATCH() { StyleRuleBase::traceAfterDispatch(visitor); } private:
diff --git a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp index 46101355..b5cec76 100644 --- a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp +++ b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
@@ -30,12 +30,12 @@ namespace blink { -PassRefPtrWillBeRawPtr<StyleRuleImport> StyleRuleImport::create(const String& href, PassRefPtrWillBeRawPtr<MediaQuerySet> media) +RawPtr<StyleRuleImport> StyleRuleImport::create(const String& href, RawPtr<MediaQuerySet> media) { - return adoptRefWillBeNoop(new StyleRuleImport(href, media)); + return new StyleRuleImport(href, media); } -StyleRuleImport::StyleRuleImport(const String& href, PassRefPtrWillBeRawPtr<MediaQuerySet> media) +StyleRuleImport::StyleRuleImport(const String& href, RawPtr<MediaQuerySet> media) : StyleRuleBase(Import) , m_parentStyleSheet(nullptr) , m_styleSheetClient(this)
diff --git a/third_party/WebKit/Source/core/css/StyleRuleImport.h b/third_party/WebKit/Source/core/css/StyleRuleImport.h index d7cb9d153..627a6076 100644 --- a/third_party/WebKit/Source/core/css/StyleRuleImport.h +++ b/third_party/WebKit/Source/core/css/StyleRuleImport.h
@@ -33,10 +33,9 @@ class StyleSheetContents; class StyleRuleImport : public StyleRuleBase { - USING_FAST_MALLOC_WILL_BE_REMOVED(StyleRuleImport); - WILL_BE_USING_PRE_FINALIZER(StyleRuleImport, dispose); + USING_PRE_FINALIZER(StyleRuleImport, dispose); public: - static PassRefPtrWillBeRawPtr<StyleRuleImport> create(const String& href, PassRefPtrWillBeRawPtr<MediaQuerySet>); + static RawPtr<StyleRuleImport> create(const String& href, RawPtr<MediaQuerySet>); ~StyleRuleImport(); @@ -75,23 +74,23 @@ } private: - RawPtrWillBeMember<StyleRuleImport> m_ownerRule; + Member<StyleRuleImport> m_ownerRule; }; void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource*); friend class ImportedStyleSheetClient; - StyleRuleImport(const String& href, PassRefPtrWillBeRawPtr<MediaQuerySet>); + StyleRuleImport(const String& href, RawPtr<MediaQuerySet>); void dispose(); - RawPtrWillBeMember<StyleSheetContents> m_parentStyleSheet; + Member<StyleSheetContents> m_parentStyleSheet; ImportedStyleSheetClient m_styleSheetClient; String m_strHref; - RefPtrWillBeMember<MediaQuerySet> m_mediaQueries; - RefPtrWillBeMember<StyleSheetContents> m_styleSheet; - RefPtrWillBeMember<CSSStyleSheetResource> m_resource; + Member<MediaQuerySet> m_mediaQueries; + Member<StyleSheetContents> m_styleSheet; + Member<CSSStyleSheetResource> m_resource; bool m_loading; };
diff --git a/third_party/WebKit/Source/core/css/StyleRuleKeyframe.cpp b/third_party/WebKit/Source/core/css/StyleRuleKeyframe.cpp index 146816d..482ef97 100644 --- a/third_party/WebKit/Source/core/css/StyleRuleKeyframe.cpp +++ b/third_party/WebKit/Source/core/css/StyleRuleKeyframe.cpp
@@ -10,7 +10,7 @@ namespace blink { -StyleRuleKeyframe::StyleRuleKeyframe(PassOwnPtr<Vector<double>> keys, PassRefPtrWillBeRawPtr<StylePropertySet> properties) +StyleRuleKeyframe::StyleRuleKeyframe(PassOwnPtr<Vector<double>> keys, RawPtr<StylePropertySet> properties) : StyleRuleBase(Keyframe) , m_properties(properties) , m_keys(*keys)
diff --git a/third_party/WebKit/Source/core/css/StyleRuleKeyframe.h b/third_party/WebKit/Source/core/css/StyleRuleKeyframe.h index bb06045a..40a37f84 100644 --- a/third_party/WebKit/Source/core/css/StyleRuleKeyframe.h +++ b/third_party/WebKit/Source/core/css/StyleRuleKeyframe.h
@@ -13,11 +13,10 @@ class StylePropertySet; class StyleRuleKeyframe final : public StyleRuleBase { - USING_FAST_MALLOC_WILL_BE_REMOVED(StyleRuleKeyframe); public: - static PassRefPtrWillBeRawPtr<StyleRuleKeyframe> create(PassOwnPtr<Vector<double>> keys, PassRefPtrWillBeRawPtr<StylePropertySet> properties) + static RawPtr<StyleRuleKeyframe> create(PassOwnPtr<Vector<double>> keys, RawPtr<StylePropertySet> properties) { - return adoptRefWillBeNoop(new StyleRuleKeyframe(keys, properties)); + return new StyleRuleKeyframe(keys, properties); } // Exposed to JavaScript. @@ -35,9 +34,9 @@ DECLARE_TRACE_AFTER_DISPATCH(); private: - StyleRuleKeyframe(PassOwnPtr<Vector<double>>, PassRefPtrWillBeRawPtr<StylePropertySet>); + StyleRuleKeyframe(PassOwnPtr<Vector<double>>, RawPtr<StylePropertySet>); - RefPtrWillBeMember<StylePropertySet> m_properties; + Member<StylePropertySet> m_properties; Vector<double> m_keys; };
diff --git a/third_party/WebKit/Source/core/css/StyleRuleNamespace.h b/third_party/WebKit/Source/core/css/StyleRuleNamespace.h index 1d324da0..cd22af5 100644 --- a/third_party/WebKit/Source/core/css/StyleRuleNamespace.h +++ b/third_party/WebKit/Source/core/css/StyleRuleNamespace.h
@@ -12,11 +12,10 @@ // This class is never actually stored anywhere currently, but only used for // the parser to pass to a stylesheet class StyleRuleNamespace final : public StyleRuleBase { - USING_FAST_MALLOC_WILL_BE_REMOVED(StyleRuleNamespace); public: - static PassRefPtrWillBeRawPtr<StyleRuleNamespace> create(AtomicString prefix, AtomicString uri) + static RawPtr<StyleRuleNamespace> create(AtomicString prefix, AtomicString uri) { - return adoptRefWillBeNoop(new StyleRuleNamespace(prefix, uri)); + return new StyleRuleNamespace(prefix, uri); } AtomicString prefix() const { return m_prefix; }
diff --git a/third_party/WebKit/Source/core/css/StyleSheet.h b/third_party/WebKit/Source/core/css/StyleSheet.h index 19cf11f..7eb925ed 100644 --- a/third_party/WebKit/Source/core/css/StyleSheet.h +++ b/third_party/WebKit/Source/core/css/StyleSheet.h
@@ -34,7 +34,7 @@ class Node; class StyleSheet; -class CORE_EXPORT StyleSheet : public RefCountedWillBeGarbageCollectedFinalized<StyleSheet>, public ScriptWrappable { +class CORE_EXPORT StyleSheet : public GarbageCollectedFinalized<StyleSheet>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: StyleSheet() { }
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp index 0b89df7..95868a7e 100644 --- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp +++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
@@ -142,7 +142,7 @@ return true; } -void StyleSheetContents::parserAppendRule(PassRefPtrWillBeRawPtr<StyleRuleBase> rule) +void StyleSheetContents::parserAppendRule(RawPtr<StyleRuleBase> rule) { if (rule->isImportRule()) { // Parser enforces that @import rules come before anything else @@ -212,7 +212,7 @@ m_childRules.clear(); } -bool StyleSheetContents::wrapperInsertRule(PassRefPtrWillBeRawPtr<StyleRuleBase> rule, unsigned index) +bool StyleSheetContents::wrapperInsertRule(RawPtr<StyleRuleBase> rule, unsigned index) { ASSERT(m_isMutable); ASSERT_WITH_SECURITY_IMPLICATION(index <= ruleCount()); @@ -374,7 +374,7 @@ // Avoid |this| being deleted by scripts that run via // ScriptableDocumentParser::executeScriptsWaitingForResources(). // See https://bugs.webkit.org/show_bug.cgi?id=95106 - RefPtrWillBeRawPtr<StyleSheetContents> protect(this); + RawPtr<StyleSheetContents> protect(this); StyleSheetContents* parentSheet = parentStyleSheet(); if (parentSheet) { @@ -394,7 +394,7 @@ // When a sheet is loaded it is moved from the set of loading clients // to the set of completed clients. We therefore need the copy in order to // not modify the set while iterating it. - WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>> loadingClients; + HeapVector<Member<CSSStyleSheet>> loadingClients; copyToVector(m_loadingClients, loadingClients); for (unsigned i = 0; i < loadingClients.size(); ++i) { @@ -402,7 +402,7 @@ continue; // sheetLoaded might be invoked after its owner node is removed from document. - if (RefPtrWillBeRawPtr<Node> ownerNode = loadingClients[i]->ownerNode()) { + if (RawPtr<Node> ownerNode = loadingClients[i]->ownerNode()) { if (loadingClients[i]->sheetLoaded()) ownerNode->notifyLoadedSheetAndAllCriticalSubresources(m_didLoadErrorOccur ? Node::ErrorOccurredLoadingSubresource : Node::NoErrorLoadingSubresource); } @@ -429,7 +429,7 @@ // completed state to the loading state which modifies the set of // completed clients. We therefore need the copy in order to not // modify the set of completed clients while iterating it. - WillBeHeapVector<RawPtrWillBeMember<CSSStyleSheet>> completedClients; + HeapVector<Member<CSSStyleSheet>> completedClients; copyToVector(root->m_completedClients, completedClients); for (unsigned i = 0; i < completedClients.size(); ++i) completedClients[i]->startLoadingDynamicSheet(); @@ -464,7 +464,7 @@ return root->clientSingleOwnerDocument(); } -static bool childRulesHaveFailedOrCanceledSubresources(const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& rules) +static bool childRulesHaveFailedOrCanceledSubresources(const HeapVector<Member<StyleRuleBase>>& rules) { for (unsigned i = 0; i < rules.size(); ++i) { const StyleRuleBase* rule = rules[i].get(); @@ -592,7 +592,7 @@ return *m_ruleSet.get(); } -static void clearResolvers(WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>>& clients) +static void clearResolvers(HeapHashSet<WeakMember<CSSStyleSheet>>& clients) { for (const auto& sheet : clients) { if (Document* document = sheet->ownerDocument()) @@ -618,11 +618,11 @@ m_ruleSet.clear(); } -static void removeFontFaceRules(WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>>& clients, const StyleRuleFontFace* fontFaceRule) +static void removeFontFaceRules(HeapHashSet<WeakMember<CSSStyleSheet>>& clients, const StyleRuleFontFace* fontFaceRule) { for (const auto& sheet : clients) { if (Node* ownerNode = sheet->ownerNode()) - ownerNode->document().styleEngine().removeFontFaceRules(WillBeHeapVector<RawPtrWillBeMember<const StyleRuleFontFace>>(1, fontFaceRule)); + ownerNode->document().styleEngine().removeFontFaceRules(HeapVector<Member<const StyleRuleFontFace>>(1, fontFaceRule)); } } @@ -633,7 +633,7 @@ removeFontFaceRules(root->m_completedClients, fontFaceRule); } -static void findFontFaceRulesFromRules(const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& rules, WillBeHeapVector<RawPtrWillBeMember<const StyleRuleFontFace>>& fontFaceRules) +static void findFontFaceRulesFromRules(const HeapVector<Member<StyleRuleBase>>& rules, HeapVector<Member<const StyleRuleFontFace>>& fontFaceRules) { for (unsigned i = 0; i < rules.size(); ++i) { StyleRuleBase* rule = rules[i].get(); @@ -649,7 +649,7 @@ } } -void StyleSheetContents::findFontFaceRules(WillBeHeapVector<RawPtrWillBeMember<const StyleRuleFontFace>>& fontFaceRules) +void StyleSheetContents::findFontFaceRules(HeapVector<Member<const StyleRuleFontFace>>& fontFaceRules) { for (unsigned i = 0; i < m_importRules.size(); ++i) { if (!m_importRules[i]->styleSheet())
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.h b/third_party/WebKit/Source/core/css/StyleSheetContents.h index 2f8f5b7..033fa055 100644 --- a/third_party/WebKit/Source/core/css/StyleSheetContents.h +++ b/third_party/WebKit/Source/core/css/StyleSheetContents.h
@@ -46,19 +46,19 @@ class StyleRuleImport; class StyleRuleNamespace; -class CORE_EXPORT StyleSheetContents : public RefCountedWillBeGarbageCollectedFinalized<StyleSheetContents> { +class CORE_EXPORT StyleSheetContents : public GarbageCollectedFinalized<StyleSheetContents> { public: - static PassRefPtrWillBeRawPtr<StyleSheetContents> create(const CSSParserContext& context) + static RawPtr<StyleSheetContents> create(const CSSParserContext& context) { - return adoptRefWillBeNoop(new StyleSheetContents(0, String(), context)); + return new StyleSheetContents(0, String(), context); } - static PassRefPtrWillBeRawPtr<StyleSheetContents> create(const String& originalURL, const CSSParserContext& context) + static RawPtr<StyleSheetContents> create(const String& originalURL, const CSSParserContext& context) { - return adoptRefWillBeNoop(new StyleSheetContents(0, originalURL, context)); + return new StyleSheetContents(0, originalURL, context); } - static PassRefPtrWillBeRawPtr<StyleSheetContents> create(StyleRuleImport* ownerRule, const String& originalURL, const CSSParserContext& context) + static RawPtr<StyleSheetContents> create(StyleRuleImport* ownerRule, const String& originalURL, const CSSParserContext& context) { - return adoptRefWillBeNoop(new StyleSheetContents(ownerRule, originalURL, context)); + return new StyleSheetContents(ownerRule, originalURL, context); } ~StyleSheetContents(); @@ -94,17 +94,17 @@ void setHasFontFaceRule(bool b) { m_hasFontFaceRule = b; } bool hasFontFaceRule() const { return m_hasFontFaceRule; } - void findFontFaceRules(WillBeHeapVector<RawPtrWillBeMember<const StyleRuleFontFace>>& fontFaceRules); + void findFontFaceRules(HeapVector<Member<const StyleRuleFontFace>>& fontFaceRules); void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri); - void parserAppendRule(PassRefPtrWillBeRawPtr<StyleRuleBase>); + void parserAppendRule(RawPtr<StyleRuleBase>); void clearRules(); // Rules other than @import. - const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& childRules() const { return m_childRules; } - const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>>& importRules() const { return m_importRules; } - const WillBeHeapVector<RefPtrWillBeMember<StyleRuleNamespace>>& namespaceRules() const { return m_namespaceRules; } + const HeapVector<Member<StyleRuleBase>>& childRules() const { return m_childRules; } + const HeapVector<Member<StyleRuleImport>>& importRules() const { return m_importRules; } + const HeapVector<Member<StyleRuleNamespace>>& namespaceRules() const { return m_namespaceRules; } void notifyLoadedSheet(const CSSStyleSheetResource*); @@ -123,12 +123,12 @@ unsigned estimatedSizeInBytes() const; - bool wrapperInsertRule(PassRefPtrWillBeRawPtr<StyleRuleBase>, unsigned index); + bool wrapperInsertRule(RawPtr<StyleRuleBase>, unsigned index); bool wrapperDeleteRule(unsigned index); - PassRefPtrWillBeRawPtr<StyleSheetContents> copy() const + RawPtr<StyleSheetContents> copy() const { - return adoptRefWillBeNoop(new StyleSheetContents(*this)); + return new StyleSheetContents(*this); } void registerClient(CSSStyleSheet*); @@ -169,13 +169,13 @@ Document* clientSingleOwnerDocument() const; - RawPtrWillBeMember<StyleRuleImport> m_ownerRule; + Member<StyleRuleImport> m_ownerRule; String m_originalURL; - WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>> m_importRules; - WillBeHeapVector<RefPtrWillBeMember<StyleRuleNamespace>> m_namespaceRules; - WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> m_childRules; + HeapVector<Member<StyleRuleImport>> m_importRules; + HeapVector<Member<StyleRuleNamespace>> m_namespaceRules; + HeapVector<Member<StyleRuleBase>> m_childRules; using PrefixNamespaceURIMap = HashMap<AtomicString, AtomicString>; PrefixNamespaceURIMap m_namespaces; AtomicString m_defaultNamespace; @@ -190,10 +190,10 @@ CSSParserContext m_parserContext; - WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>> m_loadingClients; - WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>> m_completedClients; + HeapHashSet<WeakMember<CSSStyleSheet>> m_loadingClients; + HeapHashSet<WeakMember<CSSStyleSheet>> m_completedClients; - OwnPtrWillBeMember<RuleSet> m_ruleSet; + Member<RuleSet> m_ruleSet; String m_sourceMapURL; };
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContentsTest.cpp b/third_party/WebKit/Source/core/css/StyleSheetContentsTest.cpp index cd74311..e3d768b 100644 --- a/third_party/WebKit/Source/core/css/StyleSheetContentsTest.cpp +++ b/third_party/WebKit/Source/core/css/StyleSheetContentsTest.cpp
@@ -14,7 +14,7 @@ { CSSParserContext context(HTMLStandardMode, nullptr); - RefPtrWillBeRawPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(context); + RawPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(context); styleSheet->parseString("@namespace ns url(test);"); EXPECT_EQ(1U, styleSheet->ruleCount());
diff --git a/third_party/WebKit/Source/core/css/StyleSheetList.cpp b/third_party/WebKit/Source/core/css/StyleSheetList.cpp index 07210e87..b564d320 100644 --- a/third_party/WebKit/Source/core/css/StyleSheetList.cpp +++ b/third_party/WebKit/Source/core/css/StyleSheetList.cpp
@@ -36,9 +36,7 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(StyleSheetList); - -inline const WillBeHeapVector<RefPtrWillBeMember<StyleSheet>>& StyleSheetList::styleSheets() +inline const HeapVector<Member<StyleSheet>>& StyleSheetList::styleSheets() { #if !ENABLE(OILPAN) if (!m_treeScope) @@ -62,7 +60,7 @@ StyleSheet* StyleSheetList::item(unsigned index) { - const WillBeHeapVector<RefPtrWillBeMember<StyleSheet>>& sheets = styleSheets(); + const HeapVector<Member<StyleSheet>>& sheets = styleSheets(); return index < sheets.size() ? sheets[index].get() : nullptr; }
diff --git a/third_party/WebKit/Source/core/css/StyleSheetList.h b/third_party/WebKit/Source/core/css/StyleSheetList.h index b404038b..b80cb20b 100644 --- a/third_party/WebKit/Source/core/css/StyleSheetList.h +++ b/third_party/WebKit/Source/core/css/StyleSheetList.h
@@ -34,11 +34,10 @@ class HTMLStyleElement; class StyleSheet; -class StyleSheetList final : public RefCountedWillBeGarbageCollected<StyleSheetList>, public ScriptWrappable { - DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(StyleSheetList); +class StyleSheetList final : public GarbageCollected<StyleSheetList>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<StyleSheetList> create(TreeScope* treeScope) { return adoptRefWillBeNoop(new StyleSheetList(treeScope)); } + static RawPtr<StyleSheetList> create(TreeScope* treeScope) { return new StyleSheetList(treeScope); } unsigned length(); StyleSheet* item(unsigned index); @@ -57,9 +56,9 @@ private: explicit StyleSheetList(TreeScope*); - const WillBeHeapVector<RefPtrWillBeMember<StyleSheet>>& styleSheets(); + const HeapVector<Member<StyleSheet>>& styleSheets(); - RawPtrWillBeMember<TreeScope> m_treeScope; + Member<TreeScope> m_treeScope; #if !ENABLE(OILPAN) Vector<RefPtr<StyleSheet>> m_detachedStyleSheets; #endif
diff --git a/third_party/WebKit/Source/core/css/cssom/KeywordValue.cpp b/third_party/WebKit/Source/core/css/cssom/KeywordValue.cpp index 1a96d48..d39b319 100644 --- a/third_party/WebKit/Source/core/css/cssom/KeywordValue.cpp +++ b/third_party/WebKit/Source/core/css/cssom/KeywordValue.cpp
@@ -32,7 +32,7 @@ return cssValueKeywordID(cssKeywordString); } -PassRefPtrWillBeRawPtr<CSSValue> KeywordValue::toCSSValue() const +RawPtr<CSSValue> KeywordValue::toCSSValue() const { CSSValueID keywordID = keywordValueID(); if (keywordID == CSSValueID::CSSValueInvalid) {
diff --git a/third_party/WebKit/Source/core/css/cssom/KeywordValue.h b/third_party/WebKit/Source/core/css/cssom/KeywordValue.h index bbe93af..f1872d4 100644 --- a/third_party/WebKit/Source/core/css/cssom/KeywordValue.h +++ b/third_party/WebKit/Source/core/css/cssom/KeywordValue.h
@@ -23,7 +23,7 @@ const String& keywordValue() const; CSSValueID keywordValueID() const; - PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const override; + RawPtr<CSSValue> toCSSValue() const override; private: KeywordValue(const String& keyword) : m_keywordValue(keyword) {}
diff --git a/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.cpp b/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.cpp index 69a95d9..1410ece 100644 --- a/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.cpp +++ b/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.cpp
@@ -11,9 +11,9 @@ namespace blink { -PassRefPtrWillBeRawPtr<CSSFunctionValue> MatrixTransformComponent::toCSSValue() const +RawPtr<CSSFunctionValue> MatrixTransformComponent::toCSSValue() const { - RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(m_is2D ? CSSValueMatrix : CSSValueMatrix3d); + RawPtr<CSSFunctionValue> result = CSSFunctionValue::create(m_is2D ? CSSValueMatrix : CSSValueMatrix3d); if (m_is2D) { double values[6] = {a(), b(), c(), d(), e(), f()};
diff --git a/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.h b/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.h index 680c1a3..92fd448 100644 --- a/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.h +++ b/third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.h
@@ -58,7 +58,7 @@ // Bindings require a non const return value. MatrixTransformComponent* asMatrix() const override { return const_cast<MatrixTransformComponent*>(this); } - PassRefPtrWillBeRawPtr<CSSFunctionValue> toCSSValue() const override; + RawPtr<CSSFunctionValue> toCSSValue() const override; static MatrixTransformComponent* perspective(double length);
diff --git a/third_party/WebKit/Source/core/css/cssom/NumberValue.h b/third_party/WebKit/Source/core/css/cssom/NumberValue.h index 910c3f5d..5ebdde9 100644 --- a/third_party/WebKit/Source/core/css/cssom/NumberValue.h +++ b/third_party/WebKit/Source/core/css/cssom/NumberValue.h
@@ -24,7 +24,7 @@ double value() const { return m_value; } - PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const override + RawPtr<CSSValue> toCSSValue() const override { return cssValuePool().createValue(m_value, CSSPrimitiveValue::UnitType:: Number);
diff --git a/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp b/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp index 56e633860a..551157c 100644 --- a/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp +++ b/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp
@@ -17,9 +17,9 @@ return new PerspectiveTransformComponent(length); } -PassRefPtrWillBeRawPtr<CSSFunctionValue> PerspectiveTransformComponent::toCSSValue() const +RawPtr<CSSFunctionValue> PerspectiveTransformComponent::toCSSValue() const { - RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValuePerspective); + RawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValuePerspective); result->append(m_length->toCSSValue()); return result.release(); }
diff --git a/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.h b/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.h index c658041..1f0b55c 100644 --- a/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.h +++ b/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.h
@@ -27,7 +27,7 @@ // TODO: Implement asMatrix for PerspectiveTransformComponent. MatrixTransformComponent* asMatrix() const override { return nullptr; } - PassRefPtrWillBeRawPtr<CSSFunctionValue> toCSSValue() const override; + RawPtr<CSSFunctionValue> toCSSValue() const override; DEFINE_INLINE_VIRTUAL_TRACE() {
diff --git a/third_party/WebKit/Source/core/css/cssom/PositionValue.cpp b/third_party/WebKit/Source/core/css/cssom/PositionValue.cpp index 9360865..69e1589 100644 --- a/third_party/WebKit/Source/core/css/cssom/PositionValue.cpp +++ b/third_party/WebKit/Source/core/css/cssom/PositionValue.cpp
@@ -9,7 +9,7 @@ namespace blink { -PassRefPtrWillBeRawPtr<CSSValue> PositionValue::toCSSValue() const +RawPtr<CSSValue> PositionValue::toCSSValue() const { return CSSValuePair::create(m_x->toCSSValue(), m_y->toCSSValue(), CSSValuePair::KeepIdenticalValues); }
diff --git a/third_party/WebKit/Source/core/css/cssom/PositionValue.h b/third_party/WebKit/Source/core/css/cssom/PositionValue.h index 827a5b7..e8afaa60 100644 --- a/third_party/WebKit/Source/core/css/cssom/PositionValue.h +++ b/third_party/WebKit/Source/core/css/cssom/PositionValue.h
@@ -28,7 +28,7 @@ StyleValueType type() const override { return PositionType; } - PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const override; + RawPtr<CSSValue> toCSSValue() const override; DEFINE_INLINE_VIRTUAL_TRACE() {
diff --git a/third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.cpp b/third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.cpp index 52a6af7..312ce42 100644 --- a/third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.cpp +++ b/third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.cpp
@@ -9,9 +9,9 @@ namespace blink { -PassRefPtrWillBeRawPtr<CSSFunctionValue> RotationTransformComponent::toCSSValue() const +RawPtr<CSSFunctionValue> RotationTransformComponent::toCSSValue() const { - RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(m_is2D ? CSSValueRotate : CSSValueRotate3d); + RawPtr<CSSFunctionValue> result = CSSFunctionValue::create(m_is2D ? CSSValueRotate : CSSValueRotate3d); if (!m_is2D) { result->append(cssValuePool().createValue(m_x, CSSPrimitiveValue::UnitType::Number)); result->append(cssValuePool().createValue(m_y, CSSPrimitiveValue::UnitType::Number));
diff --git a/third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.h b/third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.h index 0448e140..c59badb 100644 --- a/third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.h +++ b/third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.h
@@ -37,7 +37,7 @@ : MatrixTransformComponent::rotate3d(m_angle, m_x, m_y, m_z); } - PassRefPtrWillBeRawPtr<CSSFunctionValue> toCSSValue() const override; + RawPtr<CSSFunctionValue> toCSSValue() const override; private: RotationTransformComponent(double angle)
diff --git a/third_party/WebKit/Source/core/css/cssom/ScaleTransformComponent.cpp b/third_party/WebKit/Source/core/css/cssom/ScaleTransformComponent.cpp index 7373fa1..fe5353aa 100644 --- a/third_party/WebKit/Source/core/css/cssom/ScaleTransformComponent.cpp +++ b/third_party/WebKit/Source/core/css/cssom/ScaleTransformComponent.cpp
@@ -9,9 +9,9 @@ namespace blink { -PassRefPtrWillBeRawPtr<CSSFunctionValue> ScaleTransformComponent::toCSSValue() const +RawPtr<CSSFunctionValue> ScaleTransformComponent::toCSSValue() const { - RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(m_is2D ? CSSValueScale : CSSValueScale3d); + RawPtr<CSSFunctionValue> result = CSSFunctionValue::create(m_is2D ? CSSValueScale : CSSValueScale3d); result->append(cssValuePool().createValue(m_x, CSSPrimitiveValue::UnitType::Number)); result->append(cssValuePool().createValue(m_y, CSSPrimitiveValue::UnitType::Number));
diff --git a/third_party/WebKit/Source/core/css/cssom/ScaleTransformComponent.h b/third_party/WebKit/Source/core/css/cssom/ScaleTransformComponent.h index 9cbd456..836158f5 100644 --- a/third_party/WebKit/Source/core/css/cssom/ScaleTransformComponent.h +++ b/third_party/WebKit/Source/core/css/cssom/ScaleTransformComponent.h
@@ -36,7 +36,7 @@ : MatrixTransformComponent::scale3d(m_x, m_y, m_z); } - PassRefPtrWillBeRawPtr<CSSFunctionValue> toCSSValue() const override; + RawPtr<CSSFunctionValue> toCSSValue() const override; private: ScaleTransformComponent(double x, double y) : m_x(x), m_y(y), m_z(1), m_is2D(true) { }
diff --git a/third_party/WebKit/Source/core/css/cssom/SimpleLength.cpp b/third_party/WebKit/Source/core/css/cssom/SimpleLength.cpp index 3320bbcc..e1f8e0b6 100644 --- a/third_party/WebKit/Source/core/css/cssom/SimpleLength.cpp +++ b/third_party/WebKit/Source/core/css/cssom/SimpleLength.cpp
@@ -10,7 +10,7 @@ namespace blink { -PassRefPtrWillBeRawPtr<CSSValue> SimpleLength::toCSSValue() const +RawPtr<CSSValue> SimpleLength::toCSSValue() const { return cssValuePool().createValue(m_value, m_unit); }
diff --git a/third_party/WebKit/Source/core/css/cssom/SimpleLength.h b/third_party/WebKit/Source/core/css/cssom/SimpleLength.h index 97e0534..133d67e 100644 --- a/third_party/WebKit/Source/core/css/cssom/SimpleLength.h +++ b/third_party/WebKit/Source/core/css/cssom/SimpleLength.h
@@ -41,7 +41,7 @@ StyleValueType type() const override { return StyleValueType::SimpleLengthType; } - PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const override; + RawPtr<CSSValue> toCSSValue() const override; protected: virtual LengthValue* addInternal(const LengthValue* other, ExceptionState&);
diff --git a/third_party/WebKit/Source/core/css/cssom/SkewTransformComponent.cpp b/third_party/WebKit/Source/core/css/cssom/SkewTransformComponent.cpp index 28baace..429f0ffc 100644 --- a/third_party/WebKit/Source/core/css/cssom/SkewTransformComponent.cpp +++ b/third_party/WebKit/Source/core/css/cssom/SkewTransformComponent.cpp
@@ -9,9 +9,9 @@ namespace blink { -PassRefPtrWillBeRawPtr<CSSFunctionValue> SkewTransformComponent::toCSSValue() const +RawPtr<CSSFunctionValue> SkewTransformComponent::toCSSValue() const { - RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueSkew); + RawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueSkew); result->append(cssValuePool().createValue(m_ax, CSSPrimitiveValue::UnitType::Number)); result->append(cssValuePool().createValue(m_ay, CSSPrimitiveValue::UnitType::Number)); return result.release();
diff --git a/third_party/WebKit/Source/core/css/cssom/SkewTransformComponent.h b/third_party/WebKit/Source/core/css/cssom/SkewTransformComponent.h index 2c0003f..49db2da 100644 --- a/third_party/WebKit/Source/core/css/cssom/SkewTransformComponent.h +++ b/third_party/WebKit/Source/core/css/cssom/SkewTransformComponent.h
@@ -29,7 +29,7 @@ return MatrixTransformComponent::skew(m_ax, m_ay); } - PassRefPtrWillBeRawPtr<CSSFunctionValue> toCSSValue() const override; + RawPtr<CSSFunctionValue> toCSSValue() const override; private: SkewTransformComponent(double ax, double ay) : TransformComponent(), m_ax(ax), m_ay(ay) { }
diff --git a/third_party/WebKit/Source/core/css/cssom/StyleCalcLength.cpp b/third_party/WebKit/Source/core/css/cssom/StyleCalcLength.cpp index 1ffbc8b..a2a656a 100644 --- a/third_party/WebKit/Source/core/css/cssom/StyleCalcLength.cpp +++ b/third_party/WebKit/Source/core/css/cssom/StyleCalcLength.cpp
@@ -123,10 +123,10 @@ return result; } -PassRefPtrWillBeRawPtr<CSSValue> StyleCalcLength::toCSSValue() const +RawPtr<CSSValue> StyleCalcLength::toCSSValue() const { // Create a CSS Calc Value, then put it into a CSSPrimitiveValue - RefPtrWillBeRawPtr<CSSCalcExpressionNode> node = nullptr; + RawPtr<CSSCalcExpressionNode> node = nullptr; for (unsigned i = 0; i < LengthValue::kNumSupportedUnits; ++i) { if (!hasAtIndex(i)) continue;
diff --git a/third_party/WebKit/Source/core/css/cssom/StyleCalcLength.h b/third_party/WebKit/Source/core/css/cssom/StyleCalcLength.h index d8a5fcf..491de69 100644 --- a/third_party/WebKit/Source/core/css/cssom/StyleCalcLength.h +++ b/third_party/WebKit/Source/core/css/cssom/StyleCalcLength.h
@@ -50,7 +50,7 @@ bool containsPercent() const override; - PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const override; + RawPtr<CSSValue> toCSSValue() const override; StyleValueType type() const override { return CalcLengthType; } protected:
diff --git a/third_party/WebKit/Source/core/css/cssom/StyleValue.h b/third_party/WebKit/Source/core/css/cssom/StyleValue.h index 726518b..6997319 100644 --- a/third_party/WebKit/Source/core/css/cssom/StyleValue.h +++ b/third_party/WebKit/Source/core/css/cssom/StyleValue.h
@@ -29,7 +29,7 @@ static ScriptValue parse(ScriptState*, const String& property, const String& cssText); - virtual PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const = 0; + virtual RawPtr<CSSValue> toCSSValue() const = 0; virtual String cssString() const { return toCSSValue()->cssText();
diff --git a/third_party/WebKit/Source/core/css/cssom/TransformComponent.h b/third_party/WebKit/Source/core/css/cssom/TransformComponent.h index 756a0ae..29affcf 100644 --- a/third_party/WebKit/Source/core/css/cssom/TransformComponent.h +++ b/third_party/WebKit/Source/core/css/cssom/TransformComponent.h
@@ -42,7 +42,7 @@ return toCSSValue()->cssText(); } - virtual PassRefPtrWillBeRawPtr<CSSFunctionValue> toCSSValue() const = 0; + virtual RawPtr<CSSFunctionValue> toCSSValue() const = 0; virtual MatrixTransformComponent* asMatrix() const = 0; DEFINE_INLINE_VIRTUAL_TRACE() { }
diff --git a/third_party/WebKit/Source/core/css/cssom/TransformValue.cpp b/third_party/WebKit/Source/core/css/cssom/TransformValue.cpp index 4efb569..bcc17bd 100644 --- a/third_party/WebKit/Source/core/css/cssom/TransformValue.cpp +++ b/third_party/WebKit/Source/core/css/cssom/TransformValue.cpp
@@ -54,9 +54,9 @@ return true; } -PassRefPtrWillBeRawPtr<CSSValue> TransformValue::toCSSValue() const +RawPtr<CSSValue> TransformValue::toCSSValue() const { - RefPtrWillBeRawPtr<CSSValueList> transformCSSValue = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> transformCSSValue = CSSValueList::createSpaceSeparated(); for (size_t i = 0; i < m_transformComponents.size(); i++) { transformCSSValue->append(m_transformComponents[i]->toCSSValue()); }
diff --git a/third_party/WebKit/Source/core/css/cssom/TransformValue.h b/third_party/WebKit/Source/core/css/cssom/TransformValue.h index bc5c00a1..993bd0a 100644 --- a/third_party/WebKit/Source/core/css/cssom/TransformValue.h +++ b/third_party/WebKit/Source/core/css/cssom/TransformValue.h
@@ -31,7 +31,7 @@ bool is2D() const; - PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const override; + RawPtr<CSSValue> toCSSValue() const override; StyleValueType type() const override { return TransformValueType; }
diff --git a/third_party/WebKit/Source/core/css/cssom/TranslationTransformComponent.cpp b/third_party/WebKit/Source/core/css/cssom/TranslationTransformComponent.cpp index 166be89..7cc1466 100644 --- a/third_party/WebKit/Source/core/css/cssom/TranslationTransformComponent.cpp +++ b/third_party/WebKit/Source/core/css/cssom/TranslationTransformComponent.cpp
@@ -19,9 +19,9 @@ return new TranslationTransformComponent(x, y, z); } -PassRefPtrWillBeRawPtr<CSSFunctionValue> TranslationTransformComponent::toCSSValue() const +RawPtr<CSSFunctionValue> TranslationTransformComponent::toCSSValue() const { - RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(is2D() ? CSSValueTranslate : CSSValueTranslate3d); + RawPtr<CSSFunctionValue> result = CSSFunctionValue::create(is2D() ? CSSValueTranslate : CSSValueTranslate3d); result->append(m_x->toCSSValue()); result->append(m_y->toCSSValue()); if (!is2D())
diff --git a/third_party/WebKit/Source/core/css/cssom/TranslationTransformComponent.h b/third_party/WebKit/Source/core/css/cssom/TranslationTransformComponent.h index 3531def2..3f62ea16 100644 --- a/third_party/WebKit/Source/core/css/cssom/TranslationTransformComponent.h +++ b/third_party/WebKit/Source/core/css/cssom/TranslationTransformComponent.h
@@ -31,7 +31,7 @@ // TODO: Implement asMatrix for TranslationTransformComponent. MatrixTransformComponent* asMatrix() const override { return nullptr; } - PassRefPtrWillBeRawPtr<CSSFunctionValue> toCSSValue() const override; + RawPtr<CSSFunctionValue> toCSSValue() const override; DEFINE_INLINE_VIRTUAL_TRACE() {
diff --git a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.h b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.h index e6c1f87..150f8a860 100644 --- a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.h +++ b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.h
@@ -128,7 +128,7 @@ RecursionData* m_data; }; - using PendingInvalidationMap = WillBeHeapHashMap<RawPtrWillBeMember<Element>, OwnPtr<PendingInvalidations>>; + using PendingInvalidationMap = HeapHashMap<Member<Element>, OwnPtr<PendingInvalidations>>; PendingInvalidations& ensurePendingInvalidations(Element&);
diff --git a/third_party/WebKit/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp b/third_party/WebKit/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp index ac2dba2..f78ba6e 100644 --- a/third_party/WebKit/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp +++ b/third_party/WebKit/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp
@@ -38,7 +38,7 @@ namespace blink { -StyleSheetInvalidationAnalysis::StyleSheetInvalidationAnalysis(const TreeScope& treeScope, const WillBeHeapVector<RawPtrWillBeMember<StyleSheetContents>>& sheets) +StyleSheetInvalidationAnalysis::StyleSheetInvalidationAnalysis(const TreeScope& treeScope, const HeapVector<Member<StyleSheetContents>>& sheets) : m_treeScope(&treeScope) { for (unsigned i = 0; i < sheets.size() && !m_dirtiesAllStyle; ++i) @@ -112,7 +112,7 @@ // See if all rules on the sheet are scoped to some specific ids or classes. // Then test if we actually have any of those in the tree at the moment. - const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>>& importRules = styleSheetContents->importRules(); + const HeapVector<Member<StyleRuleImport>>& importRules = styleSheetContents->importRules(); for (unsigned i = 0; i < importRules.size(); ++i) { if (!importRules[i]->styleSheet()) continue; @@ -124,7 +124,7 @@ if (m_treeScope->rootNode().isShadowRoot()) return; - const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& rules = styleSheetContents->childRules(); + const HeapVector<Member<StyleRuleBase>>& rules = styleSheetContents->childRules(); for (unsigned i = 0; i < rules.size(); i++) { StyleRuleBase* rule = rules[i].get(); if (!rule->isStyleRule()) {
diff --git a/third_party/WebKit/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.h b/third_party/WebKit/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.h index 02f165c2..9f877a5a 100644 --- a/third_party/WebKit/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.h +++ b/third_party/WebKit/Source/core/css/invalidation/StyleSheetInvalidationAnalysis.h
@@ -41,7 +41,7 @@ class StyleSheetInvalidationAnalysis { STACK_ALLOCATED(); public: - StyleSheetInvalidationAnalysis(const TreeScope&, const WillBeHeapVector<RawPtrWillBeMember<StyleSheetContents>>&); + StyleSheetInvalidationAnalysis(const TreeScope&, const HeapVector<Member<StyleSheetContents>>&); bool dirtiesAllStyle() const { return m_dirtiesAllStyle; } void invalidateStyle(); @@ -50,7 +50,7 @@ void analyzeStyleSheet(StyleSheetContents*); - RawPtrWillBeMember<const TreeScope> m_treeScope; + Member<const TreeScope> m_treeScope; HashSet<StringImpl*> m_idScopes; HashSet<StringImpl*> m_classScopes;
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSParser.cpp index 151f5cb..07522604 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
@@ -43,7 +43,7 @@ return CSSParserImpl::parsePageSelector(scope.tokenRange(), styleSheetContents); } -PassRefPtrWillBeRawPtr<StyleRuleBase> CSSParser::parseRule(const CSSParserContext& context, StyleSheetContents* styleSheet, const String& rule) +RawPtr<StyleRuleBase> CSSParser::parseRule(const CSSParserContext& context, StyleSheetContents* styleSheet, const String& rule) { return CSSParserImpl::parseRule(rule, context, styleSheet, CSSParserImpl::AllowImportRules); } @@ -64,7 +64,7 @@ return false; CSSPropertyID resolvedProperty = resolveCSSPropertyID(unresolvedProperty); CSSParserMode parserMode = declaration->cssParserMode(); - RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(resolvedProperty, string, parserMode); + RawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(resolvedProperty, string, parserMode); if (value) return declaration->setProperty(CSSProperty(resolvedProperty, value.release(), important)); CSSParserContext context(parserMode, 0); @@ -89,7 +89,7 @@ return CSSParserImpl::parseVariableValue(declaration, propertyName, value, important, context); } -PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> CSSParser::parseCustomPropertySet(CSSParserTokenRange range) +RawPtr<ImmutableStylePropertySet> CSSParser::parseCustomPropertySet(CSSParserTokenRange range) { return CSSParserImpl::parseCustomPropertySet(range); } @@ -99,17 +99,17 @@ return CSSParserImpl::parseValue(declaration, unresolvedProperty, string, important, context); } -PassRefPtrWillBeRawPtr<CSSValue> CSSParser::parseSingleValue(CSSPropertyID propertyID, const String& string, const CSSParserContext& context) +RawPtr<CSSValue> CSSParser::parseSingleValue(CSSPropertyID propertyID, const String& string, const CSSParserContext& context) { if (string.isEmpty()) return nullptr; - if (RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(propertyID, string, context.mode())) + if (RawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(propertyID, string, context.mode())) return value; CSSTokenizer::Scope scope(string); return CSSPropertyParser::parseSingleValue(propertyID, scope.tokenRange(), context); } -PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> CSSParser::parseInlineStyleDeclaration(const String& styleString, Element* element) +RawPtr<ImmutableStylePropertySet> CSSParser::parseInlineStyleDeclaration(const String& styleString, Element* element) { return CSSParserImpl::parseInlineStyleDeclaration(styleString, element); } @@ -119,9 +119,9 @@ return CSSParserImpl::parseKeyframeKeyList(keyList); } -PassRefPtrWillBeRawPtr<StyleRuleKeyframe> CSSParser::parseKeyframeRule(const CSSParserContext& context, const String& rule) +RawPtr<StyleRuleKeyframe> CSSParser::parseKeyframeRule(const CSSParserContext& context, const String& rule) { - RefPtrWillBeRawPtr<StyleRuleBase> keyframe = CSSParserImpl::parseRule(rule, context, nullptr, CSSParserImpl::KeyframeRules); + RawPtr<StyleRuleBase> keyframe = CSSParserImpl::parseRule(rule, context, nullptr, CSSParserImpl::KeyframeRules); return toStyleRuleKeyframe(keyframe.get()); } @@ -145,7 +145,7 @@ return true; } - RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::parseColor(string, strict ? HTMLStandardMode : HTMLQuirksMode); + RawPtr<CSSValue> value = CSSParserFastPaths::parseColor(string, strict ? HTMLStandardMode : HTMLQuirksMode); // TODO(timloh): Why is this always strict mode? if (!value) value = parseSingleValue(CSSPropertyColor, string, strictCSSParserContext()); @@ -168,7 +168,7 @@ return true; } -PassRefPtrWillBeRawPtr<CSSValue> CSSParser::parseFontFaceDescriptor(CSSPropertyID propertyID, const String& propertyValue, const CSSParserContext& context) +RawPtr<CSSValue> CSSParser::parseFontFaceDescriptor(CSSPropertyID propertyID, const String& propertyValue, const CSSParserContext& context) { StringBuilder builder; builder.appendLiteral("@font-face { "); @@ -176,7 +176,7 @@ builder.appendLiteral(" : "); builder.append(propertyValue); builder.appendLiteral("; }"); - RefPtrWillBeRawPtr<StyleRuleBase> rule = parseRule(context, nullptr, builder.toString()); + RawPtr<StyleRuleBase> rule = parseRule(context, nullptr, builder.toString()); if (!rule || !rule->isFontFaceRule()) return nullptr; return toStyleRuleFontFace(rule.get())->properties().getPropertyCSSValue(propertyID);
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParser.h b/third_party/WebKit/Source/core/css/parser/CSSParser.h index 1809796..af98f80 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParser.h +++ b/third_party/WebKit/Source/core/css/parser/CSSParser.h
@@ -29,7 +29,7 @@ STATIC_ONLY(CSSParser); public: // As well as regular rules, allows @import and @namespace but not @charset - static PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(const CSSParserContext&, StyleSheetContents*, const String&); + static RawPtr<StyleRuleBase> parseRule(const CSSParserContext&, StyleSheetContents*, const String&); static void parseSheet(const CSSParserContext&, StyleSheetContents*, const String&); static CSSSelectorList parseSelector(const CSSParserContext&, StyleSheetContents*, const String&); static CSSSelectorList parsePageSelector(const CSSParserContext&, StyleSheetContents*, const String&); @@ -38,17 +38,17 @@ static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedProperty, const String&, bool important, StyleSheetContents*); static bool parseValueForCustomProperty(MutableStylePropertySet*, const AtomicString& propertyName, const String& value, bool important, StyleSheetContents*); - static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseCustomPropertySet(CSSParserTokenRange); + static RawPtr<ImmutableStylePropertySet> parseCustomPropertySet(CSSParserTokenRange); // This is for non-shorthands only - static PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID, const String&, const CSSParserContext& = strictCSSParserContext()); + static RawPtr<CSSValue> parseSingleValue(CSSPropertyID, const String&, const CSSParserContext& = strictCSSParserContext()); - static PassRefPtrWillBeRawPtr<CSSValue> parseFontFaceDescriptor(CSSPropertyID, const String&, const CSSParserContext&); + static RawPtr<CSSValue> parseFontFaceDescriptor(CSSPropertyID, const String&, const CSSParserContext&); - static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(const String&, Element*); + static RawPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(const String&, Element*); static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&); - static PassRefPtrWillBeRawPtr<StyleRuleKeyframe> parseKeyframeRule(const CSSParserContext&, const String&); + static RawPtr<StyleRuleKeyframe> parseKeyframeRule(const CSSParserContext&, const String&); static bool parseSupportsCondition(const String&);
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp index c15a16a9..708f4e2 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
@@ -86,7 +86,7 @@ return ok && CSSPropertyParser::isValidNumericValue(number); } -static PassRefPtrWillBeRawPtr<CSSValue> parseSimpleLengthValue(CSSPropertyID propertyId, const String& string, CSSParserMode cssParserMode) +static RawPtr<CSSValue> parseSimpleLengthValue(CSSPropertyID propertyId, const String& string, CSSParserMode cssParserMode) { ASSERT(!string.isEmpty()); bool acceptsNegativeNumbers = false; @@ -437,7 +437,7 @@ return false; } -PassRefPtrWillBeRawPtr<CSSValue> CSSParserFastPaths::parseColor(const String& string, CSSParserMode parserMode) +RawPtr<CSSValue> CSSParserFastPaths::parseColor(const String& string, CSSParserMode parserMode) { ASSERT(!string.isEmpty()); CSSParserString cssString; @@ -830,7 +830,7 @@ } } -static PassRefPtrWillBeRawPtr<CSSValue> parseKeywordValue(CSSPropertyID propertyId, const String& string) +static RawPtr<CSSValue> parseKeywordValue(CSSPropertyID propertyId, const String& string) { ASSERT(!string.isEmpty()); @@ -902,7 +902,7 @@ } template <typename CharType> -static PassRefPtrWillBeRawPtr<CSSFunctionValue> parseSimpleTransformValue(CharType*& pos, CharType* end) +static RawPtr<CSSFunctionValue> parseSimpleTransformValue(CharType*& pos, CharType* end) { static const int shortestValidTransformStringLength = 12; @@ -942,7 +942,7 @@ return nullptr; } pos += argumentStart; - RefPtrWillBeRawPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(transformType); + RawPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(transformType); if (!parseTransformTranslateArguments(pos, end, expectedArgumentCount, transformValue.get())) return nullptr; return transformValue.release(); @@ -960,7 +960,7 @@ if (isMatrix3d) { pos += 9; - RefPtrWillBeRawPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(CSSValueMatrix3d); + RawPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(CSSValueMatrix3d); if (!parseTransformNumberArguments(pos, end, 16, transformValue.get())) return nullptr; return transformValue.release(); @@ -977,7 +977,7 @@ if (isScale3d) { pos += 8; - RefPtrWillBeRawPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(CSSValueScale3d); + RawPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(CSSValueScale3d); if (!parseTransformNumberArguments(pos, end, 3, transformValue.get())) return nullptr; return transformValue.release(); @@ -987,13 +987,13 @@ } template <typename CharType> -static PassRefPtrWillBeRawPtr<CSSValueList> parseSimpleTransformList(CharType*& pos, CharType* end) +static RawPtr<CSSValueList> parseSimpleTransformList(CharType*& pos, CharType* end) { - RefPtrWillBeRawPtr<CSSValueList> transformList = nullptr; + RawPtr<CSSValueList> transformList = nullptr; while (pos < end) { while (pos < end && isCSSSpace(*pos)) ++pos; - RefPtrWillBeRawPtr<CSSFunctionValue> transformValue = parseSimpleTransformValue(pos, end); + RawPtr<CSSFunctionValue> transformValue = parseSimpleTransformValue(pos, end); if (!transformValue) return nullptr; if (!transformList) @@ -1007,7 +1007,7 @@ return transformList.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> parseSimpleTransform(CSSPropertyID propertyID, const String& string) +static RawPtr<CSSValue> parseSimpleTransform(CSSPropertyID propertyID, const String& string) { ASSERT(!string.isEmpty()); @@ -1023,15 +1023,15 @@ return parseSimpleTransformList(pos, end); } -PassRefPtrWillBeRawPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, CSSParserMode parserMode) +RawPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, CSSParserMode parserMode) { - if (RefPtrWillBeRawPtr<CSSValue> length = parseSimpleLengthValue(propertyID, string, parserMode)) + if (RawPtr<CSSValue> length = parseSimpleLengthValue(propertyID, string, parserMode)) return length.release(); if (isColorPropertyID(propertyID)) return parseColor(string, parserMode); - if (RefPtrWillBeRawPtr<CSSValue> keyword = parseKeywordValue(propertyID, string)) + if (RawPtr<CSSValue> keyword = parseKeywordValue(propertyID, string)) return keyword.release(); - if (RefPtrWillBeRawPtr<CSSValue> transform = parseSimpleTransform(propertyID, string)) + if (RawPtr<CSSValue> transform = parseSimpleTransform(propertyID, string)) return transform.release(); return nullptr; }
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.h b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.h index 7ae1018c..5d43a5c 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.h +++ b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.h
@@ -21,13 +21,13 @@ public: // Parses simple values like '10px' or 'green', but makes no guarantees // about handling any property completely. - static PassRefPtrWillBeRawPtr<CSSValue> maybeParseValue(CSSPropertyID, const String&, CSSParserMode); + static RawPtr<CSSValue> maybeParseValue(CSSPropertyID, const String&, CSSParserMode); // Properties handled here shouldn't be explicitly handled in CSSPropertyParser static bool isKeywordPropertyID(CSSPropertyID); static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID); - static PassRefPtrWillBeRawPtr<CSSValue> parseColor(const String&, CSSParserMode); + static RawPtr<CSSValue> parseColor(const String&, CSSParserMode); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp index 6004ec7..39d71f3c 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
@@ -62,7 +62,7 @@ return declaration->addParsedProperties(parser.m_parsedProperties); } -static inline void filterProperties(bool important, const WillBeHeapVector<CSSProperty, 256>& input, WillBeHeapVector<CSSProperty, 256>& output, size_t& unusedEntries, BitArray<numCSSProperties>& seenProperties, HashSet<AtomicString>& seenCustomProperties) +static inline void filterProperties(bool important, const HeapVector<CSSProperty, 256>& input, HeapVector<CSSProperty, 256>& output, size_t& unusedEntries, BitArray<numCSSProperties>& seenProperties, HashSet<AtomicString>& seenCustomProperties) { // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found. for (size_t i = input.size(); i--; ) { @@ -87,22 +87,22 @@ } } -static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> createStylePropertySet(WillBeHeapVector<CSSProperty, 256>& parsedProperties, CSSParserMode mode) +static RawPtr<ImmutableStylePropertySet> createStylePropertySet(HeapVector<CSSProperty, 256>& parsedProperties, CSSParserMode mode) { BitArray<numCSSProperties> seenProperties; size_t unusedEntries = parsedProperties.size(); - WillBeHeapVector<CSSProperty, 256> results(unusedEntries); + HeapVector<CSSProperty, 256> results(unusedEntries); HashSet<AtomicString> seenCustomProperties; filterProperties(true, parsedProperties, results, unusedEntries, seenProperties, seenCustomProperties); filterProperties(false, parsedProperties, results, unusedEntries, seenProperties, seenCustomProperties); - RefPtrWillBeRawPtr<ImmutableStylePropertySet> result = ImmutableStylePropertySet::create(results.data() + unusedEntries, results.size() - unusedEntries, mode); + RawPtr<ImmutableStylePropertySet> result = ImmutableStylePropertySet::create(results.data() + unusedEntries, results.size() - unusedEntries, mode); parsedProperties.clear(); return result.release(); } -PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> CSSParserImpl::parseInlineStyleDeclaration(const String& string, Element* element) +RawPtr<ImmutableStylePropertySet> CSSParserImpl::parseInlineStyleDeclaration(const String& string, Element* element) { Document& document = element->document(); CSSParserContext context = CSSParserContext(document.elementSheet().contents()->parserContext(), UseCounter::getFrom(&document)); @@ -127,7 +127,7 @@ BitArray<numCSSProperties> seenProperties; size_t unusedEntries = parser.m_parsedProperties.size(); - WillBeHeapVector<CSSProperty, 256> results(unusedEntries); + HeapVector<CSSProperty, 256> results(unusedEntries); HashSet<AtomicString> seenCustomProperties; filterProperties(true, parser.m_parsedProperties, results, unusedEntries, seenProperties, seenCustomProperties); filterProperties(false, parser.m_parsedProperties, results, unusedEntries, seenProperties, seenCustomProperties); @@ -136,7 +136,7 @@ return declaration->addParsedProperties(results); } -PassRefPtrWillBeRawPtr<StyleRuleBase> CSSParserImpl::parseRule(const String& string, const CSSParserContext& context, StyleSheetContents* styleSheet, AllowedRulesType allowedRules) +RawPtr<StyleRuleBase> CSSParserImpl::parseRule(const String& string, const CSSParserContext& context, StyleSheetContents* styleSheet, AllowedRulesType allowedRules) { CSSParserImpl parser(context, styleSheet); CSSTokenizer::Scope scope(string); @@ -144,7 +144,7 @@ range.consumeWhitespace(); if (range.atEnd()) return nullptr; // Parse error, empty rule - RefPtrWillBeRawPtr<StyleRuleBase> rule; + RawPtr<StyleRuleBase> rule; if (range.peek().type() == AtKeywordToken) rule = parser.consumeAtRule(range, allowedRules); else @@ -170,7 +170,7 @@ TRACE_EVENT_BEGIN0("blink,blink_style", "CSSParserImpl::parseStyleSheet.parse"); CSSParserImpl parser(context, styleSheet); - bool firstRuleValid = parser.consumeRuleList(scope.tokenRange(), TopLevelRuleList, [&styleSheet](PassRefPtrWillBeRawPtr<StyleRuleBase> rule) { + bool firstRuleValid = parser.consumeRuleList(scope.tokenRange(), TopLevelRuleList, [&styleSheet](RawPtr<StyleRuleBase> rule) { if (rule->isCharsetRule()) return; styleSheet->parserAppendRule(rule); @@ -227,7 +227,7 @@ return selectorList; } -PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> CSSParserImpl::parseCustomPropertySet(CSSParserTokenRange range) +RawPtr<ImmutableStylePropertySet> CSSParserImpl::parseCustomPropertySet(CSSParserTokenRange range) { range.consumeWhitespace(); if (range.peek().type() != LeftBraceToken) @@ -280,7 +280,7 @@ CSSParserObserverWrapper wrapper(observer); parser.m_observerWrapper = &wrapper; CSSTokenizer::Scope scope(string, wrapper); - bool firstRuleValid = parser.consumeRuleList(scope.tokenRange(), TopLevelRuleList, [&styleSheet](PassRefPtrWillBeRawPtr<StyleRuleBase> rule) { + bool firstRuleValid = parser.consumeRuleList(scope.tokenRange(), TopLevelRuleList, [&styleSheet](RawPtr<StyleRuleBase> rule) { if (rule->isCharsetRule()) return; styleSheet->parserAppendRule(rule); @@ -321,7 +321,7 @@ bool seenRule = false; bool firstRuleValid = false; while (!range.atEnd()) { - RefPtrWillBeRawPtr<StyleRuleBase> rule; + RawPtr<StyleRuleBase> rule; switch (range.peek().type()) { case WhitespaceToken: range.consumeWhitespace(); @@ -353,7 +353,7 @@ return firstRuleValid; } -PassRefPtrWillBeRawPtr<StyleRuleBase> CSSParserImpl::consumeAtRule(CSSParserTokenRange& range, AllowedRulesType allowedRules) +RawPtr<StyleRuleBase> CSSParserImpl::consumeAtRule(CSSParserTokenRange& range, AllowedRulesType allowedRules) { ASSERT(range.peek().type() == AtKeywordToken); const CSSParserString& name = range.consume().value(); @@ -409,7 +409,7 @@ } } -PassRefPtrWillBeRawPtr<StyleRuleBase> CSSParserImpl::consumeQualifiedRule(CSSParserTokenRange& range, AllowedRulesType allowedRules) +RawPtr<StyleRuleBase> CSSParserImpl::consumeQualifiedRule(CSSParserTokenRange& range, AllowedRulesType allowedRules) { const CSSParserToken* preludeStart = &range.peek(); while (!range.atEnd() && range.peek().type() != LeftBraceToken) @@ -449,7 +449,7 @@ return uri.value(); } -PassRefPtrWillBeRawPtr<StyleRuleCharset> CSSParserImpl::consumeCharsetRule(CSSParserTokenRange prelude) +RawPtr<StyleRuleCharset> CSSParserImpl::consumeCharsetRule(CSSParserTokenRange prelude) { prelude.consumeWhitespace(); const CSSParserToken& string = prelude.consumeIncludingWhitespace(); @@ -458,7 +458,7 @@ return StyleRuleCharset::create(); } -PassRefPtrWillBeRawPtr<StyleRuleImport> CSSParserImpl::consumeImportRule(CSSParserTokenRange prelude) +RawPtr<StyleRuleImport> CSSParserImpl::consumeImportRule(CSSParserTokenRange prelude) { prelude.consumeWhitespace(); AtomicString uri(consumeStringOrURI(prelude)); @@ -476,7 +476,7 @@ return StyleRuleImport::create(uri, MediaQueryParser::parseMediaQuerySet(prelude)); } -PassRefPtrWillBeRawPtr<StyleRuleNamespace> CSSParserImpl::consumeNamespaceRule(CSSParserTokenRange prelude) +RawPtr<StyleRuleNamespace> CSSParserImpl::consumeNamespaceRule(CSSParserTokenRange prelude) { prelude.consumeWhitespace(); AtomicString namespacePrefix; @@ -491,9 +491,9 @@ return StyleRuleNamespace::create(namespacePrefix, uri); } -PassRefPtrWillBeRawPtr<StyleRuleMedia> CSSParserImpl::consumeMediaRule(CSSParserTokenRange prelude, CSSParserTokenRange block) +RawPtr<StyleRuleMedia> CSSParserImpl::consumeMediaRule(CSSParserTokenRange prelude, CSSParserTokenRange block) { - WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> rules; + HeapVector<Member<StyleRuleBase>> rules; if (m_observerWrapper) { CSSParserTokenRange preludeWithoutWhitespace = prelude; @@ -503,7 +503,7 @@ m_observerWrapper->observer().startRuleBody(m_observerWrapper->previousTokenStartOffset(block)); } - consumeRuleList(block, RegularRuleList, [&rules](PassRefPtrWillBeRawPtr<StyleRuleBase> rule) { + consumeRuleList(block, RegularRuleList, [&rules](RawPtr<StyleRuleBase> rule) { rules.append(rule); }); @@ -513,7 +513,7 @@ return StyleRuleMedia::create(MediaQueryParser::parseMediaQuerySet(prelude), rules); } -PassRefPtrWillBeRawPtr<StyleRuleSupports> CSSParserImpl::consumeSupportsRule(CSSParserTokenRange prelude, CSSParserTokenRange block) +RawPtr<StyleRuleSupports> CSSParserImpl::consumeSupportsRule(CSSParserTokenRange prelude, CSSParserTokenRange block) { CSSSupportsParser::SupportsResult supported = CSSSupportsParser::supportsCondition(prelude, *this); if (supported == CSSSupportsParser::Invalid) @@ -525,8 +525,8 @@ m_observerWrapper->observer().startRuleBody(m_observerWrapper->previousTokenStartOffset(block)); } - WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> rules; - consumeRuleList(block, RegularRuleList, [&rules](PassRefPtrWillBeRawPtr<StyleRuleBase> rule) { + HeapVector<Member<StyleRuleBase>> rules; + consumeRuleList(block, RegularRuleList, [&rules](RawPtr<StyleRuleBase> rule) { rules.append(rule); }); @@ -536,7 +536,7 @@ return StyleRuleSupports::create(prelude.serialize().stripWhiteSpace(), supported, rules); } -PassRefPtrWillBeRawPtr<StyleRuleViewport> CSSParserImpl::consumeViewportRule(CSSParserTokenRange prelude, CSSParserTokenRange block) +RawPtr<StyleRuleViewport> CSSParserImpl::consumeViewportRule(CSSParserTokenRange prelude, CSSParserTokenRange block) { // Allow @viewport rules from UA stylesheets even if the feature is disabled. if (!RuntimeEnabledFeatures::cssViewportEnabled() && !isUASheetBehavior(m_context.mode())) @@ -558,7 +558,7 @@ return StyleRuleViewport::create(createStylePropertySet(m_parsedProperties, CSSViewportRuleMode)); } -PassRefPtrWillBeRawPtr<StyleRuleFontFace> CSSParserImpl::consumeFontFaceRule(CSSParserTokenRange prelude, CSSParserTokenRange block) +RawPtr<StyleRuleFontFace> CSSParserImpl::consumeFontFaceRule(CSSParserTokenRange prelude, CSSParserTokenRange block) { prelude.consumeWhitespace(); if (!prelude.atEnd()) @@ -579,7 +579,7 @@ return StyleRuleFontFace::create(createStylePropertySet(m_parsedProperties, m_context.mode())); } -PassRefPtrWillBeRawPtr<StyleRuleKeyframes> CSSParserImpl::consumeKeyframesRule(bool webkitPrefixed, CSSParserTokenRange prelude, CSSParserTokenRange block) +RawPtr<StyleRuleKeyframes> CSSParserImpl::consumeKeyframesRule(bool webkitPrefixed, CSSParserTokenRange prelude, CSSParserTokenRange block) { prelude.consumeWhitespace(); CSSParserTokenRange rangeCopy = prelude; // For inspector callbacks @@ -605,8 +605,8 @@ m_observerWrapper->observer().endRuleBody(m_observerWrapper->endOffset(block)); } - RefPtrWillBeRawPtr<StyleRuleKeyframes> keyframeRule = StyleRuleKeyframes::create(); - consumeRuleList(block, KeyframesRuleList, [keyframeRule](PassRefPtrWillBeRawPtr<StyleRuleBase> keyframe) { + RawPtr<StyleRuleKeyframes> keyframeRule = StyleRuleKeyframes::create(); + consumeRuleList(block, KeyframesRuleList, [keyframeRule](RawPtr<StyleRuleBase> keyframe) { keyframeRule->parserAppendKeyframe(toStyleRuleKeyframe(keyframe.get())); }); keyframeRule->setName(name); @@ -614,7 +614,7 @@ return keyframeRule.release(); } -PassRefPtrWillBeRawPtr<StyleRulePage> CSSParserImpl::consumePageRule(CSSParserTokenRange prelude, CSSParserTokenRange block) +RawPtr<StyleRulePage> CSSParserImpl::consumePageRule(CSSParserTokenRange prelude, CSSParserTokenRange block) { CSSSelectorList selectorList = parsePageSelector(prelude, m_styleSheet); if (!selectorList.isValid()) @@ -644,7 +644,7 @@ CSSCustomIdentValue::create(ident.value()))); } -PassRefPtrWillBeRawPtr<StyleRuleKeyframe> CSSParserImpl::consumeKeyframeStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block) +RawPtr<StyleRuleKeyframe> CSSParserImpl::consumeKeyframeStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block) { OwnPtr<Vector<double>> keyList = consumeKeyframeKeyList(prelude); if (!keyList) @@ -680,7 +680,7 @@ } -PassRefPtrWillBeRawPtr<StyleRule> CSSParserImpl::consumeStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block) +RawPtr<StyleRule> CSSParserImpl::consumeStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block) { CSSSelectorList selectorList = CSSSelectorParser::parseSelector(prelude, m_context, m_styleSheet); if (!selectorList.isValid()) @@ -727,7 +727,7 @@ } case AtKeywordToken: { AllowedRulesType allowedRules = ruleType == StyleRule::Style && RuntimeEnabledFeatures::cssApplyAtRulesEnabled() ? ApplyRules : NoRules; - RefPtrWillBeRawPtr<StyleRuleBase> rule = consumeAtRule(range, allowedRules); + RawPtr<StyleRuleBase> rule = consumeAtRule(range, allowedRules); ASSERT_UNUSED(rule, !rule); break; } @@ -794,7 +794,7 @@ void CSSParserImpl::consumeVariableValue(CSSParserTokenRange range, const AtomicString& variableName, bool important) { - if (RefPtrWillBeRawPtr<CSSCustomPropertyDeclaration> value = CSSVariableParser::parseDeclarationValue(variableName, range)) + if (RawPtr<CSSCustomPropertyDeclaration> value = CSSVariableParser::parseDeclarationValue(variableName, range)) m_parsedProperties.append(CSSProperty(CSSPropertyVariable, value.release(), important)); }
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h index c3b696d..71b8fb14 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h +++ b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h
@@ -57,13 +57,13 @@ static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String&, bool important, const CSSParserContext&); static bool parseVariableValue(MutableStylePropertySet*, const AtomicString& propertyName, const String&, bool important, const CSSParserContext&); - static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(const String&, Element*); + static RawPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(const String&, Element*); static bool parseDeclarationList(MutableStylePropertySet*, const String&, const CSSParserContext&); - static PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(const String&, const CSSParserContext&, StyleSheetContents*, AllowedRulesType); + static RawPtr<StyleRuleBase> parseRule(const String&, const CSSParserContext&, StyleSheetContents*, AllowedRulesType); static void parseStyleSheet(const String&, const CSSParserContext&, StyleSheetContents*); static CSSSelectorList parsePageSelector(CSSParserTokenRange, StyleSheetContents*); - static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseCustomPropertySet(CSSParserTokenRange); + static RawPtr<ImmutableStylePropertySet> parseCustomPropertySet(CSSParserTokenRange); static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&); @@ -84,23 +84,23 @@ bool consumeRuleList(CSSParserTokenRange, RuleListType, T callback); // These two functions update the range they're given - PassRefPtrWillBeRawPtr<StyleRuleBase> consumeAtRule(CSSParserTokenRange&, AllowedRulesType); - PassRefPtrWillBeRawPtr<StyleRuleBase> consumeQualifiedRule(CSSParserTokenRange&, AllowedRulesType); + RawPtr<StyleRuleBase> consumeAtRule(CSSParserTokenRange&, AllowedRulesType); + RawPtr<StyleRuleBase> consumeQualifiedRule(CSSParserTokenRange&, AllowedRulesType); - static PassRefPtrWillBeRawPtr<StyleRuleCharset> consumeCharsetRule(CSSParserTokenRange prelude); - PassRefPtrWillBeRawPtr<StyleRuleImport> consumeImportRule(CSSParserTokenRange prelude); - PassRefPtrWillBeRawPtr<StyleRuleNamespace> consumeNamespaceRule(CSSParserTokenRange prelude); - PassRefPtrWillBeRawPtr<StyleRuleMedia> consumeMediaRule(CSSParserTokenRange prelude, CSSParserTokenRange block); - PassRefPtrWillBeRawPtr<StyleRuleSupports> consumeSupportsRule(CSSParserTokenRange prelude, CSSParserTokenRange block); - PassRefPtrWillBeRawPtr<StyleRuleViewport> consumeViewportRule(CSSParserTokenRange prelude, CSSParserTokenRange block); - PassRefPtrWillBeRawPtr<StyleRuleFontFace> consumeFontFaceRule(CSSParserTokenRange prelude, CSSParserTokenRange block); - PassRefPtrWillBeRawPtr<StyleRuleKeyframes> consumeKeyframesRule(bool webkitPrefixed, CSSParserTokenRange prelude, CSSParserTokenRange block); - PassRefPtrWillBeRawPtr<StyleRulePage> consumePageRule(CSSParserTokenRange prelude, CSSParserTokenRange block); + static RawPtr<StyleRuleCharset> consumeCharsetRule(CSSParserTokenRange prelude); + RawPtr<StyleRuleImport> consumeImportRule(CSSParserTokenRange prelude); + RawPtr<StyleRuleNamespace> consumeNamespaceRule(CSSParserTokenRange prelude); + RawPtr<StyleRuleMedia> consumeMediaRule(CSSParserTokenRange prelude, CSSParserTokenRange block); + RawPtr<StyleRuleSupports> consumeSupportsRule(CSSParserTokenRange prelude, CSSParserTokenRange block); + RawPtr<StyleRuleViewport> consumeViewportRule(CSSParserTokenRange prelude, CSSParserTokenRange block); + RawPtr<StyleRuleFontFace> consumeFontFaceRule(CSSParserTokenRange prelude, CSSParserTokenRange block); + RawPtr<StyleRuleKeyframes> consumeKeyframesRule(bool webkitPrefixed, CSSParserTokenRange prelude, CSSParserTokenRange block); + RawPtr<StyleRulePage> consumePageRule(CSSParserTokenRange prelude, CSSParserTokenRange block); // Updates m_parsedProperties void consumeApplyRule(CSSParserTokenRange prelude); - PassRefPtrWillBeRawPtr<StyleRuleKeyframe> consumeKeyframeStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block); - PassRefPtrWillBeRawPtr<StyleRule> consumeStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block); + RawPtr<StyleRuleKeyframe> consumeKeyframeStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block); + RawPtr<StyleRule> consumeStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block); void consumeDeclarationList(CSSParserTokenRange, StyleRule::RuleType); void consumeDeclaration(CSSParserTokenRange, StyleRule::RuleType); @@ -111,10 +111,10 @@ // FIXME: Can we build StylePropertySets directly? // FIXME: Investigate using a smaller inline buffer - WillBeHeapVector<CSSProperty, 256> m_parsedProperties; + HeapVector<CSSProperty, 256> m_parsedProperties; CSSParserContext m_context; - RawPtrWillBeMember<StyleSheetContents> m_styleSheet; + Member<StyleSheetContents> m_styleSheet; // For the inspector CSSParserObserverWrapper* m_observerWrapper;
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp index 715afc2..3dc334d 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -49,7 +49,7 @@ using namespace CSSPropertyParserHelpers; CSSPropertyParser::CSSPropertyParser(const CSSParserTokenRange& range, - const CSSParserContext& context, WillBeHeapVector<CSSProperty, 256>* parsedProperties) + const CSSParserContext& context, HeapVector<CSSProperty, 256>* parsedProperties) : m_range(range) , m_context(context) , m_parsedProperties(parsedProperties) @@ -72,7 +72,7 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool important, const CSSParserTokenRange& range, const CSSParserContext& context, - WillBeHeapVector<CSSProperty, 256>& parsedProperties, StyleRule::RuleType ruleType) + HeapVector<CSSProperty, 256>& parsedProperties, StyleRule::RuleType ruleType) { if (hasInvalidNumericValues(range)) return false; @@ -101,13 +101,13 @@ return parseSuccess; } -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue( +RawPtr<CSSValue> CSSPropertyParser::parseSingleValue( CSSPropertyID property, const CSSParserTokenRange& range, const CSSParserContext& context) { if (hasInvalidNumericValues(range)) return nullptr; CSSPropertyParser parser(range, context, nullptr); - RefPtrWillBeRawPtr<CSSValue> value = parser.parseSingleValue(property); + RawPtr<CSSValue> value = parser.parseSingleValue(property); if (!value || !parser.m_range.atEnd()) return nullptr; return value.release(); @@ -132,7 +132,7 @@ if (parseShorthand(unresolvedProperty, important)) return true; } else { - if (RefPtrWillBeRawPtr<CSSValue> parsedValue = parseSingleValue(unresolvedProperty)) { + if (RawPtr<CSSValue> parsedValue = parseSingleValue(unresolvedProperty)) { if (m_range.atEnd()) { addProperty(propertyId, parsedValue.release(), important); return true; @@ -142,7 +142,7 @@ if (RuntimeEnabledFeatures::cssVariablesEnabled() && CSSVariableParser::containsValidVariableReferences(originalRange)) { // We don't expand the shorthand here because crazypants. - RefPtrWillBeRawPtr<CSSVariableReferenceValue> variable = CSSVariableReferenceValue::create(CSSVariableData::create(originalRange)); + RawPtr<CSSVariableReferenceValue> variable = CSSVariableReferenceValue::create(CSSVariableData::create(originalRange)); addProperty(propertyId, variable.release(), important); return true; } @@ -266,7 +266,7 @@ if (!rangeCopy.atEnd()) return false; - RefPtrWillBeRawPtr<CSSValue> value = nullptr; + RawPtr<CSSValue> value = nullptr; if (id == CSSValueInitial) value = cssValuePool().createExplicitInitialValue(); else if (id == CSSValueInherit) @@ -281,15 +281,15 @@ return true; } -static PassRefPtrWillBeRawPtr<CSSValueList> consumeTransformOrigin(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) +static RawPtr<CSSValueList> consumeTransformOrigin(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) { - RefPtrWillBeRawPtr<CSSValue> resultX = nullptr; - RefPtrWillBeRawPtr<CSSValue> resultY = nullptr; + RawPtr<CSSValue> resultX = nullptr; + RawPtr<CSSValue> resultY = nullptr; if (consumeOneOrTwoValuedPosition(range, cssParserMode, unitless, resultX, resultY)) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(resultX.release()); list->append(resultY.release()); - RefPtrWillBeRawPtr<CSSValue> resultZ = consumeLength(range, cssParserMode, ValueRangeAll); + RawPtr<CSSValue> resultZ = consumeLength(range, cssParserMode, ValueRangeAll); if (!resultZ) resultZ = cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Pixels); list->append(resultZ.release()); @@ -299,12 +299,12 @@ } // Methods for consuming non-shorthand properties starts here. -static PassRefPtrWillBeRawPtr<CSSValue> consumeWillChange(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeWillChange(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueAuto) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> values = CSSValueList::createCommaSeparated(); // Every comma-separated list of identifiers is a valid will-change value, // unless the list includes an explicitly disallowed identifier. while (true) { @@ -347,7 +347,7 @@ return values.release(); } -static PassRefPtrWillBeRawPtr<CSSFontFeatureValue> consumeFontFeatureTag(CSSParserTokenRange& range) +static RawPtr<CSSFontFeatureValue> consumeFontFeatureTag(CSSParserTokenRange& range) { // Feature tag name consists of 4-letter characters. static const unsigned tagNameLength = 4; @@ -378,13 +378,13 @@ return CSSFontFeatureValue::create(tag, tagValue); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeFontFeatureSettings(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeFontFeatureSettings(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueNormal) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> settings = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> settings = CSSValueList::createCommaSeparated(); do { - RefPtrWillBeRawPtr<CSSFontFeatureValue> fontFeatureValue = consumeFontFeatureTag(range); + RawPtr<CSSFontFeatureValue> fontFeatureValue = consumeFontFeatureTag(range); if (!fontFeatureValue) return nullptr; settings->append(fontFeatureValue); @@ -392,20 +392,20 @@ return settings.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumePage(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumePage(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueAuto) return consumeIdent(range); return consumeCustomIdent(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeQuotes(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeQuotes(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); while (!range.atEnd()) { - RefPtrWillBeRawPtr<CSSStringValue> parsedValue = consumeString(range); + RawPtr<CSSStringValue> parsedValue = consumeString(range); if (!parsedValue) return nullptr; values->append(parsedValue.release()); @@ -415,18 +415,18 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeWebkitHighlight(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeWebkitHighlight(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); return consumeString(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeFontVariantLigatures(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeFontVariantLigatures(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueNormal) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> ligatureValues = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> ligatureValues = CSSValueList::createSpaceSeparated(); bool sawCommonLigaturesValue = false; bool sawDiscretionaryLigaturesValue = false; bool sawHistoricalLigaturesValue = false; @@ -467,14 +467,14 @@ return ligatureValues.release(); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeFontVariant(CSSParserTokenRange& range) +static RawPtr<CSSPrimitiveValue> consumeFontVariant(CSSParserTokenRange& range) { return consumeIdent<CSSValueNormal, CSSValueSmallCaps>(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeFontVariantList(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeFontVariantList(CSSParserTokenRange& range) { - RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> values = CSSValueList::createCommaSeparated(); do { if (range.peek().id() == CSSValueAll) { // FIXME: CSSPropertyParser::parseFontVariant() implements @@ -485,7 +485,7 @@ return nullptr; return consumeIdent(range); } - RefPtrWillBeRawPtr<CSSPrimitiveValue> fontVariant = consumeFontVariant(range); + RawPtr<CSSPrimitiveValue> fontVariant = consumeFontVariant(range); if (fontVariant) values->append(fontVariant.release()); } while (consumeCommaIncludingWhitespace(range)); @@ -496,7 +496,7 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeFontWeight(CSSParserTokenRange& range) +static RawPtr<CSSPrimitiveValue> consumeFontWeight(CSSParserTokenRange& range) { const CSSParserToken& token = range.peek(); if (token.id() >= CSSValueNormal && token.id() <= CSSValueLighter) @@ -527,7 +527,7 @@ return builder.toString(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeFamilyName(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeFamilyName(CSSParserTokenRange& range) { if (range.peek().type() == StringToken) return cssValuePool().createFontFamilyValue(range.consumeIncludingWhitespace().value()); @@ -539,16 +539,16 @@ return cssValuePool().createFontFamilyValue(familyName); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeGenericFamily(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeGenericFamily(CSSParserTokenRange& range) { return consumeIdentRange(range, CSSValueSerif, CSSValueWebkitBody); } -static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFamily(CSSParserTokenRange& range) +static RawPtr<CSSValueList> consumeFontFamily(CSSParserTokenRange& range) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); do { - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr; + RawPtr<CSSValue> parsedValue = nullptr; if ((parsedValue = consumeGenericFamily(range))) { list->append(parsedValue); } else if ((parsedValue = consumeFamilyName(range))) { @@ -560,7 +560,7 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeSpacing(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeSpacing(CSSParserTokenRange& range, CSSParserMode cssParserMode) { if (range.peek().id() == CSSValueNormal) return consumeIdent(range); @@ -568,38 +568,38 @@ return consumeLength(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeTabSize(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeTabSize(CSSParserTokenRange& range, CSSParserMode cssParserMode) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue = consumeInteger(range, 0); + RawPtr<CSSPrimitiveValue> parsedValue = consumeInteger(range, 0); if (parsedValue) return parsedValue; return consumeLength(range, cssParserMode, ValueRangeNonNegative); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeFontSize(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless = UnitlessQuirk::Forbid) +static RawPtr<CSSValue> consumeFontSize(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless = UnitlessQuirk::Forbid) { if (range.peek().id() >= CSSValueXxSmall && range.peek().id() <= CSSValueLarger) return consumeIdent(range); return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative, unitless); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeLineHeight(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSPrimitiveValue> consumeLineHeight(CSSParserTokenRange& range, CSSParserMode cssParserMode) { if (range.peek().id() == CSSValueNormal) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSPrimitiveValue> lineHeight = consumeNumber(range, ValueRangeNonNegative); + RawPtr<CSSPrimitiveValue> lineHeight = consumeNumber(range, ValueRangeNonNegative); if (lineHeight) return lineHeight; return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative); } -static PassRefPtrWillBeRawPtr<CSSValueList> consumeRotation(CSSParserTokenRange& range) +static RawPtr<CSSValueList> consumeRotation(CSSParserTokenRange& range) { ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled()); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); - RefPtrWillBeRawPtr<CSSValue> rotation = consumeAngle(range); + RawPtr<CSSValue> rotation = consumeAngle(range); if (!rotation) return nullptr; list->append(rotation.release()); @@ -608,7 +608,7 @@ return list.release(); for (unsigned i = 0; i < 3; i++) { // 3 dimensions of rotation - RefPtrWillBeRawPtr<CSSValue> dimension = consumeNumber(range, ValueRangeAll); + RawPtr<CSSValue> dimension = consumeNumber(range, ValueRangeAll); if (!dimension) return nullptr; list->append(dimension.release()); @@ -617,14 +617,14 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValueList> consumeScale(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValueList> consumeScale(CSSParserTokenRange& range, CSSParserMode cssParserMode) { ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled()); - RefPtrWillBeRawPtr<CSSValue> scale = consumeNumber(range, ValueRangeAll); + RawPtr<CSSValue> scale = consumeNumber(range, ValueRangeAll); if (!scale) return nullptr; - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(scale.release()); if ((scale = consumeNumber(range, ValueRangeAll))) { list->append(scale.release()); @@ -635,13 +635,13 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValueList> consumeTranslate(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValueList> consumeTranslate(CSSParserTokenRange& range, CSSParserMode cssParserMode) { ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled()); - RefPtrWillBeRawPtr<CSSValue> translate = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll); + RawPtr<CSSValue> translate = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll); if (!translate) return nullptr; - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(translate.release()); if ((translate = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll))) { list->append(translate.release()); @@ -652,18 +652,18 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeCounter(CSSParserTokenRange& range, CSSParserMode cssParserMode, int defaultValue) +static RawPtr<CSSValue> consumeCounter(CSSParserTokenRange& range, CSSParserMode cssParserMode, int defaultValue) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); do { - RefPtrWillBeRawPtr<CSSCustomIdentValue> counterName = consumeCustomIdent(range); + RawPtr<CSSCustomIdentValue> counterName = consumeCustomIdent(range); if (!counterName) return nullptr; int i = defaultValue; - if (RefPtrWillBeRawPtr<CSSPrimitiveValue> counterValue = consumeInteger(range)) + if (RawPtr<CSSPrimitiveValue> counterValue = consumeInteger(range)) i = clampTo<int>(counterValue->getDoubleValue()); list->append(CSSValuePair::create(counterName.release(), cssValuePool().createValue(i, CSSPrimitiveValue::UnitType::Integer), @@ -672,30 +672,30 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumePageSize(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumePageSize(CSSParserTokenRange& range) { return consumeIdent<CSSValueA3, CSSValueA4, CSSValueA5, CSSValueB4, CSSValueB5, CSSValueLedger, CSSValueLegal, CSSValueLetter>(range); } -static PassRefPtrWillBeRawPtr<CSSValueList> consumeSize(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValueList> consumeSize(CSSParserTokenRange& range, CSSParserMode cssParserMode) { - RefPtrWillBeRawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); if (range.peek().id() == CSSValueAuto) { result->append(consumeIdent(range)); return result.release(); } - if (RefPtrWillBeRawPtr<CSSValue> width = consumeLength(range, cssParserMode, ValueRangeNonNegative)) { - RefPtrWillBeRawPtr<CSSValue> height = consumeLength(range, cssParserMode, ValueRangeNonNegative); + if (RawPtr<CSSValue> width = consumeLength(range, cssParserMode, ValueRangeNonNegative)) { + RawPtr<CSSValue> height = consumeLength(range, cssParserMode, ValueRangeNonNegative); result->append(width.release()); if (height) result->append(height.release()); return result.release(); } - RefPtrWillBeRawPtr<CSSValue> pageSize = consumePageSize(range); - RefPtrWillBeRawPtr<CSSValue> orientation = consumeIdent<CSSValuePortrait, CSSValueLandscape>(range); + RawPtr<CSSValue> pageSize = consumePageSize(range); + RawPtr<CSSValue> orientation = consumeIdent<CSSValuePortrait, CSSValueLandscape>(range); if (!pageSize) pageSize = consumePageSize(range); @@ -708,15 +708,15 @@ return result.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeSnapHeight(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeSnapHeight(CSSParserTokenRange& range, CSSParserMode cssParserMode) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> unit = consumeLength(range, cssParserMode, ValueRangeNonNegative); + RawPtr<CSSPrimitiveValue> unit = consumeLength(range, cssParserMode, ValueRangeNonNegative); if (!unit) return nullptr; - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); list->append(unit.release()); - if (RefPtrWillBeRawPtr<CSSPrimitiveValue> position = consumePositiveInteger(range)) { + if (RawPtr<CSSPrimitiveValue> position = consumePositiveInteger(range)) { if (position->getIntValue() > 100) return nullptr; list->append(position.release()); @@ -725,11 +725,11 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeTextIndent(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeTextIndent(CSSParserTokenRange& range, CSSParserMode cssParserMode) { // [ <length> | <percentage> ] && hanging? && each-line? // Keywords only allowed when css3Text is enabled. - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); bool hasLengthOrPercentage = false; bool hasEachLine = false; @@ -737,7 +737,7 @@ do { if (!hasLengthOrPercentage) { - if (RefPtrWillBeRawPtr<CSSValue> textIndent = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow)) { + if (RawPtr<CSSValue> textIndent = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow)) { list->append(textIndent.release()); hasLengthOrPercentage = true; continue; @@ -793,35 +793,35 @@ return false; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeMaxWidthOrHeight(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless = UnitlessQuirk::Forbid) +static RawPtr<CSSValue> consumeMaxWidthOrHeight(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless = UnitlessQuirk::Forbid) { if (range.peek().id() == CSSValueNone || validWidthOrHeightKeyword(range.peek().id(), context)) return consumeIdent(range); return consumeLengthOrPercent(range, context.mode(), ValueRangeNonNegative, unitless); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeWidthOrHeight(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless = UnitlessQuirk::Forbid) +static RawPtr<CSSValue> consumeWidthOrHeight(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless = UnitlessQuirk::Forbid) { if (range.peek().id() == CSSValueAuto || validWidthOrHeightKeyword(range.peek().id(), context)) return consumeIdent(range); return consumeLengthOrPercent(range, context.mode(), ValueRangeNonNegative, unitless); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeMarginOrOffset(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) +static RawPtr<CSSValue> consumeMarginOrOffset(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) { if (range.peek().id() == CSSValueAuto) return consumeIdent(range); return consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, unitless); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeClipComponent(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSPrimitiveValue> consumeClipComponent(CSSParserTokenRange& range, CSSParserMode cssParserMode) { if (range.peek().id() == CSSValueAuto) return consumeIdent(range); return consumeLength(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeClip(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeClip(CSSParserTokenRange& range, CSSParserMode cssParserMode) { if (range.peek().id() == CSSValueAuto) return consumeIdent(range); @@ -831,23 +831,23 @@ CSSParserTokenRange args = consumeFunction(range); // rect(t, r, b, l) || rect(t r b l) - RefPtrWillBeRawPtr<CSSPrimitiveValue> top = consumeClipComponent(args, cssParserMode); + RawPtr<CSSPrimitiveValue> top = consumeClipComponent(args, cssParserMode); if (!top) return nullptr; bool needsComma = consumeCommaIncludingWhitespace(args); - RefPtrWillBeRawPtr<CSSPrimitiveValue> right = consumeClipComponent(args, cssParserMode); + RawPtr<CSSPrimitiveValue> right = consumeClipComponent(args, cssParserMode); if (!right || (needsComma && !consumeCommaIncludingWhitespace(args))) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = consumeClipComponent(args, cssParserMode); + RawPtr<CSSPrimitiveValue> bottom = consumeClipComponent(args, cssParserMode); if (!bottom || (needsComma && !consumeCommaIncludingWhitespace(args))) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> left = consumeClipComponent(args, cssParserMode); + RawPtr<CSSPrimitiveValue> left = consumeClipComponent(args, cssParserMode); if (!left || !args.atEnd()) return nullptr; return CSSQuadValue::create(top.release(), right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsRect); } -static bool consumePan(CSSParserTokenRange& range, RefPtrWillBeRawPtr<CSSValue>& panX, RefPtrWillBeRawPtr<CSSValue>& panY) +static bool consumePan(CSSParserTokenRange& range, RawPtr<CSSValue>& panX, RawPtr<CSSValue>& panY) { CSSValueID id = range.peek().id(); if ((id == CSSValuePanX || id == CSSValuePanRight || id == CSSValuePanLeft) && !panX) { @@ -864,17 +864,17 @@ return true; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeTouchAction(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeTouchAction(CSSParserTokenRange& range) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); CSSValueID id = range.peek().id(); if (id == CSSValueAuto || id == CSSValueNone || id == CSSValueManipulation) { list->append(consumeIdent(range)); return list.release(); } - RefPtrWillBeRawPtr<CSSValue> panX = nullptr; - RefPtrWillBeRawPtr<CSSValue> panY = nullptr; + RawPtr<CSSValue> panX = nullptr; + RawPtr<CSSValue> panY = nullptr; if (!consumePan(range, panX, panY)) return nullptr; if (!range.atEnd() && !consumePan(range, panX, panY)) @@ -887,59 +887,59 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeLineClamp(CSSParserTokenRange& range) +static RawPtr<CSSPrimitiveValue> consumeLineClamp(CSSParserTokenRange& range) { if (range.peek().type() != PercentageToken && range.peek().type() != NumberToken) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> clampValue = consumePercent(range, ValueRangeNonNegative); + RawPtr<CSSPrimitiveValue> clampValue = consumePercent(range, ValueRangeNonNegative); if (clampValue) return clampValue; // When specifying number of lines, don't allow 0 as a valid value. return consumePositiveInteger(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeLocale(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeLocale(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueAuto) return consumeIdent(range); return consumeString(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeColumnWidth(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeColumnWidth(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueAuto) return consumeIdent(range); // Always parse lengths in strict mode here, since it would be ambiguous otherwise when used in // the 'columns' shorthand property. - RefPtrWillBeRawPtr<CSSPrimitiveValue> columnWidth = consumeLength(range, HTMLStandardMode, ValueRangeNonNegative); + RawPtr<CSSPrimitiveValue> columnWidth = consumeLength(range, HTMLStandardMode, ValueRangeNonNegative); if (!columnWidth || (!columnWidth->isCalculated() && columnWidth->getDoubleValue() == 0)) return nullptr; return columnWidth.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeColumnCount(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeColumnCount(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueAuto) return consumeIdent(range); return consumePositiveInteger(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeColumnGap(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeColumnGap(CSSParserTokenRange& range, CSSParserMode cssParserMode) { if (range.peek().id() == CSSValueNormal) return consumeIdent(range); return consumeLength(range, cssParserMode, ValueRangeNonNegative); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeColumnSpan(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeColumnSpan(CSSParserTokenRange& range, CSSParserMode cssParserMode) { return consumeIdent<CSSValueAll, CSSValueNone>(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeZoom(CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumeZoom(CSSParserTokenRange& range, const CSSParserContext& context) { const CSSParserToken& token = range.peek(); - RefPtrWillBeRawPtr<CSSPrimitiveValue> zoom = nullptr; + RawPtr<CSSPrimitiveValue> zoom = nullptr; if (token.type() == IdentToken) { zoom = consumeIdent<CSSValueNormal, CSSValueReset, CSSValueDocument>(range); } else { @@ -955,14 +955,14 @@ return zoom.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeAnimationIterationCount(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeAnimationIterationCount(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueInfinite) return consumeIdent(range); return consumeNumber(range, ValueRangeNonNegative); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeAnimationName(CSSParserTokenRange& range, const CSSParserContext& context, bool allowQuotedName) +static RawPtr<CSSValue> consumeAnimationName(CSSParserTokenRange& range, const CSSParserContext& context, bool allowQuotedName) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); @@ -981,7 +981,7 @@ return consumeCustomIdent(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeTransitionProperty(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeTransitionProperty(CSSParserTokenRange& range) { const CSSParserToken& token = range.peek(); if (token.type() != IdentToken) @@ -997,13 +997,13 @@ return consumeCustomIdent(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeSteps(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeSteps(CSSParserTokenRange& range) { ASSERT(range.peek().functionId() == CSSValueSteps); CSSParserTokenRange rangeCopy = range; CSSParserTokenRange args = consumeFunction(rangeCopy); - RefPtrWillBeRawPtr<CSSPrimitiveValue> steps = consumePositiveInteger(args); + RawPtr<CSSPrimitiveValue> steps = consumePositiveInteger(args); if (!steps) return nullptr; @@ -1033,7 +1033,7 @@ return CSSStepsTimingFunctionValue::create(steps->getIntValue(), position); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeCubicBezier(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeCubicBezier(CSSParserTokenRange& range) { ASSERT(range.peek().functionId() == CSSValueCubicBezier); CSSParserTokenRange rangeCopy = range; @@ -1057,7 +1057,7 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeAnimationTimingFunction(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeAnimationTimingFunction(CSSParserTokenRange& range) { CSSValueID id = range.peek().id(); if (id == CSSValueEase || id == CSSValueLinear || id == CSSValueEaseIn @@ -1073,7 +1073,7 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeAnimationValue(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context, bool useLegacyParsing) +static RawPtr<CSSValue> consumeAnimationValue(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context, bool useLegacyParsing) { switch (property) { case CSSPropertyAnimationDelay: @@ -1115,11 +1115,11 @@ return true; } -static PassRefPtrWillBeRawPtr<CSSValueList> consumeAnimationPropertyList(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context, bool useLegacyParsing) +static RawPtr<CSSValueList> consumeAnimationPropertyList(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context, bool useLegacyParsing) { - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); do { - RefPtrWillBeRawPtr<CSSValue> value = consumeAnimationValue(property, range, context, useLegacyParsing); + RawPtr<CSSValue> value = consumeAnimationValue(property, range, context, useLegacyParsing); if (!value) return nullptr; list->append(value.release()); @@ -1133,7 +1133,7 @@ bool CSSPropertyParser::consumeAnimationShorthand(const StylePropertyShorthand& shorthand, bool useLegacyParsing, bool important) { const unsigned longhandCount = shorthand.length(); - RefPtrWillBeRawPtr<CSSValueList> longhands[8]; + RawPtr<CSSValueList> longhands[8]; ASSERT(longhandCount <= 8); for (size_t i = 0; i < longhandCount; ++i) longhands[i] = CSSValueList::createCommaSeparated(); @@ -1146,7 +1146,7 @@ if (parsedLonghand[i]) continue; - if (RefPtrWillBeRawPtr<CSSValue> value = consumeAnimationValue(shorthand.properties()[i], m_range, m_context, useLegacyParsing)) { + if (RawPtr<CSSValue> value = consumeAnimationValue(shorthand.properties()[i], m_range, m_context, useLegacyParsing)) { parsedLonghand[i] = true; foundProperty = true; longhands[i]->append(value.release()); @@ -1176,7 +1176,7 @@ return m_range.atEnd(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeWidowsOrOrphans(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeWidowsOrOrphans(CSSParserTokenRange& range) { // Support for auto is non-standard and for backwards compatibility. if (range.peek().id() == CSSValueAuto) @@ -1184,17 +1184,17 @@ return consumePositiveInteger(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeZIndex(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeZIndex(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueAuto) return consumeIdent(range); return consumeInteger(range); } -static PassRefPtrWillBeRawPtr<CSSShadowValue> parseSingleShadow(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool allowInset, bool allowSpread) +static RawPtr<CSSShadowValue> parseSingleShadow(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool allowInset, bool allowSpread) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> style = nullptr; - RefPtrWillBeRawPtr<CSSValue> color = nullptr; + RawPtr<CSSPrimitiveValue> style = nullptr; + RawPtr<CSSValue> color = nullptr; if (range.atEnd()) return nullptr; @@ -1205,16 +1205,16 @@ } color = consumeColor(range, cssParserMode); - RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontalOffset = consumeLength(range, cssParserMode, ValueRangeAll); + RawPtr<CSSPrimitiveValue> horizontalOffset = consumeLength(range, cssParserMode, ValueRangeAll); if (!horizontalOffset) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> verticalOffset = consumeLength(range, cssParserMode, ValueRangeAll); + RawPtr<CSSPrimitiveValue> verticalOffset = consumeLength(range, cssParserMode, ValueRangeAll); if (!verticalOffset) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> blurRadius = consumeLength(range, cssParserMode, ValueRangeAll); - RefPtrWillBeRawPtr<CSSPrimitiveValue> spreadDistance = nullptr; + RawPtr<CSSPrimitiveValue> blurRadius = consumeLength(range, cssParserMode, ValueRangeAll); + RawPtr<CSSPrimitiveValue> spreadDistance = nullptr; if (blurRadius) { // Blur radius must be non-negative. if (blurRadius->getDoubleValue() < 0) @@ -1236,14 +1236,14 @@ spreadDistance.release(), style.release(), color.release()); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeShadow(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool isBoxShadowProperty) +static RawPtr<CSSValue> consumeShadow(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool isBoxShadowProperty) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> shadowValueList = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> shadowValueList = CSSValueList::createCommaSeparated(); do { - if (RefPtrWillBeRawPtr<CSSShadowValue> shadowValue = parseSingleShadow(range, cssParserMode, isBoxShadowProperty, isBoxShadowProperty)) + if (RawPtr<CSSShadowValue> shadowValue = parseSingleShadow(range, cssParserMode, isBoxShadowProperty, isBoxShadowProperty)) shadowValueList->append(shadowValue.release()); else return nullptr; @@ -1251,14 +1251,14 @@ return shadowValueList; } -static PassRefPtrWillBeRawPtr<CSSFunctionValue> consumeFilterFunction(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSFunctionValue> consumeFilterFunction(CSSParserTokenRange& range, CSSParserMode cssParserMode) { CSSValueID filterType = range.peek().functionId(); if (filterType < CSSValueInvert || filterType > CSSValueDropShadow) return nullptr; CSSParserTokenRange args = consumeFunction(range); - RefPtrWillBeRawPtr<CSSFunctionValue> filterValue = CSSFunctionValue::create(filterType); - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr; + RawPtr<CSSFunctionValue> filterValue = CSSFunctionValue::create(filterType); + RawPtr<CSSValue> parsedValue = nullptr; if (filterType == CSSValueDropShadow) { parsedValue = parseSingleShadow(args, cssParserMode, false, false); @@ -1293,15 +1293,15 @@ return filterValue.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeFilter(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeFilter(CSSParserTokenRange& range, CSSParserMode cssParserMode) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); do { String url = consumeUrl(range); - RefPtrWillBeRawPtr<CSSFunctionValue> filterValue = nullptr; + RawPtr<CSSFunctionValue> filterValue = nullptr; if (!url.isNull()) { filterValue = CSSFunctionValue::create(CSSValueUrl); filterValue->append(CSSSVGDocumentValue::create(url)); @@ -1315,14 +1315,14 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeTextDecorationLine(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeTextDecorationLine(CSSParserTokenRange& range) { CSSValueID id = range.peek().id(); if (id == CSSValueNone) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); - RefPtrWillBeRawPtr<CSSPrimitiveValue> ident = nullptr; + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSPrimitiveValue> ident = nullptr; while ((ident = consumeIdent<CSSValueBlink, CSSValueUnderline, CSSValueOverline, CSSValueLineThrough>(range))) { if (list->hasValue(ident.get())) return nullptr; @@ -1335,18 +1335,18 @@ } // none | strict | [ layout || style || paint ] -static PassRefPtrWillBeRawPtr<CSSValue> consumeContain(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeContain(CSSParserTokenRange& range) { CSSValueID id = range.peek().id(); if (id == CSSValueNone) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (id == CSSValueStrict) { list->append(consumeIdent(range)); return list.release(); } - RefPtrWillBeRawPtr<CSSPrimitiveValue> ident = nullptr; + RawPtr<CSSPrimitiveValue> ident = nullptr; while ((ident = consumeIdent<CSSValuePaint, CSSValueLayout, CSSValueStyle>(range))) { if (list->hasValue(ident.get())) return nullptr; @@ -1358,7 +1358,7 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumePath(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumePath(CSSParserTokenRange& range) { // FIXME: Add support for <url>, <basic-shape>, <geometry-box>. if (range.peek().functionId() != CSSValuePath) @@ -1382,7 +1382,7 @@ return CSSPathValue::create(byteStream.release()); } -static PassRefPtrWillBeRawPtr<CSSValue> consumePathOrNone(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumePathOrNone(CSSParserTokenRange& range) { CSSValueID id = range.peek().id(); if (id == CSSValueNone) @@ -1391,17 +1391,17 @@ return consumePath(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeMotionRotation(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeMotionRotation(CSSParserTokenRange& range) { - RefPtrWillBeRawPtr<CSSValue> angle = consumeAngle(range); - RefPtrWillBeRawPtr<CSSValue> keyword = consumeIdent<CSSValueAuto, CSSValueReverse>(range); + RawPtr<CSSValue> angle = consumeAngle(range); + RawPtr<CSSValue> keyword = consumeIdent<CSSValueAuto, CSSValueReverse>(range); if (!angle && !keyword) return nullptr; if (!angle) angle = consumeAngle(range); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); if (keyword) list->append(keyword.release()); if (angle) @@ -1409,21 +1409,21 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeTextEmphasisStyle(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeTextEmphasisStyle(CSSParserTokenRange& range) { CSSValueID id = range.peek().id(); if (id == CSSValueNone) return consumeIdent(range); - if (RefPtrWillBeRawPtr<CSSValue> textEmphasisStyle = consumeString(range)) + if (RawPtr<CSSValue> textEmphasisStyle = consumeString(range)) return textEmphasisStyle.release(); - RefPtrWillBeRawPtr<CSSPrimitiveValue> fill = consumeIdent<CSSValueFilled, CSSValueOpen>(range); - RefPtrWillBeRawPtr<CSSPrimitiveValue> shape = consumeIdent<CSSValueDot, CSSValueCircle, CSSValueDoubleCircle, CSSValueTriangle, CSSValueSesame>(range); + RawPtr<CSSPrimitiveValue> fill = consumeIdent<CSSValueFilled, CSSValueOpen>(range); + RawPtr<CSSPrimitiveValue> shape = consumeIdent<CSSValueDot, CSSValueCircle, CSSValueDoubleCircle, CSSValueTriangle, CSSValueSesame>(range); if (!fill) fill = consumeIdent<CSSValueFilled, CSSValueOpen>(range); if (fill && shape) { - RefPtrWillBeRawPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated(); parsedValues->append(fill.release()); parsedValues->append(shape.release()); return parsedValues.release(); @@ -1435,7 +1435,7 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeOutlineColor(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeOutlineColor(CSSParserTokenRange& range, CSSParserMode cssParserMode) { // Outline color has "invert" as additional keyword. // Also, we want to allow the special focus color even in HTML Standard parsing mode. @@ -1444,7 +1444,7 @@ return consumeColor(range, cssParserMode); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeLineWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) +static RawPtr<CSSPrimitiveValue> consumeLineWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) { CSSValueID id = range.peek().id(); if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick) @@ -1452,25 +1452,25 @@ return consumeLength(range, cssParserMode, ValueRangeNonNegative, unitless); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeBorderWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) +static RawPtr<CSSPrimitiveValue> consumeBorderWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) { return consumeLineWidth(range, cssParserMode, unitless); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeTextStrokeWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSPrimitiveValue> consumeTextStrokeWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode) { return consumeLineWidth(range, cssParserMode, UnitlessQuirk::Forbid); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeColumnRuleWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSPrimitiveValue> consumeColumnRuleWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode) { return consumeLineWidth(range, cssParserMode, UnitlessQuirk::Forbid); } -static bool consumeTranslate3d(CSSParserTokenRange& args, CSSParserMode cssParserMode, RefPtrWillBeRawPtr<CSSFunctionValue>& transformValue) +static bool consumeTranslate3d(CSSParserTokenRange& args, CSSParserMode cssParserMode, RawPtr<CSSFunctionValue>& transformValue) { unsigned numberOfArguments = 2; - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr; + RawPtr<CSSValue> parsedValue = nullptr; do { parsedValue = consumeLengthOrPercent(args, cssParserMode, ValueRangeAll); if (!parsedValue) @@ -1486,10 +1486,10 @@ return true; } -static bool consumeNumbers(CSSParserTokenRange& args, RefPtrWillBeRawPtr<CSSFunctionValue>& transformValue, unsigned numberOfArguments) +static bool consumeNumbers(CSSParserTokenRange& args, RawPtr<CSSFunctionValue>& transformValue, unsigned numberOfArguments) { do { - RefPtrWillBeRawPtr<CSSValue> parsedValue = consumeNumber(args, ValueRangeAll); + RawPtr<CSSValue> parsedValue = consumeNumber(args, ValueRangeAll); if (!parsedValue) return false; transformValue->append(parsedValue); @@ -1499,9 +1499,9 @@ return true; } -static bool consumePerspective(CSSParserTokenRange& args, CSSParserMode cssParserMode, RefPtrWillBeRawPtr<CSSFunctionValue>& transformValue, bool useLegacyParsing) +static bool consumePerspective(CSSParserTokenRange& args, CSSParserMode cssParserMode, RawPtr<CSSFunctionValue>& transformValue, bool useLegacyParsing) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue = consumeLength(args, cssParserMode, ValueRangeNonNegative); + RawPtr<CSSPrimitiveValue> parsedValue = consumeLength(args, cssParserMode, ValueRangeNonNegative); if (!parsedValue && useLegacyParsing) { double perspective; if (!consumeNumberRaw(args, perspective) || perspective < 0) @@ -1514,7 +1514,7 @@ return true; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeTransformValue(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing) +static RawPtr<CSSValue> consumeTransformValue(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing) { CSSValueID functionId = range.peek().functionId(); if (functionId == CSSValueInvalid) @@ -1522,8 +1522,8 @@ CSSParserTokenRange args = consumeFunction(range); if (args.atEnd()) return nullptr; - RefPtrWillBeRawPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(functionId); - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr; + RawPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(functionId); + RawPtr<CSSValue> parsedValue = nullptr; switch (functionId) { case CSSValueRotate: case CSSValueRotateX: @@ -1606,14 +1606,14 @@ return transformValue.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeTransform(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing) +static RawPtr<CSSValue> consumeTransform(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); do { - RefPtrWillBeRawPtr<CSSValue> parsedTransformValue = consumeTransformValue(range, cssParserMode, useLegacyParsing); + RawPtr<CSSValue> parsedTransformValue = consumeTransformValue(range, cssParserMode, useLegacyParsing); if (!parsedTransformValue) return nullptr; list->append(parsedTransformValue.release()); @@ -1623,7 +1623,7 @@ } template <CSSValueID start, CSSValueID end> -static PassRefPtrWillBeRawPtr<CSSValue> consumePositionLonghand(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumePositionLonghand(CSSParserTokenRange& range, CSSParserMode cssParserMode) { if (range.peek().type() == IdentToken) { CSSValueID id = range.peek().id(); @@ -1642,29 +1642,29 @@ return consumeLengthOrPercent(range, cssParserMode, ValueRangeAll); } -static PassRefPtrWillBeRawPtr<CSSValue> consumePositionX(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumePositionX(CSSParserTokenRange& range, CSSParserMode cssParserMode) { return consumePositionLonghand<CSSValueLeft, CSSValueRight>(range, cssParserMode); } -static PassRefPtrWillBeRawPtr<CSSValue> consumePositionY(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumePositionY(CSSParserTokenRange& range, CSSParserMode cssParserMode) { return consumePositionLonghand<CSSValueTop, CSSValueBottom>(range, cssParserMode); } -static PassRefPtrWillBeRawPtr<CSSValue> consumePaintStroke(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumePaintStroke(CSSParserTokenRange& range, CSSParserMode cssParserMode) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); String url = consumeUrl(range); if (!url.isNull()) { - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr; + RawPtr<CSSValue> parsedValue = nullptr; if (range.peek().id() == CSSValueNone) parsedValue = consumeIdent(range); else parsedValue = consumeColor(range, cssParserMode); if (parsedValue) { - RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); values->append(CSSURIValue::create(url)); values->append(parsedValue); return values.release(); @@ -1674,15 +1674,15 @@ return consumeColor(range, cssParserMode); } -static PassRefPtrWillBeRawPtr<CSSValue> consumePaintOrder(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumePaintOrder(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueNormal) return consumeIdent(range); Vector<CSSValueID, 3> paintTypeList; - RefPtrWillBeRawPtr<CSSPrimitiveValue> fill = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> stroke = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> markers = nullptr; + RawPtr<CSSPrimitiveValue> fill = nullptr; + RawPtr<CSSPrimitiveValue> stroke = nullptr; + RawPtr<CSSPrimitiveValue> markers = nullptr; do { CSSValueID id = range.peek().id(); if (id == CSSValueFill && !fill) @@ -1700,7 +1700,7 @@ // pop a last list items from CSSValueList without bigger cost, we create the // list after parsing. CSSValueID firstPaintOrderType = paintTypeList.at(0); - RefPtrWillBeRawPtr<CSSValueList> paintOrderList = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> paintOrderList = CSSValueList::createSpaceSeparated(); switch (firstPaintOrderType) { case CSSValueFill: case CSSValueStroke: @@ -1724,7 +1724,7 @@ return paintOrderList.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeNoneOrURI(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeNoneOrURI(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); @@ -1735,7 +1735,7 @@ return CSSURIValue::create(url); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeFlexBasis(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeFlexBasis(CSSParserTokenRange& range, CSSParserMode cssParserMode) { // FIXME: Support intrinsic dimensions too. if (range.peek().id() == CSSValueAuto) @@ -1743,15 +1743,15 @@ return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeStrokeDasharray(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeStrokeDasharray(CSSParserTokenRange& range) { CSSValueID id = range.peek().id(); if (id == CSSValueNone) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> dashes = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> dashes = CSSValueList::createCommaSeparated(); do { - RefPtrWillBeRawPtr<CSSPrimitiveValue> dash = consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeNonNegative, UnitlessQuirk::Allow); + RawPtr<CSSPrimitiveValue> dash = consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeNonNegative, UnitlessQuirk::Allow); if (!dash || (consumeCommaIncludingWhitespace(range) && range.atEnd())) return nullptr; dashes->append(dash.release()); @@ -1759,7 +1759,7 @@ return dashes.release(); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeBaselineShift(CSSParserTokenRange& range) +static RawPtr<CSSPrimitiveValue> consumeBaselineShift(CSSParserTokenRange& range) { CSSValueID id = range.peek().id(); if (id == CSSValueBaseline || id == CSSValueSub || id == CSSValueSuper) @@ -1767,24 +1767,24 @@ return consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeAll); } -static PassRefPtrWillBeRawPtr<CSSValue> createCSSImageValueWithReferrer(const AtomicString& rawValue, const CSSParserContext& context) +static RawPtr<CSSValue> createCSSImageValueWithReferrer(const AtomicString& rawValue, const CSSParserContext& context) { - RefPtrWillBeRawPtr<CSSValue> imageValue = CSSImageValue::create(rawValue, context.completeURL(rawValue)); + RawPtr<CSSValue> imageValue = CSSImageValue::create(rawValue, context.completeURL(rawValue)); toCSSImageValue(imageValue.get())->setReferrer(context.referrer()); return imageValue; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeImageSet(CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumeImageSet(CSSParserTokenRange& range, const CSSParserContext& context) { CSSParserTokenRange rangeCopy = range; CSSParserTokenRange args = consumeFunction(rangeCopy); - RefPtrWillBeRawPtr<CSSImageSetValue> imageSet = CSSImageSetValue::create(); + RawPtr<CSSImageSetValue> imageSet = CSSImageSetValue::create(); do { AtomicString urlValue(consumeUrl(args)); if (urlValue.isNull()) return nullptr; - RefPtrWillBeRawPtr<CSSValue> image = createCSSImageValueWithReferrer(urlValue, context); + RawPtr<CSSValue> image = createCSSImageValueWithReferrer(urlValue, context); imageSet->append(image); const CSSParserToken& token = args.consumeIncludingWhitespace(); @@ -1804,11 +1804,11 @@ return imageSet.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeCursor(CSSParserTokenRange& range, const CSSParserContext& context, bool inQuirksMode) +static RawPtr<CSSValue> consumeCursor(CSSParserTokenRange& range, const CSSParserContext& context, bool inQuirksMode) { - RefPtrWillBeRawPtr<CSSValueList> list = nullptr; + RawPtr<CSSValueList> list = nullptr; while (true) { - RefPtrWillBeRawPtr<CSSValue> image = nullptr; + RawPtr<CSSValue> image = nullptr; AtomicString uri(consumeUrl(range)); if (!uri.isNull()) { image = createCSSImageValueWithReferrer(uri, context); @@ -1846,7 +1846,7 @@ else if (id == CSSValueWebkitZoomOut) context.useCounter()->count(UseCounter::PrefixedCursorZoomOut); } - RefPtrWillBeRawPtr<CSSValue> cursorType = nullptr; + RawPtr<CSSValue> cursorType = nullptr; if (id == CSSValueHand) { if (!inQuirksMode) // Non-standard behavior return nullptr; @@ -1865,7 +1865,7 @@ } // This should go away once we drop support for -webkit-gradient -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeDeprecatedGradientPoint(CSSParserTokenRange& args, bool horizontal) +static RawPtr<CSSPrimitiveValue> consumeDeprecatedGradientPoint(CSSParserTokenRange& args, bool horizontal) { if (args.peek().type() == IdentToken) { if ((horizontal && consumeIdent<CSSValueLeft>(args)) || (!horizontal && consumeIdent<CSSValueTop>(args))) @@ -1876,14 +1876,14 @@ return cssValuePool().createValue(50., CSSPrimitiveValue::UnitType::Percentage); return nullptr; } - RefPtrWillBeRawPtr<CSSPrimitiveValue> result = consumePercent(args, ValueRangeAll); + RawPtr<CSSPrimitiveValue> result = consumePercent(args, ValueRangeAll); if (!result) result = consumeNumber(args, ValueRangeAll); return result; } // Used to parse colors for -webkit-gradient(...). -static PassRefPtrWillBeRawPtr<CSSValue> consumeDeprecatedGradientStopColor(CSSParserTokenRange& args, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeDeprecatedGradientStopColor(CSSParserTokenRange& args, CSSParserMode cssParserMode) { if (args.peek().id() == CSSValueCurrentcolor) return nullptr; @@ -1919,9 +1919,9 @@ return stop.m_color && args.atEnd(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeDeprecatedGradient(CSSParserTokenRange& args, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeDeprecatedGradient(CSSParserTokenRange& args, CSSParserMode cssParserMode) { - RefPtrWillBeRawPtr<CSSGradientValue> result = nullptr; + RawPtr<CSSGradientValue> result = nullptr; CSSValueID id = args.consumeIncludingWhitespace().id(); bool isDeprecatedRadialGradient = (id == CSSValueRadial); if (isDeprecatedRadialGradient) @@ -1931,7 +1931,7 @@ if (!result || !consumeCommaIncludingWhitespace(args)) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> point = consumeDeprecatedGradientPoint(args, true); + RawPtr<CSSPrimitiveValue> point = consumeDeprecatedGradientPoint(args, true); if (!point) return nullptr; result->setFirstX(point.release()); @@ -1945,7 +1945,7 @@ // For radial gradients only, we now expect a numeric radius. if (isDeprecatedRadialGradient) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> radius = consumeNumber(args, ValueRangeAll); + RawPtr<CSSPrimitiveValue> radius = consumeNumber(args, ValueRangeAll); if (!radius || !consumeCommaIncludingWhitespace(args)) return nullptr; toCSSRadialGradientValue(result.get())->setFirstRadius(radius.release()); @@ -1964,7 +1964,7 @@ if (isDeprecatedRadialGradient) { if (!consumeCommaIncludingWhitespace(args)) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> radius = consumeNumber(args, ValueRangeAll); + RawPtr<CSSPrimitiveValue> radius = consumeNumber(args, ValueRangeAll); if (!radius) return nullptr; toCSSRadialGradientValue(result.get())->setSecondRadius(radius.release()); @@ -2007,11 +2007,11 @@ return gradient->stopCount() >= 2; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeDeprecatedRadialGradient(CSSParserTokenRange& args, CSSParserMode cssParserMode, CSSGradientRepeat repeating) +static RawPtr<CSSValue> consumeDeprecatedRadialGradient(CSSParserTokenRange& args, CSSParserMode cssParserMode, CSSGradientRepeat repeating) { - RefPtrWillBeRawPtr<CSSRadialGradientValue> result = CSSRadialGradientValue::create(repeating, CSSPrefixedRadialGradient); - RefPtrWillBeRawPtr<CSSValue> centerX = nullptr; - RefPtrWillBeRawPtr<CSSValue> centerY = nullptr; + RawPtr<CSSRadialGradientValue> result = CSSRadialGradientValue::create(repeating, CSSPrefixedRadialGradient); + RawPtr<CSSValue> centerX = nullptr; + RawPtr<CSSValue> centerY = nullptr; consumeOneOrTwoValuedPosition(args, cssParserMode, UnitlessQuirk::Forbid, centerX, centerY); if ((centerX || centerY) && !consumeCommaIncludingWhitespace(args)) return nullptr; @@ -2021,8 +2021,8 @@ result->setFirstY(toCSSPrimitiveValue(centerY.get())); result->setSecondY(toCSSPrimitiveValue(centerY.get())); - RefPtrWillBeRawPtr<CSSPrimitiveValue> shape = consumeIdent<CSSValueCircle, CSSValueEllipse>(args); - RefPtrWillBeRawPtr<CSSPrimitiveValue> sizeKeyword = consumeIdent<CSSValueClosestSide, CSSValueClosestCorner, CSSValueFarthestSide, CSSValueFarthestCorner, CSSValueContain, CSSValueCover>(args); + RawPtr<CSSPrimitiveValue> shape = consumeIdent<CSSValueCircle, CSSValueEllipse>(args); + RawPtr<CSSPrimitiveValue> sizeKeyword = consumeIdent<CSSValueClosestSide, CSSValueClosestCorner, CSSValueFarthestSide, CSSValueFarthestCorner, CSSValueContain, CSSValueCover>(args); if (!shape) shape = consumeIdent<CSSValueCircle, CSSValueEllipse>(args); result->setShape(shape); @@ -2030,8 +2030,8 @@ // Or, two lengths or percentages if (!shape && !sizeKeyword) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontalSize = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> verticalSize = nullptr; + RawPtr<CSSPrimitiveValue> horizontalSize = nullptr; + RawPtr<CSSPrimitiveValue> verticalSize = nullptr; if ((horizontalSize = consumeLengthOrPercent(args, cssParserMode, ValueRangeAll))) { verticalSize = consumeLengthOrPercent(args, cssParserMode, ValueRangeAll); if (!verticalSize) @@ -2049,14 +2049,14 @@ return result.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeRadialGradient(CSSParserTokenRange& args, CSSParserMode cssParserMode, CSSGradientRepeat repeating) +static RawPtr<CSSValue> consumeRadialGradient(CSSParserTokenRange& args, CSSParserMode cssParserMode, CSSGradientRepeat repeating) { - RefPtrWillBeRawPtr<CSSRadialGradientValue> result = CSSRadialGradientValue::create(repeating, CSSRadialGradient); + RawPtr<CSSRadialGradientValue> result = CSSRadialGradientValue::create(repeating, CSSRadialGradient); - RefPtrWillBeRawPtr<CSSPrimitiveValue> shape = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> sizeKeyword = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontalSize = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> verticalSize = nullptr; + RawPtr<CSSPrimitiveValue> shape = nullptr; + RawPtr<CSSPrimitiveValue> sizeKeyword = nullptr; + RawPtr<CSSPrimitiveValue> horizontalSize = nullptr; + RawPtr<CSSPrimitiveValue> verticalSize = nullptr; // First part of grammar, the size/shape clause: // [ circle || <length> ] | @@ -2077,7 +2077,7 @@ break; } } else { - RefPtrWillBeRawPtr<CSSPrimitiveValue> center = consumeLengthOrPercent(args, cssParserMode, ValueRangeAll); + RawPtr<CSSPrimitiveValue> center = consumeLengthOrPercent(args, cssParserMode, ValueRangeAll); if (!center) break; if (horizontalSize) @@ -2109,8 +2109,8 @@ result->setEndHorizontalSize(horizontalSize); result->setEndVerticalSize(verticalSize); - RefPtrWillBeRawPtr<CSSValue> centerX = nullptr; - RefPtrWillBeRawPtr<CSSValue> centerY = nullptr; + RawPtr<CSSValue> centerX = nullptr; + RawPtr<CSSValue> centerY = nullptr; if (args.peek().id() == CSSValueAt) { args.consumeIncludingWhitespace(); consumePosition(args, cssParserMode, UnitlessQuirk::Forbid, centerX, centerY); @@ -2130,17 +2130,17 @@ return result.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeLinearGradient(CSSParserTokenRange& args, CSSParserMode cssParserMode, CSSGradientRepeat repeating, CSSGradientType gradientType) +static RawPtr<CSSValue> consumeLinearGradient(CSSParserTokenRange& args, CSSParserMode cssParserMode, CSSGradientRepeat repeating, CSSGradientType gradientType) { - RefPtrWillBeRawPtr<CSSLinearGradientValue> result = CSSLinearGradientValue::create(repeating, gradientType); + RawPtr<CSSLinearGradientValue> result = CSSLinearGradientValue::create(repeating, gradientType); bool expectComma = true; - RefPtrWillBeRawPtr<CSSPrimitiveValue> angle = consumeAngle(args); + RawPtr<CSSPrimitiveValue> angle = consumeAngle(args); if (angle) { result->setAngle(angle.release()); } else if (gradientType == CSSPrefixedLinearGradient || consumeIdent<CSSValueTo>(args)) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> endX = consumeIdent<CSSValueLeft, CSSValueRight>(args); - RefPtrWillBeRawPtr<CSSPrimitiveValue> endY = consumeIdent<CSSValueBottom, CSSValueTop>(args); + RawPtr<CSSPrimitiveValue> endX = consumeIdent<CSSValueLeft, CSSValueRight>(args); + RawPtr<CSSPrimitiveValue> endY = consumeIdent<CSSValueBottom, CSSValueTop>(args); if (!endX && !endY) { if (gradientType == CSSLinearGradient) return nullptr; @@ -2163,18 +2163,18 @@ return result.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeImageOrNone(CSSParserTokenRange&, CSSParserContext); +static RawPtr<CSSValue> consumeImageOrNone(CSSParserTokenRange&, CSSParserContext); -static PassRefPtrWillBeRawPtr<CSSValue> consumeCrossFade(CSSParserTokenRange& args, CSSParserContext context) +static RawPtr<CSSValue> consumeCrossFade(CSSParserTokenRange& args, CSSParserContext context) { - RefPtrWillBeRawPtr<CSSValue> fromImageValue = consumeImageOrNone(args, context); + RawPtr<CSSValue> fromImageValue = consumeImageOrNone(args, context); if (!fromImageValue || !consumeCommaIncludingWhitespace(args)) return nullptr; - RefPtrWillBeRawPtr<CSSValue> toImageValue = consumeImageOrNone(args, context); + RawPtr<CSSValue> toImageValue = consumeImageOrNone(args, context); if (!toImageValue || !consumeCommaIncludingWhitespace(args)) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> percentage = nullptr; + RawPtr<CSSPrimitiveValue> percentage = nullptr; const CSSParserToken& percentageArg = args.consumeIncludingWhitespace(); if (percentageArg.type() == PercentageToken) percentage = cssValuePool().createValue(clampTo<double>(percentageArg.numericValue() / 100, 0, 1), CSSPrimitiveValue::UnitType::Number); @@ -2186,23 +2186,23 @@ return CSSCrossfadeValue::create(fromImageValue, toImageValue, percentage); } -static PassRefPtrWillBeRawPtr<CSSValue> consumePaint(CSSParserTokenRange& args, CSSParserContext context) +static RawPtr<CSSValue> consumePaint(CSSParserTokenRange& args, CSSParserContext context) { ASSERT(RuntimeEnabledFeatures::cssPaintAPIEnabled()); - RefPtrWillBeRawPtr<CSSCustomIdentValue> name = consumeCustomIdent(args); + RawPtr<CSSCustomIdentValue> name = consumeCustomIdent(args); if (!name) return nullptr; return CSSPaintValue::create(name.release()); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeGeneratedImage(CSSParserTokenRange& range, CSSParserContext context) +static RawPtr<CSSValue> consumeGeneratedImage(CSSParserTokenRange& range, CSSParserContext context) { CSSValueID id = range.peek().functionId(); CSSParserTokenRange rangeCopy = range; CSSParserTokenRange args = consumeFunction(rangeCopy); - RefPtrWillBeRawPtr<CSSValue> result = nullptr; + RawPtr<CSSValue> result = nullptr; if (id == CSSValueRadialGradient) { result = consumeRadialGradient(args, context.mode(), NonRepeating); } else if (id == CSSValueRepeatingRadialGradient) { @@ -2255,7 +2255,7 @@ || id == CSSValueWebkitGradient || id == CSSValueWebkitCrossFade || id == CSSValuePaint; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeImage(CSSParserTokenRange& range, CSSParserContext context) +static RawPtr<CSSValue> consumeImage(CSSParserTokenRange& range, CSSParserContext context) { AtomicString uri(consumeUrl(range)); if (!uri.isNull()) @@ -2270,14 +2270,14 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeImageOrNone(CSSParserTokenRange& range, CSSParserContext context) +static RawPtr<CSSValue> consumeImageOrNone(CSSParserTokenRange& range, CSSParserContext context) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); return consumeImage(range, context); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeAttr(CSSParserTokenRange args, CSSParserContext context) +static RawPtr<CSSValue> consumeAttr(CSSParserTokenRange args, CSSParserContext context) { if (args.peek().type() != IdentToken) return nullptr; @@ -2293,19 +2293,19 @@ if (context.isHTMLDocument()) attrName = attrName.lower(); - RefPtrWillBeRawPtr<CSSFunctionValue> attrValue = CSSFunctionValue::create(CSSValueAttr); + RawPtr<CSSFunctionValue> attrValue = CSSFunctionValue::create(CSSValueAttr); attrValue->append(CSSCustomIdentValue::create(attrName)); return attrValue.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeCounterContent(CSSParserTokenRange args, bool counters) +static RawPtr<CSSValue> consumeCounterContent(CSSParserTokenRange args, bool counters) { - RefPtrWillBeRawPtr<CSSCustomIdentValue> identifier = consumeCustomIdent(args); + RawPtr<CSSCustomIdentValue> identifier = consumeCustomIdent(args); if (!identifier) return nullptr; // TODO(timloh): Make this a CSSStringValue. - RefPtrWillBeRawPtr<CSSCustomIdentValue> separator = nullptr; + RawPtr<CSSCustomIdentValue> separator = nullptr; if (!counters) { separator = CSSCustomIdentValue::create(String()); } else { @@ -2316,7 +2316,7 @@ separator = CSSCustomIdentValue::create(args.consumeIncludingWhitespace().value()); } - RefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle = nullptr; + RawPtr<CSSPrimitiveValue> listStyle = nullptr; if (consumeCommaIncludingWhitespace(args)) { CSSValueID id = args.peek().id(); if ((id != CSSValueNone && (id < CSSValueDisc || id > CSSValueKatakanaIroha))) @@ -2331,15 +2331,15 @@ return CSSCounterValue::create(identifier.release(), listStyle.release(), separator.release()); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeContent(CSSParserTokenRange& range, CSSParserContext context) +static RawPtr<CSSValue> consumeContent(CSSParserTokenRange& range, CSSParserContext context) { if (identMatches<CSSValueNone, CSSValueNormal>(range.peek().id())) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); do { - RefPtrWillBeRawPtr<CSSValue> parsedValue = consumeImage(range, context); + RawPtr<CSSValue> parsedValue = consumeImage(range, context); if (!parsedValue) parsedValue = consumeIdent<CSSValueOpenQuote, CSSValueCloseQuote, CSSValueNoOpenQuote, CSSValueNoCloseQuote>(range); if (!parsedValue) @@ -2360,11 +2360,11 @@ return values.release(); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumePerspective(CSSParserTokenRange& range, CSSParserMode cssParserMode, CSSPropertyID unresolvedProperty) +static RawPtr<CSSPrimitiveValue> consumePerspective(CSSParserTokenRange& range, CSSParserMode cssParserMode, CSSPropertyID unresolvedProperty) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue = consumeLength(range, cssParserMode, ValueRangeAll); + RawPtr<CSSPrimitiveValue> parsedValue = consumeLength(range, cssParserMode, ValueRangeAll); if (!parsedValue && (unresolvedProperty == CSSPropertyAliasWebkitPerspective)) { double perspective; if (!consumeNumberRaw(range, perspective)) @@ -2376,11 +2376,11 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValueList> consumePositionList(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValueList> consumePositionList(CSSParserTokenRange& range, CSSParserMode cssParserMode) { - RefPtrWillBeRawPtr<CSSValueList> positions = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> positions = CSSValueList::createCommaSeparated(); do { - RefPtrWillBeRawPtr<CSSValue> position = consumePosition(range, cssParserMode, UnitlessQuirk::Forbid); + RawPtr<CSSValue> position = consumePosition(range, cssParserMode, UnitlessQuirk::Forbid); if (!position) return nullptr; positions->append(position); @@ -2388,22 +2388,22 @@ return positions.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeScrollSnapCoordinate(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeScrollSnapCoordinate(CSSParserTokenRange& range, CSSParserMode cssParserMode) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); return consumePositionList(range, cssParserMode); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeScrollSnapPoints(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeScrollSnapPoints(CSSParserTokenRange& range, CSSParserMode cssParserMode) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); if (range.peek().functionId() == CSSValueRepeat) { CSSParserTokenRange args = consumeFunction(range); - RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue = consumeLengthOrPercent(args, cssParserMode, ValueRangeNonNegative); + RawPtr<CSSPrimitiveValue> parsedValue = consumeLengthOrPercent(args, cssParserMode, ValueRangeNonNegative); if (args.atEnd() && parsedValue && (parsedValue->isCalculated() || parsedValue->getDoubleValue() > 0)) { - RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueRepeat); + RawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueRepeat); result->append(parsedValue.release()); return result.release(); } @@ -2411,42 +2411,42 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBorderRadiusCorner(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeBorderRadiusCorner(CSSParserTokenRange& range, CSSParserMode cssParserMode) { - RefPtrWillBeRawPtr<CSSValue> parsedValue1 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative); + RawPtr<CSSValue> parsedValue1 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative); if (!parsedValue1) return nullptr; - RefPtrWillBeRawPtr<CSSValue> parsedValue2 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative); + RawPtr<CSSValue> parsedValue2 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative); if (!parsedValue2) parsedValue2 = parsedValue1; return CSSValuePair::create(parsedValue1.release(), parsedValue2.release(), CSSValuePair::DropIdenticalValues); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeVerticalAlign(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSPrimitiveValue> consumeVerticalAlign(CSSParserTokenRange& range, CSSParserMode cssParserMode) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue = consumeIdentRange(range, CSSValueBaseline, CSSValueWebkitBaselineMiddle); + RawPtr<CSSPrimitiveValue> parsedValue = consumeIdentRange(range, CSSValueBaseline, CSSValueWebkitBaselineMiddle); if (!parsedValue) parsedValue = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow); return parsedValue.release(); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeShapeRadius(CSSParserTokenRange& args, CSSParserMode cssParserMode) +static RawPtr<CSSPrimitiveValue> consumeShapeRadius(CSSParserTokenRange& args, CSSParserMode cssParserMode) { if (identMatches<CSSValueClosestSide, CSSValueFarthestSide>(args.peek().id())) return consumeIdent(args); return consumeLengthOrPercent(args, cssParserMode, ValueRangeNonNegative); } -static PassRefPtrWillBeRawPtr<CSSBasicShapeCircleValue> consumeBasicShapeCircle(CSSParserTokenRange& args, const CSSParserContext& context) +static RawPtr<CSSBasicShapeCircleValue> consumeBasicShapeCircle(CSSParserTokenRange& args, const CSSParserContext& context) { // spec: https://drafts.csswg.org/css-shapes/#supported-basic-shapes // circle( [<shape-radius>]? [at <position>]? ) - RefPtrWillBeRawPtr<CSSBasicShapeCircleValue> shape = CSSBasicShapeCircleValue::create(); - if (RefPtrWillBeRawPtr<CSSPrimitiveValue> radius = consumeShapeRadius(args, context.mode())) + RawPtr<CSSBasicShapeCircleValue> shape = CSSBasicShapeCircleValue::create(); + if (RawPtr<CSSPrimitiveValue> radius = consumeShapeRadius(args, context.mode())) shape->setRadius(radius.release()); if (consumeIdent<CSSValueAt>(args)) { - RefPtrWillBeRawPtr<CSSValue> centerX = nullptr; - RefPtrWillBeRawPtr<CSSValue> centerY = nullptr; + RawPtr<CSSValue> centerX = nullptr; + RawPtr<CSSValue> centerY = nullptr; if (!consumePosition(args, context.mode(), UnitlessQuirk::Forbid, centerX, centerY)) return nullptr; shape->setCenterX(centerX); @@ -2455,19 +2455,19 @@ return shape.release(); } -static PassRefPtrWillBeRawPtr<CSSBasicShapeEllipseValue> consumeBasicShapeEllipse(CSSParserTokenRange& args, const CSSParserContext& context) +static RawPtr<CSSBasicShapeEllipseValue> consumeBasicShapeEllipse(CSSParserTokenRange& args, const CSSParserContext& context) { // spec: https://drafts.csswg.org/css-shapes/#supported-basic-shapes // ellipse( [<shape-radius>{2}]? [at <position>]? ) - RefPtrWillBeRawPtr<CSSBasicShapeEllipseValue> shape = CSSBasicShapeEllipseValue::create(); - if (RefPtrWillBeRawPtr<CSSPrimitiveValue> radiusX = consumeShapeRadius(args, context.mode())) { + RawPtr<CSSBasicShapeEllipseValue> shape = CSSBasicShapeEllipseValue::create(); + if (RawPtr<CSSPrimitiveValue> radiusX = consumeShapeRadius(args, context.mode())) { shape->setRadiusX(radiusX); - if (RefPtrWillBeRawPtr<CSSPrimitiveValue> radiusY = consumeShapeRadius(args, context.mode())) + if (RawPtr<CSSPrimitiveValue> radiusY = consumeShapeRadius(args, context.mode())) shape->setRadiusY(radiusY); } if (consumeIdent<CSSValueAt>(args)) { - RefPtrWillBeRawPtr<CSSValue> centerX = nullptr; - RefPtrWillBeRawPtr<CSSValue> centerY = nullptr; + RawPtr<CSSValue> centerX = nullptr; + RawPtr<CSSValue> centerY = nullptr; if (!consumePosition(args, context.mode(), UnitlessQuirk::Forbid, centerX, centerY)) return nullptr; shape->setCenterX(centerX); @@ -2476,9 +2476,9 @@ return shape.release(); } -static PassRefPtrWillBeRawPtr<CSSBasicShapePolygonValue> consumeBasicShapePolygon(CSSParserTokenRange& args, const CSSParserContext& context) +static RawPtr<CSSBasicShapePolygonValue> consumeBasicShapePolygon(CSSParserTokenRange& args, const CSSParserContext& context) { - RefPtrWillBeRawPtr<CSSBasicShapePolygonValue> shape = CSSBasicShapePolygonValue::create(); + RawPtr<CSSBasicShapePolygonValue> shape = CSSBasicShapePolygonValue::create(); if (identMatches<CSSValueEvenodd, CSSValueNonzero>(args.peek().id())) { shape->setWindRule(args.consumeIncludingWhitespace().id() == CSSValueEvenodd ? RULE_EVENODD : RULE_NONZERO); if (!consumeCommaIncludingWhitespace(args)) @@ -2486,10 +2486,10 @@ } do { - RefPtrWillBeRawPtr<CSSPrimitiveValue> xLength = consumeLengthOrPercent(args, context.mode(), ValueRangeAll); + RawPtr<CSSPrimitiveValue> xLength = consumeLengthOrPercent(args, context.mode(), ValueRangeAll); if (!xLength) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> yLength = consumeLengthOrPercent(args, context.mode(), ValueRangeAll); + RawPtr<CSSPrimitiveValue> yLength = consumeLengthOrPercent(args, context.mode(), ValueRangeAll); if (!yLength) return nullptr; shape->appendPoint(xLength.release(), yLength.release()); @@ -2497,7 +2497,7 @@ return shape.release(); } -static void complete4Sides(RefPtrWillBeRawPtr<CSSPrimitiveValue> side[4]) +static void complete4Sides(RawPtr<CSSPrimitiveValue> side[4]) { if (side[3]) return; @@ -2509,7 +2509,7 @@ side[3] = side[1]; } -static bool consumeRadii(RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontalRadii[4], RefPtrWillBeRawPtr<CSSPrimitiveValue> verticalRadii[4], CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing) +static bool consumeRadii(RawPtr<CSSPrimitiveValue> horizontalRadii[4], RawPtr<CSSPrimitiveValue> verticalRadii[4], CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing) { #if ENABLE(OILPAN) // Unconditionally zero initialize the arrays of raw pointers. @@ -2551,15 +2551,15 @@ return true; } -static PassRefPtrWillBeRawPtr<CSSBasicShapeInsetValue> consumeBasicShapeInset(CSSParserTokenRange& args, const CSSParserContext& context) +static RawPtr<CSSBasicShapeInsetValue> consumeBasicShapeInset(CSSParserTokenRange& args, const CSSParserContext& context) { - RefPtrWillBeRawPtr<CSSBasicShapeInsetValue> shape = CSSBasicShapeInsetValue::create(); - RefPtrWillBeRawPtr<CSSPrimitiveValue> top = consumeLengthOrPercent(args, context.mode(), ValueRangeAll); + RawPtr<CSSBasicShapeInsetValue> shape = CSSBasicShapeInsetValue::create(); + RawPtr<CSSPrimitiveValue> top = consumeLengthOrPercent(args, context.mode(), ValueRangeAll); if (!top) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> right = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> left = nullptr; + RawPtr<CSSPrimitiveValue> right = nullptr; + RawPtr<CSSPrimitiveValue> bottom = nullptr; + RawPtr<CSSPrimitiveValue> left = nullptr; if ((right = consumeLengthOrPercent(args, context.mode(), ValueRangeAll))) { if ((bottom = consumeLengthOrPercent(args, context.mode(), ValueRangeAll))) left = consumeLengthOrPercent(args, context.mode(), ValueRangeAll); @@ -2574,8 +2574,8 @@ shape->updateShapeSize1Value(top.get()); if (consumeIdent<CSSValueRound>(args)) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontalRadii[4]; - RefPtrWillBeRawPtr<CSSPrimitiveValue> verticalRadii[4]; + RawPtr<CSSPrimitiveValue> horizontalRadii[4]; + RawPtr<CSSPrimitiveValue> verticalRadii[4]; if (!consumeRadii(horizontalRadii, verticalRadii, args, context.mode(), false)) return nullptr; shape->setTopLeftRadius(CSSValuePair::create(horizontalRadii[0].release(), verticalRadii[0].release(), CSSValuePair::DropIdenticalValues)); @@ -2586,9 +2586,9 @@ return shape.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBasicShape(CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumeBasicShape(CSSParserTokenRange& range, const CSSParserContext& context) { - RefPtrWillBeRawPtr<CSSValue> shape = nullptr; + RawPtr<CSSValue> shape = nullptr; if (range.peek().type() != FunctionToken) return nullptr; CSSValueID id = range.peek().functionId(); @@ -2608,7 +2608,7 @@ return shape.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeClipPath(CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumeClipPath(CSSParserTokenRange& range, const CSSParserContext& context) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); @@ -2618,17 +2618,17 @@ return consumeBasicShape(range, context); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeShapeOutside(CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumeShapeOutside(CSSParserTokenRange& range, const CSSParserContext& context) { - if (RefPtrWillBeRawPtr<CSSValue> imageValue = consumeImageOrNone(range, context)) + if (RawPtr<CSSValue> imageValue = consumeImageOrNone(range, context)) return imageValue.release(); - RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); - if (RefPtrWillBeRawPtr<CSSValue> boxValue = consumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, CSSValueMarginBox>(range)) + RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); + if (RawPtr<CSSValue> boxValue = consumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, CSSValueMarginBox>(range)) list->append(boxValue.release()); - if (RefPtrWillBeRawPtr<CSSValue> shapeValue = consumeBasicShape(range, context)) { + if (RawPtr<CSSValue> shapeValue = consumeBasicShape(range, context)) { list->append(shapeValue.release()); if (list->length() < 2) { - if (RefPtrWillBeRawPtr<CSSValue> boxValue = consumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, CSSValueMarginBox>(range)) + if (RawPtr<CSSValue> boxValue = consumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, CSSValueMarginBox>(range)) list->append(boxValue.release()); } } @@ -2637,7 +2637,7 @@ return list.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeContentDistributionOverflowPosition(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeContentDistributionOverflowPosition(CSSParserTokenRange& range) { if (identMatches<CSSValueNormal, CSSValueBaseline, CSSValueLastBaseline>(range.peek().id())) return CSSContentDistributionValue::create(CSSValueInvalid, range.consumeIncludingWhitespace().id(), CSSValueInvalid); @@ -2676,32 +2676,32 @@ return CSSContentDistributionValue::create(distribution, position, overflow); } -static RefPtrWillBeRawPtr<CSSPrimitiveValue> consumeBorderImageRepeatKeyword(CSSParserTokenRange& range) +static RawPtr<CSSPrimitiveValue> consumeBorderImageRepeatKeyword(CSSParserTokenRange& range) { return consumeIdent<CSSValueStretch, CSSValueRepeat, CSSValueSpace, CSSValueRound>(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBorderImageRepeat(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeBorderImageRepeat(CSSParserTokenRange& range) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontal = consumeBorderImageRepeatKeyword(range); + RawPtr<CSSPrimitiveValue> horizontal = consumeBorderImageRepeatKeyword(range); if (!horizontal) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> vertical = consumeBorderImageRepeatKeyword(range); + RawPtr<CSSPrimitiveValue> vertical = consumeBorderImageRepeatKeyword(range); if (!vertical) vertical = horizontal; return CSSValuePair::create(horizontal.release(), vertical.release(), CSSValuePair::DropIdenticalValues); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBorderImageSlice(CSSPropertyID property, CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeBorderImageSlice(CSSPropertyID property, CSSParserTokenRange& range, CSSParserMode cssParserMode) { bool fill = consumeIdent<CSSValueFill>(range); - RefPtrWillBeRawPtr<CSSPrimitiveValue> slices[4]; + RawPtr<CSSPrimitiveValue> slices[4]; #if ENABLE(OILPAN) // Unconditionally zero initialize the arrays of raw pointers. memset(slices, 0, 4 * sizeof(slices[0])); #endif for (size_t index = 0; index < 4; ++index) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> value = consumePercent(range, ValueRangeNonNegative); + RawPtr<CSSPrimitiveValue> value = consumePercent(range, ValueRangeNonNegative); if (!value) value = consumeNumber(range, ValueRangeNonNegative); if (!value) @@ -2723,14 +2723,14 @@ return CSSBorderImageSliceValue::create(CSSQuadValue::create(slices[0].release(), slices[1].release(), slices[2].release(), slices[3].release(), CSSQuadValue::SerializeAsQuad), fill); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBorderImageOutset(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeBorderImageOutset(CSSParserTokenRange& range) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> outsets[4]; + RawPtr<CSSPrimitiveValue> outsets[4]; #if ENABLE(OILPAN) // Unconditionally zero initialize the arrays of raw pointers. memset(outsets, 0, 4 * sizeof(outsets[0])); #endif - RefPtrWillBeRawPtr<CSSPrimitiveValue> value = nullptr; + RawPtr<CSSPrimitiveValue> value = nullptr; for (size_t index = 0; index < 4; ++index) { value = consumeNumber(range, ValueRangeNonNegative); if (!value) @@ -2745,14 +2745,14 @@ return CSSQuadValue::create(outsets[0].release(), outsets[1].release(), outsets[2].release(), outsets[3].release(), CSSQuadValue::SerializeAsQuad); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBorderImageWidth(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeBorderImageWidth(CSSParserTokenRange& range) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> widths[4]; + RawPtr<CSSPrimitiveValue> widths[4]; #if ENABLE(OILPAN) // Unconditionally zero initialize the arrays of raw pointers. memset(widths, 0, 4 * sizeof(widths[0])); #endif - RefPtrWillBeRawPtr<CSSPrimitiveValue> value = nullptr; + RawPtr<CSSPrimitiveValue> value = nullptr; for (size_t index = 0; index < 4; ++index) { value = consumeNumber(range, ValueRangeNonNegative); if (!value) @@ -2769,8 +2769,8 @@ return CSSQuadValue::create(widths[0].release(), widths[1].release(), widths[2].release(), widths[3].release(), CSSQuadValue::SerializeAsQuad); } -static bool consumeBorderImageComponents(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context, RefPtrWillBeRawPtr<CSSValue>& source, - RefPtrWillBeRawPtr<CSSValue>& slice, RefPtrWillBeRawPtr<CSSValue>& width, RefPtrWillBeRawPtr<CSSValue>& outset, RefPtrWillBeRawPtr<CSSValue>& repeat) +static bool consumeBorderImageComponents(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context, RawPtr<CSSValue>& source, + RawPtr<CSSValue>& slice, RawPtr<CSSValue>& width, RawPtr<CSSValue>& outset, RawPtr<CSSValue>& repeat) { do { if (!source && (source = consumeImageOrNone(range, context))) @@ -2796,25 +2796,25 @@ return true; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeWebkitBorderImage(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumeWebkitBorderImage(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context) { - RefPtrWillBeRawPtr<CSSValue> source = nullptr; - RefPtrWillBeRawPtr<CSSValue> slice = nullptr; - RefPtrWillBeRawPtr<CSSValue> width = nullptr; - RefPtrWillBeRawPtr<CSSValue> outset = nullptr; - RefPtrWillBeRawPtr<CSSValue> repeat = nullptr; + RawPtr<CSSValue> source = nullptr; + RawPtr<CSSValue> slice = nullptr; + RawPtr<CSSValue> width = nullptr; + RawPtr<CSSValue> outset = nullptr; + RawPtr<CSSValue> repeat = nullptr; if (consumeBorderImageComponents(property, range, context, source, slice, width, outset, repeat)) return createBorderImageValue(source, slice, width, outset, repeat); return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeReflect(CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumeReflect(CSSParserTokenRange& range, const CSSParserContext& context) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> direction = consumeIdent<CSSValueAbove, CSSValueBelow, CSSValueLeft, CSSValueRight>(range); + RawPtr<CSSPrimitiveValue> direction = consumeIdent<CSSValueAbove, CSSValueBelow, CSSValueLeft, CSSValueRight>(range); if (!direction) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> offset = nullptr; + RawPtr<CSSPrimitiveValue> offset = nullptr; if (range.atEnd()) { offset = cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Pixels); } else { @@ -2823,7 +2823,7 @@ return nullptr; } - RefPtrWillBeRawPtr<CSSValue> mask = nullptr; + RawPtr<CSSValue> mask = nullptr; if (!range.atEnd()) { mask = consumeWebkitBorderImage(CSSPropertyWebkitBoxReflect, range, context); if (!mask) @@ -2832,26 +2832,26 @@ return CSSReflectValue::create(direction.release(), offset.release(), mask.release()); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeFontSizeAdjust(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeFontSizeAdjust(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); return consumeNumber(range, ValueRangeNonNegative); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeImageOrientation(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeImageOrientation(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueFromImage) return consumeIdent(range); if (range.peek().type() != NumberToken) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> angle = consumeAngle(range); + RawPtr<CSSPrimitiveValue> angle = consumeAngle(range); if (angle && angle->getDoubleValue() == 0) return angle; } return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBackgroundBlendMode(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeBackgroundBlendMode(CSSParserTokenRange& range) { CSSValueID id = range.peek().id(); if (id == CSSValueNormal || id == CSSValueOverlay || (id >= CSSValueMultiply && id <= CSSValueLuminosity)) @@ -2859,47 +2859,47 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBackgroundAttachment(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeBackgroundAttachment(CSSParserTokenRange& range) { return consumeIdent<CSSValueScroll, CSSValueFixed, CSSValueLocal>(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBackgroundBox(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeBackgroundBox(CSSParserTokenRange& range) { return consumeIdent<CSSValueBorderBox, CSSValuePaddingBox, CSSValueContentBox>(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBackgroundComposite(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeBackgroundComposite(CSSParserTokenRange& range) { return consumeIdentRange(range, CSSValueClear, CSSValuePlusLighter); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeMaskSourceType(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeMaskSourceType(CSSParserTokenRange& range) { ASSERT(RuntimeEnabledFeatures::cssMaskSourceTypeEnabled()); return consumeIdent<CSSValueAuto, CSSValueAlpha, CSSValueLuminance>(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumePrefixedBackgroundBox(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumePrefixedBackgroundBox(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context) { // The values 'border', 'padding' and 'content' are deprecated and do not apply to the version of the property that has the -webkit- prefix removed. - if (RefPtrWillBeRawPtr<CSSValue> value = consumeIdentRange(range, CSSValueBorder, CSSValuePaddingBox)) + if (RawPtr<CSSValue> value = consumeIdentRange(range, CSSValueBorder, CSSValuePaddingBox)) return value.release(); if ((property == CSSPropertyWebkitBackgroundClip || property == CSSPropertyWebkitMaskClip) && range.peek().id() == CSSValueText) return consumeIdent(range); return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBackgroundSize(CSSPropertyID unresolvedProperty, CSSParserTokenRange& range, CSSParserMode mode) +static RawPtr<CSSValue> consumeBackgroundSize(CSSPropertyID unresolvedProperty, CSSParserTokenRange& range, CSSParserMode mode) { if (identMatches<CSSValueContain, CSSValueCover>(range.peek().id())) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontal = consumeIdent<CSSValueAuto>(range); + RawPtr<CSSPrimitiveValue> horizontal = consumeIdent<CSSValueAuto>(range); if (!horizontal) horizontal = consumeLengthOrPercent(range, mode, ValueRangeAll, UnitlessQuirk::Forbid); - RefPtrWillBeRawPtr<CSSPrimitiveValue> vertical = nullptr; + RawPtr<CSSPrimitiveValue> vertical = nullptr; if (!range.atEnd()) { if (range.peek().id() == CSSValueAuto) // `auto' is the default range.consumeIncludingWhitespace(); @@ -2914,7 +2914,7 @@ return CSSValuePair::create(horizontal.release(), vertical.release(), CSSValuePair::KeepIdenticalValues); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeBackgroundComponent(CSSPropertyID unresolvedProperty, CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumeBackgroundComponent(CSSPropertyID unresolvedProperty, CSSParserTokenRange& range, const CSSParserContext& context) { switch (unresolvedProperty) { case CSSPropertyBackgroundClip: @@ -2955,11 +2955,11 @@ return nullptr; } -static void addBackgroundValue(RefPtrWillBeRawPtr<CSSValue>& list, PassRefPtrWillBeRawPtr<CSSValue> value) +static void addBackgroundValue(RawPtr<CSSValue>& list, RawPtr<CSSValue> value) { if (list) { if (!list->isBaseValueList()) { - RefPtrWillBeRawPtr<CSSValue> firstValue = list.release(); + RawPtr<CSSValue> firstValue = list.release(); list = CSSValueList::createCommaSeparated(); toCSSValueList(list.get())->append(firstValue.release()); } @@ -2970,11 +2970,11 @@ } } -static PassRefPtrWillBeRawPtr<CSSValue> consumeCommaSeparatedBackgroundComponent(CSSPropertyID unresolvedProperty, CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumeCommaSeparatedBackgroundComponent(CSSPropertyID unresolvedProperty, CSSParserTokenRange& range, const CSSParserContext& context) { - RefPtrWillBeRawPtr<CSSValue> result = nullptr; + RawPtr<CSSValue> result = nullptr; do { - RefPtrWillBeRawPtr<CSSValue> value = consumeBackgroundComponent(unresolvedProperty, range, context); + RawPtr<CSSValue> value = consumeBackgroundComponent(unresolvedProperty, range, context); if (!value) return nullptr; addBackgroundValue(result, value); @@ -2982,7 +2982,7 @@ return result.release(); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeSelfPositionKeyword(CSSParserTokenRange& range) +static RawPtr<CSSPrimitiveValue> consumeSelfPositionKeyword(CSSParserTokenRange& range) { CSSValueID id = range.peek().id(); if (id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter @@ -2992,13 +2992,13 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeSelfPositionOverflowPosition(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeSelfPositionOverflowPosition(CSSParserTokenRange& range) { if (identMatches<CSSValueAuto, CSSValueStretch, CSSValueBaseline, CSSValueLastBaseline>(range.peek().id())) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSPrimitiveValue> overflowPosition = consumeIdent<CSSValueUnsafe, CSSValueSafe>(range); - RefPtrWillBeRawPtr<CSSPrimitiveValue> selfPosition = consumeSelfPositionKeyword(range); + RawPtr<CSSPrimitiveValue> overflowPosition = consumeIdent<CSSValueUnsafe, CSSValueSafe>(range); + RawPtr<CSSPrimitiveValue> selfPosition = consumeSelfPositionKeyword(range); if (!selfPosition) return nullptr; if (!overflowPosition) @@ -3008,11 +3008,11 @@ return selfPosition.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeJustifyItems(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeJustifyItems(CSSParserTokenRange& range) { CSSParserTokenRange rangeCopy = range; - RefPtrWillBeRawPtr<CSSPrimitiveValue> legacy = consumeIdent<CSSValueLegacy>(rangeCopy); - RefPtrWillBeRawPtr<CSSPrimitiveValue> positionKeyword = consumeIdent<CSSValueCenter, CSSValueLeft, CSSValueRight>(rangeCopy); + RawPtr<CSSPrimitiveValue> legacy = consumeIdent<CSSValueLegacy>(rangeCopy); + RawPtr<CSSPrimitiveValue> positionKeyword = consumeIdent<CSSValueCenter, CSSValueLeft, CSSValueRight>(rangeCopy); if (!legacy) legacy = consumeIdent<CSSValueLegacy>(rangeCopy); if (legacy && positionKeyword) { @@ -3022,21 +3022,21 @@ return consumeSelfPositionOverflowPosition(range); } -static PassRefPtrWillBeRawPtr<CSSCustomIdentValue> consumeCustomIdentForGridLine(CSSParserTokenRange& range) +static RawPtr<CSSCustomIdentValue> consumeCustomIdentForGridLine(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueAuto || range.peek().id() == CSSValueSpan) return nullptr; return consumeCustomIdent(range); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeGridLine(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeGridLine(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueAuto) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSPrimitiveValue> spanValue = nullptr; - RefPtrWillBeRawPtr<CSSCustomIdentValue> gridLineName = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> numericValue = consumeInteger(range); + RawPtr<CSSPrimitiveValue> spanValue = nullptr; + RawPtr<CSSCustomIdentValue> gridLineName = nullptr; + RawPtr<CSSPrimitiveValue> numericValue = consumeInteger(range); if (numericValue) { gridLineName = consumeCustomIdentForGridLine(range); spanValue = consumeIdent<CSSValueSpan>(range); @@ -3059,7 +3059,7 @@ if (numericValue && numericValue->getIntValue() == 0) return nullptr; // An <integer> value of zero makes the declaration invalid. - RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); if (spanValue) values->append(spanValue.release()); if (numericValue) @@ -3070,7 +3070,7 @@ return values.release(); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeGridBreadth(CSSParserTokenRange& range, CSSParserMode cssParserMode, TrackSizeRestriction restriction = AllowAll) +static RawPtr<CSSPrimitiveValue> consumeGridBreadth(CSSParserTokenRange& range, CSSParserMode cssParserMode, TrackSizeRestriction restriction = AllowAll) { if (restriction == AllowAll) { const CSSParserToken& token = range.peek(); @@ -3085,7 +3085,7 @@ return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative, UnitlessQuirk::Allow); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeGridTrackSize(CSSParserTokenRange& range, CSSParserMode cssParserMode, TrackSizeRestriction restriction = AllowAll) +static RawPtr<CSSValue> consumeGridTrackSize(CSSParserTokenRange& range, CSSParserMode cssParserMode, TrackSizeRestriction restriction = AllowAll) { const CSSParserToken& token = range.peek(); if (restriction == AllowAll && identMatches<CSSValueAuto>(token.id())) @@ -3094,14 +3094,14 @@ if (token.functionId() == CSSValueMinmax) { CSSParserTokenRange rangeCopy = range; CSSParserTokenRange args = consumeFunction(rangeCopy); - RefPtrWillBeRawPtr<CSSPrimitiveValue> minTrackBreadth = consumeGridBreadth(args, cssParserMode, restriction); + RawPtr<CSSPrimitiveValue> minTrackBreadth = consumeGridBreadth(args, cssParserMode, restriction); if (!minTrackBreadth || !consumeCommaIncludingWhitespace(args)) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> maxTrackBreadth = consumeGridBreadth(args, cssParserMode); + RawPtr<CSSPrimitiveValue> maxTrackBreadth = consumeGridBreadth(args, cssParserMode); if (!maxTrackBreadth || !args.atEnd()) return nullptr; range = rangeCopy; - RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueMinmax); + RawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueMinmax); result->append(minTrackBreadth.release()); result->append(maxTrackBreadth.release()); return result.release(); @@ -3109,13 +3109,13 @@ return consumeGridBreadth(range, cssParserMode, restriction); } -static PassRefPtrWillBeRawPtr<CSSGridLineNamesValue> consumeGridLineNames(CSSParserTokenRange& range) +static RawPtr<CSSGridLineNamesValue> consumeGridLineNames(CSSParserTokenRange& range) { CSSParserTokenRange rangeCopy = range; if (rangeCopy.consumeIncludingWhitespace().type() != LeftBracketToken) return nullptr; - RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue::create(); - while (RefPtrWillBeRawPtr<CSSCustomIdentValue> lineName = consumeCustomIdentForGridLine(rangeCopy)) + RawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue::create(); + while (RawPtr<CSSCustomIdentValue> lineName = consumeCustomIdentForGridLine(rangeCopy)) lineNames->append(lineName.release()); if (rangeCopy.consumeIncludingWhitespace().type() != RightBracketToken) return nullptr; @@ -3130,12 +3130,12 @@ // because it will be computed later, let's set it to 1. size_t repetitions = 1; isAutoRepeat = identMatches<CSSValueAutoFill, CSSValueAutoFit>(args.peek().id()); - RefPtrWillBeRawPtr<CSSValueList> repeatedValues; + RawPtr<CSSValueList> repeatedValues; if (isAutoRepeat) { repeatedValues = CSSGridAutoRepeatValue::create(args.consumeIncludingWhitespace().id()); } else { // TODO(rob.buis): a consumeIntegerRaw would be more efficient here. - RefPtrWillBeRawPtr<CSSPrimitiveValue> repetition = consumePositiveInteger(args); + RawPtr<CSSPrimitiveValue> repetition = consumePositiveInteger(args); if (!repetition) return false; repetitions = clampTo<size_t>(repetition->getDoubleValue(), 0, kGridMaxTracks); @@ -3143,7 +3143,7 @@ } if (!consumeCommaIncludingWhitespace(args)) return false; - RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = consumeGridLineNames(args); + RawPtr<CSSGridLineNamesValue> lineNames = consumeGridLineNames(args); if (lineNames) repeatedValues->append(lineNames.release()); @@ -3152,7 +3152,7 @@ while (!args.atEnd()) { if (isAutoRepeat && numberOfTracks) return false; - RefPtrWillBeRawPtr<CSSValue> trackSize = consumeGridTrackSize(args, cssParserMode, restriction); + RawPtr<CSSValue> trackSize = consumeGridTrackSize(args, cssParserMode, restriction); if (!trackSize) return false; repeatedValues->append(trackSize.release()); @@ -3178,10 +3178,10 @@ return true; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeGridTrackList(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeGridTrackList(CSSParserTokenRange& range, CSSParserMode cssParserMode) { - RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); - RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = consumeGridLineNames(range); + RawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); + RawPtr<CSSGridLineNamesValue> lineNames = consumeGridLineNames(range); if (lineNames) values->append(lineNames.release()); @@ -3195,7 +3195,7 @@ if (isAutoRepeat && seenAutoRepeat) return nullptr; seenAutoRepeat = seenAutoRepeat || isAutoRepeat; - } else if (RefPtrWillBeRawPtr<CSSValue> value = consumeGridTrackSize(range, cssParserMode, seenAutoRepeat ? FixedSizeOnly : AllowAll)) { + } else if (RawPtr<CSSValue> value = consumeGridTrackSize(range, cssParserMode, seenAutoRepeat ? FixedSizeOnly : AllowAll)) { values->append(value.release()); } else { return nullptr; @@ -3211,14 +3211,14 @@ return values.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeGridTemplatesRowsOrColumns(CSSParserTokenRange& range, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeGridTemplatesRowsOrColumns(CSSParserTokenRange& range, CSSParserMode cssParserMode) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); return consumeGridTrackList(range, cssParserMode); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeGridTemplateAreas(CSSParserTokenRange& range) +static RawPtr<CSSValue> consumeGridTemplateAreas(CSSParserTokenRange& range) { if (range.peek().id() == CSSValueNone) return consumeIdent(range); @@ -3239,7 +3239,7 @@ return CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount); } -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty) +RawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty) { CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); if (CSSParserFastPaths::isKeywordPropertyID(property)) { @@ -3622,7 +3622,7 @@ CSSParserValueList valueList(m_range); if (valueList.size()) { m_valueList = &valueList; - if (RefPtrWillBeRawPtr<CSSValue> result = legacyParseValue(unresolvedProperty)) { + if (RawPtr<CSSValue> result = legacyParseValue(unresolvedProperty)) { while (!m_range.atEnd()) m_range.consume(); return result.release(); @@ -3632,9 +3632,9 @@ } } -static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParserTokenRange& range) +static RawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParserTokenRange& range) { - RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> values = CSSValueList::createCommaSeparated(); do { const CSSParserToken& token = range.consumeIncludingWhitespace(); @@ -3651,12 +3651,12 @@ return values.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeFontFaceSrcURI(CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumeFontFaceSrcURI(CSSParserTokenRange& range, const CSSParserContext& context) { String url = consumeUrl(range); if (url.isNull()) return nullptr; - RefPtrWillBeRawPtr<CSSFontFaceSrcValue> uriValue(CSSFontFaceSrcValue::create(url, context.completeURL(url), context.shouldCheckContentSecurityPolicy())); + RawPtr<CSSFontFaceSrcValue> uriValue(CSSFontFaceSrcValue::create(url, context.completeURL(url), context.shouldCheckContentSecurityPolicy())); uriValue->setReferrer(context.referrer()); if (range.peek().functionId() != CSSValueFormat) @@ -3673,7 +3673,7 @@ return uriValue.release(); } -static PassRefPtrWillBeRawPtr<CSSValue> consumeFontFaceSrcLocal(CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValue> consumeFontFaceSrcLocal(CSSParserTokenRange& range, const CSSParserContext& context) { CSSParserTokenRange args = consumeFunction(range); ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy = context.shouldCheckContentSecurityPolicy(); @@ -3692,13 +3692,13 @@ return nullptr; } -static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceSrc(CSSParserTokenRange& range, const CSSParserContext& context) +static RawPtr<CSSValueList> consumeFontFaceSrc(CSSParserTokenRange& range, const CSSParserContext& context) { - RefPtrWillBeRawPtr<CSSValueList> values(CSSValueList::createCommaSeparated()); + RawPtr<CSSValueList> values(CSSValueList::createCommaSeparated()); do { const CSSParserToken& token = range.peek(); - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr; + RawPtr<CSSValue> parsedValue = nullptr; if (token.functionId() == CSSValueLocal) parsedValue = consumeFontFaceSrcLocal(range, context); else @@ -3712,7 +3712,7 @@ bool CSSPropertyParser::parseFontFaceDescriptor(CSSPropertyID propId) { - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr; + RawPtr<CSSValue> parsedValue = nullptr; switch (propId) { case CSSPropertyFontFamily: if (consumeGenericFamily(m_range)) @@ -3770,7 +3770,7 @@ addProperty(CSSPropertyFontStyle, cssValuePool().createIdentifierValue(fontStyle == FontStyleItalic ? CSSValueItalic : CSSValueNormal), important); addProperty(CSSPropertyFontWeight, cssValuePool().createValue(fontWeight), important); addProperty(CSSPropertyFontSize, cssValuePool().createValue(fontSize, CSSPrimitiveValue::UnitType::Pixels), important); - RefPtrWillBeRawPtr<CSSValueList> fontFamilyList = CSSValueList::createCommaSeparated(); + RawPtr<CSSValueList> fontFamilyList = CSSValueList::createCommaSeparated(); fontFamilyList->append(cssValuePool().createFontFamilyValue(fontFamily)); addProperty(CSSPropertyFontFamily, fontFamilyList.release(), important); @@ -3790,10 +3790,10 @@ return false; } // Optional font-style, font-variant, font-stretch and font-weight. - RefPtrWillBeRawPtr<CSSPrimitiveValue> fontStyle = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> fontVariant = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> fontWeight = nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> fontStretch = nullptr; + RawPtr<CSSPrimitiveValue> fontStyle = nullptr; + RawPtr<CSSPrimitiveValue> fontVariant = nullptr; + RawPtr<CSSPrimitiveValue> fontWeight = nullptr; + RawPtr<CSSPrimitiveValue> fontStretch = nullptr; while (!m_range.atEnd()) { CSSValueID id = m_range.peek().id(); if (!fontStyle && CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStyle, id)) { @@ -3826,14 +3826,14 @@ addProperty(CSSPropertyFontStretch, fontStretch ? fontStretch.release() : cssValuePool().createIdentifierValue(CSSValueNormal), important); // Now a font size _must_ come. - RefPtrWillBeRawPtr<CSSValue> fontSize = consumeFontSize(m_range, m_context.mode()); + RawPtr<CSSValue> fontSize = consumeFontSize(m_range, m_context.mode()); if (!fontSize || m_range.atEnd()) return false; addProperty(CSSPropertyFontSize, fontSize.release(), important); if (consumeSlashIncludingWhitespace(m_range)) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> lineHeight = consumeLineHeight(m_range, m_context.mode()); + RawPtr<CSSPrimitiveValue> lineHeight = consumeLineHeight(m_range, m_context.mode()); if (!lineHeight) return false; addProperty(CSSPropertyLineHeight, lineHeight.release(), important); @@ -3842,7 +3842,7 @@ } // Font family must come now. - RefPtrWillBeRawPtr<CSSValue> parsedFamilyValue = consumeFontFamily(m_range); + RawPtr<CSSValue> parsedFamilyValue = consumeFontFamily(m_range); if (!parsedFamilyValue) return false; @@ -3856,10 +3856,10 @@ bool CSSPropertyParser::consumeBorderSpacing(bool important) { - RefPtrWillBeRawPtr<CSSValue> horizontalSpacing = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative, UnitlessQuirk::Allow); + RawPtr<CSSValue> horizontalSpacing = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative, UnitlessQuirk::Allow); if (!horizontalSpacing) return false; - RefPtrWillBeRawPtr<CSSValue> verticalSpacing = horizontalSpacing; + RawPtr<CSSValue> verticalSpacing = horizontalSpacing; if (!m_range.atEnd()) verticalSpacing = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative, UnitlessQuirk::Allow); if (!verticalSpacing || !m_range.atEnd()) @@ -3869,7 +3869,7 @@ return true; } -static PassRefPtrWillBeRawPtr<CSSValue> consumeSingleViewportDescriptor(CSSParserTokenRange& range, CSSPropertyID propId, CSSParserMode cssParserMode) +static RawPtr<CSSValue> consumeSingleViewportDescriptor(CSSParserTokenRange& range, CSSPropertyID propId, CSSParserMode cssParserMode) { CSSValueID id = range.peek().id(); switch (propId) { @@ -3885,7 +3885,7 @@ case CSSPropertyZoom: { if (id == CSSValueAuto) return consumeIdent(range); - RefPtrWillBeRawPtr<CSSValue> parsedValue = consumeNumber(range, ValueRangeNonNegative); + RawPtr<CSSValue> parsedValue = consumeNumber(range, ValueRangeNonNegative); if (parsedValue) return parsedValue.release(); return consumePercent(range, ValueRangeNonNegative); @@ -3909,10 +3909,10 @@ switch (propId) { case CSSPropertyWidth: { - RefPtrWillBeRawPtr<CSSValue> minWidth = consumeSingleViewportDescriptor(m_range, CSSPropertyMinWidth, m_context.mode()); + RawPtr<CSSValue> minWidth = consumeSingleViewportDescriptor(m_range, CSSPropertyMinWidth, m_context.mode()); if (!minWidth) return false; - RefPtrWillBeRawPtr<CSSValue> maxWidth = minWidth; + RawPtr<CSSValue> maxWidth = minWidth; if (!m_range.atEnd()) maxWidth = consumeSingleViewportDescriptor(m_range, CSSPropertyMaxWidth, m_context.mode()); if (!maxWidth || !m_range.atEnd()) @@ -3922,10 +3922,10 @@ return true; } case CSSPropertyHeight: { - RefPtrWillBeRawPtr<CSSValue> minHeight = consumeSingleViewportDescriptor(m_range, CSSPropertyMinHeight, m_context.mode()); + RawPtr<CSSValue> minHeight = consumeSingleViewportDescriptor(m_range, CSSPropertyMinHeight, m_context.mode()); if (!minHeight) return false; - RefPtrWillBeRawPtr<CSSValue> maxHeight = minHeight; + RawPtr<CSSValue> maxHeight = minHeight; if (!m_range.atEnd()) maxHeight = consumeSingleViewportDescriptor(m_range, CSSPropertyMaxHeight, m_context.mode()); if (!maxHeight || !m_range.atEnd()) @@ -3943,7 +3943,7 @@ case CSSPropertyZoom: case CSSPropertyUserZoom: case CSSPropertyOrientation: { - RefPtrWillBeRawPtr<CSSValue> parsedValue = consumeSingleViewportDescriptor(m_range, propId, m_context.mode()); + RawPtr<CSSValue> parsedValue = consumeSingleViewportDescriptor(m_range, propId, m_context.mode()); if (!parsedValue || !m_range.atEnd()) return false; addProperty(propId, parsedValue.release(), important); @@ -3954,7 +3954,7 @@ } } -static bool consumeColumnWidthOrCount(CSSParserTokenRange& range, CSSParserMode cssParserMode, RefPtrWillBeRawPtr<CSSValue>& columnWidth, RefPtrWillBeRawPtr<CSSValue>& columnCount) +static bool consumeColumnWidthOrCount(CSSParserTokenRange& range, CSSParserMode cssParserMode, RawPtr<CSSValue>& columnWidth, RawPtr<CSSValue>& columnCount) { if (range.peek().id() == CSSValueAuto) { consumeIdent(range); @@ -3971,8 +3971,8 @@ bool CSSPropertyParser::consumeColumns(bool important) { - RefPtrWillBeRawPtr<CSSValue> columnWidth = nullptr; - RefPtrWillBeRawPtr<CSSValue> columnCount = nullptr; + RawPtr<CSSValue> columnWidth = nullptr; + RawPtr<CSSValue> columnCount = nullptr; if (!consumeColumnWidthOrCount(m_range, m_context.mode(), columnWidth, columnCount)) return false; consumeColumnWidthOrCount(m_range, m_context.mode(), columnWidth, columnCount); @@ -3990,7 +3990,7 @@ bool CSSPropertyParser::consumeShorthandGreedily(const StylePropertyShorthand& shorthand, bool important) { ASSERT(shorthand.length() <= 6); // Existing shorthands have at most 6 longhands. - RefPtrWillBeRawPtr<CSSValue> longhands[6] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; + RawPtr<CSSValue> longhands[6] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; const CSSPropertyID* shorthandProperties = shorthand.properties(); do { bool foundLonghand = false; @@ -4019,7 +4019,7 @@ static const double unsetValue = -1; double flexGrow = unsetValue; double flexShrink = unsetValue; - RefPtrWillBeRawPtr<CSSPrimitiveValue> flexBasis = nullptr; + RawPtr<CSSPrimitiveValue> flexBasis = nullptr; if (m_range.peek().id() == CSSValueNone) { flexGrow = 0; @@ -4070,9 +4070,9 @@ bool CSSPropertyParser::consumeBorder(bool important) { - RefPtrWillBeRawPtr<CSSValue> width = nullptr; - RefPtrWillBeRawPtr<CSSValue> style = nullptr; - RefPtrWillBeRawPtr<CSSValue> color = nullptr; + RawPtr<CSSValue> width = nullptr; + RawPtr<CSSValue> style = nullptr; + RawPtr<CSSValue> color = nullptr; while (!width || !style || !color) { if (!width && (width = consumeLineWidth(m_range, m_context.mode(), UnitlessQuirk::Forbid))) @@ -4106,13 +4106,13 @@ { ASSERT(shorthand.length() == 4); const CSSPropertyID* longhands = shorthand.properties(); - RefPtrWillBeRawPtr<CSSValue> top = parseSingleValue(longhands[0]); + RawPtr<CSSValue> top = parseSingleValue(longhands[0]); if (!top) return false; - RefPtrWillBeRawPtr<CSSValue> right = nullptr; - RefPtrWillBeRawPtr<CSSValue> bottom = nullptr; - RefPtrWillBeRawPtr<CSSValue> left = nullptr; + RawPtr<CSSValue> right = nullptr; + RawPtr<CSSValue> bottom = nullptr; + RawPtr<CSSValue> left = nullptr; if ((right = parseSingleValue(longhands[1]))) { if ((bottom = parseSingleValue(longhands[2]))) left = parseSingleValue(longhands[3]); @@ -4135,11 +4135,11 @@ bool CSSPropertyParser::consumeBorderImage(CSSPropertyID property, bool important) { - RefPtrWillBeRawPtr<CSSValue> source = nullptr; - RefPtrWillBeRawPtr<CSSValue> slice = nullptr; - RefPtrWillBeRawPtr<CSSValue> width = nullptr; - RefPtrWillBeRawPtr<CSSValue> outset = nullptr; - RefPtrWillBeRawPtr<CSSValue> repeat = nullptr; + RawPtr<CSSValue> source = nullptr; + RawPtr<CSSValue> slice = nullptr; + RawPtr<CSSValue> width = nullptr; + RawPtr<CSSValue> outset = nullptr; + RawPtr<CSSValue> repeat = nullptr; if (consumeBorderImageComponents(property, m_range, m_context, source, slice, width, outset, repeat)) { switch (property) { case CSSPropertyWebkitMaskBoxImage: @@ -4204,7 +4204,7 @@ // The fragmentation spec says that page-break-(after|before|inside) are to be treated as // shorthands for their break-(after|before|inside) counterparts. We'll do the same for the // non-standard properties -webkit-column-break-(after|before|inside). - RefPtrWillBeRawPtr<CSSPrimitiveValue> keyword = consumeIdent(m_range); + RawPtr<CSSPrimitiveValue> keyword = consumeIdent(m_range); if (!keyword) return false; if (!m_range.atEnd()) @@ -4234,11 +4234,11 @@ return true; } -static bool consumeBackgroundPosition(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless, RefPtrWillBeRawPtr<CSSValue>& resultX, RefPtrWillBeRawPtr<CSSValue>& resultY) +static bool consumeBackgroundPosition(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless, RawPtr<CSSValue>& resultX, RawPtr<CSSValue>& resultY) { do { - RefPtrWillBeRawPtr<CSSValue> positionX = nullptr; - RefPtrWillBeRawPtr<CSSValue> positionY = nullptr; + RawPtr<CSSValue> positionX = nullptr; + RawPtr<CSSValue> positionY = nullptr; if (!consumePosition(range, context.mode(), unitless, positionX, positionY)) return false; addBackgroundValue(resultX, positionX); @@ -4247,7 +4247,7 @@ return true; } -static bool consumeRepeatStyleComponent(CSSParserTokenRange& range, RefPtrWillBeRawPtr<CSSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2, bool& implicit) +static bool consumeRepeatStyleComponent(CSSParserTokenRange& range, RawPtr<CSSValue>& value1, RawPtr<CSSValue>& value2, bool& implicit) { if (consumeIdent<CSSValueRepeatX>(range)) { value1 = cssValuePool().createIdentifierValue(CSSValueRepeat); @@ -4273,11 +4273,11 @@ return true; } -static bool consumeRepeatStyle(CSSParserTokenRange& range, RefPtrWillBeRawPtr<CSSValue>& resultX, RefPtrWillBeRawPtr<CSSValue>& resultY, bool& implicit) +static bool consumeRepeatStyle(CSSParserTokenRange& range, RawPtr<CSSValue>& resultX, RawPtr<CSSValue>& resultY, bool& implicit) { do { - RefPtrWillBeRawPtr<CSSValue> repeatX = nullptr; - RefPtrWillBeRawPtr<CSSValue> repeatY = nullptr; + RawPtr<CSSValue> repeatX = nullptr; + RawPtr<CSSValue> repeatY = nullptr; if (!consumeRepeatStyleComponent(range, repeatX, repeatY, implicit)) return false; addBackgroundValue(resultX, repeatX); @@ -4291,7 +4291,7 @@ bool CSSPropertyParser::consumeBackgroundShorthand(const StylePropertyShorthand& shorthand, bool important) { const unsigned longhandCount = shorthand.length(); - RefPtrWillBeRawPtr<CSSValue> longhands[10]; + RawPtr<CSSValue> longhands[10]; ASSERT(longhandCount <= 10); #if ENABLE(OILPAN) // Zero initialize the array of raw pointers. @@ -4300,15 +4300,15 @@ bool implicit = false; do { bool parsedLonghand[10] = { false }; - RefPtrWillBeRawPtr<CSSValue> originValue = nullptr; + RawPtr<CSSValue> originValue = nullptr; do { bool foundProperty = false; for (size_t i = 0; i < longhandCount; ++i) { if (parsedLonghand[i]) continue; - RefPtrWillBeRawPtr<CSSValue> value = nullptr; - RefPtrWillBeRawPtr<CSSValue> valueY = nullptr; + RawPtr<CSSValue> value = nullptr; + RawPtr<CSSValue> valueY = nullptr; CSSPropertyID property = shorthand.properties()[i]; if (property == CSSPropertyBackgroundRepeatX || property == CSSPropertyWebkitMaskRepeatX) { consumeRepeatStyleComponent(m_range, value, valueY, implicit); @@ -4378,11 +4378,11 @@ ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); const StylePropertyShorthand& shorthand = shorthandForProperty(shorthandId); ASSERT(shorthand.length() == 2); - RefPtrWillBeRawPtr<CSSValue> startValue = consumeGridLine(m_range); + RawPtr<CSSValue> startValue = consumeGridLine(m_range); if (!startValue) return false; - RefPtrWillBeRawPtr<CSSValue> endValue = nullptr; + RawPtr<CSSValue> endValue = nullptr; if (consumeSlashIncludingWhitespace(m_range)) { endValue = consumeGridLine(m_range); if (!endValue) @@ -4401,12 +4401,12 @@ { ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); ASSERT(gridAreaShorthand().length() == 4); - RefPtrWillBeRawPtr<CSSValue> rowStartValue = consumeGridLine(m_range); + RawPtr<CSSValue> rowStartValue = consumeGridLine(m_range); if (!rowStartValue) return false; - RefPtrWillBeRawPtr<CSSValue> columnStartValue = nullptr; - RefPtrWillBeRawPtr<CSSValue> rowEndValue = nullptr; - RefPtrWillBeRawPtr<CSSValue> columnEndValue = nullptr; + RawPtr<CSSValue> columnStartValue = nullptr; + RawPtr<CSSValue> rowEndValue = nullptr; + RawPtr<CSSValue> columnEndValue = nullptr; if (consumeSlashIncludingWhitespace(m_range)) { columnStartValue = consumeGridLine(m_range); if (!columnStartValue) @@ -4450,7 +4450,7 @@ CSSValueID id = m_range.consumeIncludingWhitespace().id(); if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id)) return false; - RefPtrWillBeRawPtr<CSSValue> beforeCollapse = cssValuePool().createIdentifierValue(id); + RawPtr<CSSValue> beforeCollapse = cssValuePool().createIdentifierValue(id); addProperty(CSSPropertyWebkitMarginBeforeCollapse, beforeCollapse, important); if (m_range.atEnd()) { addProperty(CSSPropertyWebkitMarginAfterCollapse, beforeCollapse, important); @@ -4468,9 +4468,9 @@ return false; if (!m_range.atEnd()) return false; - RefPtrWillBeRawPtr<CSSValue> overflowYValue = cssValuePool().createIdentifierValue(id); + RawPtr<CSSValue> overflowYValue = cssValuePool().createIdentifierValue(id); - RefPtrWillBeRawPtr<CSSValue> overflowXValue = nullptr; + RawPtr<CSSValue> overflowXValue = nullptr; // FIXME: -webkit-paged-x or -webkit-paged-y only apply to overflow-y. If this value has been // set using the shorthand, then for now overflow-x will default to auto, but once we implement @@ -4525,7 +4525,7 @@ case CSSPropertyWebkitTextStroke: return consumeShorthandGreedily(webkitTextStrokeShorthand(), important); case CSSPropertyMarker: { - RefPtrWillBeRawPtr<CSSValue> marker = parseSingleValue(CSSPropertyMarkerStart); + RawPtr<CSSValue> marker = parseSingleValue(CSSPropertyMarkerStart); if (!marker || !m_range.atEnd()) return false; addProperty(CSSPropertyMarkerStart, marker, important); @@ -4542,8 +4542,8 @@ case CSSPropertyListStyle: return consumeShorthandGreedily(listStyleShorthand(), important); case CSSPropertyBorderRadius: { - RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontalRadii[4]; - RefPtrWillBeRawPtr<CSSPrimitiveValue> verticalRadii[4]; + RawPtr<CSSPrimitiveValue> horizontalRadii[4]; + RawPtr<CSSPrimitiveValue> verticalRadii[4]; if (!consumeRadii(horizontalRadii, verticalRadii, m_range, m_context.mode(), unresolvedProperty == CSSPropertyAliasWebkitBorderRadius)) return false; addProperty(CSSPropertyBorderTopLeftRadius, CSSValuePair::create(horizontalRadii[0].release(), verticalRadii[0].release(), CSSValuePair::DropIdenticalValues), important); @@ -4580,8 +4580,8 @@ return consumeLegacyBreakProperty(property, important); case CSSPropertyWebkitMaskPosition: case CSSPropertyBackgroundPosition: { - RefPtrWillBeRawPtr<CSSValue> resultX = nullptr; - RefPtrWillBeRawPtr<CSSValue> resultY = nullptr; + RawPtr<CSSValue> resultX = nullptr; + RawPtr<CSSValue> resultY = nullptr; if (!consumeBackgroundPosition(m_range, m_context, UnitlessQuirk::Allow, resultX, resultY) || !m_range.atEnd()) return false; addProperty(property == CSSPropertyBackgroundPosition ? CSSPropertyBackgroundPositionX : CSSPropertyWebkitMaskPositionX, resultX.release(), important); @@ -4590,8 +4590,8 @@ } case CSSPropertyBackgroundRepeat: case CSSPropertyWebkitMaskRepeat: { - RefPtrWillBeRawPtr<CSSValue> resultX = nullptr; - RefPtrWillBeRawPtr<CSSValue> resultY = nullptr; + RawPtr<CSSValue> resultX = nullptr; + RawPtr<CSSValue> resultY = nullptr; bool implicit = false; if (!consumeRepeatStyle(m_range, resultX, resultY, implicit) || !m_range.atEnd()) return false; @@ -4605,8 +4605,8 @@ return consumeBackgroundShorthand(webkitMaskShorthand(), important); case CSSPropertyGridGap: { ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled() && shorthandForProperty(CSSPropertyGridGap).length() == 2); - RefPtrWillBeRawPtr<CSSValue> rowGap = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative); - RefPtrWillBeRawPtr<CSSValue> columnGap = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative); + RawPtr<CSSValue> rowGap = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative); + RawPtr<CSSValue> columnGap = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative); if (!rowGap || !m_range.atEnd()) return false; if (!columnGap)
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h index 5c5b17e..f6f5292d9 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h
@@ -71,10 +71,10 @@ static bool parseValue(CSSPropertyID, bool important, const CSSParserTokenRange&, const CSSParserContext&, - WillBeHeapVector<CSSProperty, 256>&, StyleRule::RuleType); + HeapVector<CSSProperty, 256>&, StyleRule::RuleType); // Parses a non-shorthand CSS property - static PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID, const CSSParserTokenRange&, const CSSParserContext&); + static RawPtr<CSSValue> parseSingleValue(CSSPropertyID, const CSSParserTokenRange&, const CSSParserContext&); // TODO(timloh): This doesn't seem like the right place for these static bool isSystemColor(CSSValueID); @@ -83,14 +83,14 @@ private: CSSPropertyParser(const CSSParserTokenRange&, const CSSParserContext&, - WillBeHeapVector<CSSProperty, 256>*); + HeapVector<CSSProperty, 256>*); // TODO(timloh): Rename once the CSSParserValue-based parseValue is removed bool parseValueStart(CSSPropertyID unresolvedProperty, bool important); bool consumeCSSWideKeyword(CSSPropertyID unresolvedProperty, bool important); - PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID); + RawPtr<CSSValue> parseSingleValue(CSSPropertyID); - PassRefPtrWillBeRawPtr<CSSValue> legacyParseValue(CSSPropertyID); + RawPtr<CSSValue> legacyParseValue(CSSPropertyID); bool legacyParseAndApplyValue(CSSPropertyID, bool important); bool legacyParseShorthand(CSSPropertyID, bool important); @@ -100,8 +100,8 @@ bool parseViewportDescriptor(CSSPropertyID propId, bool important); bool parseFontFaceDescriptor(CSSPropertyID); - void addProperty(CSSPropertyID, PassRefPtrWillBeRawPtr<CSSValue>, bool important, bool implicit = false); - void addExpandedPropertyForValue(CSSPropertyID propId, PassRefPtrWillBeRawPtr<CSSValue>, bool); + void addProperty(CSSPropertyID, RawPtr<CSSValue>, bool important, bool implicit = false); + void addExpandedPropertyForValue(CSSPropertyID propId, RawPtr<CSSValue>, bool); bool consumeBorder(bool important); @@ -116,17 +116,17 @@ bool consumeColumns(bool important); bool consumeGridItemPositionShorthand(CSSPropertyID, bool important); - PassRefPtrWillBeRawPtr<CSSValue> parseGridTemplateColumns(bool important); + RawPtr<CSSValue> parseGridTemplateColumns(bool important); bool parseGridTemplateRowsAndAreasAndColumns(bool important); bool parseGridTemplateShorthand(bool important); bool parseGridShorthand(bool important); bool consumeGridAreaShorthand(bool important); - PassRefPtrWillBeRawPtr<CSSValue> parseGridTrackList(); + RawPtr<CSSValue> parseGridTrackList(); bool parseGridTrackRepeatFunction(CSSValueList&, bool& isAutoRepeat); - PassRefPtrWillBeRawPtr<CSSValue> parseGridTrackSize(CSSParserValueList& inputList, TrackSizeRestriction = AllowAll); - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseGridBreadth(CSSParserValue*, TrackSizeRestriction = AllowAll); + RawPtr<CSSValue> parseGridTrackSize(CSSParserValueList& inputList, TrackSizeRestriction = AllowAll); + RawPtr<CSSPrimitiveValue> parseGridBreadth(CSSParserValue*, TrackSizeRestriction = AllowAll); bool parseGridLineNames(CSSParserValueList&, CSSValueList&, CSSGridLineNamesValue* = nullptr); - PassRefPtrWillBeRawPtr<CSSValue> parseGridAutoFlow(CSSParserValueList&); + RawPtr<CSSValue> parseGridAutoFlow(CSSParserValueList&); bool consumeFont(bool important); bool consumeSystemFont(bool important); @@ -142,8 +142,8 @@ bool parseCalculation(CSSParserValue*, ValueRange); - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createPrimitiveNumericValue(CSSParserValue*); - PassRefPtrWillBeRawPtr<CSSCustomIdentValue> createPrimitiveCustomIdentValue(CSSParserValue*); + RawPtr<CSSPrimitiveValue> createPrimitiveNumericValue(CSSParserValue*); + RawPtr<CSSCustomIdentValue> createPrimitiveCustomIdentValue(CSSParserValue*); class ShorthandScope { STACK_ALLOCATED(); @@ -187,12 +187,12 @@ const CSSParserContext& m_context; // Outputs: - WillBeHeapVector<CSSProperty, 256>* m_parsedProperties; + HeapVector<CSSProperty, 256>* m_parsedProperties; // Locals during parsing: int m_inParseShorthand; CSSPropertyID m_currentShorthand; - RefPtrWillBeMember<CSSCalcValue> m_parsedCalculation; + Member<CSSCalcValue> m_parsedCalculation; }; // TODO(rob.buis): should move to CSSPropertyParser after conversion.
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp index 1c6d661d..bf89b1e 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
@@ -56,14 +56,14 @@ } const CSSCalcValue* value() const { return m_calcValue.get(); } - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeValue() + RawPtr<CSSPrimitiveValue> consumeValue() { if (!m_calcValue) return nullptr; m_sourceRange = m_range; return CSSPrimitiveValue::create(m_calcValue.release()); } - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeNumber() + RawPtr<CSSPrimitiveValue> consumeNumber() { if (!m_calcValue) return nullptr; @@ -84,10 +84,10 @@ private: CSSParserTokenRange& m_sourceRange; CSSParserTokenRange m_range; - RefPtrWillBeMember<CSSCalcValue> m_calcValue; + Member<CSSCalcValue> m_calcValue; }; -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeInteger(CSSParserTokenRange& range, double minimumValue) +RawPtr<CSSPrimitiveValue> consumeInteger(CSSParserTokenRange& range, double minimumValue) { const CSSParserToken& token = range.peek(); if (token.type() == NumberToken) { @@ -107,7 +107,7 @@ return nullptr; } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumePositiveInteger(CSSParserTokenRange& range) +RawPtr<CSSPrimitiveValue> consumePositiveInteger(CSSParserTokenRange& range) { return consumeInteger(range, 1); } @@ -123,7 +123,7 @@ } // TODO(timloh): Work out if this can just call consumeNumberRaw -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeNumber(CSSParserTokenRange& range, ValueRange valueRange) +RawPtr<CSSPrimitiveValue> consumeNumber(CSSParserTokenRange& range, ValueRange valueRange) { const CSSParserToken& token = range.peek(); if (token.type() == NumberToken) { @@ -150,7 +150,7 @@ || (cssParserMode == HTMLQuirksMode && unitless == UnitlessQuirk::Allow); } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeLength(CSSParserTokenRange& range, CSSParserMode cssParserMode, ValueRange valueRange, UnitlessQuirk unitless) +RawPtr<CSSPrimitiveValue> consumeLength(CSSParserTokenRange& range, CSSParserMode cssParserMode, ValueRange valueRange, UnitlessQuirk unitless) { const CSSParserToken& token = range.peek(); if (token.type() == DimensionToken) { @@ -199,7 +199,7 @@ return nullptr; } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumePercent(CSSParserTokenRange& range, ValueRange valueRange) +RawPtr<CSSPrimitiveValue> consumePercent(CSSParserTokenRange& range, ValueRange valueRange) { const CSSParserToken& token = range.peek(); if (token.type() == PercentageToken) { @@ -215,7 +215,7 @@ return nullptr; } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeLengthOrPercent(CSSParserTokenRange& range, CSSParserMode cssParserMode, ValueRange valueRange, UnitlessQuirk unitless) +RawPtr<CSSPrimitiveValue> consumeLengthOrPercent(CSSParserTokenRange& range, CSSParserMode cssParserMode, ValueRange valueRange, UnitlessQuirk unitless) { const CSSParserToken& token = range.peek(); if (token.type() == DimensionToken || token.type() == NumberToken) @@ -230,7 +230,7 @@ return nullptr; } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeAngle(CSSParserTokenRange& range) +RawPtr<CSSPrimitiveValue> consumeAngle(CSSParserTokenRange& range) { const CSSParserToken& token = range.peek(); if (token.type() == DimensionToken) { @@ -256,7 +256,7 @@ return nullptr; } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeTime(CSSParserTokenRange& range, ValueRange valueRange) +RawPtr<CSSPrimitiveValue> consumeTime(CSSParserTokenRange& range, ValueRange valueRange) { const CSSParserToken& token = range.peek(); if (token.type() == DimensionToken) { @@ -275,28 +275,28 @@ return nullptr; } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange& range) +RawPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange& range) { if (range.peek().type() != IdentToken) return nullptr; return cssValuePool().createIdentifierValue(range.consumeIncludingWhitespace().id()); } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeIdentRange(CSSParserTokenRange& range, CSSValueID lower, CSSValueID upper) +RawPtr<CSSPrimitiveValue> consumeIdentRange(CSSParserTokenRange& range, CSSValueID lower, CSSValueID upper) { if (range.peek().id() < lower || range.peek().id() > upper) return nullptr; return consumeIdent(range); } -PassRefPtrWillBeRawPtr<CSSCustomIdentValue> consumeCustomIdent(CSSParserTokenRange& range) +RawPtr<CSSCustomIdentValue> consumeCustomIdent(CSSParserTokenRange& range) { if (range.peek().type() != IdentToken || isCSSWideKeyword(range.peek().id())) return nullptr; return CSSCustomIdentValue::create(range.consumeIncludingWhitespace().value()); } -PassRefPtrWillBeRawPtr<CSSStringValue> consumeString(CSSParserTokenRange& range) +RawPtr<CSSStringValue> consumeString(CSSParserTokenRange& range) { if (range.peek().type() != StringToken) return nullptr; @@ -338,7 +338,7 @@ { ASSERT(range.peek().functionId() == CSSValueRgb || range.peek().functionId() == CSSValueRgba); CSSParserTokenRange args = consumeFunction(range); - RefPtrWillBeRawPtr<CSSPrimitiveValue> colorParameter = consumeInteger(args); + RawPtr<CSSPrimitiveValue> colorParameter = consumeInteger(args); if (!colorParameter) colorParameter = consumePercent(args, ValueRangeAll); if (!colorParameter) @@ -374,7 +374,7 @@ { ASSERT(range.peek().functionId() == CSSValueHsl || range.peek().functionId() == CSSValueHsla); CSSParserTokenRange args = consumeFunction(range); - RefPtrWillBeRawPtr<CSSPrimitiveValue> hslValue = consumeNumber(args, ValueRangeAll); + RawPtr<CSSPrimitiveValue> hslValue = consumeNumber(args, ValueRangeAll); if (!hslValue) return false; double colorArray[3]; @@ -440,7 +440,7 @@ return true; } -PassRefPtrWillBeRawPtr<CSSValue> consumeColor(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool acceptQuirkyColors) +RawPtr<CSSValue> consumeColor(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool acceptQuirkyColors) { CSSValueID id = range.peek().id(); if (CSSPropertyParser::isColorKeyword(id)) { @@ -454,7 +454,7 @@ return cssValuePool().createColorValue(color); } -static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumePositionComponent(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) +static RawPtr<CSSPrimitiveValue> consumePositionComponent(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) { if (range.peek().type() == IdentToken) return consumeIdent<CSSValueLeft, CSSValueTop, CSSValueBottom, CSSValueRight, CSSValueCenter>(range); @@ -471,7 +471,7 @@ return value.isValueID() && (value.getValueID() == CSSValueTop || value.getValueID() == CSSValueBottom); } -static void positionFromOneValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> value, RefPtrWillBeRawPtr<CSSValue>& resultX, RefPtrWillBeRawPtr<CSSValue>& resultY) +static void positionFromOneValue(RawPtr<CSSPrimitiveValue> value, RawPtr<CSSValue>& resultX, RawPtr<CSSValue>& resultY) { bool valueAppliesToYAxisOnly = isVerticalPositionKeywordOnly(*value); resultX = value; @@ -480,8 +480,8 @@ swap(resultX, resultY); } -static bool positionFromTwoValues(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> value1, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> value2, - RefPtrWillBeRawPtr<CSSValue>& resultX, RefPtrWillBeRawPtr<CSSValue>& resultY) +static bool positionFromTwoValues(RawPtr<CSSPrimitiveValue> value1, RawPtr<CSSPrimitiveValue> value2, + RawPtr<CSSValue>& resultX, RawPtr<CSSValue>& resultY) { bool mustOrderAsXY = isHorizontalPositionKeywordOnly(*value1) || isVerticalPositionKeywordOnly(*value2) || !value1->isValueID() || !value2->isValueID(); @@ -495,7 +495,7 @@ return true; } -static bool positionFromThreeOrFourValues(CSSPrimitiveValue** values, RefPtrWillBeRawPtr<CSSValue>& resultX, RefPtrWillBeRawPtr<CSSValue>& resultY) +static bool positionFromThreeOrFourValues(CSSPrimitiveValue** values, RawPtr<CSSValue>& resultX, RawPtr<CSSValue>& resultY) { CSSPrimitiveValue* center = nullptr; for (int i = 0; values[i]; i++) { @@ -511,7 +511,7 @@ continue; } - RefPtrWillBeRawPtr<CSSValue> result = nullptr; + RawPtr<CSSValue> result = nullptr; if (values[i + 1] && !values[i + 1]->isValueID()) { result = CSSValuePair::create(currentValue, values[++i], CSSValuePair::KeepIdenticalValues); } else { @@ -546,23 +546,23 @@ // TODO(timloh): This may consume from the range upon failure. The background // shorthand works around it, but we should just fix it here. -bool consumePosition(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless, RefPtrWillBeRawPtr<CSSValue>& resultX, RefPtrWillBeRawPtr<CSSValue>& resultY) +bool consumePosition(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless, RawPtr<CSSValue>& resultX, RawPtr<CSSValue>& resultY) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> value1 = consumePositionComponent(range, cssParserMode, unitless); + RawPtr<CSSPrimitiveValue> value1 = consumePositionComponent(range, cssParserMode, unitless); if (!value1) return false; - RefPtrWillBeRawPtr<CSSPrimitiveValue> value2 = consumePositionComponent(range, cssParserMode, unitless); + RawPtr<CSSPrimitiveValue> value2 = consumePositionComponent(range, cssParserMode, unitless); if (!value2) { positionFromOneValue(value1.release(), resultX, resultY); return true; } - RefPtrWillBeRawPtr<CSSPrimitiveValue> value3 = consumePositionComponent(range, cssParserMode, unitless); + RawPtr<CSSPrimitiveValue> value3 = consumePositionComponent(range, cssParserMode, unitless); if (!value3) return positionFromTwoValues(value1.release(), value2.release(), resultX, resultY); - RefPtrWillBeRawPtr<CSSPrimitiveValue> value4 = consumePositionComponent(range, cssParserMode, unitless); + RawPtr<CSSPrimitiveValue> value4 = consumePositionComponent(range, cssParserMode, unitless); CSSPrimitiveValue* values[5]; values[0] = value1.get(); values[1] = value2.get(); @@ -572,21 +572,21 @@ return positionFromThreeOrFourValues(values, resultX, resultY); } -PassRefPtrWillBeRawPtr<CSSValuePair> consumePosition(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) +RawPtr<CSSValuePair> consumePosition(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) { - RefPtrWillBeRawPtr<CSSValue> resultX = nullptr; - RefPtrWillBeRawPtr<CSSValue> resultY = nullptr; + RawPtr<CSSValue> resultX = nullptr; + RawPtr<CSSValue> resultY = nullptr; if (consumePosition(range, cssParserMode, unitless, resultX, resultY)) return CSSValuePair::create(resultX.release(), resultY.release(), CSSValuePair::KeepIdenticalValues); return nullptr; } -bool consumeOneOrTwoValuedPosition(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless, RefPtrWillBeRawPtr<CSSValue>& resultX, RefPtrWillBeRawPtr<CSSValue>& resultY) +bool consumeOneOrTwoValuedPosition(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless, RawPtr<CSSValue>& resultX, RawPtr<CSSValue>& resultY) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> value1 = consumePositionComponent(range, cssParserMode, unitless); + RawPtr<CSSPrimitiveValue> value1 = consumePositionComponent(range, cssParserMode, unitless); if (!value1) return false; - RefPtrWillBeRawPtr<CSSPrimitiveValue> value2 = consumePositionComponent(range, cssParserMode, unitless); + RawPtr<CSSPrimitiveValue> value2 = consumePositionComponent(range, cssParserMode, unitless); if (!value2) { positionFromOneValue(value1.release(), resultX, resultY); return true;
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h index 25bfdbf8..9a9e9b51 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h
@@ -33,30 +33,30 @@ Forbid }; -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeInteger(CSSParserTokenRange&, double minimumValue = -std::numeric_limits<double>::max()); -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumePositiveInteger(CSSParserTokenRange&); +RawPtr<CSSPrimitiveValue> consumeInteger(CSSParserTokenRange&, double minimumValue = -std::numeric_limits<double>::max()); +RawPtr<CSSPrimitiveValue> consumePositiveInteger(CSSParserTokenRange&); bool consumeNumberRaw(CSSParserTokenRange&, double& result); -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeNumber(CSSParserTokenRange&, ValueRange); -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeLength(CSSParserTokenRange&, CSSParserMode, ValueRange, UnitlessQuirk = UnitlessQuirk::Forbid); -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumePercent(CSSParserTokenRange&, ValueRange); -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeLengthOrPercent(CSSParserTokenRange&, CSSParserMode, ValueRange, UnitlessQuirk = UnitlessQuirk::Forbid); -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeAngle(CSSParserTokenRange&); -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeTime(CSSParserTokenRange&, ValueRange); +RawPtr<CSSPrimitiveValue> consumeNumber(CSSParserTokenRange&, ValueRange); +RawPtr<CSSPrimitiveValue> consumeLength(CSSParserTokenRange&, CSSParserMode, ValueRange, UnitlessQuirk = UnitlessQuirk::Forbid); +RawPtr<CSSPrimitiveValue> consumePercent(CSSParserTokenRange&, ValueRange); +RawPtr<CSSPrimitiveValue> consumeLengthOrPercent(CSSParserTokenRange&, CSSParserMode, ValueRange, UnitlessQuirk = UnitlessQuirk::Forbid); +RawPtr<CSSPrimitiveValue> consumeAngle(CSSParserTokenRange&); +RawPtr<CSSPrimitiveValue> consumeTime(CSSParserTokenRange&, ValueRange); -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange&); -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeIdentRange(CSSParserTokenRange&, CSSValueID lower, CSSValueID upper); +RawPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange&); +RawPtr<CSSPrimitiveValue> consumeIdentRange(CSSParserTokenRange&, CSSValueID lower, CSSValueID upper); template<CSSValueID, CSSValueID...> inline bool identMatches(CSSValueID id); -template<CSSValueID... allowedIdents> PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange&); +template<CSSValueID... allowedIdents> RawPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange&); -PassRefPtrWillBeRawPtr<CSSCustomIdentValue> consumeCustomIdent(CSSParserTokenRange&); -PassRefPtrWillBeRawPtr<CSSStringValue> consumeString(CSSParserTokenRange&); +RawPtr<CSSCustomIdentValue> consumeCustomIdent(CSSParserTokenRange&); +RawPtr<CSSStringValue> consumeString(CSSParserTokenRange&); String consumeUrl(CSSParserTokenRange&); -PassRefPtrWillBeRawPtr<CSSValue> consumeColor(CSSParserTokenRange&, CSSParserMode, bool acceptQuirkyColors = false); +RawPtr<CSSValue> consumeColor(CSSParserTokenRange&, CSSParserMode, bool acceptQuirkyColors = false); -PassRefPtrWillBeRawPtr<CSSValuePair> consumePosition(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk); -bool consumePosition(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk, RefPtrWillBeRawPtr<CSSValue>& resultX, RefPtrWillBeRawPtr<CSSValue>& resultY); -bool consumeOneOrTwoValuedPosition(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk, RefPtrWillBeRawPtr<CSSValue>& resultX, RefPtrWillBeRawPtr<CSSValue>& resultY); +RawPtr<CSSValuePair> consumePosition(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk); +bool consumePosition(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk, RawPtr<CSSValue>& resultX, RawPtr<CSSValue>& resultY); +bool consumeOneOrTwoValuedPosition(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk, RawPtr<CSSValue>& resultX, RawPtr<CSSValue>& resultY); // TODO(timloh): Move across consumeImage @@ -68,7 +68,7 @@ return id == head || identMatches<tail...>(id); } -template<CSSValueID... names> PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange& range) +template<CSSValueID... names> RawPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange& range) { if (range.peek().type() != IdentToken || !identMatches<names...>(range.peek().id())) return nullptr;
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserTest.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserTest.cpp index ddf5f20..5d56cc7 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserTest.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserTest.cpp
@@ -23,7 +23,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit1) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(999999, 20px)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(999999, 20px)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 999999); @@ -31,7 +31,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit2) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(999999, 20px)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(999999, 20px)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 999999); @@ -39,7 +39,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit3) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(1000000, 10%)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(1000000, 10%)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 1000000); @@ -47,7 +47,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit4) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(1000000, 10%)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(1000000, 10%)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 1000000); @@ -55,7 +55,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit5) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(1000000, [first] min-content [last])"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(1000000, [first] min-content [last])"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 1000000); @@ -63,7 +63,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit6) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(1000000, [first] min-content [last])"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(1000000, [first] min-content [last])"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 1000000); @@ -71,7 +71,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit7) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(1000001, auto)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(1000001, auto)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 1000000); @@ -79,7 +79,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit8) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(1000001, auto)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(1000001, auto)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 1000000); @@ -87,7 +87,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit9) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(400000, 2em minmax(10px, max-content) 0.5fr)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(400000, 2em minmax(10px, max-content) 0.5fr)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 999999); @@ -95,7 +95,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit10) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(400000, 2em minmax(10px, max-content) 0.5fr)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(400000, 2em minmax(10px, max-content) 0.5fr)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 999999); @@ -103,7 +103,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit11) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(600000, [first] 3vh 10% 2fr [nav] 10px auto 1fr 6em [last])"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(600000, [first] 3vh 10% 2fr [nav] 10px auto 1fr 6em [last])"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 999999); @@ -111,7 +111,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit12) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(600000, [first] 3vh 10% 2fr [nav] 10px auto 1fr 6em [last])"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(600000, [first] 3vh 10% 2fr [nav] 10px auto 1fr 6em [last])"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 999999); @@ -119,7 +119,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit13) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(100000000000000000000, 10% 1fr)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(100000000000000000000, 10% 1fr)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 1000000); @@ -127,7 +127,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit14) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(100000000000000000000, 10% 1fr)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(100000000000000000000, 10% 1fr)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 1000000); @@ -135,7 +135,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit15) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(100000000000000000000, 10% 5em 1fr auto auto 15px min-content)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateColumns, "repeat(100000000000000000000, 10% 5em 1fr auto auto 15px min-content)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 999999); @@ -143,7 +143,7 @@ TEST(CSSPropertyParserTest, GridTrackLimit16) { - RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(100000000000000000000, 10% 5em 1fr auto auto 15px min-content)"); + RawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyGridTemplateRows, "repeat(100000000000000000000, 10% 5em 1fr auto auto 15px min-content)"); ASSERT_TRUE(value); ASSERT_TRUE(value->isValueList()); EXPECT_EQ(computeNumberOfTracks(toCSSValueList(value.get())), 999999);
diff --git a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.h b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.h index 4c6b768..8d3c0a1 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.h +++ b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.h
@@ -55,7 +55,7 @@ static PassOwnPtr<CSSParserSelector> splitCompoundAtImplicitShadowCrossingCombinator(PassOwnPtr<CSSParserSelector> compoundSelector); const CSSParserContext& m_context; - RawPtrWillBeMember<StyleSheetContents> m_styleSheet; // FIXME: Should be const + Member<StyleSheetContents> m_styleSheet; // FIXME: Should be const bool m_failedParsing = false; bool m_disallowPseudoElements = false;
diff --git a/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp b/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp index 9797b27..ab5006d 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp
@@ -262,7 +262,7 @@ }; CSSParserContext context(HTMLStandardMode, nullptr); - RefPtrWillBeRawPtr<StyleSheetContents> sheet = StyleSheetContents::create(context); + RawPtr<StyleSheetContents> sheet = StyleSheetContents::create(context); for (auto testCase : testCases) { CSSTokenizer::Scope scope(testCase); @@ -292,7 +292,7 @@ }; CSSParserContext context(HTMLStandardMode, nullptr); - RefPtrWillBeRawPtr<StyleSheetContents> sheet = StyleSheetContents::create(context); + RawPtr<StyleSheetContents> sheet = StyleSheetContents::create(context); sheet->parserAddNamespace("ns", "http://ns.org"); for (auto testCase : testCases) {
diff --git a/third_party/WebKit/Source/core/css/parser/CSSVariableParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSVariableParser.cpp index 88941b4..f1a7e0d 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSVariableParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSVariableParser.cpp
@@ -122,7 +122,7 @@ return type == CSSValueInternalVariableValue && hasReferences && !hasAtApplyRule; } -PassRefPtrWillBeRawPtr<CSSCustomPropertyDeclaration> CSSVariableParser::parseDeclarationValue(const AtomicString& variableName, CSSParserTokenRange range) +RawPtr<CSSCustomPropertyDeclaration> CSSVariableParser::parseDeclarationValue(const AtomicString& variableName, CSSParserTokenRange range) { if (range.atEnd()) return nullptr;
diff --git a/third_party/WebKit/Source/core/css/parser/CSSVariableParser.h b/third_party/WebKit/Source/core/css/parser/CSSVariableParser.h index 6caadd0..dbda30f 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSVariableParser.h +++ b/third_party/WebKit/Source/core/css/parser/CSSVariableParser.h
@@ -18,7 +18,7 @@ public: static bool containsValidVariableReferences(CSSParserTokenRange); - static PassRefPtrWillBeRawPtr<CSSCustomPropertyDeclaration> parseDeclarationValue(const AtomicString&, CSSParserTokenRange); + static RawPtr<CSSCustomPropertyDeclaration> parseDeclarationValue(const AtomicString&, CSSParserTokenRange); static bool isValidVariableName(const CSSParserToken&); static bool isValidVariableName(const String&);
diff --git a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp index 9ce8c80..e077752 100644 --- a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
@@ -40,7 +40,7 @@ namespace blink { -void CSSPropertyParser::addProperty(CSSPropertyID propId, PassRefPtrWillBeRawPtr<CSSValue> value, bool important, bool implicit) +void CSSPropertyParser::addProperty(CSSPropertyID propId, RawPtr<CSSValue> value, bool important, bool implicit) { ASSERT(!isPropertyAlias(propId)); @@ -192,7 +192,7 @@ } } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::createPrimitiveNumericValue(CSSParserValue* value) +RawPtr<CSSPrimitiveValue> CSSPropertyParser::createPrimitiveNumericValue(CSSParserValue* value) { if (m_parsedCalculation) { ASSERT(isCalculation(value)); @@ -206,7 +206,7 @@ return cssValuePool().createValue(value->fValue, value->unit()); } -inline PassRefPtrWillBeRawPtr<CSSCustomIdentValue> CSSPropertyParser::createPrimitiveCustomIdentValue(CSSParserValue* value) +inline RawPtr<CSSCustomIdentValue> CSSPropertyParser::createPrimitiveCustomIdentValue(CSSParserValue* value) { ASSERT(value->m_unit == CSSParserValue::String || value->m_unit == CSSParserValue::Identifier); return CSSCustomIdentValue::create(value->string); @@ -224,7 +224,7 @@ return value->m_unit == CSSParserValue::Operator && value->iValue == '/'; } -void CSSPropertyParser::addExpandedPropertyForValue(CSSPropertyID propId, PassRefPtrWillBeRawPtr<CSSValue> prpValue, bool important) +void CSSPropertyParser::addExpandedPropertyForValue(CSSPropertyID propId, RawPtr<CSSValue> prpValue, bool important) { const StylePropertyShorthand& shorthand = shorthandForProperty(propId); unsigned shorthandLength = shorthand.length(); @@ -233,7 +233,7 @@ return; } - RefPtrWillBeRawPtr<CSSValue> value = prpValue; + RawPtr<CSSValue> value = prpValue; ShorthandScope scope(this, propId); const CSSPropertyID* longhands = shorthand.properties(); for (unsigned i = 0; i < shorthandLength; ++i) @@ -242,14 +242,14 @@ bool CSSPropertyParser::legacyParseAndApplyValue(CSSPropertyID propertyID, bool important) { - RefPtrWillBeRawPtr<CSSValue> result = legacyParseValue(propertyID); + RawPtr<CSSValue> result = legacyParseValue(propertyID); if (!result) return false; addProperty(propertyID, result.release(), important); return true; } -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::legacyParseValue(CSSPropertyID unresolvedProperty) +RawPtr<CSSValue> CSSPropertyParser::legacyParseValue(CSSPropertyID unresolvedProperty) { CSSPropertyID propId = resolveCSSPropertyID(unresolvedProperty); @@ -257,7 +257,7 @@ // FIXME: This is to avoid having to pass parsedCalc to all validUnit callers. ASSERT(!m_parsedCalculation); - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr; + RawPtr<CSSValue> parsedValue = nullptr; switch (propId) { case CSSPropertyGridAutoFlow: @@ -306,11 +306,11 @@ return value.m_unit == CSSParserValue::Identifier && value.id != CSSValueSpan && value.id != CSSValueAuto && !isCSSWideKeyword(value); } -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTemplateColumns(bool important) +RawPtr<CSSValue> CSSPropertyParser::parseGridTemplateColumns(bool important) { if (!(m_valueList->current() && isForwardSlashOperator(m_valueList->current()) && m_valueList->next())) return nullptr; - if (RefPtrWillBeRawPtr<CSSValue> columnsValue = parseGridTrackList()) { + if (RawPtr<CSSValue> columnsValue = parseGridTrackList()) { if (m_valueList->current()) return nullptr; return columnsValue; @@ -325,7 +325,7 @@ size_t rowCount = 0; size_t columnCount = 0; bool trailingIdentWasAdded = false; - RefPtrWillBeRawPtr<CSSValueList> templateRows = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> templateRows = CSSValueList::createSpaceSeparated(); // At least template-areas strings must be defined. if (!m_valueList->current() || isForwardSlashOperator(m_valueList->current())) @@ -347,7 +347,7 @@ // Handle template-rows's track-size. if (m_valueList->current() && m_valueList->current()->m_unit != CSSParserValue::Operator && m_valueList->current()->m_unit != CSSParserValue::String) { - RefPtrWillBeRawPtr<CSSValue> value = parseGridTrackSize(*m_valueList); + RawPtr<CSSValue> value = parseGridTrackSize(*m_valueList); if (!value) return false; templateRows->append(value); @@ -361,7 +361,7 @@ trailingIdentWasAdded = templateRows->item(templateRows->length() - 1)->isGridLineNamesValue(); } - RefPtrWillBeRawPtr<CSSValue> columnsValue = nullptr; + RawPtr<CSSValue> columnsValue = nullptr; if (m_valueList->current()) { ASSERT(isForwardSlashOperator(m_valueList->current())); columnsValue = parseGridTemplateColumns(important); @@ -375,7 +375,7 @@ addProperty(CSSPropertyGridTemplateRows, templateRows.release(), important); addProperty(CSSPropertyGridTemplateColumns, columnsValue ? columnsValue.release() : cssValuePool().createIdentifierValue(CSSValueNone), important); - RefPtrWillBeRawPtr<CSSValue> templateAreas = CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount); + RawPtr<CSSValue> templateAreas = CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount); addProperty(CSSPropertyGridTemplateAreas, templateAreas.release(), important); return true; @@ -404,7 +404,7 @@ } // 2- <grid-template-rows> / <grid-template-columns> - RefPtrWillBeRawPtr<CSSValue> rowsValue = nullptr; + RawPtr<CSSValue> rowsValue = nullptr; if (firstValueIsNone) { rowsValue = cssValuePool().createIdentifierValue(CSSValueNone); } else { @@ -412,7 +412,7 @@ } if (rowsValue) { - RefPtrWillBeRawPtr<CSSValue> columnsValue = parseGridTemplateColumns(important); + RawPtr<CSSValue> columnsValue = parseGridTemplateColumns(important); if (!columnsValue) return false; @@ -452,8 +452,8 @@ if (!legacyParseAndApplyValue(CSSPropertyGridAutoFlow, important)) return false; - RefPtrWillBeRawPtr<CSSValue> autoColumnsValue = nullptr; - RefPtrWillBeRawPtr<CSSValue> autoRowsValue = nullptr; + RawPtr<CSSValue> autoColumnsValue = nullptr; + RawPtr<CSSValue> autoRowsValue = nullptr; if (m_valueList->current()) { autoRowsValue = parseGridTrackSize(*m_valueList); @@ -505,7 +505,7 @@ // Skip '[' inputList.next(); - RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = previousNamedAreaTrailingLineNames; + RawPtr<CSSGridLineNamesValue> lineNames = previousNamedAreaTrailingLineNames; if (!lineNames) lineNames = CSSGridLineNamesValue::create(); @@ -516,7 +516,7 @@ if (!isValidCustomIdentForGridPositions(*identValue)) return false; - RefPtrWillBeRawPtr<CSSCustomIdentValue> lineName = createPrimitiveCustomIdentValue(identValue); + RawPtr<CSSCustomIdentValue> lineName = createPrimitiveCustomIdentValue(identValue); lineNames->append(lineName.release()); inputList.next(); } @@ -554,7 +554,7 @@ return true; } -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackList() +RawPtr<CSSValue> CSSPropertyParser::parseGridTrackList() { ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); @@ -564,7 +564,7 @@ return cssValuePool().createIdentifierValue(CSSValueNone); } - RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); // Handle leading <custom-ident>*. if (!parseGridLineNames(*m_valueList, *values)) return nullptr; @@ -583,7 +583,7 @@ seenTrackSizeOrRepeatFunction = true; seenAutoRepeat = seenAutoRepeat || isAutoRepeat; } else { - RefPtrWillBeRawPtr<CSSValue> value = parseGridTrackSize(*m_valueList, seenAutoRepeat ? FixedSizeOnly : AllowAll); + RawPtr<CSSValue> value = parseGridTrackSize(*m_valueList, seenAutoRepeat ? FixedSizeOnly : AllowAll); if (!value) return nullptr; values->append(value); @@ -621,7 +621,7 @@ // because it will be computed later, let's set it to 1. size_t repetitions = isAutoRepeat ? 1 : clampTo<size_t>(currentValue->fValue, 0, kGridMaxTracks); - RefPtrWillBeRawPtr<CSSValueList> repeatedValues = isAutoRepeat ? CSSGridAutoRepeatValue::create(currentValue->id) : CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> repeatedValues = isAutoRepeat ? CSSGridAutoRepeatValue::create(currentValue->id) : CSSValueList::createSpaceSeparated(); arguments->next(); // Skip the repetition count. arguments->next(); // Skip the comma. @@ -635,7 +635,7 @@ if (isAutoRepeat && numberOfTracks) return false; - RefPtrWillBeRawPtr<CSSValue> trackSize = parseGridTrackSize(*arguments, restriction); + RawPtr<CSSValue> trackSize = parseGridTrackSize(*arguments, restriction); if (!trackSize) return false; @@ -670,7 +670,7 @@ } -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackSize(CSSParserValueList& inputList, TrackSizeRestriction restriction) +RawPtr<CSSValue> CSSPropertyParser::parseGridTrackSize(CSSParserValueList& inputList, TrackSizeRestriction restriction) { ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); @@ -686,15 +686,15 @@ if (!arguments || arguments->size() != 3 || !isComma(arguments->valueAt(1))) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> minTrackBreadth = parseGridBreadth(arguments->valueAt(0), restriction); + RawPtr<CSSPrimitiveValue> minTrackBreadth = parseGridBreadth(arguments->valueAt(0), restriction); if (!minTrackBreadth) return nullptr; - RefPtrWillBeRawPtr<CSSPrimitiveValue> maxTrackBreadth = parseGridBreadth(arguments->valueAt(2)); + RawPtr<CSSPrimitiveValue> maxTrackBreadth = parseGridBreadth(arguments->valueAt(2)); if (!maxTrackBreadth) return nullptr; - RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueMinmax); + RawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueMinmax); result->append(minTrackBreadth); result->append(maxTrackBreadth); return result.release(); @@ -703,7 +703,7 @@ return parseGridBreadth(currentValue, restriction); } -PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseGridBreadth(CSSParserValue* currentValue, TrackSizeRestriction restriction) +RawPtr<CSSPrimitiveValue> CSSPropertyParser::parseGridBreadth(CSSParserValue* currentValue, TrackSizeRestriction restriction) { if (currentValue->id == CSSValueMinContent || currentValue->id == CSSValueMaxContent || currentValue->id == CSSValueAuto) return restriction == AllowAll ? cssValuePool().createIdentifierValue(currentValue->id) : nullptr; @@ -821,7 +821,7 @@ return true; } -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridAutoFlow(CSSParserValueList& list) +RawPtr<CSSValue> CSSPropertyParser::parseGridAutoFlow(CSSParserValueList& list) { // [ row | column ] || dense ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); @@ -830,7 +830,7 @@ if (!value) return nullptr; - RefPtrWillBeRawPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated(); + RawPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated(); // First parameter. CSSValueID firstId = value->id;
diff --git a/third_party/WebKit/Source/core/css/parser/MediaConditionTest.cpp b/third_party/WebKit/Source/core/css/parser/MediaConditionTest.cpp index dc56d19..50822b4 100644 --- a/third_party/WebKit/Source/core/css/parser/MediaConditionTest.cpp +++ b/third_party/WebKit/Source/core/css/parser/MediaConditionTest.cpp
@@ -39,7 +39,7 @@ // FIXME: We should test comma-seperated media conditions for (unsigned i = 0; testCases[i].input; ++i) { CSSTokenizer::Scope scope(testCases[i].input); - RefPtrWillBeRawPtr<MediaQuerySet> mediaConditionQuerySet = MediaQueryParser::parseMediaCondition(scope.tokenRange()); + RawPtr<MediaQuerySet> mediaConditionQuerySet = MediaQueryParser::parseMediaCondition(scope.tokenRange()); ASSERT_EQ(mediaConditionQuerySet->queryVector().size(), (unsigned)1); String queryText = mediaConditionQuerySet->queryVector()[0]->cssText(); ASSERT_STREQ(testCases[i].output, queryText.ascii().data());
diff --git a/third_party/WebKit/Source/core/css/parser/MediaQueryParser.cpp b/third_party/WebKit/Source/core/css/parser/MediaQueryParser.cpp index 5dadb44..f1bac52 100644 --- a/third_party/WebKit/Source/core/css/parser/MediaQueryParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/MediaQueryParser.cpp
@@ -11,17 +11,17 @@ namespace blink { -PassRefPtrWillBeRawPtr<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(const String& queryString) +RawPtr<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(const String& queryString) { return parseMediaQuerySet(CSSTokenizer::Scope(queryString).tokenRange()); } -PassRefPtrWillBeRawPtr<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(CSSParserTokenRange range) +RawPtr<MediaQuerySet> MediaQueryParser::parseMediaQuerySet(CSSParserTokenRange range) { return MediaQueryParser(MediaQuerySetParser).parseImpl(range); } -PassRefPtrWillBeRawPtr<MediaQuerySet> MediaQueryParser::parseMediaCondition(CSSParserTokenRange range) +RawPtr<MediaQuerySet> MediaQueryParser::parseMediaCondition(CSSParserTokenRange range) { return MediaQueryParser(MediaConditionParser).parseImpl(range); } @@ -214,7 +214,7 @@ } // The state machine loop -PassRefPtrWillBeRawPtr<MediaQuerySet> MediaQueryParser::parseImpl(CSSParserTokenRange range) +RawPtr<MediaQuerySet> MediaQueryParser::parseImpl(CSSParserTokenRange range) { while (!range.atEnd()) processToken(range.consume()); @@ -248,16 +248,16 @@ m_expressions.clear(); } -PassOwnPtrWillBeRawPtr<MediaQuery> MediaQueryData::takeMediaQuery() +RawPtr<MediaQuery> MediaQueryData::takeMediaQuery() { - OwnPtrWillBeRawPtr<MediaQuery> mediaQuery = MediaQuery::create(m_restrictor, std::move(m_mediaType), std::move(m_expressions)); + RawPtr<MediaQuery> mediaQuery = MediaQuery::create(m_restrictor, std::move(m_mediaType), std::move(m_expressions)); clear(); return mediaQuery.release(); } bool MediaQueryData::addExpression() { - OwnPtrWillBeRawPtr<MediaQueryExp> expression = MediaQueryExp::createIfValid(m_mediaFeature, m_valueList); + RawPtr<MediaQueryExp> expression = MediaQueryExp::createIfValid(m_mediaFeature, m_valueList); bool isValid = !!expression; m_expressions.append(expression.release()); m_valueList.clear();
diff --git a/third_party/WebKit/Source/core/css/parser/MediaQueryParser.h b/third_party/WebKit/Source/core/css/parser/MediaQueryParser.h index bb05cba0..bcde4e0 100644 --- a/third_party/WebKit/Source/core/css/parser/MediaQueryParser.h +++ b/third_party/WebKit/Source/core/css/parser/MediaQueryParser.h
@@ -35,7 +35,7 @@ bool addExpression(); bool tryAddParserToken(CSSParserTokenType, const CSSParserToken&); void setMediaType(const String&); - PassOwnPtrWillBeRawPtr<MediaQuery> takeMediaQuery(); + RawPtr<MediaQuery> takeMediaQuery(); inline bool currentMediaQueryChanged() const { @@ -51,9 +51,9 @@ class CORE_EXPORT MediaQueryParser { STACK_ALLOCATED(); public: - static PassRefPtrWillBeRawPtr<MediaQuerySet> parseMediaQuerySet(const String&); - static PassRefPtrWillBeRawPtr<MediaQuerySet> parseMediaQuerySet(CSSParserTokenRange); - static PassRefPtrWillBeRawPtr<MediaQuerySet> parseMediaCondition(CSSParserTokenRange); + static RawPtr<MediaQuerySet> parseMediaQuerySet(const String&); + static RawPtr<MediaQuerySet> parseMediaQuerySet(CSSParserTokenRange); + static RawPtr<MediaQuerySet> parseMediaCondition(CSSParserTokenRange); private: enum ParserType { @@ -64,7 +64,7 @@ MediaQueryParser(ParserType); virtual ~MediaQueryParser(); - PassRefPtrWillBeRawPtr<MediaQuerySet> parseImpl(CSSParserTokenRange); + RawPtr<MediaQuerySet> parseImpl(CSSParserTokenRange); void processToken(const CSSParserToken&); @@ -89,7 +89,7 @@ State m_state; ParserType m_parserType; MediaQueryData m_mediaQueryData; - RefPtrWillBeMember<MediaQuerySet> m_querySet; + Member<MediaQuerySet> m_querySet; MediaQueryBlockWatcher m_blockWatcher; const static State ReadRestrictor;
diff --git a/third_party/WebKit/Source/core/css/parser/SizesAttributeParser.cpp b/third_party/WebKit/Source/core/css/parser/SizesAttributeParser.cpp index 5ac6074..97cd6de 100644 --- a/third_party/WebKit/Source/core/css/parser/SizesAttributeParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/SizesAttributeParser.cpp
@@ -11,7 +11,7 @@ namespace blink { -SizesAttributeParser::SizesAttributeParser(PassRefPtrWillBeRawPtr<MediaValues> mediaValues, const String& attribute) +SizesAttributeParser::SizesAttributeParser(RawPtr<MediaValues> mediaValues, const String& attribute) : m_mediaValues(mediaValues) , m_length(0) , m_lengthWasSet(false) @@ -53,7 +53,7 @@ return false; } -bool SizesAttributeParser::mediaConditionMatches(PassRefPtrWillBeRawPtr<MediaQuerySet> mediaCondition) +bool SizesAttributeParser::mediaConditionMatches(RawPtr<MediaQuerySet> mediaCondition) { // A Media Condition cannot have a media type other then screen. MediaQueryEvaluator mediaQueryEvaluator(*m_mediaValues); @@ -79,7 +79,7 @@ float length; if (!calculateLengthInPixels(range.makeSubRange(lengthTokenStart, lengthTokenEnd), length)) continue; - RefPtrWillBeRawPtr<MediaQuerySet> mediaCondition = MediaQueryParser::parseMediaCondition(range.makeSubRange(mediaConditionStart, lengthTokenStart)); + RawPtr<MediaQuerySet> mediaCondition = MediaQueryParser::parseMediaCondition(range.makeSubRange(mediaConditionStart, lengthTokenStart)); if (!mediaCondition || !mediaConditionMatches(mediaCondition)) continue; m_length = length;
diff --git a/third_party/WebKit/Source/core/css/parser/SizesAttributeParser.h b/third_party/WebKit/Source/core/css/parser/SizesAttributeParser.h index 0941fc1b..f8193e7 100644 --- a/third_party/WebKit/Source/core/css/parser/SizesAttributeParser.h +++ b/third_party/WebKit/Source/core/css/parser/SizesAttributeParser.h
@@ -17,7 +17,7 @@ class CORE_EXPORT SizesAttributeParser { STACK_ALLOCATED(); public: - SizesAttributeParser(PassRefPtrWillBeRawPtr<MediaValues>, const String&); + SizesAttributeParser(RawPtr<MediaValues>, const String&); float length(); @@ -25,11 +25,11 @@ bool parse(CSSParserTokenRange); float effectiveSize(); bool calculateLengthInPixels(CSSParserTokenRange, float& result); - bool mediaConditionMatches(PassRefPtrWillBeRawPtr<MediaQuerySet> mediaCondition); + bool mediaConditionMatches(RawPtr<MediaQuerySet> mediaCondition); unsigned effectiveSizeDefaultValue(); - RefPtrWillBeMember<MediaQuerySet> m_mediaCondition; - RefPtrWillBeMember<MediaValues> m_mediaValues; + Member<MediaQuerySet> m_mediaCondition; + Member<MediaValues> m_mediaValues; float m_length; bool m_lengthWasSet; bool m_isValid;
diff --git a/third_party/WebKit/Source/core/css/parser/SizesAttributeParserTest.cpp b/third_party/WebKit/Source/core/css/parser/SizesAttributeParserTest.cpp index 225ad3b..59c7fdc 100644 --- a/third_party/WebKit/Source/core/css/parser/SizesAttributeParserTest.cpp +++ b/third_party/WebKit/Source/core/css/parser/SizesAttributeParserTest.cpp
@@ -88,7 +88,7 @@ data.mediaType = MediaTypeNames::screen; data.strictMode = true; data.displayMode = WebDisplayModeBrowser; - RefPtrWillBeRawPtr<MediaValues> mediaValues = MediaValuesCached::create(data); + RawPtr<MediaValues> mediaValues = MediaValuesCached::create(data); for (unsigned i = 0; testCases[i].input; ++i) { SizesAttributeParser parser(mediaValues, testCases[i].input);
diff --git a/third_party/WebKit/Source/core/css/parser/SizesCalcParser.cpp b/third_party/WebKit/Source/core/css/parser/SizesCalcParser.cpp index 889607d..c712fc4 100644 --- a/third_party/WebKit/Source/core/css/parser/SizesCalcParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/SizesCalcParser.cpp
@@ -9,7 +9,7 @@ namespace blink { -SizesCalcParser::SizesCalcParser(CSSParserTokenRange range, PassRefPtrWillBeRawPtr<MediaValues> mediaValues) +SizesCalcParser::SizesCalcParser(CSSParserTokenRange range, RawPtr<MediaValues> mediaValues) : m_mediaValues(mediaValues) , m_result(0) {
diff --git a/third_party/WebKit/Source/core/css/parser/SizesCalcParser.h b/third_party/WebKit/Source/core/css/parser/SizesCalcParser.h index 011479f..5d049850 100644 --- a/third_party/WebKit/Source/core/css/parser/SizesCalcParser.h +++ b/third_party/WebKit/Source/core/css/parser/SizesCalcParser.h
@@ -37,7 +37,7 @@ class CORE_EXPORT SizesCalcParser { STACK_ALLOCATED(); public: - SizesCalcParser(CSSParserTokenRange, PassRefPtrWillBeRawPtr<MediaValues>); + SizesCalcParser(CSSParserTokenRange, RawPtr<MediaValues>); float result() const; bool isValid() const { return m_isValid; } @@ -51,7 +51,7 @@ void appendOperator(const CSSParserToken&); Vector<SizesCalcValue> m_valueList; - RefPtrWillBeMember<MediaValues> m_mediaValues; + Member<MediaValues> m_mediaValues; bool m_isValid; float m_result; };
diff --git a/third_party/WebKit/Source/core/css/parser/SizesCalcParserTest.cpp b/third_party/WebKit/Source/core/css/parser/SizesCalcParserTest.cpp index 3c425a1..e69935d 100644 --- a/third_party/WebKit/Source/core/css/parser/SizesCalcParserTest.cpp +++ b/third_party/WebKit/Source/core/css/parser/SizesCalcParserTest.cpp
@@ -31,7 +31,7 @@ { CSSLengthArray lengthArray; initLengthArray(lengthArray); - RefPtrWillBeRawPtr<CSSValue> cssValue = CSSParser::parseSingleValue(CSSPropertyLeft, text); + RawPtr<CSSValue> cssValue = CSSParser::parseSingleValue(CSSPropertyLeft, text); CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssValue.get()); if (primitiveValue) primitiveValue->accumulateLengthArray(lengthArray); @@ -112,7 +112,7 @@ data.mediaType = MediaTypeNames::screen; data.strictMode = true; data.displayMode = WebDisplayModeBrowser; - RefPtrWillBeRawPtr<MediaValues> mediaValues = MediaValuesCached::create(data); + RawPtr<MediaValues> mediaValues = MediaValuesCached::create(data); for (unsigned i = 0; testCases[i].input; ++i) { SizesCalcParser calcParser(CSSTokenizer::Scope(testCases[i].input).tokenRange(), mediaValues);
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.h b/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.h index 04a6f47..c46da5f 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.h +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.h
@@ -48,7 +48,7 @@ // Accessors to functions on the property API. CSSPropertyID id() const { return m_id; } - PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSParserTokenRange& range, const CSSParserContext& context) const { return m_parseSingleValue(range, context); } + RawPtr<CSSValue> parseSingleValue(CSSParserTokenRange& range, const CSSParserContext& context) const { return m_parseSingleValue(range, context); } private: // Used internally to check whether an array entry is filled or not.
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyFunctions.h b/third_party/WebKit/Source/core/css/properties/CSSPropertyFunctions.h index 59aec409..846ef5d 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyFunctions.h +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyFunctions.h
@@ -25,7 +25,7 @@ // Consumes and parses a single value for this property from by the token range, // returning the corresponding CSSValue. This function does not check for the end // of the token range. Returns nullptr if the input is invalid. - static PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSParserTokenRange&, const CSSParserContext&); + static RawPtr<CSSValue> parseSingleValue(CSSParserTokenRange&, const CSSParserContext&); using parseSingleValueFunction = decltype(&parseSingleValue); };
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp index 936cb2d..91be435 100644 --- a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
@@ -130,7 +130,7 @@ return success; } -PassRefPtrWillBeRawPtr<CSSValue> CSSVariableResolver::resolveVariableReferences(StyleVariableData* styleVariableData, CSSPropertyID id, const CSSVariableReferenceValue& value) +RawPtr<CSSValue> CSSVariableResolver::resolveVariableReferences(StyleVariableData* styleVariableData, CSSPropertyID id, const CSSVariableReferenceValue& value) { ASSERT(!isShorthandProperty(id)); @@ -138,7 +138,7 @@ Vector<CSSParserToken> tokens; if (!resolver.resolveTokenRange(value.variableDataValue()->tokens(), tokens)) return cssValuePool().createUnsetValue(); - RefPtrWillBeRawPtr<CSSValue> result = CSSPropertyParser::parseSingleValue(id, tokens, strictCSSParserContext()); + RawPtr<CSSValue> result = CSSPropertyParser::parseSingleValue(id, tokens, strictCSSParserContext()); if (!result) return cssValuePool().createUnsetValue(); return result.release(); @@ -152,7 +152,7 @@ if (resolver.resolveTokenRange(value.variableDataValue()->tokens(), tokens)) { CSSParserContext context(HTMLStandardMode, 0); - WillBeHeapVector<CSSProperty, 256> parsedProperties; + HeapVector<CSSProperty, 256> parsedProperties; // TODO: Non-shorthands should just call CSSPropertyParser::parseSingleValue if (CSSPropertyParser::parseValue(id, false, CSSParserTokenRange(tokens), context, parsedProperties, StyleRule::RuleType::Style)) { @@ -163,7 +163,7 @@ } } - RefPtrWillBeRawPtr<CSSUnsetValue> unset = cssValuePool().createUnsetValue(); + RawPtr<CSSUnsetValue> unset = cssValuePool().createUnsetValue(); if (isShorthandProperty(id)) { StylePropertyShorthand shorthand = shorthandForProperty(id); for (unsigned i = 0; i < shorthand.length(); i++)
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h index c49b97f..2aabc55 100644 --- a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h +++ b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h
@@ -25,7 +25,7 @@ static void resolveAndApplyVariableReferences(StyleResolverState&, CSSPropertyID, const CSSVariableReferenceValue&); // Shorthand properties are not supported. - static PassRefPtrWillBeRawPtr<CSSValue> resolveVariableReferences(StyleVariableData*, CSSPropertyID, const CSSVariableReferenceValue&); + static RawPtr<CSSValue> resolveVariableReferences(StyleVariableData*, CSSPropertyID, const CSSVariableReferenceValue&); private: CSSVariableResolver(StyleVariableData*);
diff --git a/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.h b/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.h index 029ba38..de74519 100644 --- a/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.h +++ b/third_party/WebKit/Source/core/css/resolver/ElementResolveContext.h
@@ -48,8 +48,8 @@ bool distributedToInsertionPoint() const { return m_distributedToInsertionPoint; } private: - RawPtrWillBeMember<Element> m_element; - RawPtrWillBeMember<ContainerNode> m_parentNode; + Member<Element> m_element; + Member<ContainerNode> m_parentNode; const ComputedStyle* m_rootElementStyle; EInsideLink m_elementLinkState; bool m_distributedToInsertionPoint;
diff --git a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp index f6a59a1..1dbe414 100644 --- a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp +++ b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp
@@ -49,7 +49,7 @@ { } -PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::styleImage(CSSPropertyID property, const CSSValue& value) +RawPtr<StyleImage> ElementStyleResources::styleImage(CSSPropertyID property, const CSSValue& value) { if (value.isImageValue()) return cachedOrPendingFromValue(property, toCSSImageValue(value)); @@ -66,7 +66,7 @@ return nullptr; } -PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::generatedOrPendingFromValue(CSSPropertyID property, const CSSImageGeneratorValue& value) +RawPtr<StyleImage> ElementStyleResources::generatedOrPendingFromValue(CSSPropertyID property, const CSSImageGeneratorValue& value) { if (value.isPending()) { m_pendingImageProperties.add(property); @@ -75,7 +75,7 @@ return StyleGeneratedImage::create(value); } -PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::setOrPendingFromValue(CSSPropertyID property, const CSSImageSetValue& value) +RawPtr<StyleImage> ElementStyleResources::setOrPendingFromValue(CSSPropertyID property, const CSSImageSetValue& value) { if (value.isCachePending(m_deviceScaleFactor)) { m_pendingImageProperties.add(property); @@ -84,7 +84,7 @@ return value.cachedImage(m_deviceScaleFactor); } -PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::cachedOrPendingFromValue(CSSPropertyID property, const CSSImageValue& value) +RawPtr<StyleImage> ElementStyleResources::cachedOrPendingFromValue(CSSPropertyID property, const CSSImageValue& value) { if (value.isCachePending()) { m_pendingImageProperties.add(property); @@ -94,7 +94,7 @@ return value.cachedImage(); } -PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::cursorOrPendingFromValue(CSSPropertyID property, const CSSCursorImageValue& value) +RawPtr<StyleImage> ElementStyleResources::cursorOrPendingFromValue(CSSPropertyID property, const CSSCursorImageValue& value) { if (value.isCachePending(m_deviceScaleFactor)) { m_pendingImageProperties.add(property); @@ -115,7 +115,7 @@ FilterOperations::FilterOperationVector& filterOperations = computedStyle->mutableFilter().operations(); for (unsigned i = 0; i < filterOperations.size(); ++i) { - RefPtrWillBeRawPtr<FilterOperation> filterOperation = filterOperations.at(i); + RawPtr<FilterOperation> filterOperation = filterOperations.at(i); if (filterOperation->type() == FilterOperation::REFERENCE) { ReferenceFilterOperation* referenceFilter = toReferenceFilterOperation(filterOperation.get()); @@ -132,10 +132,10 @@ } } -PassRefPtrWillBeRawPtr<StyleImage> ElementStyleResources::loadPendingImage(StylePendingImage* pendingImage, CrossOriginAttributeValue crossOrigin) +RawPtr<StyleImage> ElementStyleResources::loadPendingImage(StylePendingImage* pendingImage, CrossOriginAttributeValue crossOrigin) { if (CSSImageValue* imageValue = pendingImage->cssImageValue()) { - if (RefPtrWillBeRawPtr<StyleImage> cachedImage = imageValue->cacheImage(m_document, crossOrigin)) + if (RawPtr<StyleImage> cachedImage = imageValue->cacheImage(m_document, crossOrigin)) return cachedImage.release(); return StyleInvalidImage::create(imageValue->url()); } @@ -220,7 +220,7 @@ if (StyleReflection* reflection = style->boxReflect()) { const NinePieceImage& maskImage = reflection->mask(); if (maskImage.image() && maskImage.image()->isPendingImage()) { - RefPtrWillBeRawPtr<StyleImage> loadedImage = loadPendingImage(toStylePendingImage(maskImage.image())); + RawPtr<StyleImage> loadedImage = loadPendingImage(toStylePendingImage(maskImage.image())); reflection->setMask(NinePieceImage(loadedImage.release(), maskImage.imageSlices(), maskImage.fill(), maskImage.borderSlices(), maskImage.outset(), maskImage.horizontalRule(), maskImage.verticalRule())); } }
diff --git a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.h b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.h index 60c1ead..2a9f722 100644 --- a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.h +++ b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.h
@@ -51,26 +51,26 @@ public: ElementStyleResources(Document&, float deviceScaleFactor); - PassRefPtrWillBeRawPtr<StyleImage> styleImage(CSSPropertyID, const CSSValue&); - PassRefPtrWillBeRawPtr<StyleImage> cachedOrPendingFromValue(CSSPropertyID, const CSSImageValue&); - PassRefPtrWillBeRawPtr<StyleImage> setOrPendingFromValue(CSSPropertyID, const CSSImageSetValue&); + RawPtr<StyleImage> styleImage(CSSPropertyID, const CSSValue&); + RawPtr<StyleImage> cachedOrPendingFromValue(CSSPropertyID, const CSSImageValue&); + RawPtr<StyleImage> setOrPendingFromValue(CSSPropertyID, const CSSImageSetValue&); void loadPendingResources(ComputedStyle*); void addPendingSVGDocument(FilterOperation*, CSSSVGDocumentValue*); private: - PassRefPtrWillBeRawPtr<StyleImage> cursorOrPendingFromValue(CSSPropertyID, const CSSCursorImageValue&); - PassRefPtrWillBeRawPtr<StyleImage> generatedOrPendingFromValue(CSSPropertyID, const CSSImageGeneratorValue&); + RawPtr<StyleImage> cursorOrPendingFromValue(CSSPropertyID, const CSSCursorImageValue&); + RawPtr<StyleImage> generatedOrPendingFromValue(CSSPropertyID, const CSSImageGeneratorValue&); void loadPendingSVGDocuments(ComputedStyle*); void loadPendingImages(ComputedStyle*); - PassRefPtrWillBeRawPtr<StyleImage> loadPendingImage(StylePendingImage*, CrossOriginAttributeValue = CrossOriginAttributeNotSet); + RawPtr<StyleImage> loadPendingImage(StylePendingImage*, CrossOriginAttributeValue = CrossOriginAttributeNotSet); - RawPtrWillBeMember<Document> m_document; + Member<Document> m_document; HashSet<CSSPropertyID> m_pendingImageProperties; - WillBeHeapHashMap<RawPtrWillBeMember<FilterOperation>, RefPtrWillBeMember<CSSSVGDocumentValue>> m_pendingSVGDocuments; + HeapHashMap<Member<FilterOperation>, Member<CSSSVGDocumentValue>> m_pendingSVGDocuments; float m_deviceScaleFactor; };
diff --git a/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp b/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp index a5b1918..66cb157 100644 --- a/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp
@@ -138,7 +138,7 @@ CSSSVGDocumentValue* svgDocumentValue = toCSSSVGDocumentValue(filterValue->item(0)); KURL url = state.document().completeURL(svgDocumentValue->url()); - RefPtrWillBeRawPtr<ReferenceFilterOperation> operation = ReferenceFilterOperation::create(svgDocumentValue->url(), AtomicString(url.fragmentIdentifier())); + RawPtr<ReferenceFilterOperation> operation = ReferenceFilterOperation::create(svgDocumentValue->url(), AtomicString(url.fragmentIdentifier())); if (SVGURIReference::isExternalURIReference(svgDocumentValue->url(), state.document())) { if (!svgDocumentValue->loadRequested()) state.elementStyleResources().addPendingSVGDocument(operation.get(), svgDocumentValue);
diff --git a/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp b/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp index 5458537..261025d 100644 --- a/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp +++ b/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp
@@ -339,7 +339,7 @@ fontDescription.setComputedSize(computedSize); } -void FontBuilder::createFont(PassRefPtrWillBeRawPtr<FontSelector> fontSelector, ComputedStyle& style) +void FontBuilder::createFont(RawPtr<FontSelector> fontSelector, ComputedStyle& style) { if (!m_flags) return; @@ -389,7 +389,7 @@ m_flags = 0; } -void FontBuilder::createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector> fontSelector, ComputedStyle& documentStyle) +void FontBuilder::createFontForDocument(RawPtr<FontSelector> fontSelector, ComputedStyle& documentStyle) { FontDescription fontDescription = FontDescription(); fontDescription.setLocale(documentStyle.locale());
diff --git a/third_party/WebKit/Source/core/css/resolver/FontBuilder.h b/third_party/WebKit/Source/core/css/resolver/FontBuilder.h index e51e702f..e49b7fc6 100644 --- a/third_party/WebKit/Source/core/css/resolver/FontBuilder.h +++ b/third_party/WebKit/Source/core/css/resolver/FontBuilder.h
@@ -69,9 +69,9 @@ void setFontSmoothing(FontSmoothingMode); // FIXME: These need to just vend a Font object eventually. - void createFont(PassRefPtrWillBeRawPtr<FontSelector>, ComputedStyle&); + void createFont(RawPtr<FontSelector>, ComputedStyle&); - void createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector>, ComputedStyle&); + void createFontForDocument(RawPtr<FontSelector>, ComputedStyle&); bool fontDirty() const { return m_flags; } @@ -103,7 +103,7 @@ float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom, float specifiedSize); - RawPtrWillBeMember<const Document> m_document; + Member<const Document> m_document; FontDescription m_fontDescription; enum class PropertySetFlag {
diff --git a/third_party/WebKit/Source/core/css/resolver/MatchRequest.h b/third_party/WebKit/Source/core/css/resolver/MatchRequest.h index c56c474..190ac16 100644 --- a/third_party/WebKit/Source/core/css/resolver/MatchRequest.h +++ b/third_party/WebKit/Source/core/css/resolver/MatchRequest.h
@@ -44,9 +44,9 @@ ruleSet->compactRulesIfNeeded(); } - RawPtrWillBeMember<const RuleSet> ruleSet; - RawPtrWillBeMember<const ContainerNode> scope; - RawPtrWillBeMember<const CSSStyleSheet> styleSheet; + Member<const RuleSet> ruleSet; + Member<const ContainerNode> scope; + Member<const CSSStyleSheet> styleSheet; const unsigned styleSheetIndex; };
diff --git a/third_party/WebKit/Source/core/css/resolver/MatchResult.h b/third_party/WebKit/Source/core/css/resolver/MatchResult.h index 1011b5b..dd649255 100644 --- a/third_party/WebKit/Source/core/css/resolver/MatchResult.h +++ b/third_party/WebKit/Source/core/css/resolver/MatchResult.h
@@ -41,7 +41,7 @@ DECLARE_TRACE(); - RefPtrWillBeMember<StylePropertySet> properties; + Member<StylePropertySet> properties; union { struct { @@ -59,7 +59,7 @@ namespace blink { -using MatchedPropertiesVector = WillBeHeapVector<MatchedProperties, 64>; +using MatchedPropertiesVector = HeapVector<MatchedProperties, 64>; // MatchedPropertiesRange is used to represent a subset of the matched properties from // a given origin, for instance UA rules, author rules, or a shadow tree scope. This is
diff --git a/third_party/WebKit/Source/core/css/resolver/MatchResultTest.cpp b/third_party/WebKit/Source/core/css/resolver/MatchResultTest.cpp index c475ff5..f50d1c6 100644 --- a/third_party/WebKit/Source/core/css/resolver/MatchResultTest.cpp +++ b/third_party/WebKit/Source/core/css/resolver/MatchResultTest.cpp
@@ -19,7 +19,7 @@ } private: - WillBePersistentHeapVector<RefPtrWillBeMember<MutableStylePropertySet>, 6> propertySets; + PersistentHeapVector<Member<MutableStylePropertySet>, 6> propertySets; }; void MatchResultTest::SetUp()
diff --git a/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.h b/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.h index c7d8d6e9..101c8e9e 100644 --- a/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.h +++ b/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.h
@@ -36,10 +36,9 @@ class ComputedStyle; class StyleResolverState; -class CachedMatchedProperties final : public NoBaseWillBeGarbageCollectedFinalized<CachedMatchedProperties> { - USING_FAST_MALLOC_WILL_BE_REMOVED(CachedMatchedProperties); +class CachedMatchedProperties final : public GarbageCollectedFinalized<CachedMatchedProperties> { public: - WillBeHeapVector<MatchedProperties> matchedProperties; + HeapVector<MatchedProperties> matchedProperties; RefPtr<ComputedStyle> computedStyle; RefPtr<ComputedStyle> parentComputedStyle;
diff --git a/third_party/WebKit/Source/core/css/resolver/MediaQueryResult.h b/third_party/WebKit/Source/core/css/resolver/MediaQueryResult.h index e97120e..fea50925 100644 --- a/third_party/WebKit/Source/core/css/resolver/MediaQueryResult.h +++ b/third_party/WebKit/Source/core/css/resolver/MediaQueryResult.h
@@ -29,8 +29,8 @@ namespace blink { -class MediaQueryResult : public RefCountedWillBeGarbageCollectedFinalized<MediaQueryResult> { - WTF_MAKE_NONCOPYABLE(MediaQueryResult); USING_FAST_MALLOC_WILL_BE_REMOVED(MediaQueryResult); +class MediaQueryResult : public GarbageCollectedFinalized<MediaQueryResult> { + WTF_MAKE_NONCOPYABLE(MediaQueryResult); public: MediaQueryResult(const MediaQueryExp& expr, bool result) #if ENABLE(OILPAN)
diff --git a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp index c40cc08..ba120ef3 100644 --- a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -56,7 +56,7 @@ void ScopedStyleResolver::addKeyframeRules(const RuleSet& ruleSet) { - const WillBeHeapVector<RawPtrWillBeMember<StyleRuleKeyframes>> keyframesRules = ruleSet.keyframesRules(); + const HeapVector<Member<StyleRuleKeyframes>> keyframesRules = ruleSet.keyframesRules(); for (unsigned i = 0; i < keyframesRules.size(); ++i) addKeyframeStyle(keyframesRules[i]); } @@ -69,9 +69,9 @@ Document& document = treeScope().document(); CSSFontSelector* cssFontSelector = document.styleEngine().fontSelector(); - const WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace>> fontFaceRules = ruleSet.fontFaceRules(); + const HeapVector<Member<StyleRuleFontFace>> fontFaceRules = ruleSet.fontFaceRules(); for (auto& fontFaceRule : fontFaceRules) { - if (RefPtrWillBeRawPtr<FontFace> fontFace = FontFace::create(&document, fontFaceRule)) + if (RawPtr<FontFace> fontFace = FontFace::create(&document, fontFaceRule)) cssFontSelector->fontFaceCache()->add(cssFontSelector, fontFaceRule, fontFace); } if (fontFaceRules.size()) @@ -93,7 +93,7 @@ treeScope().document().styleResolver()->addDeviceDependentMediaQueries(ruleSet.deviceDependentMediaQueryResults()); } -void ScopedStyleResolver::collectFeaturesTo(RuleFeatureSet& features, WillBeHeapHashSet<RawPtrWillBeMember<const StyleSheetContents>>& visitedSharedStyleSheetContents) const +void ScopedStyleResolver::collectFeaturesTo(RuleFeatureSet& features, HeapHashSet<Member<const StyleSheetContents>>& visitedSharedStyleSheetContents) const { for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { ASSERT(m_authorStyleSheets[i]->ownerNode()); @@ -129,7 +129,7 @@ return it->value.get(); } -void ScopedStyleResolver::addKeyframeStyle(PassRefPtrWillBeRawPtr<StyleRuleKeyframes> rule) +void ScopedStyleResolver::addKeyframeStyle(RawPtr<StyleRuleKeyframes> rule) { AtomicString s(rule->name()); @@ -199,7 +199,7 @@ #endif } -static void addRules(RuleSet* ruleSet, const WillBeHeapVector<MinimalRuleData>& rules) +static void addRules(RuleSet* ruleSet, const HeapVector<MinimalRuleData>& rules) { for (unsigned i = 0; i < rules.size(); ++i) { const MinimalRuleData& info = rules[i]; @@ -217,7 +217,7 @@ if (!authorRules.deepCombinatorOrShadowPseudoRules().isEmpty()) m_hasDeepOrShadowSelector = true; - OwnPtrWillBeRawPtr<RuleSet> ruleSetForScope = RuleSet::create(); + RawPtr<RuleSet> ruleSetForScope = RuleSet::create(); addRules(ruleSetForScope.get(), authorRules.deepCombinatorOrShadowPseudoRules()); if (!isDocumentScope) { @@ -226,7 +226,7 @@ } if (!m_treeBoundaryCrossingRuleSet) { - m_treeBoundaryCrossingRuleSet = adoptPtrWillBeNoop(new CSSStyleSheetRuleSubSet()); + m_treeBoundaryCrossingRuleSet = new CSSStyleSheetRuleSubSet(); treeScope().document().styleResolver()->addTreeBoundaryCrossingScope(treeScope().rootNode()); }
diff --git a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h index b60b375..6cf9c54 100644 --- a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h +++ b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h
@@ -42,13 +42,12 @@ class ViewportStyleResolver; // This class selects a ComputedStyle for a given element based on a collection of stylesheets. -class ScopedStyleResolver final : public NoBaseWillBeGarbageCollected<ScopedStyleResolver> { +class ScopedStyleResolver final : public GarbageCollected<ScopedStyleResolver> { WTF_MAKE_NONCOPYABLE(ScopedStyleResolver); - USING_FAST_MALLOC_WILL_BE_REMOVED(ScopedStyleResolver); public: - static PassOwnPtrWillBeRawPtr<ScopedStyleResolver> create(TreeScope& scope) + static RawPtr<ScopedStyleResolver> create(TreeScope& scope) { - return adoptPtrWillBeNoop(new ScopedStyleResolver(scope)); + return new ScopedStyleResolver(scope); } const TreeScope& treeScope() const { return *m_scope; } @@ -61,7 +60,7 @@ void collectMatchingShadowHostRules(ElementRuleCollector&, CascadeOrder = ignoreCascadeOrder); void collectMatchingTreeBoundaryCrossingRules(ElementRuleCollector&, CascadeOrder = ignoreCascadeOrder); void matchPageRules(PageRuleCollector&); - void collectFeaturesTo(RuleFeatureSet&, WillBeHeapHashSet<RawPtrWillBeMember<const StyleSheetContents>>& visitedSharedStyleSheetContents) const; + void collectFeaturesTo(RuleFeatureSet&, HeapHashSet<Member<const StyleSheetContents>>& visitedSharedStyleSheetContents) const; void resetAuthorStyle(); void collectViewportRulesTo(ViewportStyleResolver*) const; bool hasDeepOrShadowSelector() const { return m_hasDeepOrShadowSelector; } @@ -77,39 +76,39 @@ void addTreeBoundaryCrossingRules(const RuleSet&, CSSStyleSheet*, unsigned sheetIndex); void addKeyframeRules(const RuleSet&); void addFontFaceRules(const RuleSet&); - void addKeyframeStyle(PassRefPtrWillBeRawPtr<StyleRuleKeyframes>); + void addKeyframeStyle(RawPtr<StyleRuleKeyframes>); - RawPtrWillBeMember<TreeScope> m_scope; + Member<TreeScope> m_scope; - WillBeHeapVector<RawPtrWillBeMember<CSSStyleSheet>> m_authorStyleSheets; + HeapVector<Member<CSSStyleSheet>> m_authorStyleSheets; - using KeyframesRuleMap = WillBeHeapHashMap<const StringImpl*, RefPtrWillBeMember<StyleRuleKeyframes>>; + using KeyframesRuleMap = HeapHashMap<const StringImpl*, Member<StyleRuleKeyframes>>; KeyframesRuleMap m_keyframesRuleMap; - class RuleSubSet final : public NoBaseWillBeGarbageCollected<RuleSubSet> { + class RuleSubSet final : public GarbageCollected<RuleSubSet> { public: - static PassOwnPtrWillBeRawPtr<RuleSubSet> create(CSSStyleSheet* sheet, unsigned index, PassOwnPtrWillBeRawPtr<RuleSet> rules) + static RawPtr<RuleSubSet> create(CSSStyleSheet* sheet, unsigned index, RawPtr<RuleSet> rules) { - return adoptPtrWillBeNoop(new RuleSubSet(sheet, index, rules)); + return new RuleSubSet(sheet, index, rules); } - RawPtrWillBeMember<CSSStyleSheet> m_parentStyleSheet; + Member<CSSStyleSheet> m_parentStyleSheet; unsigned m_parentIndex; - OwnPtrWillBeMember<RuleSet> m_ruleSet; + Member<RuleSet> m_ruleSet; DECLARE_TRACE(); private: - RuleSubSet(CSSStyleSheet* sheet, unsigned index, PassOwnPtrWillBeRawPtr<RuleSet> rules) + RuleSubSet(CSSStyleSheet* sheet, unsigned index, RawPtr<RuleSet> rules) : m_parentStyleSheet(sheet) , m_parentIndex(index) , m_ruleSet(rules) { } }; - using CSSStyleSheetRuleSubSet = WillBeHeapVector<OwnPtrWillBeMember<RuleSubSet>>; + using CSSStyleSheetRuleSubSet = HeapVector<Member<RuleSubSet>>; - OwnPtrWillBeMember<CSSStyleSheetRuleSubSet> m_treeBoundaryCrossingRuleSet; + Member<CSSStyleSheetRuleSubSet> m_treeBoundaryCrossingRuleSet; bool m_hasDeepOrShadowSelector = false; };
diff --git a/third_party/WebKit/Source/core/css/resolver/SelectorFilterParentScope.h b/third_party/WebKit/Source/core/css/resolver/SelectorFilterParentScope.h index c4a57d6a..9dbe0109 100644 --- a/third_party/WebKit/Source/core/css/resolver/SelectorFilterParentScope.h +++ b/third_party/WebKit/Source/core/css/resolver/SelectorFilterParentScope.h
@@ -24,10 +24,10 @@ private: void pushParentIfNeeded(); - RawPtrWillBeMember<Element> m_parent; + Member<Element> m_parent; bool m_pushed; SelectorFilterParentScope* m_previous; - RawPtrWillBeMember<StyleResolver> m_resolver; + Member<StyleResolver> m_resolver; static SelectorFilterParentScope* s_currentScope; };
diff --git a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp index b3f4a82..8ac8429 100644 --- a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp +++ b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
@@ -185,7 +185,7 @@ bool SharedStyleFinder::sharingCandidateDistributedToSameInsertionPoint(Element& candidate) const { - WillBeHeapVector<RawPtrWillBeMember<InsertionPoint>, 8> insertionPoints, candidateInsertionPoints; + HeapVector<Member<InsertionPoint>, 8> insertionPoints, candidateInsertionPoints; collectDestinationInsertionPoints(element(), insertionPoints); collectDestinationInsertionPoints(candidate, candidateInsertionPoints); if (insertionPoints.size() != candidateInsertionPoints.size())
diff --git a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.h b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.h index 475c8dcd..572614f 100644 --- a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.h +++ b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.h
@@ -72,9 +72,9 @@ bool m_elementAffectedByClassRules; const RuleFeatureSet& m_features; - RawPtrWillBeMember<RuleSet> m_siblingRuleSet; - RawPtrWillBeMember<RuleSet> m_uncommonAttributeRuleSet; - RawPtrWillBeMember<StyleResolver> m_styleResolver; + Member<RuleSet> m_siblingRuleSet; + Member<RuleSet> m_uncommonAttributeRuleSet; + Member<StyleResolver> m_styleResolver; const ElementResolveContext& m_context; };
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp index 57870a6f7..0597e24 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -793,7 +793,7 @@ return ShadowList::adopt(shadows); } -PassRefPtrWillBeRawPtr<ShapeValue> StyleBuilderConverter::convertShapeValue(StyleResolverState& state, const CSSValue& value) +RawPtr<ShapeValue> StyleBuilderConverter::convertShapeValue(StyleResolverState& state, const CSSValue& value) { if (value.isPrimitiveValue()) { ASSERT(toCSSPrimitiveValue(value).getValueID() == CSSValueNone);
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h index e328c8e..7fb05c2 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
@@ -88,7 +88,7 @@ static LengthSize convertRadius(StyleResolverState&, const CSSValue&); static EPaintOrder convertPaintOrder(StyleResolverState&, const CSSValue&); static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, const CSSValue&); - static PassRefPtrWillBeRawPtr<ShapeValue> convertShapeValue(StyleResolverState&, const CSSValue&); + static RawPtr<ShapeValue> convertShapeValue(StyleResolverState&, const CSSValue&); static float convertSpacing(StyleResolverState&, const CSSValue&); template <CSSValueID IdForNone> static AtomicString convertString(StyleResolverState&, const CSSValue&); static PassRefPtr<SVGDashArray> convertStrokeDasharray(StyleResolverState&, const CSSValue&);
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp index e1fd99f..508bdb2f 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -154,7 +154,7 @@ return rightToLeftDecl; } -static void collectScopedResolversForHostedShadowTrees(const Element& element, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>& resolvers) +static void collectScopedResolversForHostedShadowTrees(const Element& element, HeapVector<Member<ScopedStyleResolver>, 8>& resolvers) { ElementShadow* shadow = element.shadow(); if (!shadow) @@ -178,10 +178,10 @@ { FrameView* view = document.view(); if (view) { - m_medium = adoptPtrWillBeNoop(new MediaQueryEvaluator(&view->frame())); + m_medium = new MediaQueryEvaluator(&view->frame()); m_printMediaType = equalIgnoringCase(view->mediaType(), MediaTypeNames::print); } else { - m_medium = adoptPtrWillBeNoop(new MediaQueryEvaluator("all")); + m_medium = new MediaQueryEvaluator("all"); } initWatchedSelectorRules(); @@ -202,7 +202,7 @@ CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*m_document); if (!watch) return; - const WillBeHeapVector<RefPtrWillBeMember<StyleRule>>& watchedSelectors = watch->watchedCallbackSelectors(); + const HeapVector<Member<StyleRule>>& watchedSelectors = watch->watchedCallbackSelectors(); if (!watchedSelectors.size()) return; m_watchedSelectorsRules = RuleSet::create(); @@ -210,14 +210,14 @@ m_watchedSelectorsRules->addStyleRule(watchedSelectors[i].get(), RuleHasNoSpecialState); } -void StyleResolver::lazyAppendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>>& styleSheets) +void StyleResolver::lazyAppendAuthorStyleSheets(unsigned firstNew, const HeapVector<Member<CSSStyleSheet>>& styleSheets) { unsigned size = styleSheets.size(); for (unsigned i = firstNew; i < size; ++i) m_pendingStyleSheets.add(styleSheets[i].get()); } -void StyleResolver::removePendingAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>>& styleSheets) +void StyleResolver::removePendingAuthorStyleSheets(const HeapVector<Member<CSSStyleSheet>>& styleSheets) { for (unsigned i = 0; i < styleSheets.size(); ++i) m_pendingStyleSheets.remove(styleSheets[i].get()); @@ -259,7 +259,7 @@ finishAppendAuthorStyleSheets(); } -void StyleResolver::appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>>& styleSheets) +void StyleResolver::appendAuthorStyleSheets(const HeapVector<Member<CSSStyleSheet>>& styleSheets) { // This handles sheets added to the end of the stylesheet list only. In other cases the style resolver // needs to be reconstructed. To handle insertions too the rule order numbers would need to be updated. @@ -312,12 +312,12 @@ treeScope.clearScopedStyleResolver(); } -static PassOwnPtrWillBeRawPtr<RuleSet> makeRuleSet(const WillBeHeapVector<RuleFeature>& rules) +static RawPtr<RuleSet> makeRuleSet(const HeapVector<RuleFeature>& rules) { size_t size = rules.size(); if (!size) return nullptr; - OwnPtrWillBeRawPtr<RuleSet> ruleSet = RuleSet::create(); + RawPtr<RuleSet> ruleSet = RuleSet::create(); for (size_t i = 0; i < size; ++i) ruleSet->addRule(rules[i].rule, rules[i].selectorIndex, rules[i].hasDocumentSecurityOrigin ? RuleHasDocumentSecurityOrigin : RuleHasNoSpecialState); return ruleSet.release(); @@ -539,7 +539,7 @@ collector.clearMatchedRules(); CascadeOrder cascadeOrder = 0; - WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8> resolversInShadowTree; + HeapVector<Member<ScopedStyleResolver>, 8> resolversInShadowTree; collectScopedResolversForHostedShadowTrees(element, resolversInShadowTree); // Apply :host and :host-context rules from inner scopes. @@ -834,14 +834,14 @@ return CSSAnimatableValueFactory::create(property, *state.style()); } -PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElement(Element* parent, PseudoId pseudoId) +RawPtr<PseudoElement> StyleResolver::createPseudoElement(Element* parent, PseudoId pseudoId) { if (pseudoId == PseudoIdFirstLetter) return FirstLetterPseudoElement::create(parent); return PseudoElement::create(parent, pseudoId); } -PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded(Element& parent, PseudoId pseudoId) +RawPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded(Element& parent, PseudoId pseudoId) { LayoutObject* parentLayoutObject = parent.layoutObject(); if (!parentLayoutObject) @@ -878,7 +878,7 @@ if (!pseudoElementLayoutObjectIsNeeded(style.get())) return nullptr; - RefPtrWillBeRawPtr<PseudoElement> pseudo = createPseudoElement(&parent, pseudoId); + RawPtr<PseudoElement> pseudo = createPseudoElement(&parent, pseudoId); setAnimationUpdateIfNeeded(state, *pseudo); if (ElementAnimations* elementAnimations = pseudo->elementAnimations()) @@ -1037,7 +1037,7 @@ state.setConversionZoom(state.style()->effectiveZoom()); } -PassRefPtrWillBeRawPtr<StyleRuleList> StyleResolver::styleRulesForElement(Element* element, unsigned rulesToInclude) +RawPtr<StyleRuleList> StyleResolver::styleRulesForElement(Element* element, unsigned rulesToInclude) { ASSERT(element); StyleResolverState state(document(), element); @@ -1047,7 +1047,7 @@ return collector.matchedStyleRuleList(); } -PassRefPtrWillBeRawPtr<CSSRuleList> StyleResolver::pseudoCSSRulesForElement(Element* element, PseudoId pseudoId, unsigned rulesToInclude) +RawPtr<CSSRuleList> StyleResolver::pseudoCSSRulesForElement(Element* element, PseudoId pseudoId, unsigned rulesToInclude) { ASSERT(element); StyleResolverState state(document(), element); @@ -1057,7 +1057,7 @@ return collector.matchedCSSRuleList(); } -PassRefPtrWillBeRawPtr<CSSRuleList> StyleResolver::cssRulesForElement(Element* element, unsigned rulesToInclude) +RawPtr<CSSRuleList> StyleResolver::cssRulesForElement(Element* element, unsigned rulesToInclude) { return pseudoCSSRulesForElement(element, PseudoIdNone, rulesToInclude); } @@ -1124,7 +1124,7 @@ StyleRuleKeyframes* StyleResolver::findKeyframesRule(const Element* element, const AtomicString& animationName) { - WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8> resolvers; + HeapVector<Member<ScopedStyleResolver>, 8> resolvers; collectScopedResolversForHostedShadowTrees(*element, resolvers); if (ScopedStyleResolver* scopedResolver = element->treeScope().scopedStyleResolver()) resolvers.append(scopedResolver); @@ -1638,7 +1638,7 @@ collector.collectMatchingRules(matchRequest); collector.sortAndTransferMatchedRules(); - RefPtrWillBeRawPtr<StyleRuleList> rules = collector.matchedStyleRuleList(); + RawPtr<StyleRuleList> rules = collector.matchedStyleRuleList(); if (!rules) return; for (size_t i = 0; i < rules->size(); i++)
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.h b/third_party/WebKit/Source/core/css/resolver/StyleResolver.h index 1223600..d35639b8 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.h +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.h
@@ -72,16 +72,16 @@ const unsigned styleSharingListSize = 15; const unsigned styleSharingMaxDepth = 32; -using StyleSharingList = WillBeHeapDeque<RawPtrWillBeMember<Element>, styleSharingListSize>; +using StyleSharingList = HeapDeque<Member<Element>, styleSharingListSize>; using ActiveInterpolationsMap = HashMap<PropertyHandle, Vector<RefPtr<Interpolation>, 1>>; // This class selects a ComputedStyle for a given element based on a collection of stylesheets. -class CORE_EXPORT StyleResolver final : public NoBaseWillBeGarbageCollectedFinalized<StyleResolver> { - WTF_MAKE_NONCOPYABLE(StyleResolver); USING_FAST_MALLOC_WILL_BE_REMOVED(StyleResolver); +class CORE_EXPORT StyleResolver final : public GarbageCollectedFinalized<StyleResolver> { + WTF_MAKE_NONCOPYABLE(StyleResolver); public: - static PassOwnPtrWillBeRawPtr<StyleResolver> create(Document& document) + static RawPtr<StyleResolver> create(Document& document) { - return adoptPtrWillBeNoop(new StyleResolver(document)); + return new StyleResolver(document); } ~StyleResolver(); void dispose(); @@ -101,13 +101,13 @@ // FIXME: It could be better to call appendAuthorStyleSheets() directly after we factor StyleResolver further. // https://bugs.webkit.org/show_bug.cgi?id=108890 - void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>>&); + void appendAuthorStyleSheets(const HeapVector<Member<CSSStyleSheet>>&); void resetAuthorStyle(TreeScope&); void resetRuleFeatures(); void finishAppendAuthorStyleSheets(); - void lazyAppendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>>&); - void removePendingAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>>&); + void lazyAppendAuthorStyleSheets(unsigned firstNew, const HeapVector<Member<CSSStyleSheet>>&); + void removePendingAuthorStyleSheets(const HeapVector<Member<CSSStyleSheet>>&); void appendPendingAuthorStyleSheets(); bool hasPendingAuthorStyleSheets() const { return m_pendingStyleSheets.size() > 0 || m_needCollectFeatures; } @@ -126,9 +126,9 @@ AllButEmptyCSSRules = UAAndUserCSSRules | AuthorCSSRules | CrossOriginCSSRules, AllCSSRules = AllButEmptyCSSRules | EmptyCSSRules, }; - PassRefPtrWillBeRawPtr<CSSRuleList> cssRulesForElement(Element*, unsigned rulesToInclude = AllButEmptyCSSRules); - PassRefPtrWillBeRawPtr<CSSRuleList> pseudoCSSRulesForElement(Element*, PseudoId, unsigned rulesToInclude = AllButEmptyCSSRules); - PassRefPtrWillBeRawPtr<StyleRuleList> styleRulesForElement(Element*, unsigned rulesToInclude); + RawPtr<CSSRuleList> cssRulesForElement(Element*, unsigned rulesToInclude = AllButEmptyCSSRules); + RawPtr<CSSRuleList> pseudoCSSRulesForElement(Element*, PseudoId, unsigned rulesToInclude = AllButEmptyCSSRules); + RawPtr<StyleRuleList> styleRulesForElement(Element*, unsigned rulesToInclude); void computeFont(ComputedStyle*, const StylePropertySet&); @@ -171,7 +171,7 @@ void increaseStyleSharingDepth() { ++m_styleSharingDepth; } void decreaseStyleSharingDepth() { --m_styleSharingDepth; } - PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElementIfNeeded(Element& parent, PseudoId); + RawPtr<PseudoElement> createPseudoElementIfNeeded(Element& parent, PseudoId); DECLARE_TRACE(); @@ -220,7 +220,7 @@ bool hasAuthorBackground(const StyleResolverState&); bool hasAuthorBorder(const StyleResolverState&); - PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElement(Element* parent, PseudoId); + RawPtr<PseudoElement> createPseudoElement(Element* parent, PseudoId); Document& document() { return *m_document; } @@ -228,23 +228,23 @@ MatchedPropertiesCache m_matchedPropertiesCache; - OwnPtrWillBeMember<MediaQueryEvaluator> m_medium; + Member<MediaQueryEvaluator> m_medium; MediaQueryResultList m_viewportDependentMediaQueryResults; MediaQueryResultList m_deviceDependentMediaQueryResults; - RawPtrWillBeMember<Document> m_document; + Member<Document> m_document; SelectorFilter m_selectorFilter; - OwnPtrWillBeMember<ViewportStyleResolver> m_viewportStyleResolver; + Member<ViewportStyleResolver> m_viewportStyleResolver; - WillBeHeapListHashSet<RawPtrWillBeMember<CSSStyleSheet>, 16> m_pendingStyleSheets; + HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets; // FIXME: The entire logic of collecting features on StyleResolver, as well as transferring them // between various parts of machinery smells wrong. This needs to be better somehow. RuleFeatureSet m_features; - OwnPtrWillBeMember<RuleSet> m_siblingRuleSet; - OwnPtrWillBeMember<RuleSet> m_uncommonAttributeRuleSet; - OwnPtrWillBeMember<RuleSet> m_watchedSelectorsRules; + Member<RuleSet> m_siblingRuleSet; + Member<RuleSet> m_uncommonAttributeRuleSet; + Member<RuleSet> m_watchedSelectorsRules; DocumentOrderedList m_treeBoundaryCrossingScopes; @@ -253,7 +253,7 @@ bool m_hasFullscreenUAStyle = false; unsigned m_styleSharingDepth; - WillBeHeapVector<OwnPtrWillBeMember<StyleSharingList>, styleSharingMaxDepth> m_styleSharingLists; + HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> m_styleSharingLists; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h index b3c88dfa..c6d88639 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h
@@ -118,7 +118,7 @@ // FIXME: Once styleImage can be made to not take a StyleResolverState // this convenience function should be removed. As-is, without this, call // sites are extremely verbose. - PassRefPtrWillBeRawPtr<StyleImage> styleImage(CSSPropertyID propertyId, const CSSValue& value) + RawPtr<StyleImage> styleImage(CSSPropertyID propertyId, const CSSValue& value) { return m_elementStyleResources.styleImage(propertyId, value); } @@ -161,7 +161,7 @@ private: ElementResolveContext m_elementContext; - RawPtrWillBeMember<Document> m_document; + Member<Document> m_document; // m_style is the primary output for each element's style resolve. RefPtr<ComputedStyle> m_style; @@ -184,7 +184,7 @@ ElementStyleResources m_elementStyleResources; - WillBeHeapHashMap<String, RefPtrWillBeMember<StylePropertySet>> m_customPropertySetsForApplyAtRule; + HeapHashMap<String, Member<StylePropertySet>> m_customPropertySetsForApplyAtRule; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleSharingDepthScope.h b/third_party/WebKit/Source/core/css/resolver/StyleSharingDepthScope.h index 5ea763ca..b49044a 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleSharingDepthScope.h +++ b/third_party/WebKit/Source/core/css/resolver/StyleSharingDepthScope.h
@@ -26,7 +26,7 @@ } private: - RawPtrWillBeMember<StyleResolver> m_resolver; + Member<StyleResolver> m_resolver; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.cpp index 7712f84..8f90de9 100644 --- a/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.cpp
@@ -43,8 +43,6 @@ namespace blink { -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ViewportStyleResolver); - ViewportStyleResolver::ViewportStyleResolver(Document* document) : m_document(document) , m_hasAuthorStyle(false) @@ -73,7 +71,7 @@ { rules->compactRulesIfNeeded(); - const WillBeHeapVector<RawPtrWillBeMember<StyleRuleViewport>>& viewportRules = rules->viewportRules(); + const HeapVector<Member<StyleRuleViewport>>& viewportRules = rules->viewportRules(); for (size_t i = 0; i < viewportRules.size(); ++i) addViewportRule(viewportRules[i], origin); } @@ -135,7 +133,7 @@ if (id == CSSPropertyUserZoom) defaultValue = 1; - RefPtrWillBeRawPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id); + RawPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id); if (!value || !value->isPrimitiveValue()) return defaultValue; @@ -185,7 +183,7 @@ || id == CSSPropertyMaxWidth || id == CSSPropertyMinWidth); - RefPtrWillBeRawPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id); + RawPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id); if (!value || !value->isPrimitiveValue()) return Length(); // auto
diff --git a/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.h b/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.h index ba7ddcf2..78b1568 100644 --- a/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.h +++ b/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.h
@@ -43,13 +43,11 @@ class MutableStylePropertySet; class StyleRuleViewport; -class CORE_EXPORT ViewportStyleResolver : public NoBaseWillBeGarbageCollected<ViewportStyleResolver> { - USING_FAST_MALLOC_WILL_BE_REMOVED(ViewportStyleResolver); - DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ViewportStyleResolver); +class CORE_EXPORT ViewportStyleResolver : public GarbageCollected<ViewportStyleResolver> { public: - static PassOwnPtrWillBeRawPtr<ViewportStyleResolver> create(Document* document) + static RawPtr<ViewportStyleResolver> create(Document* document) { - return adoptPtrWillBeNoop(new ViewportStyleResolver(document)); + return new ViewportStyleResolver(document); } enum Origin { UserAgentOrigin, AuthorOrigin }; @@ -68,8 +66,8 @@ float viewportArgumentValue(CSSPropertyID) const; Length viewportLengthValue(CSSPropertyID) const; - RawPtrWillBeMember<Document> m_document; - RefPtrWillBeMember<MutableStylePropertySet> m_propertySet; + Member<Document> m_document; + Member<MutableStylePropertySet> m_propertySet; bool m_hasAuthorStyle; };
diff --git a/third_party/WebKit/Source/core/dom/ContextFeatures.cpp b/third_party/WebKit/Source/core/dom/ContextFeatures.cpp index fb28796..42b1bc2 100644 --- a/third_party/WebKit/Source/core/dom/ContextFeatures.cpp +++ b/third_party/WebKit/Source/core/dom/ContextFeatures.cpp
@@ -65,12 +65,12 @@ void provideContextFeaturesTo(Page& page, PassOwnPtr<ContextFeaturesClient> client) { - ContextFeatures::SupplementType::provideTo(page, ContextFeatures::supplementName(), ContextFeatures::create(client)); + Supplement<Page>::provideTo(page, ContextFeatures::supplementName(), ContextFeatures::create(client)); } void provideContextFeaturesToDocumentFrom(Document& document, Page& page) { - ContextFeatures* provided = static_cast<ContextFeatures*>(ContextFeatures::SupplementType::from(page, ContextFeatures::supplementName())); + ContextFeatures* provided = static_cast<ContextFeatures*>(Supplement<Page>::from(page, ContextFeatures::supplementName())); if (!provided) return; document.setContextFeatures(*provided);
diff --git a/third_party/WebKit/Source/core/dom/ContextFeatures.h b/third_party/WebKit/Source/core/dom/ContextFeatures.h index fe53aa61..796d763 100644 --- a/third_party/WebKit/Source/core/dom/ContextFeatures.h +++ b/third_party/WebKit/Source/core/dom/ContextFeatures.h
@@ -29,7 +29,6 @@ #include "core/CoreExport.h" #include "core/page/Page.h" -#include "platform/RefCountedSupplement.h" namespace blink { @@ -37,16 +36,9 @@ class Document; class Page; -#if ENABLE(OILPAN) -class ContextFeatures final : public GarbageCollectedFinalized<ContextFeatures>, public HeapSupplement<Page> { +class ContextFeatures final : public GarbageCollectedFinalized<ContextFeatures>, public Supplement<Page> { USING_GARBAGE_COLLECTED_MIXIN(ContextFeatures); public: - typedef HeapSupplement<Page> SupplementType; -#else -class ContextFeatures : public RefCountedSupplement<Page, ContextFeatures> { -public: - typedef RefCountedSupplement<Page, ContextFeatures> SupplementType; -#endif enum FeatureType { PagePopup = 0, MutationEvents, @@ -63,10 +55,6 @@ bool isEnabled(Document*, FeatureType, bool) const; void urlDidChange(Document*); -#if ENABLE(OILPAN) - DEFINE_INLINE_VIRTUAL_TRACE() { HeapSupplement<Page>::trace(visitor); } -#endif - private: explicit ContextFeatures(PassOwnPtr<ContextFeaturesClient> client) : m_client(std::move(client))
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index a29d9edc..7380252 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -69,6 +69,7 @@ #include "core/dom/DOMImplementation.h" #include "core/dom/DocumentFragment.h" #include "core/dom/DocumentLifecycleObserver.h" +#include "core/dom/DocumentParserTiming.h" #include "core/dom/DocumentType.h" #include "core/dom/Element.h" #include "core/dom/ElementDataCache.h" @@ -2495,6 +2496,7 @@ return; m_parser->detach(); m_parser.clear(); + DocumentParserTiming::from(*this).markParserDetached(); } void Document::cancelParsing() @@ -2518,6 +2520,7 @@ m_parserSyncPolicy = parserSyncPolicy; m_parser = createParser(); + DocumentParserTiming::from(*this).markParserStart(); setParsingState(Parsing); setReadyState(Loading); @@ -4803,6 +4806,7 @@ ASSERT(!scriptableDocumentParser() || !m_parser->isParsing()); ASSERT(!scriptableDocumentParser() || m_readyState != Loading); setParsingState(InDOMContentLoaded); + DocumentParserTiming::from(*this).markParserStop(); // FIXME: DOMContentLoaded is dispatched synchronously, but this should be dispatched in a queued task, // See https://crbug.com/425790 @@ -5956,7 +5960,6 @@ DEFINE_TRACE(Document) { -#if ENABLE(OILPAN) visitor->trace(m_importsController); visitor->trace(m_docType); visitor->trace(m_implementation); @@ -6012,8 +6015,7 @@ visitor->trace(m_canvasFontCache); visitor->trace(m_intersectionObserverController); visitor->trace(m_intersectionObserverData); - HeapSupplementable<Document>::trace(visitor); -#endif + Supplementable<Document>::trace(visitor); TreeScope::trace(visitor); ContainerNode::trace(visitor); ExecutionContext::trace(visitor); @@ -6021,7 +6023,7 @@ SecurityContext::trace(visitor); } -template class CORE_TEMPLATE_EXPORT HeapSupplement<Document>; +template class CORE_TEMPLATE_EXPORT Supplement<Document>; } // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h index 3eddb35..0c6bf6f1 100644 --- a/third_party/WebKit/Source/core/dom/Document.h +++ b/third_party/WebKit/Source/core/dom/Document.h
@@ -212,8 +212,7 @@ using DocumentClassFlags = unsigned char; -class CORE_EXPORT Document : public ContainerNode, public TreeScope, public SecurityContext, public ExecutionContext - , public HeapSupplementable<Document>, public DocumentLifecycleNotifier { +class CORE_EXPORT Document : public ContainerNode, public TreeScope, public SecurityContext, public ExecutionContext, public Supplementable<Document>, public DocumentLifecycleNotifier { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(Document); public: @@ -1405,7 +1404,7 @@ int m_nodeCount; }; -extern template class CORE_EXTERN_TEMPLATE_EXPORT HeapSupplement<Document>; +extern template class CORE_EXTERN_TEMPLATE_EXPORT Supplement<Document>; inline bool Document::shouldOverrideLegacyDescription(ViewportDescription::Type origin) {
diff --git a/third_party/WebKit/Source/core/dom/DocumentParserTiming.cpp b/third_party/WebKit/Source/core/dom/DocumentParserTiming.cpp new file mode 100644 index 0000000..7272c1a --- /dev/null +++ b/third_party/WebKit/Source/core/dom/DocumentParserTiming.cpp
@@ -0,0 +1,73 @@ +// 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. + +#include "core/dom/DocumentParserTiming.h" + +#include "core/dom/Document.h" +#include "core/loader/DocumentLoader.h" +#include "platform/TraceEvent.h" +#include "wtf/RawPtr.h" + +namespace blink { + +static const char kSupplementName[] = "DocumentParserTiming"; + +DocumentParserTiming& DocumentParserTiming::from(Document& document) +{ + DocumentParserTiming* timing = static_cast<DocumentParserTiming*>(HeapSupplement<Document>::from(document, kSupplementName)); + if (!timing) { + timing = new DocumentParserTiming(document); + HeapSupplement<Document>::provideTo(document, kSupplementName, timing); + } + return *timing; +} + +void DocumentParserTiming::markParserStart() +{ + if (m_parserDetached || m_parserStart > 0.0) + return; + ASSERT(m_parserStop == 0.0); + m_parserStart = monotonicallyIncreasingTime(); + notifyDocumentParserTimingChanged(); +} + +void DocumentParserTiming::markParserStop() +{ + if (m_parserDetached || m_parserStart == 0.0 || m_parserStop > 0.0) + return; + m_parserStop = monotonicallyIncreasingTime(); + notifyDocumentParserTimingChanged(); +} + +void DocumentParserTiming::markParserDetached() +{ + ASSERT(m_parserStart > 0.0); + m_parserDetached = true; +} + +void DocumentParserTiming::recordParserBlockedOnScriptLoadDuration(double duration) +{ + if (m_parserDetached || m_parserStart == 0.0 || m_parserStop > 0.0) + return; + m_parserBlockedOnScriptLoadDuration += duration; + notifyDocumentParserTimingChanged(); +} + +DEFINE_TRACE(DocumentParserTiming) +{ + visitor->trace(m_document); +} + +DocumentParserTiming::DocumentParserTiming(Document& document) + : m_document(document) +{ +} + +void DocumentParserTiming::notifyDocumentParserTimingChanged() +{ + if (m_document->loader()) + m_document->loader()->didChangePerformanceTiming(); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/DocumentParserTiming.h b/third_party/WebKit/Source/core/dom/DocumentParserTiming.h new file mode 100644 index 0000000..c199740e --- /dev/null +++ b/third_party/WebKit/Source/core/dom/DocumentParserTiming.h
@@ -0,0 +1,78 @@ +// 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. + +#ifndef DocumentParserTiming_h +#define DocumentParserTiming_h + +#include "core/dom/Document.h" +#include "platform/Supplementable.h" +#include "platform/heap/Handle.h" +#include "wtf/Noncopyable.h" + +namespace blink { + +class LocalFrame; + +// DocumentParserTiming is responsible for tracking parser-related timings for a +// given document. +class DocumentParserTiming final : public GarbageCollectedFinalized<DocumentParserTiming>, public HeapSupplement<Document> { + WTF_MAKE_NONCOPYABLE(DocumentParserTiming); + USING_GARBAGE_COLLECTED_MIXIN(DocumentParserTiming); + +public: + virtual ~DocumentParserTiming() {} + + static DocumentParserTiming& from(Document&); + + // markParserStart and markParserStop methods record the time that the + // parser was first started/stopped, and notify that the document parser + // timing has changed. These methods do nothing (early return) if a time has + // already been recorded for the given parser event, or if a parser has + // already been detached. + void markParserStart(); + void markParserStop(); + + // markParserDetached records that the parser is detached from the + // document. A single document may have multiple parsers, if e.g. the + // document is re-opened using document.write. DocumentParserTiming only + // wants to record parser start and stop time for the first parser. To avoid + // recording parser start and stop times for re-opened documents, we keep + // track of whether a parser has been detached, and avoid recording + // start/stop times for subsequent parsers, after the first parser has been + // detached. + void markParserDetached(); + + // Record a duration of time that the parser yielded due to loading a + // script, in seconds. This may be called multiple times, once for each time + // the parser yields on a script load. + void recordParserBlockedOnScriptLoadDuration(double duration); + + // The getters below return monotonically-increasing seconds, or zero if the + // given parser event has not yet occurred. See the comments for + // monotonicallyIncreasingTime in wtf/CurrentTime.h for additional details. + + double parserStart() const { return m_parserStart; } + double parserStop() const { return m_parserStop; } + + // Returns the sum of all blocking script load durations reported via + // recordParseBlockedOnScriptLoadDuration. + double parserBlockedOnScriptLoadDuration() const { return m_parserBlockedOnScriptLoadDuration; } + + DECLARE_VIRTUAL_TRACE(); + +private: + explicit DocumentParserTiming(Document&); + void notifyDocumentParserTimingChanged(); + + double m_parserStart = 0.0; + double m_parserStop = 0.0; + double m_parserBlockedOnScriptLoadDuration = 0.0; + bool m_parserDetached = false; + + Member<Document> m_document; +}; + +} // namespace blink + +#endif
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp index 68a6e97..d63b8465 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
@@ -276,11 +276,9 @@ DEFINE_TRACE(ExecutionContext) { -#if ENABLE(OILPAN) visitor->trace(m_publicURLManager); - HeapSupplementable<ExecutionContext>::trace(visitor); -#endif ContextLifecycleNotifier::trace(visitor); + Supplementable<ExecutionContext>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.h b/third_party/WebKit/Source/core/dom/ExecutionContext.h index 4ed122e7..ce21bcb 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.h +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.h
@@ -58,8 +58,7 @@ class SecurityOrigin; class ScriptCallStack; -class CORE_EXPORT ExecutionContext - : public ContextLifecycleNotifier, public HeapSupplementable<ExecutionContext> { +class CORE_EXPORT ExecutionContext : public ContextLifecycleNotifier, public Supplementable<ExecutionContext> { WTF_MAKE_NONCOPYABLE(ExecutionContext); public: DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/core/dom/PendingScript.cpp b/third_party/WebKit/Source/core/dom/PendingScript.cpp index 54d9faf..0fc76ea218 100644 --- a/third_party/WebKit/Source/core/dom/PendingScript.cpp +++ b/third_party/WebKit/Source/core/dom/PendingScript.cpp
@@ -30,6 +30,7 @@ #include "core/fetch/ScriptResource.h" #include "core/frame/SubresourceIntegrity.h" #include "platform/SharedBuffer.h" +#include "wtf/CurrentTime.h" namespace blink { @@ -42,6 +43,7 @@ : m_watchingForLoad(false) , m_element(element) , m_integrityFailure(false) + , m_parserBlockingLoadStartTime(0) , m_client(nullptr) { setScriptResource(resource); @@ -119,6 +121,7 @@ m_watchingForLoad = false; m_startingPosition = TextPosition::belowRangePosition(); m_integrityFailure = false; + m_parserBlockingLoadStartTime = 0; if (m_streamer) m_streamer->cancel(); m_streamer.release(); @@ -130,6 +133,12 @@ setResource(resource); } +void PendingScript::markParserBlockingLoadStartTime() +{ + ASSERT(m_parserBlockingLoadStartTime == 0.0); + m_parserBlockingLoadStartTime = monotonicallyIncreasingTime(); +} + void PendingScript::notifyFinished(Resource* resource) { // The following SRI checks need to be here because, unfortunately, fetches
diff --git a/third_party/WebKit/Source/core/dom/PendingScript.h b/third_party/WebKit/Source/core/dom/PendingScript.h index 75d9fe9..a16d0c7 100644 --- a/third_party/WebKit/Source/core/dom/PendingScript.h +++ b/third_party/WebKit/Source/core/dom/PendingScript.h
@@ -56,6 +56,11 @@ TextPosition startingPosition() const { return m_startingPosition; } void setStartingPosition(const TextPosition& position) { m_startingPosition = position; } + void markParserBlockingLoadStartTime(); + // Returns the time the load of this script started blocking the parser, or + // zero if this script hasn't yet blocked the parser, in + // monotonicallyIncreasingTime. + double parserBlockingLoadStartTime() const { return m_parserBlockingLoadStartTime; } void watchForLoad(ScriptResourceClient*); void stopWatchingForLoad(); @@ -89,6 +94,7 @@ Member<Element> m_element; TextPosition m_startingPosition; // Only used for inline script tags. bool m_integrityFailure; + double m_parserBlockingLoadStartTime; Member<ScriptStreamer> m_streamer; ScriptResourceClient* m_client;
diff --git a/third_party/WebKit/Source/core/dom/StyleSheetCollection.h b/third_party/WebKit/Source/core/dom/StyleSheetCollection.h index a188878..5d80497 100644 --- a/third_party/WebKit/Source/core/dom/StyleSheetCollection.h +++ b/third_party/WebKit/Source/core/dom/StyleSheetCollection.h
@@ -47,8 +47,6 @@ StyleSheetCollection(); - HeapVector<Member<CSSStyleSheet>>& activeAuthorStyleSheets() { return m_activeAuthorStyleSheets; } - HeapVector<Member<StyleSheet>>& styleSheetsForStyleSheetList() { return m_styleSheetsForStyleSheetList; } const HeapVector<Member<CSSStyleSheet>>& activeAuthorStyleSheets() const { return m_activeAuthorStyleSheets; } const HeapVector<Member<StyleSheet>>& styleSheetsForStyleSheetList() const { return m_styleSheetsForStyleSheetList; }
diff --git a/third_party/WebKit/Source/core/editing/CaretBase.h b/third_party/WebKit/Source/core/editing/CaretBase.h index 7907bb0..42ceb7f 100644 --- a/third_party/WebKit/Source/core/editing/CaretBase.h +++ b/third_party/WebKit/Source/core/editing/CaretBase.h
@@ -44,7 +44,6 @@ class CORE_EXPORT CaretBase { WTF_MAKE_NONCOPYABLE(CaretBase); - USING_FAST_MALLOC_WILL_BE_REMOVED(CaretBase); public: explicit CaretBase(CaretVisibility = CaretVisibility::Hidden);
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp index 56b7fb9e..27cd215 100644 --- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp +++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -220,7 +220,7 @@ if (!isValidForPosition(node)) return; - RefPtrWillBeRawPtr<Range> range = Range::create(node->document()); + RawPtr<Range> range = Range::create(node->document()); range->setStart(node, offset, exceptionState); if (exceptionState.hadException()) return; @@ -366,7 +366,7 @@ m_frame->selection().setExtent(createVisiblePosition(createPosition(node, offset))); } -PassRefPtrWillBeRawPtr<Range> DOMSelection::getRangeAt(int index, ExceptionState& exceptionState) +RawPtr<Range> DOMSelection::getRangeAt(int index, ExceptionState& exceptionState) { if (!m_frame) return nullptr; @@ -414,7 +414,7 @@ return; } - RefPtrWillBeRawPtr<Range> originalRange = selection.firstRange(); + RawPtr<Range> originalRange = selection.firstRange(); if (originalRange->startContainer()->document() != newRange->startContainer()->document()) { addConsoleError("The given range does not belong to the current selection's document."); @@ -438,7 +438,7 @@ Range* start = originalRange->compareBoundaryPoints(Range::START_TO_START, newRange, ASSERT_NO_EXCEPTION) < 0 ? originalRange.get() : newRange; Range* end = originalRange->compareBoundaryPoints(Range::END_TO_END, newRange, ASSERT_NO_EXCEPTION) < 0 ? newRange : originalRange.get(); - RefPtrWillBeRawPtr<Range> merged = Range::create(originalRange->startContainer()->document(), start->startContainer(), start->startOffset(), end->endContainer(), end->endOffset()); + RawPtr<Range> merged = Range::create(originalRange->startContainer()->document(), start->startContainer(), start->startOffset(), end->endContainer(), end->endOffset()); TextAffinity affinity = selection.selection().affinity(); selection.setSelectedRange(merged.get(), affinity); } @@ -453,7 +453,7 @@ if (selection.isNone()) return; - RefPtrWillBeRawPtr<Range> selectedRange = createRange(selection.selection().toNormalizedEphemeralRange()); + RawPtr<Range> selectedRange = createRange(selection.selection().toNormalizedEphemeralRange()); if (!selectedRange) return;
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.h b/third_party/WebKit/Source/core/editing/DOMSelection.h index fa5c228..61b1edbb0 100644 --- a/third_party/WebKit/Source/core/editing/DOMSelection.h +++ b/third_party/WebKit/Source/core/editing/DOMSelection.h
@@ -47,13 +47,13 @@ class Range; class TreeScope; -class DOMSelection final : public RefCountedWillBeGarbageCollected<DOMSelection>, public ScriptWrappable, public DOMWindowProperty { +class DOMSelection final : public GarbageCollected<DOMSelection>, public ScriptWrappable, public DOMWindowProperty { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMSelection); + USING_GARBAGE_COLLECTED_MIXIN(DOMSelection); public: - static PassRefPtrWillBeRawPtr<DOMSelection> create(const TreeScope* treeScope) + static RawPtr<DOMSelection> create(const TreeScope* treeScope) { - return adoptRefWillBeNoop(new DOMSelection(treeScope)); + return new DOMSelection(treeScope); } void clearTreeScope(); @@ -84,7 +84,7 @@ void collapseToEnd(ExceptionState&); void collapseToStart(ExceptionState&); void extend(Node*, int offset, ExceptionState&); - PassRefPtrWillBeRawPtr<Range> getRangeAt(int, ExceptionState&); + RawPtr<Range> getRangeAt(int, ExceptionState&); void removeAllRanges(); void addRange(Range*); void deleteFromDocument(); @@ -111,7 +111,7 @@ void addConsoleError(const String& message); - RawPtrWillBeMember<const TreeScope> m_treeScope; + Member<const TreeScope> m_treeScope; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/DragCaretController.cpp b/third_party/WebKit/Source/core/editing/DragCaretController.cpp index 95efe8f..334757f1 100644 --- a/third_party/WebKit/Source/core/editing/DragCaretController.cpp +++ b/third_party/WebKit/Source/core/editing/DragCaretController.cpp
@@ -36,7 +36,7 @@ { } -PassOwnPtrWillBeRawPtr<DragCaretController> DragCaretController::create() +RawPtr<DragCaretController> DragCaretController::create() { return adoptPtrWillBeNoop(new DragCaretController); }
diff --git a/third_party/WebKit/Source/core/editing/DragCaretController.h b/third_party/WebKit/Source/core/editing/DragCaretController.h index b1fa615e..00c61a9 100644 --- a/third_party/WebKit/Source/core/editing/DragCaretController.h +++ b/third_party/WebKit/Source/core/editing/DragCaretController.h
@@ -32,11 +32,10 @@ class CullRect; -class DragCaretController final : public NoBaseWillBeGarbageCollectedFinalized<DragCaretController>, private CaretBase { +class DragCaretController final : public GarbageCollectedFinalized<DragCaretController>, private CaretBase { WTF_MAKE_NONCOPYABLE(DragCaretController); - USING_FAST_MALLOC_WILL_BE_REMOVED(DragCaretController); public: - static PassOwnPtrWillBeRawPtr<DragCaretController> create(); + static RawPtr<DragCaretController> create(); LayoutBlock* caretLayoutObject() const; void paintDragCaret(LocalFrame*, GraphicsContext&, const LayoutPoint&) const;
diff --git a/third_party/WebKit/Source/core/editing/EditingStyle.cpp b/third_party/WebKit/Source/core/editing/EditingStyle.cpp index 16b9bb7a..d7489943 100644 --- a/third_party/WebKit/Source/core/editing/EditingStyle.cpp +++ b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
@@ -127,7 +127,7 @@ } template <class StyleDeclarationType> -static PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyEditingProperties(StyleDeclarationType* style, EditingPropertiesType type = OnlyInheritableEditingProperties) +static RawPtr<MutableStylePropertySet> copyEditingProperties(StyleDeclarationType* style, EditingPropertiesType type = OnlyInheritableEditingProperties) { if (type == AllEditingProperties) return style->copyPropertiesInSet(allEditingProperties()); @@ -139,14 +139,14 @@ return allEditingProperties().contains(static_cast<CSSPropertyID>(id)); } -static PassRefPtrWillBeRawPtr<MutableStylePropertySet> editingStyleFromComputedStyle(PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> style, EditingPropertiesType type = OnlyInheritableEditingProperties) +static RawPtr<MutableStylePropertySet> editingStyleFromComputedStyle(RawPtr<CSSComputedStyleDeclaration> style, EditingPropertiesType type = OnlyInheritableEditingProperties) { if (!style) return MutableStylePropertySet::create(HTMLQuirksMode); return copyEditingProperties(style.get(), type); } -static PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ensureComputedStyle(const Position& position) +static RawPtr<CSSComputedStyleDeclaration> ensureComputedStyle(const Position& position) { Element* elem = associatedElementOf(position); if (!elem) @@ -154,21 +154,19 @@ return CSSComputedStyleDeclaration::create(elem); } -static PassRefPtrWillBeRawPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle); +static RawPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle); enum LegacyFontSizeMode { AlwaysUseLegacyFontSize, UseLegacyFontSizeOnlyIfPixelValuesMatch }; static int legacyFontSizeFromCSSValue(Document*, CSSPrimitiveValue*, bool, LegacyFontSizeMode); static bool isTransparentColorValue(CSSValue*); static bool hasTransparentBackgroundColor(CSSStyleDeclaration*); static bool hasTransparentBackgroundColor(StylePropertySet*); -static PassRefPtrWillBeRawPtr<CSSValue> backgroundColorValueInEffect(Node*); +static RawPtr<CSSValue> backgroundColorValueInEffect(Node*); -class HTMLElementEquivalent : public NoBaseWillBeGarbageCollected<HTMLElementEquivalent> { - USING_FAST_MALLOC_WILL_BE_REMOVED(HTMLElementEquivalent); - DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(HTMLElementEquivalent); +class HTMLElementEquivalent : public GarbageCollected<HTMLElementEquivalent> { public: - static PassOwnPtrWillBeRawPtr<HTMLElementEquivalent> create(CSSPropertyID propertyID, CSSValueID primitiveValue, const HTMLQualifiedName& tagName) + static RawPtr<HTMLElementEquivalent> create(CSSPropertyID propertyID, CSSValueID primitiveValue, const HTMLQualifiedName& tagName) { - return adoptPtrWillBeNoop(new HTMLElementEquivalent(propertyID, primitiveValue, tagName)); + return new HTMLElementEquivalent(propertyID, primitiveValue, tagName); } virtual bool matches(const Element* element) const { return !m_tagName || element->hasTagName(*m_tagName); } @@ -184,12 +182,10 @@ HTMLElementEquivalent(CSSPropertyID, const HTMLQualifiedName& tagName); HTMLElementEquivalent(CSSPropertyID, CSSValueID primitiveValue, const HTMLQualifiedName& tagName); const CSSPropertyID m_propertyID; - const RefPtrWillBeMember<CSSPrimitiveValue> m_primitiveValue; + const Member<CSSPrimitiveValue> m_primitiveValue; const HTMLQualifiedName* m_tagName; // We can store a pointer because HTML tag names are const global. }; -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(HTMLElementEquivalent); - HTMLElementEquivalent::HTMLElementEquivalent(CSSPropertyID id) : m_propertyID(id) , m_tagName(0) @@ -212,7 +208,7 @@ bool HTMLElementEquivalent::valueIsPresentInStyle(HTMLElement* element, StylePropertySet* style) const { - RefPtrWillBeRawPtr<CSSValue> value = style->getPropertyCSSValue(m_propertyID); + RawPtr<CSSValue> value = style->getPropertyCSSValue(m_propertyID); return matches(element) && value && value->isPrimitiveValue() && toCSSPrimitiveValue(value.get())->getValueID() == m_primitiveValue->getValueID(); } @@ -223,9 +219,9 @@ class HTMLTextDecorationEquivalent final : public HTMLElementEquivalent { public: - static PassOwnPtrWillBeRawPtr<HTMLElementEquivalent> create(CSSValueID primitiveValue, const HTMLQualifiedName& tagName) + static RawPtr<HTMLElementEquivalent> create(CSSValueID primitiveValue, const HTMLQualifiedName& tagName) { - return adoptPtrWillBeNoop(new HTMLTextDecorationEquivalent(primitiveValue, tagName)); + return new HTMLTextDecorationEquivalent(primitiveValue, tagName); } bool propertyExistsInStyle(const StylePropertySet*) const override; bool valueIsPresentInStyle(HTMLElement*, StylePropertySet*) const override; @@ -250,7 +246,7 @@ bool HTMLTextDecorationEquivalent::valueIsPresentInStyle(HTMLElement* element, StylePropertySet* style) const { - RefPtrWillBeRawPtr<CSSValue> styleValue = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect); + RawPtr<CSSValue> styleValue = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect); if (!styleValue) styleValue = style->getPropertyCSSValue(textDecorationPropertyForEditing()); return matches(element) && styleValue && styleValue->isValueList() && toCSSValueList(styleValue.get())->hasValue(m_primitiveValue.get()); @@ -258,20 +254,20 @@ class HTMLAttributeEquivalent : public HTMLElementEquivalent { public: - static PassOwnPtrWillBeRawPtr<HTMLAttributeEquivalent> create(CSSPropertyID propertyID, const HTMLQualifiedName& tagName, const QualifiedName& attrName) + static RawPtr<HTMLAttributeEquivalent> create(CSSPropertyID propertyID, const HTMLQualifiedName& tagName, const QualifiedName& attrName) { - return adoptPtrWillBeNoop(new HTMLAttributeEquivalent(propertyID, tagName, attrName)); + return new HTMLAttributeEquivalent(propertyID, tagName, attrName); } - static PassOwnPtrWillBeRawPtr<HTMLAttributeEquivalent> create(CSSPropertyID propertyID, const QualifiedName& attrName) + static RawPtr<HTMLAttributeEquivalent> create(CSSPropertyID propertyID, const QualifiedName& attrName) { - return adoptPtrWillBeNoop(new HTMLAttributeEquivalent(propertyID, attrName)); + return new HTMLAttributeEquivalent(propertyID, attrName); } bool matches(const Element* element) const override { return HTMLElementEquivalent::matches(element) && element->hasAttribute(m_attrName); } bool hasAttribute() const override { return true; } bool valueIsPresentInStyle(HTMLElement*, StylePropertySet*) const override; void addToStyle(Element*, EditingStyle*) const override; - virtual PassRefPtrWillBeRawPtr<CSSValue> attributeValueAsCSSValue(Element*) const; + virtual RawPtr<CSSValue> attributeValueAsCSSValue(Element*) const; inline const QualifiedName& attributeName() const { return m_attrName; } DEFINE_INLINE_VIRTUAL_TRACE() { HTMLElementEquivalent::trace(visitor); } @@ -296,26 +292,26 @@ bool HTMLAttributeEquivalent::valueIsPresentInStyle(HTMLElement* element, StylePropertySet* style) const { - RefPtrWillBeRawPtr<CSSValue> value = attributeValueAsCSSValue(element); - RefPtrWillBeRawPtr<CSSValue> styleValue = style->getPropertyCSSValue(m_propertyID); + RawPtr<CSSValue> value = attributeValueAsCSSValue(element); + RawPtr<CSSValue> styleValue = style->getPropertyCSSValue(m_propertyID); return compareCSSValuePtr(value, styleValue); } void HTMLAttributeEquivalent::addToStyle(Element* element, EditingStyle* style) const { - if (RefPtrWillBeRawPtr<CSSValue> value = attributeValueAsCSSValue(element)) + if (RawPtr<CSSValue> value = attributeValueAsCSSValue(element)) style->setProperty(m_propertyID, value->cssText()); } -PassRefPtrWillBeRawPtr<CSSValue> HTMLAttributeEquivalent::attributeValueAsCSSValue(Element* element) const +RawPtr<CSSValue> HTMLAttributeEquivalent::attributeValueAsCSSValue(Element* element) const { ASSERT(element); const AtomicString& value = element->getAttribute(m_attrName); if (value.isNull()) return nullptr; - RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = nullptr; + RawPtr<MutableStylePropertySet> dummyStyle = nullptr; dummyStyle = MutableStylePropertySet::create(HTMLQuirksMode); dummyStyle->setProperty(m_propertyID, value); return dummyStyle->getPropertyCSSValue(m_propertyID); @@ -323,11 +319,11 @@ class HTMLFontSizeEquivalent final : public HTMLAttributeEquivalent { public: - static PassOwnPtrWillBeRawPtr<HTMLFontSizeEquivalent> create() + static RawPtr<HTMLFontSizeEquivalent> create() { - return adoptPtrWillBeNoop(new HTMLFontSizeEquivalent()); + return new HTMLFontSizeEquivalent(); } - PassRefPtrWillBeRawPtr<CSSValue> attributeValueAsCSSValue(Element*) const override; + RawPtr<CSSValue> attributeValueAsCSSValue(Element*) const override; DEFINE_INLINE_VIRTUAL_TRACE() { HTMLAttributeEquivalent::trace(visitor); } @@ -340,7 +336,7 @@ { } -PassRefPtrWillBeRawPtr<CSSValue> HTMLFontSizeEquivalent::attributeValueAsCSSValue(Element* element) const +RawPtr<CSSValue> HTMLFontSizeEquivalent::attributeValueAsCSSValue(Element* element) const { ASSERT(element); const AtomicString& value = element->getAttribute(m_attrName); @@ -468,13 +464,13 @@ else if (isTabHTMLSpanElement(node)) node = node->parentNode(); - RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleAtPosition = CSSComputedStyleDeclaration::create(node); + RawPtr<CSSComputedStyleDeclaration> computedStyleAtPosition = CSSComputedStyleDeclaration::create(node); m_mutableStyle = propertiesToInclude == AllProperties && computedStyleAtPosition ? computedStyleAtPosition->copyProperties() : editingStyleFromComputedStyle(computedStyleAtPosition); if (propertiesToInclude == EditingPropertiesInEffect) { - if (RefPtrWillBeRawPtr<CSSValue> value = backgroundColorValueInEffect(node)) + if (RawPtr<CSSValue> value = backgroundColorValueInEffect(node)) m_mutableStyle->setProperty(CSSPropertyBackgroundColor, value->cssText()); - if (RefPtrWillBeRawPtr<CSSValue> value = computedStyleAtPosition->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect)) + if (RawPtr<CSSValue> value = computedStyleAtPosition->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect)) m_mutableStyle->setProperty(CSSPropertyTextDecoration, value->cssText()); } @@ -526,7 +522,7 @@ } // Get the adjustment amount out of the style. - RefPtrWillBeRawPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitFontSizeDelta); + RawPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitFontSizeDelta); if (!value || !value->isPrimitiveValue()) return; @@ -551,13 +547,13 @@ if (!m_mutableStyle) return false; - RefPtrWillBeRawPtr<CSSValue> unicodeBidi = m_mutableStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi); + RawPtr<CSSValue> unicodeBidi = m_mutableStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi); if (!unicodeBidi || !unicodeBidi->isPrimitiveValue()) return false; CSSValueID unicodeBidiValue = toCSSPrimitiveValue(unicodeBidi.get())->getValueID(); if (isEmbedOrIsolate(unicodeBidiValue)) { - RefPtrWillBeRawPtr<CSSValue> direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection); + RawPtr<CSSValue> direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection); if (!direction || !direction->isPrimitiveValue()) return false; @@ -591,9 +587,9 @@ m_fontSizeDelta = NoFontDelta; } -PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::copy() const +RawPtr<EditingStyle> EditingStyle::copy() const { - RefPtrWillBeRawPtr<EditingStyle> copy = EditingStyle::create(); + RawPtr<EditingStyle> copy = EditingStyle::create(); if (m_mutableStyle) copy->m_mutableStyle = m_mutableStyle->mutableCopy(); copy->m_isMonospaceFont = m_isMonospaceFont; @@ -635,9 +631,9 @@ return properties; } -PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::extractAndRemoveBlockProperties() +RawPtr<EditingStyle> EditingStyle::extractAndRemoveBlockProperties() { - RefPtrWillBeRawPtr<EditingStyle> blockProperties = EditingStyle::create(); + RawPtr<EditingStyle> blockProperties = EditingStyle::create(); if (!m_mutableStyle) return blockProperties; @@ -647,9 +643,9 @@ return blockProperties; } -PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::extractAndRemoveTextDirection() +RawPtr<EditingStyle> EditingStyle::extractAndRemoveTextDirection() { - RefPtrWillBeRawPtr<EditingStyle> textDirection = EditingStyle::create(); + RawPtr<EditingStyle> textDirection = EditingStyle::create(); textDirection->m_mutableStyle = MutableStylePropertySet::create(HTMLQuirksMode); textDirection->m_mutableStyle->setProperty(CSSPropertyUnicodeBidi, CSSValueIsolate, m_mutableStyle->propertyIsImportant(CSSPropertyUnicodeBidi)); textDirection->m_mutableStyle->setProperty(CSSPropertyDirection, m_mutableStyle->getPropertyValue(CSSPropertyDirection), @@ -673,8 +669,8 @@ { if (!element || !element->parentNode()) return; - RefPtrWillBeRawPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element->parentNode()), AllEditingProperties); - RefPtrWillBeRawPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element), AllEditingProperties); + RawPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element->parentNode()), AllEditingProperties); + RawPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element), AllEditingProperties); nodeStyle->removeEquivalentProperties(parentStyle.get()); m_mutableStyle->removeEquivalentProperties(nodeStyle.get()); } @@ -684,8 +680,8 @@ if (!element || !element->parentNode() || !m_mutableStyle) return; - RefPtrWillBeRawPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element->parentNode()), AllEditingProperties); - RefPtrWillBeRawPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element), AllEditingProperties); + RawPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element->parentNode()), AllEditingProperties); + RawPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element), AllEditingProperties); nodeStyle->removeEquivalentProperties(parentStyle.get()); unsigned propertyCount = nodeStyle->propertyCount(); @@ -698,7 +694,7 @@ if (!m_mutableStyle) return; - RefPtrWillBeRawPtr<CSSValue> textDecorationsInEffect = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect); + RawPtr<CSSValue> textDecorationsInEffect = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect); if (!textDecorationsInEffect) return; @@ -730,7 +726,7 @@ TriState EditingStyle::triStateOfStyle(CSSStyleDeclaration* styleToCompare, ShouldIgnoreTextOnlyProperties shouldIgnoreTextOnlyProperties) const { - RefPtrWillBeRawPtr<MutableStylePropertySet> difference = getPropertiesNotIn(m_mutableStyle.get(), styleToCompare); + RawPtr<MutableStylePropertySet> difference = getPropertiesNotIn(m_mutableStyle.get(), styleToCompare); if (shouldIgnoreTextOnlyProperties == IgnoreTextOnlyProperties) difference->removePropertiesInSet(textOnlyProperties, WTF_ARRAY_LENGTH(textOnlyProperties)); @@ -755,7 +751,7 @@ bool nodeIsStart = true; for (Node& node : NodeTraversal::startsAt(selection.start().anchorNode())) { if (node.layoutObject() && node.hasEditableStyle()) { - RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> nodeStyle = CSSComputedStyleDeclaration::create(&node); + RawPtr<CSSComputedStyleDeclaration> nodeStyle = CSSComputedStyleDeclaration::create(&node); if (nodeStyle) { TriState nodeState = triStateOfStyle(nodeStyle.get(), node.isTextNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreTextOnlyProperties); if (nodeIsStart) { @@ -827,9 +823,9 @@ return conflictingProperties && !conflictingProperties->isEmpty(); } -static const WillBeHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent>>& htmlElementEquivalents() +static const HeapVector<Member<HTMLElementEquivalent>>& htmlElementEquivalents() { - DEFINE_STATIC_LOCAL(WillBePersistentHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent>>, HTMLElementEquivalents, ()); + DEFINE_STATIC_LOCAL(PersistentHeapVector<Member<HTMLElementEquivalent>>, HTMLElementEquivalents, ()); if (!HTMLElementEquivalents.size()) { HTMLElementEquivalents.append(HTMLElementEquivalent::create(CSSPropertyFontWeight, CSSValueBold, HTMLNames::bTag)); HTMLElementEquivalents.append(HTMLElementEquivalent::create(CSSPropertyFontWeight, CSSValueBold, HTMLNames::strongTag)); @@ -852,7 +848,7 @@ if (!m_mutableStyle) return false; - const WillBeHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent>>& HTMLElementEquivalents = htmlElementEquivalents(); + const HeapVector<Member<HTMLElementEquivalent>>& HTMLElementEquivalents = htmlElementEquivalents(); for (size_t i = 0; i < HTMLElementEquivalents.size(); ++i) { const HTMLElementEquivalent* equivalent = HTMLElementEquivalents[i].get(); if (equivalent->matches(element) && equivalent->propertyExistsInStyle(m_mutableStyle.get()) @@ -865,9 +861,9 @@ return false; } -static const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>& htmlAttributeEquivalents() +static const HeapVector<Member<HTMLAttributeEquivalent>>& htmlAttributeEquivalents() { - DEFINE_STATIC_LOCAL(WillBePersistentHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>, HTMLAttributeEquivalents, ()); + DEFINE_STATIC_LOCAL(PersistentHeapVector<Member<HTMLAttributeEquivalent>>, HTMLAttributeEquivalents, ()); if (!HTMLAttributeEquivalents.size()) { // elementIsStyledSpanOrHTMLEquivalent depends on the fact each HTMLAttriuteEquivalent matches exactly one attribute // of exactly one element except dirAttr. @@ -888,7 +884,7 @@ if (!m_mutableStyle) return false; - const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents(); + const HeapVector<Member<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents(); for (const auto& equivalent : HTMLAttributeEquivalents) { if (equivalent->matches(element) && equivalent->propertyExistsInStyle(m_mutableStyle.get()) && !equivalent->valueIsPresentInStyle(element, m_mutableStyle.get())) @@ -907,7 +903,7 @@ if (!m_mutableStyle) return false; - const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents(); + const HeapVector<Member<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents(); bool removed = false; for (const auto& attribute : HTMLAttributeEquivalents) { const HTMLAttributeEquivalent* equivalent = attribute.get(); @@ -941,7 +937,7 @@ if (isHTMLSpanElement(*element)) { elementIsSpanOrElementEquivalent = true; } else { - const WillBeHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent>>& HTMLElementEquivalents = htmlElementEquivalents(); + const HeapVector<Member<HTMLElementEquivalent>>& HTMLElementEquivalents = htmlElementEquivalents(); size_t i; for (i = 0; i < HTMLElementEquivalents.size(); ++i) { if (HTMLElementEquivalents[i]->matches(element)) { @@ -956,7 +952,7 @@ return elementIsSpanOrElementEquivalent; // span, b, etc... without any attributes unsigned matchedAttributes = 0; - const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents(); + const HeapVector<Member<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents(); for (const auto& equivalent : HTMLAttributeEquivalents) { if (equivalent->matches(element) && equivalent->attributeName() != HTMLNames::dirAttr) matchedAttributes++; @@ -992,11 +988,11 @@ // ReplaceSelectionCommand::handleStyleSpans() requires that this function only removes the editing style. // If this function was modified in the future to delete all redundant properties, then add a boolean value to indicate // which one of editingStyleAtPosition or computedStyle is called. - RefPtrWillBeRawPtr<EditingStyle> editingStyleAtPosition = EditingStyle::create(position, EditingPropertiesInEffect); + RawPtr<EditingStyle> editingStyleAtPosition = EditingStyle::create(position, EditingPropertiesInEffect); StylePropertySet* styleAtPosition = editingStyleAtPosition->m_mutableStyle.get(); - RefPtrWillBeRawPtr<CSSValue> unicodeBidi = nullptr; - RefPtrWillBeRawPtr<CSSValue> direction = nullptr; + RawPtr<CSSValue> unicodeBidi = nullptr; + RawPtr<CSSValue> direction = nullptr; if (shouldPreserveWritingDirection == PreserveWritingDirection) { unicodeBidi = m_mutableStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi); direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection); @@ -1025,7 +1021,7 @@ { ASSERT(document); - RefPtrWillBeRawPtr<EditingStyle> typingStyle = document->frame()->selection().typingStyle(); + RawPtr<EditingStyle> typingStyle = document->frame()->selection().typingStyle(); if (!typingStyle || typingStyle == this) return; @@ -1058,7 +1054,7 @@ && (mode == EditingStyle::OverrideValues || !equivalent->propertyExistsInStyle(style)); } -static PassRefPtrWillBeRawPtr<MutableStylePropertySet> extractEditingProperties(const StylePropertySet* style, EditingStyle::PropertiesToInclude propertiesToInclude) +static RawPtr<MutableStylePropertySet> extractEditingProperties(const StylePropertySet* style, EditingStyle::PropertiesToInclude propertiesToInclude) { if (!style) return nullptr; @@ -1077,7 +1073,7 @@ void EditingStyle::mergeInlineAndImplicitStyleOfElement(Element* element, CSSPropertyOverrideMode mode, PropertiesToInclude propertiesToInclude) { - RefPtrWillBeRawPtr<EditingStyle> styleFromRules = EditingStyle::create(); + RawPtr<EditingStyle> styleFromRules = EditingStyle::create(); styleFromRules->mergeStyleFromRulesForSerialization(element); if (element->inlineStyle()) @@ -1086,13 +1082,13 @@ styleFromRules->m_mutableStyle = extractEditingProperties(styleFromRules->m_mutableStyle.get(), propertiesToInclude); mergeStyle(styleFromRules->m_mutableStyle.get(), mode); - const WillBeHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent>>& elementEquivalents = htmlElementEquivalents(); + const HeapVector<Member<HTMLElementEquivalent>>& elementEquivalents = htmlElementEquivalents(); for (const auto& equivalent : elementEquivalents) { if (elementMatchesAndPropertyIsNotInInlineStyleDecl(equivalent.get(), element, mode, m_mutableStyle.get())) equivalent->addToStyle(element, this); } - const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>& attributeEquivalents = htmlAttributeEquivalents(); + const HeapVector<Member<HTMLAttributeEquivalent>>& attributeEquivalents = htmlAttributeEquivalents(); for (const auto& attribute : attributeEquivalents) { if (attribute->attributeName() == HTMLNames::dirAttr) continue; // We don't want to include directionality @@ -1101,9 +1097,9 @@ } } -PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::wrappingStyleForAnnotatedSerialization(ContainerNode* context) +RawPtr<EditingStyle> EditingStyle::wrappingStyleForAnnotatedSerialization(ContainerNode* context) { - RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = EditingStyle::create(context, EditingStyle::EditingPropertiesInEffect); + RawPtr<EditingStyle> wrappingStyle = EditingStyle::create(context, EditingStyle::EditingPropertiesInEffect); // Styles that Mail blockquotes contribute should only be placed on the Mail // blockquote, to help us differentiate those styles from ones that the user @@ -1117,9 +1113,9 @@ return wrappingStyle.release(); } -PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::wrappingStyleForSerialization(ContainerNode* context) +RawPtr<EditingStyle> EditingStyle::wrappingStyleForSerialization(ContainerNode* context) { - RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = EditingStyle::create(); + RawPtr<EditingStyle> wrappingStyle = EditingStyle::create(); // When not annotating for interchange, we only preserve inline style declarations. for (ContainerNode* node = context; node && !node->isDocumentNode(); node = node->parentNode()) { @@ -1156,7 +1152,7 @@ unsigned propertyCount = style->propertyCount(); for (unsigned i = 0; i < propertyCount; ++i) { StylePropertySet::PropertyReference property = style->propertyAt(i); - RefPtrWillBeRawPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(property.id()); + RawPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(property.id()); // text decorations never override values if ((property.id() == textDecorationPropertyForEditing() || property.id() == CSSPropertyWebkitTextDecorationsInEffect) && property.value()->isValueList() && value) { @@ -1172,10 +1168,10 @@ } } -static PassRefPtrWillBeRawPtr<MutableStylePropertySet> styleFromMatchedRulesForElement(Element* element, unsigned rulesToInclude) +static RawPtr<MutableStylePropertySet> styleFromMatchedRulesForElement(Element* element, unsigned rulesToInclude) { - RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); - RefPtrWillBeRawPtr<StyleRuleList> matchedRules = element->document().ensureStyleResolver().styleRulesForElement(element, rulesToInclude); + RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); + RawPtr<StyleRuleList> matchedRules = element->document().ensureStyleResolver().styleRulesForElement(element, rulesToInclude); if (matchedRules) { for (unsigned i = 0; i < matchedRules->size(); ++i) style->mergeAndOverrideOnConflict(&matchedRules->at(i)->properties()); @@ -1185,7 +1181,7 @@ void EditingStyle::mergeStyleFromRules(Element* element) { - RefPtrWillBeRawPtr<MutableStylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element, + RawPtr<MutableStylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element, StyleResolver::AuthorCSSRules | StyleResolver::CrossOriginCSSRules); // Styles from the inline style declaration, held in the variable "style", take precedence // over those from matched rules. @@ -1203,8 +1199,8 @@ // The property value, if it's a percentage, may not reflect the actual computed value. // For example: style="height: 1%; overflow: visible;" in quirksmode // FIXME: There are others like this, see <rdar://problem/5195123> Slashdot copy/paste fidelity problem - RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleForElement = CSSComputedStyleDeclaration::create(element); - RefPtrWillBeRawPtr<MutableStylePropertySet> fromComputedStyle = MutableStylePropertySet::create(HTMLQuirksMode); + RawPtr<CSSComputedStyleDeclaration> computedStyleForElement = CSSComputedStyleDeclaration::create(element); + RawPtr<MutableStylePropertySet> fromComputedStyle = MutableStylePropertySet::create(HTMLQuirksMode); { unsigned propertyCount = m_mutableStyle->propertyCount(); for (unsigned i = 0; i < propertyCount; ++i) { @@ -1213,7 +1209,7 @@ if (!value->isPrimitiveValue()) continue; if (toCSSPrimitiveValue(value)->isPercentage()) { - if (RefPtrWillBeRawPtr<CSSValue> computedPropertyValue = computedStyleForElement->getPropertyCSSValue(property.id())) + if (RawPtr<CSSValue> computedPropertyValue = computedStyleForElement->getPropertyCSSValue(property.id())) fromComputedStyle->addRespectingCascade(CSSProperty(property.id(), computedPropertyValue)); } } @@ -1238,12 +1234,12 @@ return; // 1. Remove style from matched rules because style remain without repeating it in inline style declaration - RefPtrWillBeRawPtr<MutableStylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element, StyleResolver::AllButEmptyCSSRules); + RawPtr<MutableStylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element, StyleResolver::AllButEmptyCSSRules); if (styleFromMatchedRules && !styleFromMatchedRules->isEmpty()) m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), styleFromMatchedRules->ensureCSSStyleDeclaration()); // 2. Remove style present in context and not overriden by matched rules. - RefPtrWillBeRawPtr<EditingStyle> computedStyle = EditingStyle::create(context, EditingPropertiesInEffect); + RawPtr<EditingStyle> computedStyle = EditingStyle::create(context, EditingPropertiesInEffect); if (computedStyle->m_mutableStyle) { if (!computedStyle->m_mutableStyle->getPropertyCSSValue(CSSPropertyBackgroundColor)) computedStyle->m_mutableStyle->setProperty(CSSPropertyBackgroundColor, CSSValueTransparent); @@ -1267,7 +1263,7 @@ if (!m_mutableStyle || m_mutableStyle->isEmpty()) return; - RefPtrWillBeRawPtr<StylePropertySet> defaultStyle = styleFromMatchedRulesForElement(element, StyleResolver::UAAndUserCSSRules); + RawPtr<StylePropertySet> defaultStyle = styleFromMatchedRulesForElement(element, StyleResolver::UAAndUserCSSRules); removePropertiesInStyle(m_mutableStyle.get(), defaultStyle.get()); } @@ -1307,14 +1303,14 @@ int EditingStyle::legacyFontSize(Document* document) const { - RefPtrWillBeRawPtr<CSSValue> cssValue = m_mutableStyle->getPropertyCSSValue(CSSPropertyFontSize); + RawPtr<CSSValue> cssValue = m_mutableStyle->getPropertyCSSValue(CSSPropertyFontSize); if (!cssValue || !cssValue->isPrimitiveValue()) return 0; return legacyFontSizeFromCSSValue(document, toCSSPrimitiveValue(cssValue.get()), m_isMonospaceFont, AlwaysUseLegacyFontSize); } -PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::styleAtSelectionStart(const VisibleSelection& selection, bool shouldUseBackgroundColorInEffect) +RawPtr<EditingStyle> EditingStyle::styleAtSelectionStart(const VisibleSelection& selection, bool shouldUseBackgroundColorInEffect) { if (selection.isNone()) return nullptr; @@ -1333,7 +1329,7 @@ if (!element) return nullptr; - RefPtrWillBeRawPtr<EditingStyle> style = EditingStyle::create(element, EditingStyle::AllProperties); + RawPtr<EditingStyle> style = EditingStyle::create(element, EditingStyle::AllProperties); style->mergeTypingStyle(&element->document()); // If background color is transparent, traverse parent nodes until we hit a different value or document root @@ -1341,7 +1337,7 @@ // and find the background color of the common ancestor. if (shouldUseBackgroundColorInEffect && (selection.isRange() || hasTransparentBackgroundColor(style->m_mutableStyle.get()))) { const EphemeralRange range(selection.toNormalizedEphemeralRange()); - if (PassRefPtrWillBeRawPtr<CSSValue> value = backgroundColorValueInEffect(Range::commonAncestorContainer(range.startPosition().computeContainerNode(), range.endPosition().computeContainerNode()))) + if (RawPtr<CSSValue> value = backgroundColorValueInEffect(Range::commonAncestorContainer(range.startPosition().computeContainerNode(), range.endPosition().computeContainerNode()))) style->setProperty(CSSPropertyBackgroundColor, value->cssText()); } @@ -1378,8 +1374,8 @@ if (!n->isStyledElement()) continue; - RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(n); - RefPtrWillBeRawPtr<CSSValue> unicodeBidi = style->getPropertyCSSValue(CSSPropertyUnicodeBidi); + RawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(n); + RawPtr<CSSValue> unicodeBidi = style->getPropertyCSSValue(CSSPropertyUnicodeBidi); if (!unicodeBidi || !unicodeBidi->isPrimitiveValue()) continue; @@ -1408,8 +1404,8 @@ continue; Element* element = toElement(node); - RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(element); - RefPtrWillBeRawPtr<CSSValue> unicodeBidi = style->getPropertyCSSValue(CSSPropertyUnicodeBidi); + RawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(element); + RawPtr<CSSValue> unicodeBidi = style->getPropertyCSSValue(CSSPropertyUnicodeBidi); if (!unicodeBidi || !unicodeBidi->isPrimitiveValue()) continue; @@ -1421,7 +1417,7 @@ return NaturalWritingDirection; ASSERT(isEmbedOrIsolate(unicodeBidiValue)); - RefPtrWillBeRawPtr<CSSValue> direction = style->getPropertyCSSValue(CSSPropertyDirection); + RawPtr<CSSValue> direction = style->getPropertyCSSValue(CSSPropertyDirection); if (!direction || !direction->isPrimitiveValue()) continue; @@ -1449,8 +1445,8 @@ static void reconcileTextDecorationProperties(MutableStylePropertySet* style) { - RefPtrWillBeRawPtr<CSSValue> textDecorationsInEffect = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect); - RefPtrWillBeRawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing()); + RawPtr<CSSValue> textDecorationsInEffect = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect); + RawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing()); // We shouldn't have both text-decoration and -webkit-text-decorations-in-effect because that wouldn't make sense. ASSERT(!textDecorationsInEffect || !textDecoration); if (textDecorationsInEffect) { @@ -1476,9 +1472,9 @@ if (!style || !style->style() || !document || !document->frame() || !associatedElementOf(position)) return; - RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle = ensureComputedStyle(position); + RawPtr<CSSComputedStyleDeclaration> computedStyle = ensureComputedStyle(position); // FIXME: take care of background-color in effect - RefPtrWillBeRawPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get()); + RawPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get()); ASSERT(mutableStyle); reconcileTextDecorationProperties(mutableStyle.get()); @@ -1526,11 +1522,11 @@ // Assuming reconcileTextDecorationProperties has been called, there should not be -webkit-text-decorations-in-effect // Furthermore, text-decoration: none has been trimmed so that text-decoration property is always a CSSValueList. - RefPtrWillBeRawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing()); + RawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing()); if (textDecoration && textDecoration->isValueList()) { DEFINE_STATIC_REF_WILL_BE_PERSISTENT(CSSPrimitiveValue, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline))); DEFINE_STATIC_REF_WILL_BE_PERSISTENT(CSSPrimitiveValue, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough))); - RefPtrWillBeRawPtr<CSSValueList> newTextDecoration = toCSSValueList(textDecoration.get())->copy(); + RawPtr<CSSValueList> newTextDecoration = toCSSValueList(textDecoration.get())->copy(); if (newTextDecoration->removeAll(underline)) m_applyUnderline = true; if (newTextDecoration->removeAll(lineThrough)) @@ -1562,7 +1558,7 @@ m_applyFontFace.replace('"', ""); style->removeProperty(CSSPropertyFontFamily); - if (RefPtrWillBeRawPtr<CSSValue> fontSize = style->getPropertyCSSValue(CSSPropertyFontSize)) { + if (RawPtr<CSSValue> fontSize = style->getPropertyCSSValue(CSSPropertyFontSize)) { if (!fontSize->isPrimitiveValue()) { style->removeProperty(CSSPropertyFontSize); // Can't make sense of the number. Put no font size. } else if (int legacyFontSize = legacyFontSizeFromCSSValue(document, toCSSPrimitiveValue(fontSize.get()), isMonospaceFont, UseLegacyFontSizeOnlyIfPixelValuesMatch)) { @@ -1574,11 +1570,11 @@ static void diffTextDecorations(MutableStylePropertySet* style, CSSPropertyID propertID, CSSValue* refTextDecoration) { - RefPtrWillBeRawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(propertID); + RawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(propertID); if (!textDecoration || !textDecoration->isValueList() || !refTextDecoration || !refTextDecoration->isValueList()) return; - RefPtrWillBeRawPtr<CSSValueList> newTextDecoration = toCSSValueList(textDecoration.get())->copy(); + RawPtr<CSSValueList> newTextDecoration = toCSSValueList(textDecoration.get())->copy(); CSSValueList* valuesInRefTextDecoration = toCSSValueList(refTextDecoration); for (size_t i = 0; i < valuesInRefTextDecoration->length(); i++) @@ -1625,20 +1621,20 @@ return value == CSSValueLighter || value == CSSValueBolder; } -PassRefPtrWillBeRawPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle) +RawPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle) { ASSERT(styleWithRedundantProperties); ASSERT(baseStyle); - RefPtrWillBeRawPtr<MutableStylePropertySet> result = styleWithRedundantProperties->mutableCopy(); + RawPtr<MutableStylePropertySet> result = styleWithRedundantProperties->mutableCopy(); result->removeEquivalentProperties(baseStyle); - RefPtrWillBeRawPtr<CSSValue> baseTextDecorationsInEffect = baseStyle->getPropertyCSSValueInternal(CSSPropertyWebkitTextDecorationsInEffect); + RawPtr<CSSValue> baseTextDecorationsInEffect = baseStyle->getPropertyCSSValueInternal(CSSPropertyWebkitTextDecorationsInEffect); diffTextDecorations(result.get(), textDecorationPropertyForEditing(), baseTextDecorationsInEffect.get()); diffTextDecorations(result.get(), CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get()); - if (RefPtrWillBeRawPtr<CSSValue> baseFontWeight = baseStyle->getPropertyCSSValueInternal(CSSPropertyFontWeight)) { - if (RefPtrWillBeRawPtr<CSSValue> fontWeight = result->getPropertyCSSValue(CSSPropertyFontWeight)) { + if (RawPtr<CSSValue> baseFontWeight = baseStyle->getPropertyCSSValueInternal(CSSPropertyFontWeight)) { + if (RawPtr<CSSValue> fontWeight = result->getPropertyCSSValue(CSSPropertyFontWeight)) { if (!fontWeightNeedsResolving(fontWeight.get()) && !fontWeightNeedsResolving(baseFontWeight.get()) && (fontWeightIsBold(fontWeight.get()) == fontWeightIsBold(baseFontWeight.get()))) result->removeProperty(CSSPropertyFontWeight); @@ -1662,7 +1658,7 @@ { if (!style) return CSSValueInvalid; - RefPtrWillBeRawPtr<CSSValue> value = style->getPropertyCSSValue(propertyID); + RawPtr<CSSValue> value = style->getPropertyCSSValue(propertyID); if (!value || !value->isPrimitiveValue()) return CSSValueInvalid; return toCSSPrimitiveValue(value.get())->getValueID(); @@ -1672,7 +1668,7 @@ { if (!style) return CSSValueInvalid; - RefPtrWillBeRawPtr<CSSValue> value = style->getPropertyCSSValueInternal(propertyID); + RawPtr<CSSValue> value = style->getPropertyCSSValueInternal(propertyID); if (!value || !value->isPrimitiveValue()) return CSSValueInvalid; return toCSSPrimitiveValue(value.get())->getValueID(); @@ -1713,20 +1709,20 @@ bool hasTransparentBackgroundColor(CSSStyleDeclaration* style) { - RefPtrWillBeRawPtr<CSSValue> cssValue = style->getPropertyCSSValueInternal(CSSPropertyBackgroundColor); + RawPtr<CSSValue> cssValue = style->getPropertyCSSValueInternal(CSSPropertyBackgroundColor); return isTransparentColorValue(cssValue.get()); } bool hasTransparentBackgroundColor(StylePropertySet* style) { - RefPtrWillBeRawPtr<CSSValue> cssValue = style->getPropertyCSSValue(CSSPropertyBackgroundColor); + RawPtr<CSSValue> cssValue = style->getPropertyCSSValue(CSSPropertyBackgroundColor); return isTransparentColorValue(cssValue.get()); } -PassRefPtrWillBeRawPtr<CSSValue> backgroundColorValueInEffect(Node* node) +RawPtr<CSSValue> backgroundColorValueInEffect(Node* node) { for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { - RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDeclaration::create(ancestor); + RawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDeclaration::create(ancestor); if (!hasTransparentBackgroundColor(ancestorStyle.get())) return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor); }
diff --git a/third_party/WebKit/Source/core/editing/EditingStyle.h b/third_party/WebKit/Source/core/editing/EditingStyle.h index c98e6bd..db494e88 100644 --- a/third_party/WebKit/Source/core/editing/EditingStyle.h +++ b/third_party/WebKit/Source/core/editing/EditingStyle.h
@@ -59,7 +59,7 @@ class ComputedStyle; class StylePropertySet; -class EditingStyle final : public RefCountedWillBeGarbageCollectedFinalized<EditingStyle> { +class EditingStyle final : public GarbageCollectedFinalized<EditingStyle> { public: enum PropertiesToInclude { AllProperties, OnlyEditingInheritableProperties, EditingPropertiesInEffect }; @@ -67,29 +67,29 @@ enum ShouldExtractMatchingStyle { ExtractMatchingStyle, DoNotExtractMatchingStyle }; static float NoFontDelta; - static PassRefPtrWillBeRawPtr<EditingStyle> create() + static RawPtr<EditingStyle> create() { - return adoptRefWillBeNoop(new EditingStyle()); + return new EditingStyle(); } - static PassRefPtrWillBeRawPtr<EditingStyle> create(ContainerNode* node, PropertiesToInclude propertiesToInclude = OnlyEditingInheritableProperties) + static RawPtr<EditingStyle> create(ContainerNode* node, PropertiesToInclude propertiesToInclude = OnlyEditingInheritableProperties) { - return adoptRefWillBeNoop(new EditingStyle(node, propertiesToInclude)); + return new EditingStyle(node, propertiesToInclude); } - static PassRefPtrWillBeRawPtr<EditingStyle> create(const Position& position, PropertiesToInclude propertiesToInclude = OnlyEditingInheritableProperties) + static RawPtr<EditingStyle> create(const Position& position, PropertiesToInclude propertiesToInclude = OnlyEditingInheritableProperties) { - return adoptRefWillBeNoop(new EditingStyle(position, propertiesToInclude)); + return new EditingStyle(position, propertiesToInclude); } - static PassRefPtrWillBeRawPtr<EditingStyle> create(const StylePropertySet* style) + static RawPtr<EditingStyle> create(const StylePropertySet* style) { - return adoptRefWillBeNoop(new EditingStyle(style)); + return new EditingStyle(style); } - static PassRefPtrWillBeRawPtr<EditingStyle> create(CSSPropertyID propertyID, const String& value) + static RawPtr<EditingStyle> create(CSSPropertyID propertyID, const String& value) { - return adoptRefWillBeNoop(new EditingStyle(propertyID, value)); + return new EditingStyle(propertyID, value); } ~EditingStyle(); @@ -99,9 +99,9 @@ bool isEmpty() const; void overrideWithStyle(const StylePropertySet*); void clear(); - PassRefPtrWillBeRawPtr<EditingStyle> copy() const; - PassRefPtrWillBeRawPtr<EditingStyle> extractAndRemoveBlockProperties(); - PassRefPtrWillBeRawPtr<EditingStyle> extractAndRemoveTextDirection(); + RawPtr<EditingStyle> copy() const; + RawPtr<EditingStyle> extractAndRemoveBlockProperties(); + RawPtr<EditingStyle> extractAndRemoveTextDirection(); void removeBlockProperties(); void removeStyleAddedByElement(Element*); void removeStyleConflictingWithStyleOfElement(Element*); @@ -126,8 +126,8 @@ void mergeTypingStyle(Document*); enum CSSPropertyOverrideMode { OverrideValues, DoNotOverrideValues }; void mergeInlineStyleOfElement(HTMLElement*, CSSPropertyOverrideMode, PropertiesToInclude = AllProperties); - static PassRefPtrWillBeRawPtr<EditingStyle> wrappingStyleForAnnotatedSerialization(ContainerNode* context); - static PassRefPtrWillBeRawPtr<EditingStyle> wrappingStyleForSerialization(ContainerNode* context); + static RawPtr<EditingStyle> wrappingStyleForAnnotatedSerialization(ContainerNode* context); + static RawPtr<EditingStyle> wrappingStyleForSerialization(ContainerNode* context); void mergeStyleFromRules(Element*); void mergeStyleFromRulesForSerialization(Element*); void removeStyleFromRulesAndContext(Element*, ContainerNode* context); @@ -139,7 +139,7 @@ float fontSizeDelta() const { return m_fontSizeDelta; } bool hasFontSizeDelta() const { return m_fontSizeDelta != NoFontDelta; } - static PassRefPtrWillBeRawPtr<EditingStyle> styleAtSelectionStart(const VisibleSelection&, bool shouldUseBackgroundColorInEffect = false); + static RawPtr<EditingStyle> styleAtSelectionStart(const VisibleSelection&, bool shouldUseBackgroundColorInEffect = false); static WritingDirection textDirectionForSelection(const VisibleSelection&, EditingStyle* typingStyle, bool& hasNestedOrMultipleEmbeddings); static bool isEmbedOrIsolate(CSSValueID unicodeBidi) { @@ -164,7 +164,7 @@ void mergeInlineAndImplicitStyleOfElement(Element*, CSSPropertyOverrideMode, PropertiesToInclude); void mergeStyle(const StylePropertySet*, CSSPropertyOverrideMode); - RefPtrWillBeMember<MutableStylePropertySet> m_mutableStyle; + Member<MutableStylePropertySet> m_mutableStyle; bool m_isMonospaceFont; float m_fontSizeDelta;
diff --git a/third_party/WebKit/Source/core/editing/EditingTestBase.cpp b/third_party/WebKit/Source/core/editing/EditingTestBase.cpp index 1c14a7a..74eff64 100644 --- a/third_party/WebKit/Source/core/editing/EditingTestBase.cpp +++ b/third_party/WebKit/Source/core/editing/EditingTestBase.cpp
@@ -31,9 +31,9 @@ m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); } -PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::createShadowRootForElementWithIDAndSetInnerHTML(TreeScope& scope, const char* hostElementID, const char* shadowRootContent) +RawPtr<ShadowRoot> EditingTestBase::createShadowRootForElementWithIDAndSetInnerHTML(TreeScope& scope, const char* hostElementID, const char* shadowRootContent) { - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = scope.getElementById(AtomicString::fromUTF8(hostElementID))->createShadowRootInternal(ShadowRootType::V0, ASSERT_NO_EXCEPTION); + RawPtr<ShadowRoot> shadowRoot = scope.getElementById(AtomicString::fromUTF8(hostElementID))->createShadowRootInternal(ShadowRootType::V0, ASSERT_NO_EXCEPTION); shadowRoot->setInnerHTML(String::fromUTF8(shadowRootContent), ASSERT_NO_EXCEPTION); return shadowRoot.release(); } @@ -43,9 +43,9 @@ document().body()->setInnerHTML(String::fromUTF8(bodyContent.c_str()), ASSERT_NO_EXCEPTION); } -PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::setShadowContent(const char* shadowContent, const char* host) +RawPtr<ShadowRoot> EditingTestBase::setShadowContent(const char* shadowContent, const char* host) { - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithIDAndSetInnerHTML(document(), host, shadowContent); + RawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithIDAndSetInnerHTML(document(), host, shadowContent); document().updateDistribution(); return shadowRoot.release(); }
diff --git a/third_party/WebKit/Source/core/editing/EditingTestBase.h b/third_party/WebKit/Source/core/editing/EditingTestBase.h index 1dad287..5ebfa4d 100644 --- a/third_party/WebKit/Source/core/editing/EditingTestBase.h +++ b/third_party/WebKit/Source/core/editing/EditingTestBase.h
@@ -25,10 +25,10 @@ Document& document() const; DummyPageHolder& dummyPageHolder() const { return *m_dummyPageHolder; } - static PassRefPtrWillBeRawPtr<ShadowRoot> createShadowRootForElementWithIDAndSetInnerHTML(TreeScope&, const char* hostElementID, const char* shadowRootContent); + static RawPtr<ShadowRoot> createShadowRootForElementWithIDAndSetInnerHTML(TreeScope&, const char* hostElementID, const char* shadowRootContent); void setBodyContent(const std::string&); - PassRefPtrWillBeRawPtr<ShadowRoot> setShadowContent(const char* shadowContent, const char* shadowHostId); + RawPtr<ShadowRoot> setShadowContent(const char* shadowContent, const char* shadowHostId); void updateLayoutAndStyleForPainting(); private:
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp index 84fe0d2..1a7dc9d7 100644 --- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp +++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -1279,7 +1279,7 @@ return !childLayoutObject->nextSibling(); } -PassRefPtrWillBeRawPtr<HTMLElement> createDefaultParagraphElement(Document& document) +RawPtr<HTMLElement> createDefaultParagraphElement(Document& document) { switch (document.frame()->editor().defaultParagraphSeparator()) { case EditorParagraphSeparatorIsDiv: @@ -1292,7 +1292,7 @@ return nullptr; } -PassRefPtrWillBeRawPtr<HTMLElement> createHTMLElement(Document& document, const QualifiedName& name) +RawPtr<HTMLElement> createHTMLElement(Document& document, const QualifiedName& name) { return HTMLElementFactory::createHTMLElement(name.localName(), document, 0, false); } @@ -1315,12 +1315,12 @@ return isTabHTMLSpanElementTextNode(node) ? toHTMLSpanElement(node->parentNode()) : 0; } -static PassRefPtrWillBeRawPtr<HTMLSpanElement> createTabSpanElement(Document& document, PassRefPtrWillBeRawPtr<Text> prpTabTextNode) +static RawPtr<HTMLSpanElement> createTabSpanElement(Document& document, RawPtr<Text> prpTabTextNode) { - RefPtrWillBeRawPtr<Text> tabTextNode = prpTabTextNode; + RawPtr<Text> tabTextNode = prpTabTextNode; // Make the span to hold the tab. - RefPtrWillBeRawPtr<HTMLSpanElement> spanElement = HTMLSpanElement::create(document); + RawPtr<HTMLSpanElement> spanElement = HTMLSpanElement::create(document); spanElement->setAttribute(classAttr, AppleTabSpanClass); spanElement->setAttribute(styleAttr, "white-space:pre"); @@ -1333,14 +1333,14 @@ return spanElement.release(); } -PassRefPtrWillBeRawPtr<HTMLSpanElement> createTabSpanElement(Document& document, const String& tabText) +RawPtr<HTMLSpanElement> createTabSpanElement(Document& document, const String& tabText) { return createTabSpanElement(document, document.createTextNode(tabText)); } -PassRefPtrWillBeRawPtr<HTMLSpanElement> createTabSpanElement(Document& document) +RawPtr<HTMLSpanElement> createTabSpanElement(Document& document) { - return createTabSpanElement(document, PassRefPtrWillBeRawPtr<Text>(nullptr)); + return createTabSpanElement(document, RawPtr<Text>(nullptr)); } bool isNodeRendered(const Node& node) @@ -1537,7 +1537,7 @@ // opertion is unreliable. TextIterator's TextIteratorEmitsCharactersBetweenAllVisiblePositions mode needs to be fixed, // or these functions need to be changed to iterate using actual VisiblePositions. // FIXME: Deploy these functions everywhere that TextIterators are used to convert between VisiblePositions and indices. -int indexForVisiblePosition(const VisiblePosition& visiblePosition, RefPtrWillBeRawPtr<ContainerNode>& scope) +int indexForVisiblePosition(const VisiblePosition& visiblePosition, RawPtr<ContainerNode>& scope) { if (visiblePosition.isNull()) return 0; @@ -1551,7 +1551,7 @@ else scope = document.documentElement(); - RefPtrWillBeRawPtr<Range> range = Range::create(document, firstPositionInNode(scope.get()), p.parentAnchoredEquivalent()); + RawPtr<Range> range = Range::create(document, firstPositionInNode(scope.get()), p.parentAnchoredEquivalent()); return TextIterator::rangeLength(range->startPosition(), range->endPosition(), true); }
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.h b/third_party/WebKit/Source/core/editing/EditingUtilities.h index 8e38eff6..51dd8c2 100644 --- a/third_party/WebKit/Source/core/editing/EditingUtilities.h +++ b/third_party/WebKit/Source/core/editing/EditingUtilities.h
@@ -279,7 +279,7 @@ int comparePositions(const VisiblePosition&, const VisiblePosition&); -int indexForVisiblePosition(const VisiblePosition&, RefPtrWillBeRawPtr<ContainerNode>& scope); +int indexForVisiblePosition(const VisiblePosition&, RawPtr<ContainerNode>& scope); EphemeralRange makeRange(const VisiblePosition&, const VisiblePosition&); EphemeralRange normalizeRange(const EphemeralRange&); EphemeralRangeInFlatTree normalizeRange(const EphemeralRangeInFlatTree&); @@ -291,8 +291,8 @@ // Functions returning HTMLElement -PassRefPtrWillBeRawPtr<HTMLElement> createDefaultParagraphElement(Document&); -PassRefPtrWillBeRawPtr<HTMLElement> createHTMLElement(Document&, const QualifiedName&); +RawPtr<HTMLElement> createDefaultParagraphElement(Document&); +RawPtr<HTMLElement> createHTMLElement(Document&, const QualifiedName&); HTMLElement* enclosingList(Node*); HTMLElement* outermostEnclosingList(Node*, HTMLElement* rootList = nullptr); @@ -304,8 +304,8 @@ // Functions returning Element -PassRefPtrWillBeRawPtr<HTMLSpanElement> createTabSpanElement(Document&); -PassRefPtrWillBeRawPtr<HTMLSpanElement> createTabSpanElement(Document&, const String& tabText); +RawPtr<HTMLSpanElement> createTabSpanElement(Document&); +RawPtr<HTMLSpanElement> createTabSpanElement(Document&, const String& tabText); Element* rootEditableElementOf(const Position&, EditableType = ContentIsEditable); Element* rootEditableElementOf(const PositionInFlatTree&, EditableType = ContentIsEditable);
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp b/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp index 941d5f6a..43b15b2 100644 --- a/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp +++ b/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp
@@ -30,7 +30,7 @@ const char* bodyContent = "<p id='host' contenteditable><b id='one'>1</b><b id='two'>22</b></p>"; const char* shadowContent = "<content select=#two></content><content select=#one></content><b id='three'>333</b>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Element* host = document().getElementById("host"); Node* one = document().getElementById("one"); @@ -54,7 +54,7 @@ const char* bodyContent = "<p id='host'><b id='one'>11</b></p>"; const char* shadowContent = "<content select=#two></content><div id='three'><content select=#one></content></div>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* host = document().getElementById("host"); Node* one = document().getElementById("one"); @@ -69,7 +69,7 @@ const char* bodyContent = "<p id='host'><b id='one'>11</b></p>"; const char* shadowContent = "<content select=#two></content><div id='three'><content select=#one></div></content>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* host = document().getElementById("host"); Node* one = document().getElementById("one"); @@ -86,7 +86,7 @@ // However, |setBodyContent()| automatically creates HTML, HEAD and BODY // element. So, we build DOM tree manually. // Note: This is unusual HTML taken from http://crbug.com/574230 - RefPtrWillBeRawPtr<Element> table = document().createElement("table", ASSERT_NO_EXCEPTION); + RawPtr<Element> table = document().createElement("table", ASSERT_NO_EXCEPTION); table->setInnerHTML("<caption>foo</caption>", ASSERT_NO_EXCEPTION); while (document().firstChild()) document().firstChild()->remove(); @@ -128,7 +128,7 @@ const char* bodyContent = "<p id='host' contenteditable><b id='one'>1</b><b id='two'>22</b></p>"; const char* shadowContent = "<content select=#two></content><content select=#one></content><b id='three'>333</b>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Element* host = document().getElementById("host"); Node* one = document().getElementById("one"); @@ -179,7 +179,7 @@ { setBodyContent("<style>li:nth-child(even) { -webkit-user-modify: read-write; }</style><ul><li>first item</li><li>second item</li><li class=foo>third</li><li>fourth</li></ul>"); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<StaticElementList> items = document().querySelectorAll("li", ASSERT_NO_EXCEPTION); + RawPtr<StaticElementList> items = document().querySelectorAll("li", ASSERT_NO_EXCEPTION); ASSERT(items->length() == 4); EXPECT_FALSE(areIdenticalElements(*items->item(0)->firstChild(), *items->item(1)->firstChild()))
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp index 6442a0e..d91cc9a 100644 --- a/third_party/WebKit/Source/core/editing/Editor.cpp +++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -122,7 +122,7 @@ HTMLTextFormControlElement* textFormControlOfSelectionStart = enclosingTextFormControl(selection.start()); HTMLTextFormControlElement* textFromControlOfTarget = isHTMLTextFormControlElement(*event->target()->toNode()) ? toHTMLTextFormControlElement(event->target()->toNode()) : 0; if (textFromControlOfTarget && (selection.start().isNull() || textFromControlOfTarget != textFormControlOfSelectionStart)) { - if (RefPtrWillBeRawPtr<Range> range = textFromControlOfTarget->selection()) + if (RawPtr<Range> range = textFromControlOfTarget->selection()) return VisibleSelection(EphemeralRange(range.get()), TextAffinity::Downstream, selection.isDirectional()); } return selection; @@ -353,7 +353,7 @@ target->dispatchEvent(TextEvent::createForPlainTextPaste(frame().domWindow(), pastingText, smartReplace)); } -void Editor::pasteAsFragment(PassRefPtrWillBeRawPtr<DocumentFragment> pastingFragment, bool smartReplace, bool matchStyle) +void Editor::pasteAsFragment(RawPtr<DocumentFragment> pastingFragment, bool smartReplace, bool matchStyle) { Element* target = findEventTargetFromSelection(); if (!target) @@ -390,7 +390,7 @@ void Editor::pasteWithPasteboard(Pasteboard* pasteboard) { - RefPtrWillBeRawPtr<DocumentFragment> fragment = nullptr; + RawPtr<DocumentFragment> fragment = nullptr; bool chosePlainText = false; if (pasteboard->isHTMLAvailable()) { @@ -485,7 +485,7 @@ ? DataObject::create() : DataObject::createFromPasteboard(pasteMode)); - RefPtrWillBeRawPtr<Event> evt = ClipboardEvent::create(eventType, true, true, dataTransfer); + RawPtr<Event> evt = ClipboardEvent::create(eventType, true, true, dataTransfer); target->dispatchEvent(evt); bool noDefaultProcessing = evt->defaultPrevented(); if (noDefaultProcessing && policy == DataTransferWritable) @@ -502,7 +502,7 @@ return smartInsertDeleteEnabled() && pasteboard->canSmartReplace(); } -void Editor::replaceSelectionWithFragment(PassRefPtrWillBeRawPtr<DocumentFragment> fragment, bool selectReplacement, bool smartReplace, bool matchStyle) +void Editor::replaceSelectionWithFragment(RawPtr<DocumentFragment> fragment, bool selectReplacement, bool smartReplace, bool matchStyle) { if (frame().selection().isNone() || !frame().selection().isContentEditable() || !fragment) return; @@ -525,7 +525,7 @@ } // TODO(xiaochengh): Merge it with |replaceSelectionWithFragment()|. -void Editor::replaceSelectionAfterDragging(PassRefPtrWillBeRawPtr<DocumentFragment> fragment, bool smartReplace, bool plainText) +void Editor::replaceSelectionAfterDragging(RawPtr<DocumentFragment> fragment, bool smartReplace, bool plainText) { ReplaceSelectionCommand::CommandOptions options = ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::PreventNesting; if (smartReplace) @@ -536,7 +536,7 @@ ReplaceSelectionCommand::create(*frame().document(), fragment, options, EditActionDrag)->apply(); } -void Editor::moveSelectionAfterDragging(PassRefPtrWillBeRawPtr<DocumentFragment> fragment, const Position& pos, bool smartInsert, bool smartDelete) +void Editor::moveSelectionAfterDragging(RawPtr<DocumentFragment> fragment, const Position& pos, bool smartInsert, bool smartDelete) { MoveSelectionCommand::create(fragment, pos, smartInsert, smartDelete)->apply(); } @@ -652,7 +652,7 @@ String Editor::selectionStartCSSPropertyValue(CSSPropertyID propertyID) { - RefPtrWillBeRawPtr<EditingStyle> selectionStyle = EditingStyle::styleAtSelectionStart(frame().selection().selection(), + RawPtr<EditingStyle> selectionStyle = EditingStyle::styleAtSelectionStart(frame().selection().selection(), propertyID == CSSPropertyBackgroundColor); if (!selectionStyle || !selectionStyle->style()) return String(); @@ -662,7 +662,7 @@ return selectionStyle->style()->getPropertyValue(propertyID); } -static void dispatchEditableContentChangedEvents(PassRefPtrWillBeRawPtr<Element> startRoot, PassRefPtrWillBeRawPtr<Element> endRoot) +static void dispatchEditableContentChangedEvents(RawPtr<Element> startRoot, RawPtr<Element> endRoot) { if (startRoot) startRoot->dispatchEvent(Event::create(EventTypeNames::webkitEditableContentChanged)); @@ -688,7 +688,7 @@ spellChecker().chunkAndMarkAllMisspellingsAndBadGrammar(cmd->endingSelection().rootEditableElement(), insertedRange); } -void Editor::appliedEditing(PassRefPtrWillBeRawPtr<CompositeEditCommand> cmd) +void Editor::appliedEditing(RawPtr<CompositeEditCommand> cmd) { EventQueueScope scope; frame().document()->updateLayout(); @@ -721,7 +721,7 @@ respondToChangedContents(newSelection); } -void Editor::unappliedEditing(PassRefPtrWillBeRawPtr<EditCommandComposition> cmd) +void Editor::unappliedEditing(RawPtr<EditCommandComposition> cmd) { EventQueueScope scope; frame().document()->updateLayout(); @@ -739,7 +739,7 @@ respondToChangedContents(newSelection); } -void Editor::reappliedEditing(PassRefPtrWillBeRawPtr<EditCommandComposition> cmd) +void Editor::reappliedEditing(RawPtr<EditCommandComposition> cmd) { EventQueueScope scope; frame().document()->updateLayout(); @@ -755,9 +755,9 @@ respondToChangedContents(newSelection); } -PassOwnPtrWillBeRawPtr<Editor> Editor::create(LocalFrame& frame) +RawPtr<Editor> Editor::create(LocalFrame& frame) { - return adoptPtrWillBeNoop(new Editor(frame)); + return new Editor(frame); } Editor::Editor(LocalFrame& frame) @@ -1032,7 +1032,7 @@ return; } - RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); + RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); style->setProperty(CSSPropertyDirection, direction == LeftToRightWritingDirection ? "ltr" : direction == RightToLeftWritingDirection ? "rtl" : "inherit", false); applyParagraphStyleToSelection(style.get(), EditActionSetWritingDirection); } @@ -1155,7 +1155,7 @@ } // Calculate the current typing style. - RefPtrWillBeRawPtr<EditingStyle> typingStyle = nullptr; + RawPtr<EditingStyle> typingStyle = nullptr; if (frame().selection().typingStyle()) { typingStyle = frame().selection().typingStyle()->copy(); typingStyle->overrideWithStyle(style); @@ -1166,7 +1166,7 @@ typingStyle->prepareToApplyAt(frame().selection().selection().visibleStart().deepEquivalent(), EditingStyle::PreserveWritingDirection); // Handle block styles, substracting these from the typing style. - RefPtrWillBeRawPtr<EditingStyle> blockStyle = typingStyle->extractAndRemoveBlockProperties(); + RawPtr<EditingStyle> blockStyle = typingStyle->extractAndRemoveBlockProperties(); if (!blockStyle->isEmpty()) { ASSERT(frame().document()); ApplyStyleCommand::create(*frame().document(), blockStyle.get(), editingAction)->apply(); @@ -1182,7 +1182,7 @@ // TODO(yosin) We should make |findRangeOfString()| to return // |EphemeralRange| rather than|Range| object. - RefPtrWillBeRawPtr<Range> resultRange = findRangeOfString(target, EphemeralRange(selection.start(), selection.end()), static_cast<FindOptions>(options | FindAPICall)); + RawPtr<Range> resultRange = findRangeOfString(target, EphemeralRange(selection.start(), selection.end()), static_cast<FindOptions>(options | FindAPICall)); if (!resultRange) return false; @@ -1192,9 +1192,9 @@ return true; } -PassRefPtrWillBeRawPtr<Range> Editor::findStringAndScrollToVisible(const String& target, Range* previousMatch, FindOptions options) +RawPtr<Range> Editor::findStringAndScrollToVisible(const String& target, Range* previousMatch, FindOptions options) { - RefPtrWillBeRawPtr<Range> nextMatch = findRangeOfString(target, EphemeralRangeInFlatTree(previousMatch), options); + RawPtr<Range> nextMatch = findRangeOfString(target, EphemeralRangeInFlatTree(previousMatch), options); if (!nextMatch) return nullptr; @@ -1210,7 +1210,7 @@ // |Range| object for checking whether start and end position crossing shadow // boundaries, however we can do it without |Range| object. template <typename Strategy> -static PassRefPtrWillBeRawPtr<Range> findStringBetweenPositions(const String& target, const EphemeralRangeTemplate<Strategy>& referenceRange, FindOptions options) +static RawPtr<Range> findStringBetweenPositions(const String& target, const EphemeralRangeTemplate<Strategy>& referenceRange, FindOptions options) { EphemeralRangeTemplate<Strategy> searchRange(referenceRange); @@ -1221,7 +1221,7 @@ if (resultRange.isCollapsed()) return nullptr; - RefPtrWillBeRawPtr<Range> rangeObject = Range::create(resultRange.document(), toPositionInDOMTree(resultRange.startPosition()), toPositionInDOMTree(resultRange.endPosition())); + RawPtr<Range> rangeObject = Range::create(resultRange.document(), toPositionInDOMTree(resultRange.startPosition()), toPositionInDOMTree(resultRange.endPosition())); if (!rangeObject->collapsed()) return rangeObject.release(); @@ -1245,7 +1245,7 @@ } template <typename Strategy> -static PassRefPtrWillBeRawPtr<Range> findRangeOfStringAlgorithm(Document& document, const String& target, const EphemeralRangeTemplate<Strategy>& referenceRange, FindOptions options) +static RawPtr<Range> findRangeOfStringAlgorithm(Document& document, const String& target, const EphemeralRangeTemplate<Strategy>& referenceRange, FindOptions options) { if (target.isEmpty()) return nullptr; @@ -1270,7 +1270,7 @@ searchRange = EphemeralRangeTemplate<Strategy>(documentRange.startPosition(), referenceRange.startPosition()); } - RefPtrWillBeRawPtr<Range> resultRange = findStringBetweenPositions(target, searchRange, options); + RawPtr<Range> resultRange = findStringBetweenPositions(target, searchRange, options); // If we started in the reference range and the found range exactly matches // the reference range, find again. Build a selection with the found range @@ -1290,12 +1290,12 @@ return resultRange.release(); } -PassRefPtrWillBeRawPtr<Range> Editor::findRangeOfString(const String& target, const EphemeralRange& reference, FindOptions options) +RawPtr<Range> Editor::findRangeOfString(const String& target, const EphemeralRange& reference, FindOptions options) { return findRangeOfStringAlgorithm<EditingStrategy>(*frame().document(), target, reference, options); } -PassRefPtrWillBeRawPtr<Range> Editor::findRangeOfString(const String& target, const EphemeralRangeInFlatTree& reference, FindOptions options) +RawPtr<Range> Editor::findRangeOfString(const String& target, const EphemeralRangeInFlatTree& reference, FindOptions options) { return findRangeOfStringAlgorithm<EditingInFlatTreeStrategy>(*frame().document(), target, reference, options); } @@ -1334,8 +1334,8 @@ bool needsValidStructure = document.hasEditableStyle() || (document.documentElement() && document.documentElement()->hasEditableStyle()); if (!needsValidStructure) return; - RefPtrWillBeRawPtr<Element> existingHead = nullptr; - RefPtrWillBeRawPtr<Element> existingBody = nullptr; + RawPtr<Element> existingHead = nullptr; + RawPtr<Element> existingBody = nullptr; Element* currentRoot = document.documentElement(); if (currentRoot) { if (isHTMLHtmlElement(currentRoot)) @@ -1353,10 +1353,10 @@ // rootEditableElement. document.addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "document.execCommand() doesn't work with an invalid HTML structure. It is corrected automatically.")); - RefPtrWillBeRawPtr<Element> root = HTMLHtmlElement::create(document); + RawPtr<Element> root = HTMLHtmlElement::create(document); if (existingHead) root->appendChild(existingHead.release()); - RefPtrWillBeRawPtr<Element> body = nullptr; + RawPtr<Element> body = nullptr; if (existingBody) body = existingBody.release(); else
diff --git a/third_party/WebKit/Source/core/editing/Editor.h b/third_party/WebKit/Source/core/editing/Editor.h index 31db5ef..86581ce 100644 --- a/third_party/WebKit/Source/core/editing/Editor.h +++ b/third_party/WebKit/Source/core/editing/Editor.h
@@ -59,11 +59,10 @@ enum EditorCommandSource { CommandFromMenuOrKeyBinding, CommandFromDOM }; enum EditorParagraphSeparator { EditorParagraphSeparatorIsDiv, EditorParagraphSeparatorIsP }; -class CORE_EXPORT Editor final : public NoBaseWillBeGarbageCollectedFinalized<Editor> { - USING_FAST_MALLOC_WILL_BE_REMOVED(Editor); +class CORE_EXPORT Editor final : public GarbageCollectedFinalized<Editor> { WTF_MAKE_NONCOPYABLE(Editor); public: - static PassOwnPtrWillBeRawPtr<Editor> create(LocalFrame&); + static RawPtr<Editor> create(LocalFrame&); ~Editor(); EditorClient& client() const; @@ -114,9 +113,9 @@ void applyStyleToSelection(StylePropertySet*, EditAction); void applyParagraphStyleToSelection(StylePropertySet*, EditAction); - void appliedEditing(PassRefPtrWillBeRawPtr<CompositeEditCommand>); - void unappliedEditing(PassRefPtrWillBeRawPtr<EditCommandComposition>); - void reappliedEditing(PassRefPtrWillBeRawPtr<EditCommandComposition>); + void appliedEditing(RawPtr<CompositeEditCommand>); + void unappliedEditing(RawPtr<EditCommandComposition>); + void reappliedEditing(RawPtr<EditCommandComposition>); void setShouldStyleWithCSS(bool flag) { m_shouldStyleWithCSS = flag; } bool shouldStyleWithCSS() const { return m_shouldStyleWithCSS; } @@ -125,7 +124,7 @@ STACK_ALLOCATED(); public: Command(); - Command(const EditorInternalCommand*, EditorCommandSource, PassRefPtrWillBeRawPtr<LocalFrame>); + Command(const EditorInternalCommand*, EditorCommandSource, RawPtr<LocalFrame>); bool execute(const String& parameter = String(), Event* triggeringEvent = nullptr) const; bool execute(Event* triggeringEvent) const; @@ -149,7 +148,7 @@ const EditorInternalCommand* m_command; EditorCommandSource m_source; - RefPtrWillBeMember<LocalFrame> m_frame; + Member<LocalFrame> m_frame; }; Command createCommand(const String& commandName); // Command source is CommandFromMenuOrKeyBinding. Command createCommand(const String& commandName, EditorCommandSource); @@ -195,16 +194,16 @@ void addToKillRing(const EphemeralRange&); - void pasteAsFragment(PassRefPtrWillBeRawPtr<DocumentFragment>, bool smartReplace, bool matchStyle); + void pasteAsFragment(RawPtr<DocumentFragment>, bool smartReplace, bool matchStyle); void pasteAsPlainText(const String&, bool smartReplace); Element* findEventTargetFrom(const VisibleSelection&) const; bool findString(const String&, FindOptions); - PassRefPtrWillBeRawPtr<Range> findStringAndScrollToVisible(const String&, Range*, FindOptions); - PassRefPtrWillBeRawPtr<Range> findRangeOfString(const String& target, const EphemeralRange& referenceRange, FindOptions); - PassRefPtrWillBeRawPtr<Range> findRangeOfString(const String& target, const EphemeralRangeInFlatTree& referenceRange, FindOptions); + RawPtr<Range> findStringAndScrollToVisible(const String&, Range*, FindOptions); + RawPtr<Range> findRangeOfString(const String& target, const EphemeralRange& referenceRange, FindOptions); + RawPtr<Range> findRangeOfString(const String& target, const EphemeralRangeInFlatTree& referenceRange, FindOptions); const VisibleSelection& mark() const; // Mark, to be used as emacs uses it. void setMark(const VisibleSelection&); @@ -219,12 +218,12 @@ bool markedTextMatchesAreHighlighted() const; void setMarkedTextMatchesAreHighlighted(bool); - void replaceSelectionWithFragment(PassRefPtrWillBeRawPtr<DocumentFragment>, bool selectReplacement, bool smartReplace, bool matchStyle); + void replaceSelectionWithFragment(RawPtr<DocumentFragment>, bool selectReplacement, bool smartReplace, bool matchStyle); void replaceSelectionWithText(const String&, bool selectReplacement, bool smartReplace); // TODO(xiaochengh): Replace |bool| parameters by |enum|. - void replaceSelectionAfterDragging(PassRefPtrWillBeRawPtr<DocumentFragment>, bool smartReplace, bool plainText); - void moveSelectionAfterDragging(PassRefPtrWillBeRawPtr<DocumentFragment>, const Position&, bool smartInsert, bool smartDelete); + void replaceSelectionAfterDragging(RawPtr<DocumentFragment>, bool smartReplace, bool plainText); + void moveSelectionAfterDragging(RawPtr<DocumentFragment>, const Position&, bool smartInsert, bool smartDelete); EditorParagraphSeparator defaultParagraphSeparator() const { return m_defaultParagraphSeparator; } void setDefaultParagraphSeparator(EditorParagraphSeparator separator) { m_defaultParagraphSeparator = separator; } @@ -233,20 +232,22 @@ class RevealSelectionScope { WTF_MAKE_NONCOPYABLE(RevealSelectionScope); - STACK_ALLOCATED(); + DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); public: explicit RevealSelectionScope(Editor*); ~RevealSelectionScope(); + + DECLARE_TRACE(); private: - RawPtrWillBeMember<Editor> m_editor; + Member<Editor> m_editor; }; friend class RevealSelectionScope; DECLARE_TRACE(); private: - RawPtrWillBeMember<LocalFrame> m_frame; - RefPtrWillBeMember<CompositeEditCommand> m_lastEditCommand; + Member<LocalFrame> m_frame; + Member<CompositeEditCommand> m_lastEditCommand; int m_preventRevealSelection; bool m_shouldStartNewKillRingSequence; bool m_shouldStyleWithCSS;
diff --git a/third_party/WebKit/Source/core/editing/EditorTest.cpp b/third_party/WebKit/Source/core/editing/EditorTest.cpp index b92e8a45..6bff66d 100644 --- a/third_party/WebKit/Source/core/editing/EditorTest.cpp +++ b/third_party/WebKit/Source/core/editing/EditorTest.cpp
@@ -26,7 +26,7 @@ TEST_F(EditorTest, tidyUpHTMLStructureFromBody) { - RefPtrWillBeRawPtr<Element> body = HTMLBodyElement::create(document()); + RawPtr<Element> body = HTMLBodyElement::create(document()); makeDocumentEmpty(); document().setDesignMode("on"); document().appendChild(body); @@ -39,7 +39,7 @@ TEST_F(EditorTest, tidyUpHTMLStructureFromDiv) { - RefPtrWillBeRawPtr<Element> div = HTMLDivElement::create(document()); + RawPtr<Element> div = HTMLDivElement::create(document()); makeDocumentEmpty(); document().setDesignMode("on"); document().appendChild(div); @@ -52,7 +52,7 @@ TEST_F(EditorTest, tidyUpHTMLStructureFromHead) { - RefPtrWillBeRawPtr<Element> head = HTMLHeadElement::create(document()); + RawPtr<Element> head = HTMLHeadElement::create(document()); makeDocumentEmpty(); document().setDesignMode("on"); document().appendChild(head);
diff --git a/third_party/WebKit/Source/core/editing/EphemeralRange.cpp b/third_party/WebKit/Source/core/editing/EphemeralRange.cpp index e8b70d1..e82f556 100644 --- a/third_party/WebKit/Source/core/editing/EphemeralRange.cpp +++ b/third_party/WebKit/Source/core/editing/EphemeralRange.cpp
@@ -137,7 +137,7 @@ } #endif -PassRefPtrWillBeRawPtr<Range> createRange(const EphemeralRange& range) +RawPtr<Range> createRange(const EphemeralRange& range) { if (range.isNull()) return nullptr;
diff --git a/third_party/WebKit/Source/core/editing/EphemeralRange.h b/third_party/WebKit/Source/core/editing/EphemeralRange.h index 1b95928..abf3d0d 100644 --- a/third_party/WebKit/Source/core/editing/EphemeralRange.h +++ b/third_party/WebKit/Source/core/editing/EphemeralRange.h
@@ -19,7 +19,7 @@ // position. // // Example usage: -// RefPtrWillBeRawPtr<Range> range = produceRange(); +// RawPtr<Range> range = produceRange(); // consumeRange(range.get()); // ... no DOM modification ... // consumeRange2(range.get()); @@ -93,7 +93,7 @@ // Returns a newly created |Range| object from |range| or |nullptr| if // |range.isNull()| returns true. -CORE_EXPORT PassRefPtrWillBeRawPtr<Range> createRange(const EphemeralRange& /* range */); +CORE_EXPORT RawPtr<Range> createRange(const EphemeralRange& /* range */); } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp index a2609577..c9b36bd 100644 --- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp +++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -292,7 +292,7 @@ // TODO(hajimehoshi): validateSelection already checks if the selection // is valid, thus we don't need this 'if' clause any more. if (document.frame() && document.frame() != m_frame && document != m_frame->document()) { - RefPtrWillBeRawPtr<LocalFrame> guard(document.frame()); + RawPtr<LocalFrame> guard(document.frame()); document.frame()->selection().setSelection(s, options, align, granularity); // It's possible that during the above set selection, this // |FrameSelection| has been modified by @@ -342,7 +342,7 @@ // Always clear the x position used for vertical arrow navigation. // It will be restored by the vertical arrow navigation code if necessary. m_selectionEditor->resetXPosForVerticalArrowNavigation(); - RefPtrWillBeRawPtr<LocalFrame> protector(m_frame.get()); + RawPtr<LocalFrame> protector(m_frame.get()); // This may dispatch a synchronous focus-related events. selectFrameElementInParentIfFullySelected(); notifyLayoutObjectOfSelectionChange(userTriggered); @@ -840,7 +840,7 @@ } } - RefPtrWillBeRawPtr<Node> root = nullptr; + RawPtr<Node> root = nullptr; Node* selectStartTarget = nullptr; if (isContentEditable()) { root = highestEditableRoot(selection().start()); @@ -887,7 +887,7 @@ return m_selectionEditor->setSelectedRange(range, affinity, directional, options); } -PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const +RawPtr<Range> FrameSelection::firstRange() const { return m_selectionEditor->firstRange(); } @@ -922,7 +922,7 @@ void FrameSelection::focusedOrActiveStateChanged() { bool activeAndFocused = isFocusedAndActive(); - RefPtrWillBeRawPtr<Document> document = m_frame->document(); + RawPtr<Document> document = m_frame->document(); // Trigger style invalidation from the focused element. Even though // the focused element hasn't changed, the evaluation of focus pseudo
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.h b/third_party/WebKit/Source/core/editing/FrameSelection.h index 75486994..663cc0e 100644 --- a/third_party/WebKit/Source/core/editing/FrameSelection.h +++ b/third_party/WebKit/Source/core/editing/FrameSelection.h
@@ -67,13 +67,12 @@ enum class CaretVisibility; -class CORE_EXPORT FrameSelection final : public NoBaseWillBeGarbageCollectedFinalized<FrameSelection> { +class CORE_EXPORT FrameSelection final : public GarbageCollectedFinalized<FrameSelection> { WTF_MAKE_NONCOPYABLE(FrameSelection); - USING_FAST_MALLOC_WILL_BE_REMOVED(FrameSelection); public: - static PassOwnPtrWillBeRawPtr<FrameSelection> create(LocalFrame* frame = nullptr) + static RawPtr<FrameSelection> create(LocalFrame* frame = nullptr) { - return adoptPtrWillBeNoop(new FrameSelection(frame)); + return new FrameSelection(frame); } ~FrameSelection(); @@ -175,7 +174,7 @@ // If this FrameSelection has a logical range which is still valid, this function return its clone. Otherwise, // the return value from underlying VisibleSelection's firstRange() is returned. - PassRefPtrWillBeRawPtr<Range> firstRange() const; + RawPtr<Range> firstRange() const; void nodeWillBeRemoved(Node&); void didUpdateCharacterData(CharacterData*, unsigned offset, unsigned oldLength, unsigned newLength); @@ -219,7 +218,7 @@ void notifyLayoutObjectOfSelectionChange(EUserTriggered); EditingStyle* typingStyle() const; - void setTypingStyle(PassRefPtrWillBeRawPtr<EditingStyle>); + void setTypingStyle(RawPtr<EditingStyle>); void clearTypingStyle(); String selectedHTMLForClipboard() const; @@ -293,20 +292,20 @@ bool shouldPaintCaretForTesting() const { return m_shouldPaintCaret; } bool isPreviousCaretDirtyForTesting() const { return m_previousCaretNode; } - RawPtrWillBeMember<LocalFrame> m_frame; - const OwnPtrWillBeMember<PendingSelection> m_pendingSelection; - const OwnPtrWillBeMember<SelectionEditor> m_selectionEditor; + Member<LocalFrame> m_frame; + const Member<PendingSelection> m_pendingSelection; + const Member<SelectionEditor> m_selectionEditor; // Used to store base before the adjustment at bidi boundary VisiblePosition m_originalBase; VisiblePositionInFlatTree m_originalBaseInFlatTree; TextGranularity m_granularity; - RefPtrWillBeMember<Node> m_previousCaretNode; // The last node which painted the caret. Retained for clearing the old caret when it moves. + Member<Node> m_previousCaretNode; // The last node which painted the caret. Retained for clearing the old caret when it moves. LayoutRect m_previousCaretRect; CaretVisibility m_previousCaretVisibility; - RefPtrWillBeMember<EditingStyle> m_typingStyle; + Member<EditingStyle> m_typingStyle; Timer<FrameSelection> m_caretBlinkTimer; @@ -332,7 +331,7 @@ m_typingStyle.clear(); } -inline void FrameSelection::setTypingStyle(PassRefPtrWillBeRawPtr<EditingStyle> style) +inline void FrameSelection::setTypingStyle(RawPtr<EditingStyle> style) { m_typingStyle = style; }
diff --git a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp index 131898a..62bd783 100644 --- a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp +++ b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
@@ -33,14 +33,14 @@ const VisibleSelection& visibleSelectionInDOMTree() const { return selection().selection(); } const VisibleSelectionInFlatTree& visibleSelectionInFlatTree() const { return selection().selectionInFlatTree(); } - PassRefPtrWillBeRawPtr<Text> appendTextNode(const String& data); + RawPtr<Text> appendTextNode(const String& data); int layoutCount() const { return dummyPageHolder().frameView().layoutCount(); } bool shouldPaintCaretForTesting() const { return selection().shouldPaintCaretForTesting(); } bool isPreviousCaretDirtyForTesting() const { return selection().isPreviousCaretDirtyForTesting(); } private: - RefPtrWillBePersistent<Text> m_textNode; + Persistent<Text> m_textNode; }; void FrameSelectionTest::setSelection(const VisibleSelection& newSelection) @@ -53,16 +53,16 @@ return dummyPageHolder().frame().selection(); } -PassRefPtrWillBeRawPtr<Text> FrameSelectionTest::appendTextNode(const String& data) +RawPtr<Text> FrameSelectionTest::appendTextNode(const String& data) { - RefPtrWillBeRawPtr<Text> text = document().createTextNode(data); + RawPtr<Text> text = document().createTextNode(data); document().body()->appendChild(text); return text.release(); } TEST_F(FrameSelectionTest, SetValidSelection) { - RefPtrWillBeRawPtr<Text> text = appendTextNode("Hello, World!"); + RawPtr<Text> text = appendTextNode("Hello, World!"); VisibleSelection validSelection(Position(text, 0), Position(text, 5)); EXPECT_FALSE(validSelection.isNone()); setSelection(validSelection); @@ -73,10 +73,10 @@ { // Create a new document without frame by using DOMImplementation. DocumentInit dummy; - RefPtrWillBeRawPtr<Document> documentWithoutFrame = Document::create(); - RefPtrWillBeRawPtr<Element> body = HTMLBodyElement::create(*documentWithoutFrame); + RawPtr<Document> documentWithoutFrame = Document::create(); + RawPtr<Element> body = HTMLBodyElement::create(*documentWithoutFrame); documentWithoutFrame->appendChild(body); - RefPtrWillBeRawPtr<Text> anotherText = documentWithoutFrame->createTextNode("Hello, another world"); + RawPtr<Text> anotherText = documentWithoutFrame->createTextNode("Hello, another world"); body->appendChild(anotherText); // Create a new VisibleSelection for the new document without frame and @@ -90,7 +90,7 @@ TEST_F(FrameSelectionTest, InvalidateCaretRect) { - RefPtrWillBeRawPtr<Text> text = appendTextNode("Hello, World!"); + RawPtr<Text> text = appendTextNode("Hello, World!"); document().view()->updateAllLifecyclePhases(); VisibleSelection validSelection(Position(text, 0), Position(text, 0)); @@ -110,7 +110,7 @@ TEST_F(FrameSelectionTest, PaintCaretShouldNotLayout) { - RefPtrWillBeRawPtr<Text> text = appendTextNode("Hello, World!"); + RawPtr<Text> text = appendTextNode("Hello, World!"); document().view()->updateAllLifecyclePhases(); document().body()->setContentEditable("true", ASSERT_NO_EXCEPTION); @@ -141,7 +141,7 @@ TEST_F(FrameSelectionTest, InvalidatePreviousCaretAfterRemovingLastCharacter) { - RefPtrWillBeRawPtr<Text> text = appendTextNode("Hello, World!"); + RawPtr<Text> text = appendTextNode("Hello, World!"); document().view()->updateAllLifecyclePhases(); document().body()->setContentEditable("true", ASSERT_NO_EXCEPTION); @@ -193,7 +193,7 @@ TEST_F(FrameSelectionTest, SelectWordAroundPosition) { // "Foo Bar Baz," - RefPtrWillBeRawPtr<Text> text = appendTextNode("Foo Bar Baz,"); + RawPtr<Text> text = appendTextNode("Foo Bar Baz,"); // "Fo|o Bar Baz," EXPECT_TRUE(selection().selectWordAroundPosition(createVisiblePosition(Position(text, 2)))); EXPECT_EQ_SELECTED_TEXT("Foo"); @@ -212,7 +212,7 @@ setBodyContent("<span id=host></span>one"); setShadowContent("two<content></content>", "host"); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> host = document().getElementById("host"); + RawPtr<Element> host = document().getElementById("host"); Node* const two = FlatTreeTraversal::firstChild(*host); // Select "two" for selection in DOM tree // Select "twoone" for selection in Flat tree @@ -227,7 +227,7 @@ TEST_F(FrameSelectionTest, MoveRangeSelectionTest) { // "Foo Bar Baz," - RefPtrWillBeRawPtr<Text> text = appendTextNode("Foo Bar Baz,"); + RawPtr<Text> text = appendTextNode("Foo Bar Baz,"); // Itinitializes with "Foo B|a>r Baz," (| means start and > means end). selection().setSelection(VisibleSelection(Position(text, 5), Position(text, 6))); EXPECT_EQ_SELECTED_TEXT("a"); @@ -251,7 +251,7 @@ const char* bodyContent = "<span id=top>top</span><span id=host></span>"; const char* shadowContent = "<span id=bottom>bottom</span>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* top = document().getElementById("top")->firstChild(); @@ -285,7 +285,7 @@ TEST_F(FrameSelectionTest, SelectAllWithUnselectableRoot) { - RefPtrWillBeRawPtr<Element> select = document().createElement("select", ASSERT_NO_EXCEPTION); + RawPtr<Element> select = document().createElement("select", ASSERT_NO_EXCEPTION); document().replaceChild(select.get(), document().documentElement()); selection().selectAll(); EXPECT_TRUE(selection().isNone()) << "Nothing should be selected if the content of the documentElement is not selctable.";
diff --git a/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp b/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp index a019d6b..ff2eff4 100644 --- a/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp +++ b/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp
@@ -34,7 +34,7 @@ return result; } -using TextNodeVector = WillBeHeapVector<RefPtrWillBeMember<Text>>; +using TextNodeVector = HeapVector<Member<Text>>; class GranularityStrategyTest : public ::testing::Test { protected: @@ -44,16 +44,16 @@ HTMLDocument& document() const; void setSelection(const VisibleSelection&); FrameSelection& selection() const; - PassRefPtrWillBeRawPtr<Text> appendTextNode(const String& data); + RawPtr<Text> appendTextNode(const String& data); int layoutCount() const { return m_dummyPageHolder->frameView().layoutCount(); } void setInnerHTML(const char*); // Parses the text node, appending the info to m_letterPos and m_wordMiddles. void parseText(Text*); void parseText(const TextNodeVector&); - PassRefPtrWillBeRawPtr<Text> setupTranslateZ(String); - PassRefPtrWillBeRawPtr<Text> setupTransform(String); - PassRefPtrWillBeRawPtr<Text> setupRotate(String); + RawPtr<Text> setupTranslateZ(String); + RawPtr<Text> setupTransform(String); + RawPtr<Text> setupRotate(String); void setupTextSpan(String str1, String str2, String str3, size_t selBegin, size_t selEnd); void setupVerticalAlign(String str1, String str2, String str3, size_t selBegin, size_t selEnd); void setupFontSize(String str1, String str2, String str3, size_t selBegin, size_t selEnd); @@ -70,7 +70,7 @@ private: OwnPtr<DummyPageHolder> m_dummyPageHolder; - RawPtrWillBePersistent<HTMLDocument> m_document; + Persistent<HTMLDocument> m_document; }; void GranularityStrategyTest::SetUp() @@ -97,9 +97,9 @@ return m_dummyPageHolder->frame().selection(); } -PassRefPtrWillBeRawPtr<Text> GranularityStrategyTest::appendTextNode(const String& data) +RawPtr<Text> GranularityStrategyTest::appendTextNode(const String& data) { - RefPtrWillBeRawPtr<Text> text = document().createTextNode(data); + RawPtr<Text> text = document().createTextNode(data); document().body()->appendChild(text); return text.release(); } @@ -145,7 +145,7 @@ } } -PassRefPtrWillBeRawPtr<Text> GranularityStrategyTest::setupTranslateZ(String str) +RawPtr<Text> GranularityStrategyTest::setupTranslateZ(String str) { setInnerHTML( "<html>" @@ -161,7 +161,7 @@ "</body>" "</html>"); - RefPtrWillBeRawPtr<Text> text = document().createTextNode(str); + RawPtr<Text> text = document().createTextNode(str); Element* div = document().getElementById("mytext"); div->appendChild(text); @@ -171,7 +171,7 @@ return text.release(); } -PassRefPtrWillBeRawPtr<Text> GranularityStrategyTest::setupTransform(String str) +RawPtr<Text> GranularityStrategyTest::setupTransform(String str) { setInnerHTML( "<html>" @@ -187,7 +187,7 @@ "</body>" "</html>"); - RefPtrWillBeRawPtr<Text> text = document().createTextNode(str); + RawPtr<Text> text = document().createTextNode(str); Element* div = document().getElementById("mytext"); div->appendChild(text); @@ -197,7 +197,7 @@ return text.release(); } -PassRefPtrWillBeRawPtr<Text> GranularityStrategyTest::setupRotate(String str) +RawPtr<Text> GranularityStrategyTest::setupRotate(String str) { setInnerHTML( "<html>" @@ -213,7 +213,7 @@ "</body>" "</html>"); - RefPtrWillBeRawPtr<Text> text = document().createTextNode(str); + RawPtr<Text> text = document().createTextNode(str); Element* div = document().getElementById("mytext"); div->appendChild(text); @@ -225,10 +225,10 @@ void GranularityStrategyTest::setupTextSpan(String str1, String str2, String str3, size_t selBegin, size_t selEnd) { - RefPtrWillBeRawPtr<Text> text1 = document().createTextNode(str1); - RefPtrWillBeRawPtr<Text> text2 = document().createTextNode(str2); - RefPtrWillBeRawPtr<Text> text3 = document().createTextNode(str3); - RefPtrWillBeRawPtr<Element> span = HTMLSpanElement::create(document()); + RawPtr<Text> text1 = document().createTextNode(str1); + RawPtr<Text> text2 = document().createTextNode(str2); + RawPtr<Text> text3 = document().createTextNode(str3); + RawPtr<Element> span = HTMLSpanElement::create(document()); Element* div = document().getElementById("mytext"); div->appendChild(text1); div->appendChild(span); @@ -480,7 +480,7 @@ dummyPageHolder().frame().settings()->setSelectionStrategy(SelectionStrategy::Character); dummyPageHolder().frame().settings()->setDefaultFontSize(12); // "Foo Bar Baz," - RefPtrWillBeRawPtr<Text> text = appendTextNode("Foo Bar Baz,"); + RawPtr<Text> text = appendTextNode("Foo Bar Baz,"); // "Foo B^a|>r Baz," (^ means base, | means extent, , < means start, and > means end). selection().setSelection(VisibleSelection(Position(text, 5), Position(text, 6))); EXPECT_EQ_SELECTED_TEXT("a"); @@ -496,7 +496,7 @@ // same behavior as CharacterGranularityStrategy TEST_F(GranularityStrategyTest, DirectionRotate) { - RefPtrWillBeRawPtr<Text> text = setupRotate("Foo Bar Baz,"); + RawPtr<Text> text = setupRotate("Foo Bar Baz,"); // "Foo B^a|>r Baz," (^ means base, | means extent, , < means start, and > means end). selection().setSelection(VisibleSelection(Position(text, 5), Position(text, 6))); EXPECT_EQ_SELECTED_TEXT("a"); @@ -516,7 +516,7 @@ TEST_F(GranularityStrategyTest, DirectionExpandTranslateZ) { - RefPtrWillBeRawPtr<Text> text = setupTranslateZ("abcdef ghij kl mnopqr stuvwi inm mnii,"); + RawPtr<Text> text = setupTranslateZ("abcdef ghij kl mnopqr stuvwi inm mnii,"); // "abcdef ghij kl mno^p|>qr stuvwi inm mnii," (^ means base, | means extent, < means start, and > means end). selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 19))); EXPECT_EQ_SELECTED_TEXT("p"); @@ -525,7 +525,7 @@ TEST_F(GranularityStrategyTest, DirectionExpandTransform) { - RefPtrWillBeRawPtr<Text> text = setupTransform("abcdef ghij kl mnopqr stuvwi inm mnii,"); + RawPtr<Text> text = setupTransform("abcdef ghij kl mnopqr stuvwi inm mnii,"); // "abcdef ghij kl mno^p|>qr stuvwi inm mnii," (^ means base, | means extent, < means start, and > means end). selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 19))); EXPECT_EQ_SELECTED_TEXT("p"); @@ -549,7 +549,7 @@ TEST_F(GranularityStrategyTest, DirectionShrinkTranslateZ) { - RefPtrWillBeRawPtr<Text> text = setupTranslateZ("abcdef ghij kl mnopqr iiinmni, abc"); + RawPtr<Text> text = setupTranslateZ("abcdef ghij kl mnopqr iiinmni, abc"); selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 21))); EXPECT_EQ_SELECTED_TEXT("pqr"); testDirectionShrink(); @@ -557,7 +557,7 @@ TEST_F(GranularityStrategyTest, DirectionShrinkTransform) { - RefPtrWillBeRawPtr<Text> text = setupTransform("abcdef ghij kl mnopqr iiinmni, abc"); + RawPtr<Text> text = setupTransform("abcdef ghij kl mnopqr iiinmni, abc"); selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 21))); EXPECT_EQ_SELECTED_TEXT("pqr"); testDirectionShrink(); @@ -579,7 +579,7 @@ TEST_F(GranularityStrategyTest, DirectionSwitchSideTranslateZ) { - RefPtrWillBeRawPtr<Text> text = setupTranslateZ("abcd efgh ijkl mnopqr iiinmni, abc"); + RawPtr<Text> text = setupTranslateZ("abcd efgh ijkl mnopqr iiinmni, abc"); selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 21))); EXPECT_EQ_SELECTED_TEXT("pqr"); testDirectionSwitchSide(); @@ -587,7 +587,7 @@ TEST_F(GranularityStrategyTest, DirectionSwitchSideTransform) { - RefPtrWillBeRawPtr<Text> text = setupTransform("abcd efgh ijkl mnopqr iiinmni, abc"); + RawPtr<Text> text = setupTransform("abcd efgh ijkl mnopqr iiinmni, abc"); selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 21))); EXPECT_EQ_SELECTED_TEXT("pqr"); testDirectionSwitchSide(); @@ -613,7 +613,7 @@ { dummyPageHolder().frame().settings()->setDefaultFontSize(12); String str = "ab cd efghijkl mnopqr iiin, abc"; - RefPtrWillBeRawPtr<Text> text = document().createTextNode(str); + RawPtr<Text> text = document().createTextNode(str); document().body()->appendChild(text); dummyPageHolder().frame().settings()->setSelectionStrategy(SelectionStrategy::Direction); @@ -645,7 +645,7 @@ { dummyPageHolder().frame().settings()->setDefaultFontSize(12); String str = "ab cd efghijkl mnopqr iiin, abc"; - RefPtrWillBeRawPtr<Text> text = document().createTextNode(str); + RawPtr<Text> text = document().createTextNode(str); document().body()->appendChild(text); dummyPageHolder().frame().settings()->setSelectionStrategy(SelectionStrategy::Direction);
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp index 7aeb0d1..7ba773e 100644 --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -40,6 +40,7 @@ #include "core/layout/LayoutObject.h" #include "core/layout/LayoutTheme.h" #include "core/page/ChromeClient.h" +#include "wtf/Optional.h" namespace blink { @@ -56,9 +57,9 @@ // ---------------------------- -PassOwnPtrWillBeRawPtr<InputMethodController> InputMethodController::create(LocalFrame& frame) +RawPtr<InputMethodController> InputMethodController::create(LocalFrame& frame) { - return adoptPtrWillBeNoop(new InputMethodController(frame)); + return new InputMethodController(frame); } InputMethodController::InputMethodController(LocalFrame& frame) @@ -130,17 +131,19 @@ if (!target) return; - RefPtrWillBeRawPtr<CompositionEvent> event = + RawPtr<CompositionEvent> event = CompositionEvent::create(EventTypeNames::compositionend, frame.domWindow(), text); target->dispatchEvent(event); } -bool InputMethodController::confirmComposition(const String& text) +bool InputMethodController::confirmComposition(const String& text, ConfirmCompositionBehavior confirmBehavior) { if (!hasComposition()) return false; - Editor::RevealSelectionScope revealSelectionScope(&editor()); + Optional<Editor::RevealSelectionScope> revealSelectionScope; + if (confirmBehavior == KeepSelection) + revealSelectionScope.emplace(&editor()); // If the composition was set from existing text and didn't change, then // there's nothing to do here (and we should avoid doing anything as that @@ -188,8 +191,8 @@ return true; } - if (confirmBehavior != KeepSelection) - return confirmComposition(); + if (confirmBehavior == DoNotKeepSelection) + return confirmComposition(composingText(), DoNotKeepSelection); SelectionOffsetsScope selectionOffsetsScope(this); return confirmComposition(); @@ -261,7 +264,7 @@ // 3. Canceling the ongoing composition. // Send a compositionend event when function deletes the existing composition node, i.e. // !hasComposition() && test.isEmpty(). - RefPtrWillBeRawPtr<CompositionEvent> event = nullptr; + RawPtr<CompositionEvent> event = nullptr; if (!hasComposition()) { // We should send a compositionstart event only when the given text is not empty because this // function doesn't create a composition node when the text is empty. @@ -321,7 +324,7 @@ unsigned start = std::min(baseOffset + selectionStart, extentOffset); unsigned end = std::min(std::max(start, baseOffset + selectionEnd), extentOffset); - RefPtrWillBeRawPtr<Range> selectedRange = Range::create(baseNode->document(), baseNode, start, baseNode, end); + RawPtr<Range> selectedRange = Range::create(baseNode->document(), baseNode, start, baseNode, end); frame().selection().setSelectedRange(selectedRange.get(), TextAffinity::Downstream, SelectionDirectionalMode::NonDirectional, NotUserTriggered); if (underlines.isEmpty()) { @@ -381,7 +384,7 @@ return EphemeralRange(m_compositionRange.get()); } -PassRefPtrWillBeRawPtr<Range> InputMethodController::compositionRange() const +RawPtr<Range> InputMethodController::compositionRange() const { return hasComposition() ? m_compositionRange : nullptr; }
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.h b/third_party/WebKit/Source/core/editing/InputMethodController.h index 535071c..8936994 100644 --- a/third_party/WebKit/Source/core/editing/InputMethodController.h +++ b/third_party/WebKit/Source/core/editing/InputMethodController.h
@@ -41,8 +41,7 @@ class Range; class Text; -class CORE_EXPORT InputMethodController final : public NoBaseWillBeGarbageCollectedFinalized<InputMethodController> { - USING_FAST_MALLOC_WILL_BE_REMOVED(InputMethodController); +class CORE_EXPORT InputMethodController final : public GarbageCollectedFinalized<InputMethodController> { WTF_MAKE_NONCOPYABLE(InputMethodController); public: enum ConfirmCompositionBehavior { @@ -50,7 +49,7 @@ KeepSelection, }; - static PassOwnPtrWillBeRawPtr<InputMethodController> create(LocalFrame&); + static RawPtr<InputMethodController> create(LocalFrame&); ~InputMethodController(); DECLARE_TRACE(); @@ -63,7 +62,7 @@ bool confirmComposition(); // Inserts the given text string in the place of the existing composition // and returns true. - bool confirmComposition(const String& text); + bool confirmComposition(const String& text, ConfirmCompositionBehavior confirmBehavior = KeepSelection); // Inserts the text that is being composed or specified non-empty text and // returns true. bool confirmCompositionOrInsertText(const String& text, ConfirmCompositionBehavior); @@ -71,7 +70,7 @@ void cancelComposition(); void cancelCompositionIfSelectionIsInvalid(); EphemeralRange compositionEphemeralRange() const; - PassRefPtrWillBeRawPtr<Range> compositionRange() const; + RawPtr<Range> compositionRange() const; void clear(); void documentDetached(); @@ -89,13 +88,13 @@ explicit SelectionOffsetsScope(InputMethodController*); ~SelectionOffsetsScope(); private: - RawPtrWillBeMember<InputMethodController> m_inputMethodController; + Member<InputMethodController> m_inputMethodController; const PlainTextRange m_offsets; }; friend class SelectionOffsetsScope; - RawPtrWillBeMember<LocalFrame> m_frame; - RefPtrWillBeMember<Range> m_compositionRange; + Member<LocalFrame> m_frame; + Member<Range> m_compositionRange; bool m_isDirty; bool m_hasComposition;
diff --git a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp index 20ad741..8378cfd 100644 --- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp +++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
@@ -26,7 +26,7 @@ void SetUp() override; OwnPtr<DummyPageHolder> m_dummyPageHolder; - RefPtrWillBePersistent<HTMLDocument> m_document; + Persistent<HTMLDocument> m_document; }; void InputMethodControllerTest::SetUp() @@ -97,7 +97,7 @@ underlines.append(CompositionUnderline(0, 5, Color(255, 0, 0), false, 0)); controller().setCompositionFromExistingText(underlines, 0, 5); - RefPtrWillBeRawPtr<Range> range = controller().compositionRange(); + RawPtr<Range> range = controller().compositionRange(); EXPECT_EQ(0, range->startOffset()); EXPECT_EQ(5, range->endOffset()); @@ -157,7 +157,7 @@ underlines.append(CompositionUnderline(0, 5, Color(255, 0, 0), false, 0)); controller().setCompositionFromExistingText(underlines, 0, 5); - RefPtrWillBeRawPtr<Range> range = controller().compositionRange(); + RawPtr<Range> range = controller().compositionRange(); EXPECT_EQ(1, range->startOffset()); EXPECT_EQ(6, range->endOffset());
diff --git a/third_party/WebKit/Source/core/editing/PendingSelection.h b/third_party/WebKit/Source/core/editing/PendingSelection.h index 484a101..f38a2fa 100644 --- a/third_party/WebKit/Source/core/editing/PendingSelection.h +++ b/third_party/WebKit/Source/core/editing/PendingSelection.h
@@ -32,12 +32,11 @@ class FrameSelection; class LayoutView; -class PendingSelection final : public NoBaseWillBeGarbageCollected<PendingSelection> { - USING_FAST_MALLOC_WILL_BE_REMOVED(PendingSelection); +class PendingSelection final : public GarbageCollected<PendingSelection> { public: - static PassOwnPtrWillBeRawPtr<PendingSelection> create(FrameSelection& frameSelection) + static RawPtr<PendingSelection> create(FrameSelection& frameSelection) { - return adoptPtrWillBeNoop(new PendingSelection(frameSelection)); + return new PendingSelection(frameSelection); } bool hasPendingSelection() const { return m_hasPendingSelection; } @@ -53,7 +52,7 @@ VisibleSelectionInFlatTree calcVisibleSelection(const VisibleSelectionInFlatTree&) const; - RawPtrWillBeMember<FrameSelection> m_frameSelection; + Member<FrameSelection> m_frameSelection; bool m_hasPendingSelection : 1; };
diff --git a/third_party/WebKit/Source/core/editing/Position.cpp b/third_party/WebKit/Source/core/editing/Position.cpp index b7a21735..b12f49d 100644 --- a/third_party/WebKit/Source/core/editing/Position.cpp +++ b/third_party/WebKit/Source/core/editing/Position.cpp
@@ -51,7 +51,7 @@ template <typename Strategy> -PositionTemplate<Strategy> PositionTemplate<Strategy>::editingPositionOf(PassRefPtrWillBeRawPtr<Node> anchorNode, int offset) +PositionTemplate<Strategy> PositionTemplate<Strategy>::editingPositionOf(RawPtr<Node> anchorNode, int offset) { if (!anchorNode || anchorNode->isTextNode()) return PositionTemplate<Strategy>(anchorNode, offset); @@ -69,7 +69,7 @@ } template <typename Strategy> -PositionTemplate<Strategy>::PositionTemplate(PassRefPtrWillBeRawPtr<Node> anchorNode, PositionAnchorType anchorType) +PositionTemplate<Strategy>::PositionTemplate(RawPtr<Node> anchorNode, PositionAnchorType anchorType) : m_anchorNode(anchorNode) , m_offset(0) , m_anchorType(anchorType) @@ -87,7 +87,7 @@ } template <typename Strategy> -PositionTemplate<Strategy>::PositionTemplate(PassRefPtrWillBeRawPtr<Node> anchorNode, int offset) +PositionTemplate<Strategy>::PositionTemplate(RawPtr<Node> anchorNode, int offset) : m_anchorNode(anchorNode) , m_offset(offset) , m_anchorType(PositionAnchorType::OffsetInAnchor)
diff --git a/third_party/WebKit/Source/core/editing/Position.h b/third_party/WebKit/Source/core/editing/Position.h index 2bca3a1e..8b49ae6e 100644 --- a/third_party/WebKit/Source/core/editing/Position.h +++ b/third_party/WebKit/Source/core/editing/Position.h
@@ -66,14 +66,14 @@ } static const TreeScope* commonAncestorTreeScope(const PositionTemplate<Strategy>&, const PositionTemplate<Strategy>& b); - static PositionTemplate<Strategy> editingPositionOf(PassRefPtrWillBeRawPtr<Node> anchorNode, int offset); + static PositionTemplate<Strategy> editingPositionOf(RawPtr<Node> anchorNode, int offset); // For creating before/after positions: - PositionTemplate(PassRefPtrWillBeRawPtr<Node> anchorNode, PositionAnchorType); + PositionTemplate(RawPtr<Node> anchorNode, PositionAnchorType); // For creating offset positions: // FIXME: This constructor should eventually go away. See bug 63040. - PositionTemplate(PassRefPtrWillBeRawPtr<Node> anchorNode, int offset); + PositionTemplate(RawPtr<Node> anchorNode, int offset); PositionTemplate(const PositionTemplate&); @@ -186,7 +186,7 @@ return isAfterAnchor() || isAfterChildren(); } - RefPtrWillBeMember<Node> m_anchorNode; + Member<Node> m_anchorNode; // m_offset can be the offset inside m_anchorNode, or if editingIgnoresContent(m_anchorNode) // returns true, then other places in editing will treat m_offset == 0 as "before the anchor" // and m_offset > 0 as "after the anchor node". See parentAnchoredEquivalent for more info.
diff --git a/third_party/WebKit/Source/core/editing/PositionIterator.h b/third_party/WebKit/Source/core/editing/PositionIterator.h index 8777b977..6469ba1 100644 --- a/third_party/WebKit/Source/core/editing/PositionIterator.h +++ b/third_party/WebKit/Source/core/editing/PositionIterator.h
@@ -74,8 +74,8 @@ bool isValid() const { return !m_anchorNode || m_domTreeVersion == m_anchorNode->document().domTreeVersion(); } - RawPtrWillBeMember<Node> m_anchorNode; - RawPtrWillBeMember<Node> m_nodeAfterPositionInAnchor; // If this is non-null, Strategy::parent(*m_nodeAfterPositionInAnchor) == m_anchorNode; + Member<Node> m_anchorNode; + Member<Node> m_nodeAfterPositionInAnchor; // If this is non-null, Strategy::parent(*m_nodeAfterPositionInAnchor) == m_anchorNode; int m_offsetInAnchor; size_t m_depthToAnchorNode; // If |m_nodeAfterPositionInAnchor| is not null,
diff --git a/third_party/WebKit/Source/core/editing/PositionTest.cpp b/third_party/WebKit/Source/core/editing/PositionTest.cpp index 5eaa807..fd228e03 100644 --- a/third_party/WebKit/Source/core/editing/PositionTest.cpp +++ b/third_party/WebKit/Source/core/editing/PositionTest.cpp
@@ -73,7 +73,7 @@ const char* bodyContent = "<p id='host'>00<b id='one'>11</b><b id='two'>22</b>33</p>"; const char* shadowContent = "<a id='a'><content select=#two></content><content select=#one></content></a>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); Node* host = document().getElementById("host"); Node* n1 = document().getElementById("one"); @@ -102,8 +102,8 @@ const char* bodyContent = "<p id='host'>00<b id='one'>11</b>22</p>"; const char* shadowContent = "<a id='a'><content select=#one id='content'></content><content></content></a>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); - RefPtrWillBeRawPtr<Element> anchor = shadowRoot->getElementById("a"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<Element> anchor = shadowRoot->getElementById("a"); EXPECT_EQ(PositionInFlatTree(anchor.get(), 0), toPositionInFlatTree(Position(anchor.get(), 0))); EXPECT_EQ(PositionInFlatTree(anchor.get(), 1), toPositionInFlatTree(Position(anchor.get(), 1))); @@ -114,7 +114,7 @@ { const char* bodyContent = "<p id='p'><content></content></p>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<Element> anchor = document().getElementById("p"); + RawPtr<Element> anchor = document().getElementById("p"); EXPECT_EQ(PositionInFlatTree(anchor.get(), 0), toPositionInFlatTree(Position(anchor.get(), 0))); EXPECT_EQ(PositionInFlatTree(anchor, PositionAnchorType::AfterChildren), toPositionInFlatTree(Position(anchor.get(), 1))); @@ -134,8 +134,8 @@ const char* bodyContent = "<p id='host'>00<b id='one'>11</b>22</p>"; const char* shadowContent = "<a><content select=#one></content></a>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); - RefPtrWillBeRawPtr<Element> host = document().getElementById("host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<Element> host = document().getElementById("host"); EXPECT_EQ(PositionInFlatTree(host.get(), 0), toPositionInFlatTree(Position(shadowRoot.get(), 0))); EXPECT_EQ(PositionInFlatTree(host.get(), PositionAnchorType::AfterChildren), toPositionInFlatTree(Position(shadowRoot.get(), 1))); @@ -146,8 +146,8 @@ const char* bodyContent = "<p id='host'>00<b id='one'>11</b>22</p>"; const char* shadowContent = "<content select=#one></content>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); - RefPtrWillBeRawPtr<Element> host = document().getElementById("host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<Element> host = document().getElementById("host"); EXPECT_EQ(PositionInFlatTree(host.get(), 0), toPositionInFlatTree(Position(shadowRoot.get(), 0))); EXPECT_EQ(PositionInFlatTree(host.get(), PositionAnchorType::AfterChildren), toPositionInFlatTree(Position(shadowRoot.get(), 1))); @@ -158,8 +158,8 @@ const char* bodyContent = "<p id='host'>00<b id='one'>11</b>22</p>"; const char* shadowContent = ""; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); - RefPtrWillBeRawPtr<Element> host = document().getElementById("host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<Element> host = document().getElementById("host"); EXPECT_EQ(PositionInFlatTree(host, PositionAnchorType::AfterChildren), toPositionInFlatTree(Position(shadowRoot.get(), 0))); }
diff --git a/third_party/WebKit/Source/core/editing/Selection.idl b/third_party/WebKit/Source/core/editing/Selection.idl index 7466f32c..750f9debd 100644 --- a/third_party/WebKit/Source/core/editing/Selection.idl +++ b/third_party/WebKit/Source/core/editing/Selection.idl
@@ -32,7 +32,7 @@ // TODO(yoichio): All long types should be unsigned long. crbug.com/391673 [ ImplementedAs=DOMSelection, - WillBeGarbageCollected, + GarbageCollected, ] interface Selection { [MeasureAs=SelectionAnchorNode] readonly attribute Node? anchorNode; [MeasureAs=SelectionAnchorOffset] readonly attribute long anchorOffset;
diff --git a/third_party/WebKit/Source/core/editing/SelectionAdjusterTest.cpp b/third_party/WebKit/Source/core/editing/SelectionAdjusterTest.cpp index e106aa8..2431225b 100644 --- a/third_party/WebKit/Source/core/editing/SelectionAdjusterTest.cpp +++ b/third_party/WebKit/Source/core/editing/SelectionAdjusterTest.cpp
@@ -11,10 +11,10 @@ namespace { class MockVisibleSelectionChangeObserver final : - public NoBaseWillBeGarbageCollectedFinalized<MockVisibleSelectionChangeObserver>, + public GarbageCollectedFinalized<MockVisibleSelectionChangeObserver>, public VisibleSelectionChangeObserver { WTF_MAKE_NONCOPYABLE(MockVisibleSelectionChangeObserver); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MockVisibleSelectionChangeObserver); + USING_GARBAGE_COLLECTED_MIXIN(MockVisibleSelectionChangeObserver); public: MockVisibleSelectionChangeObserver() = default; ~MockVisibleSelectionChangeObserver() final = default;
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp index 6db0a912..32674f3 100644 --- a/third_party/WebKit/Source/core/editing/SelectionController.cpp +++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -40,14 +40,15 @@ #include "core/frame/LocalFrame.h" #include "core/frame/Settings.h" #include "core/layout/LayoutView.h" +#include "core/layout/api/LayoutViewItem.h" #include "core/page/FocusController.h" #include "core/page/Page.h" #include "platform/RuntimeEnabledFeatures.h" namespace blink { -PassOwnPtrWillBeRawPtr<SelectionController> SelectionController::create(LocalFrame& frame) +RawPtr<SelectionController> SelectionController::create(LocalFrame& frame) { - return adoptPtrWillBeNoop(new SelectionController(frame)); + return new SelectionController(frame); } SelectionController::SelectionController(LocalFrame& frame) @@ -457,13 +458,13 @@ FrameView* view = m_frame->view(); if (!view) return; - LayoutView* layoutObject = m_frame->contentLayoutObject(); - if (!layoutObject) + LayoutViewItem layoutItem = m_frame->contentLayoutItem(); + if (layoutItem.isNull()) return; HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::Move); HitTestResult result(request, view->rootFrameToContents(lastKnownMousePosition)); - layoutObject->hitTest(result); + layoutItem.hitTest(result); updateSelectionForMouseDrag(result, mousePressNode, dragStartPos, lastKnownMousePosition); }
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.h b/third_party/WebKit/Source/core/editing/SelectionController.h index ea9104f..e0b7788a 100644 --- a/third_party/WebKit/Source/core/editing/SelectionController.h +++ b/third_party/WebKit/Source/core/editing/SelectionController.h
@@ -39,11 +39,10 @@ class HitTestResult; class LocalFrame; -class SelectionController final : public NoBaseWillBeGarbageCollected<SelectionController> { +class SelectionController final : public GarbageCollected<SelectionController> { WTF_MAKE_NONCOPYABLE(SelectionController); - USING_FAST_MALLOC_WILL_BE_REMOVED(SelectionController); public: - static PassOwnPtrWillBeRawPtr<SelectionController> create(LocalFrame&); + static RawPtr<SelectionController> create(LocalFrame&); DECLARE_TRACE(); void handleMousePressEvent(const MouseEventWithHitTestResults&); @@ -81,7 +80,7 @@ FrameSelection& selection() const; - RawPtrWillBeMember<LocalFrame> const m_frame; + Member<LocalFrame> const m_frame; bool m_mouseDownMayStartSelect; bool m_mouseDownWasSingleClickInSelection; bool m_mouseDownAllowsMultiClick;
diff --git a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp index c82677d7..a5d9f7be 100644 --- a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp +++ b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
@@ -582,7 +582,7 @@ bool SelectionEditor::modify(EAlteration alter, SelectionDirection direction, TextGranularity granularity, EUserTriggered userTriggered) { if (userTriggered == UserTriggered) { - OwnPtrWillBeRawPtr<FrameSelection> trialFrameSelection = FrameSelection::create(); + RawPtr<FrameSelection> trialFrameSelection = FrameSelection::create(); trialFrameSelection->setSelection(m_selection); trialFrameSelection->modify(alter, direction, granularity, NotUserTriggered); @@ -695,7 +695,7 @@ return false; if (userTriggered == UserTriggered) { - OwnPtrWillBeRawPtr<FrameSelection> trialFrameSelection = FrameSelection::create(); + RawPtr<FrameSelection> trialFrameSelection = FrameSelection::create(); trialFrameSelection->setSelection(m_selection); trialFrameSelection->modify(alter, verticalDistance, direction, NotUserTriggered); } @@ -850,7 +850,7 @@ return true; } -PassRefPtrWillBeRawPtr<Range> SelectionEditor::firstRange() const +RawPtr<Range> SelectionEditor::firstRange() const { if (m_logicalRange) return m_logicalRange->cloneRange();
diff --git a/third_party/WebKit/Source/core/editing/SelectionEditor.h b/third_party/WebKit/Source/core/editing/SelectionEditor.h index 5f81fa8..29e02842 100644 --- a/third_party/WebKit/Source/core/editing/SelectionEditor.h +++ b/third_party/WebKit/Source/core/editing/SelectionEditor.h
@@ -31,19 +31,18 @@ namespace blink { -class SelectionEditor final : public NoBaseWillBeGarbageCollectedFinalized<SelectionEditor>, public VisibleSelectionChangeObserver { +class SelectionEditor final : public GarbageCollectedFinalized<SelectionEditor>, public VisibleSelectionChangeObserver { WTF_MAKE_NONCOPYABLE(SelectionEditor); - USING_FAST_MALLOC_WILL_BE_REMOVED(SelectionEditor); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SelectionEditor); + USING_GARBAGE_COLLECTED_MIXIN(SelectionEditor); public: // TODO(yosin) We should move |EAlteration| and |VerticalDirection| out // from |FrameSelection| class like |EUserTriggered|. typedef FrameSelection::EAlteration EAlteration; typedef FrameSelection::VerticalDirection VerticalDirection; - static PassOwnPtrWillBeRawPtr<SelectionEditor> create(FrameSelection& frameSelection) + static RawPtr<SelectionEditor> create(FrameSelection& frameSelection) { - return adoptPtrWillBeNoop(new SelectionEditor(frameSelection)); + return new SelectionEditor(frameSelection); } virtual ~SelectionEditor(); void dispose(); @@ -72,7 +71,7 @@ // If this FrameSelection has a logical range which is still valid, this // function return its clone. Otherwise, the return value from underlying // |VisibleSelection|'s |firstRange()| is returned. - PassRefPtrWillBeRawPtr<Range> firstRange() const; + RawPtr<Range> firstRange() const; // VisibleSelectionChangeObserver interface. void didChangeVisibleSelection() override; @@ -114,7 +113,7 @@ LayoutUnit lineDirectionPointForBlockDirectionNavigation(EPositionType); DispatchEventResult dispatchSelectStart(); - RawPtrWillBeMember<FrameSelection> m_frameSelection; + Member<FrameSelection> m_frameSelection; LayoutUnit m_xPosForVerticalArrowNavigation; VisibleSelection m_selection; @@ -125,7 +124,7 @@ // (hence "logical"). This will be invalidated if the underlying // |VisibleSelection| changes. If that happens, this variable will // become |nullptr|, in which case logical positions == visible positions. - RefPtrWillBeMember<Range> m_logicalRange; + Member<Range> m_logicalRange; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/SurroundingText.cpp b/third_party/WebKit/Source/core/editing/SurroundingText.cpp index ea69868..9260c77 100644 --- a/third_party/WebKit/Source/core/editing/SurroundingText.cpp +++ b/third_party/WebKit/Source/core/editing/SurroundingText.cpp
@@ -89,7 +89,7 @@ ASSERT(m_contentRange); } -PassRefPtrWillBeRawPtr<Range> SurroundingText::rangeFromContentOffsets(unsigned startOffsetInContent, unsigned endOffsetInContent) +RawPtr<Range> SurroundingText::rangeFromContentOffsets(unsigned startOffsetInContent, unsigned endOffsetInContent) { if (startOffsetInContent >= endOffsetInContent || endOffsetInContent > content().length()) return nullptr;
diff --git a/third_party/WebKit/Source/core/editing/SurroundingText.h b/third_party/WebKit/Source/core/editing/SurroundingText.h index 2660fe38..d53f7ed 100644 --- a/third_party/WebKit/Source/core/editing/SurroundingText.h +++ b/third_party/WebKit/Source/core/editing/SurroundingText.h
@@ -51,12 +51,12 @@ unsigned startOffsetInContent() const; unsigned endOffsetInContent() const; - PassRefPtrWillBeRawPtr<Range> rangeFromContentOffsets(unsigned startOffsetInContent, unsigned endOffsetInContent); + RawPtr<Range> rangeFromContentOffsets(unsigned startOffsetInContent, unsigned endOffsetInContent); private: void initialize(const Position&, const Position&, unsigned maxLength); - RefPtrWillBePersistent<Range> m_contentRange; + Persistent<Range> m_contentRange; size_t m_startOffsetInContent; size_t m_endOffsetInContent; };
diff --git a/third_party/WebKit/Source/core/editing/VisiblePositionTest.cpp b/third_party/WebKit/Source/core/editing/VisiblePositionTest.cpp index d591a6b..86817cf 100644 --- a/third_party/WebKit/Source/core/editing/VisiblePositionTest.cpp +++ b/third_party/WebKit/Source/core/editing/VisiblePositionTest.cpp
@@ -17,13 +17,13 @@ const char* bodyContent = "<p id='host'>00<b id='one'>11</b><b id='two'>22</b>33</p>"; const char* shadowContent = "<a><span id='s4'>44</span><content select=#two></content><span id='s5'>55</span><content select=#one></content><span id='s6'>66</span></a>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); - RefPtrWillBeRawPtr<Element> body = document().body(); - RefPtrWillBeRawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> two = body->querySelector("#two", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> four = shadowRoot->querySelector("#s4", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> five = shadowRoot->querySelector("#s5", ASSERT_NO_EXCEPTION); + RawPtr<Element> body = document().body(); + RawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); + RawPtr<Element> two = body->querySelector("#two", ASSERT_NO_EXCEPTION); + RawPtr<Element> four = shadowRoot->querySelector("#s4", ASSERT_NO_EXCEPTION); + RawPtr<Element> five = shadowRoot->querySelector("#s5", ASSERT_NO_EXCEPTION); EXPECT_EQ(Position(one->firstChild(), 0), canonicalPositionOf(Position(one, 0))); EXPECT_EQ(Position(one->firstChild(), 0), createVisiblePosition(Position(one, 0)).deepEquivalent());
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp index 010c6dcb..40e5b828a 100644 --- a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
@@ -214,7 +214,7 @@ return EphemeralRange(start, end); } -PassRefPtrWillBeRawPtr<Range> firstRangeOf(const VisibleSelection& selection) +RawPtr<Range> firstRangeOf(const VisibleSelection& selection) { return createRange(firstEphemeralRangeOf(selection)); }
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelection.h b/third_party/WebKit/Source/core/editing/VisibleSelection.h index 25608c3..a2a1258 100644 --- a/third_party/WebKit/Source/core/editing/VisibleSelection.h +++ b/third_party/WebKit/Source/core/editing/VisibleSelection.h
@@ -50,7 +50,7 @@ // // Objects implementing |VisibleSelectionChangeObserver| interface must outlive // the |VisibleSelection| object. -class CORE_EXPORT VisibleSelectionChangeObserver : public WillBeGarbageCollectedMixin { +class CORE_EXPORT VisibleSelectionChangeObserver : public GarbageCollectedMixin { WTF_MAKE_NONCOPYABLE(VisibleSelectionChangeObserver); public: VisibleSelectionChangeObserver(); @@ -62,7 +62,6 @@ template <typename Strategy> class CORE_TEMPLATE_CLASS_EXPORT VisibleSelectionTemplate { DISALLOW_NEW(); - DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(VisibleSelectionTemplate); public: VisibleSelectionTemplate(); VisibleSelectionTemplate(const PositionTemplate<Strategy>&, TextAffinity, bool isDirectional = false); @@ -191,7 +190,7 @@ // Oilpan: this reference has a lifetime that is at least as long // as this object. - RawPtrWillBeMember<VisibleSelectionChangeObserver> m_changeObserver; + Member<VisibleSelectionChangeObserver> m_changeObserver; // these are cached, can be recalculated by validate() SelectionType m_selectionType; // None, Caret, Range @@ -221,7 +220,7 @@ CORE_EXPORT EphemeralRange firstEphemeralRangeOf(const VisibleSelection&); // TODO(sof): move more firstRangeOf() uses to be over EphemeralRange instead. -CORE_EXPORT PassRefPtrWillBeRawPtr<Range> firstRangeOf(const VisibleSelection&); +CORE_EXPORT RawPtr<Range> firstRangeOf(const VisibleSelection&); } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp b/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp index d8ba923..8af808a4 100644 --- a/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp
@@ -52,7 +52,7 @@ const char* bodyContent = "<span id=host><a id=one>1</a><a id=two>22</a></span>"; const char* shadowContent = "<p><b id=three>333</b><content select=#two></content><b id=four>4444</b><span id=space> </span><content select=#one></content><b id=five>55555</b></p>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -159,7 +159,7 @@ EXPECT_TRUE(selection.isCaret()); EXPECT_TRUE(selectionInFlatTree.isCaret()); - RefPtrWillBeRawPtr<Range> range = firstRangeOf(selection); + RawPtr<Range> range = firstRangeOf(selection); EXPECT_EQ(0, range->startOffset()); EXPECT_EQ(0, range->endOffset()); EXPECT_EQ("", range->text()); @@ -171,12 +171,12 @@ const char* bodyContent = "<p id='host'>00<b id='one'>11</b><b id='two'>22</b>33</p>"; const char* shadowContent = "<a><span id='s4'>44</span><content select=#two></content><span id='s5'>55</span><content select=#one></content><span id='s6'>66</span></a>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); - RefPtrWillBeRawPtr<Element> body = document().body(); - RefPtrWillBeRawPtr<Element> host = body->querySelector("#host", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> six = shadowRoot->querySelector("#s6", ASSERT_NO_EXCEPTION); + RawPtr<Element> body = document().body(); + RawPtr<Element> host = body->querySelector("#host", ASSERT_NO_EXCEPTION); + RawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); + RawPtr<Element> six = shadowRoot->querySelector("#s6", ASSERT_NO_EXCEPTION); VisibleSelection selection(Position::firstPositionInNode(one.get()), Position::lastPositionInNode(shadowRoot.get())); VisibleSelectionInFlatTree selectionInFlatTree(PositionInFlatTree::firstPositionInNode(one.get()), PositionInFlatTree::lastPositionInNode(host.get())); @@ -192,12 +192,12 @@ const char* bodyContent = "<p id='host'>00<b id='one'>11</b><b id='two'>22</b>33</p>"; const char* shadowContent = "<a><span id='s4'>44</span><content select=#two></content><span id='s5'>55</span><content select=#one></content><span id='s6'>66</span></a>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); - RefPtrWillBeRawPtr<Element> body = document().body(); - RefPtrWillBeRawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> two = body->querySelector("#two", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> five = shadowRoot->querySelector("#s5", ASSERT_NO_EXCEPTION); + RawPtr<Element> body = document().body(); + RawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); + RawPtr<Element> two = body->querySelector("#two", ASSERT_NO_EXCEPTION); + RawPtr<Element> five = shadowRoot->querySelector("#s5", ASSERT_NO_EXCEPTION); VisibleSelection selection(Position::firstPositionInNode(one.get()), Position::lastPositionInNode(two.get())); VisibleSelectionInFlatTree selectionInFlatTree(PositionInFlatTree::firstPositionInNode(one.get()), PositionInFlatTree::lastPositionInNode(two.get())); @@ -214,8 +214,8 @@ const char* shadowContent = "<a><span id='s4'>44</span><content select=#two></content><span id='s5'>55</span><content select=#one></content><span id='s6'>66</span></a>"; const char* shadowContent2 = "<span id='s7'>77</span><content></content><span id='s8'>88</span>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot2 = createShadowRootForElementWithIDAndSetInnerHTML(*shadowRoot, "s5", shadowContent2); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot2 = createShadowRootForElementWithIDAndSetInnerHTML(*shadowRoot, "s5", shadowContent2); // Flat tree is something like below: // <p id="host"> @@ -225,10 +225,10 @@ // <b id="one">11</b> // <span id="s6">66</span> // </p> - RefPtrWillBeRawPtr<Element> body = document().body(); - RefPtrWillBeRawPtr<Element> host = body->querySelector("#host", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> eight = shadowRoot2->querySelector("#s8", ASSERT_NO_EXCEPTION); + RawPtr<Element> body = document().body(); + RawPtr<Element> host = body->querySelector("#host", ASSERT_NO_EXCEPTION); + RawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); + RawPtr<Element> eight = shadowRoot2->querySelector("#s8", ASSERT_NO_EXCEPTION); VisibleSelection selection(Position::firstPositionInNode(one.get()), Position::lastPositionInNode(shadowRoot2.get())); VisibleSelectionInFlatTree selectionInFlatTree(PositionInFlatTree::firstPositionInNode(one.get()), PositionInFlatTree::afterNode(eight.get())); @@ -253,7 +253,7 @@ selection.expandUsingGranularity(WordGranularity); selectionInFlatTree.expandUsingGranularity(WordGranularity); - RefPtrWillBeRawPtr<Range> range = firstRangeOf(selection); + RawPtr<Range> range = firstRangeOf(selection); EXPECT_EQ(0, range->startOffset()); EXPECT_EQ(5, range->endOffset()); EXPECT_EQ("Lorem", range->text()); @@ -268,7 +268,7 @@ selection.expandUsingGranularity(WordGranularity); selectionInFlatTree.expandUsingGranularity(WordGranularity); - RefPtrWillBeRawPtr<Range> range = firstRangeOf(selection); + RawPtr<Range> range = firstRangeOf(selection); EXPECT_EQ(6, range->startOffset()); EXPECT_EQ(11, range->endOffset()); EXPECT_EQ("ipsum", range->text()); @@ -285,7 +285,7 @@ selection.expandUsingGranularity(WordGranularity); selectionInFlatTree.expandUsingGranularity(WordGranularity); - RefPtrWillBeRawPtr<Range> range = firstRangeOf(selection); + RawPtr<Range> range = firstRangeOf(selection); EXPECT_EQ(5, range->startOffset()); EXPECT_EQ(6, range->endOffset()); EXPECT_EQ(" ", range->text()); @@ -301,7 +301,7 @@ selection.expandUsingGranularity(WordGranularity); selectionInFlatTree.expandUsingGranularity(WordGranularity); - RefPtrWillBeRawPtr<Range> range = firstRangeOf(selection); + RawPtr<Range> range = firstRangeOf(selection); EXPECT_EQ(26, range->startOffset()); EXPECT_EQ(27, range->endOffset()); EXPECT_EQ(",", range->text()); @@ -315,7 +315,7 @@ selection.expandUsingGranularity(WordGranularity); selectionInFlatTree.expandUsingGranularity(WordGranularity); - RefPtrWillBeRawPtr<Range> range = firstRangeOf(selection); + RawPtr<Range> range = firstRangeOf(selection); EXPECT_EQ(27, range->startOffset()); EXPECT_EQ(28, range->endOffset()); EXPECT_EQ(" ", range->text()); @@ -329,7 +329,7 @@ selection.expandUsingGranularity(WordGranularity); selectionInFlatTree.expandUsingGranularity(WordGranularity); - RefPtrWillBeRawPtr<Range> range = firstRangeOf(selection); + RawPtr<Range> range = firstRangeOf(selection); EXPECT_EQ(0, range->startOffset()); EXPECT_EQ(5, range->endOffset()); EXPECT_EQ("Lorem", range->text()); @@ -343,7 +343,7 @@ selection.expandUsingGranularity(WordGranularity); selectionInFlatTree.expandUsingGranularity(WordGranularity); - RefPtrWillBeRawPtr<Range> range = firstRangeOf(selection); + RawPtr<Range> range = firstRangeOf(selection); EXPECT_EQ(0, range->startOffset()); EXPECT_EQ(11, range->endOffset()); EXPECT_EQ("Lorem ipsum", range->text());
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp index 7f902f7c..eb8f651e 100644 --- a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
@@ -53,12 +53,12 @@ const char* bodyContent = "<p id='host'><b id='one'>11</b><b id='two'>22</b></p>"; const char* shadowContent = "<div><content select=#two></content><content select=#one></content></div>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); ASSERT_UNUSED(shadowRoot, shadowRoot); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> body = document().body(); - RefPtrWillBeRawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); + RawPtr<Element> body = document().body(); + RawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); IntRect boundsInDOMTree = absoluteCaretBoundsOf(createVisiblePosition(Position(one.get(), 0))); IntRect boundsInFlatTree = absoluteCaretBoundsOf(createVisiblePosition(PositionInFlatTree(one.get(), 0))); @@ -132,7 +132,7 @@ const char* bodyContent = "<p id=one>one</p>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<Element> one = document().getElementById("one"); + RawPtr<Element> one = document().getElementById("one"); EXPECT_EQ(0, caretMinOffset(one->firstChild())); } @@ -142,7 +142,7 @@ const char* bodyContent = "<style>#one:first-letter { font-size: 200%; }</style><p id=one>one</p>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<Element> one = document().getElementById("one"); + RawPtr<Element> one = document().getElementById("one"); EXPECT_EQ(0, caretMinOffset(one->firstChild())); } @@ -155,8 +155,8 @@ setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> one = document().getElementById("one"); - RefPtrWillBeRawPtr<Element> two = document().getElementById("two"); + RawPtr<Element> one = document().getElementById("one"); + RawPtr<Element> two = document().getElementById("two"); EXPECT_EQ('2', characterAfter(createVisiblePositionInDOMTree(*one->firstChild(), 1))); EXPECT_EQ('5', characterAfter(createVisiblePositionInFlatTree(*one->firstChild(), 1))); @@ -170,11 +170,11 @@ const char* bodyContent = "<html><div id=one contenteditable>1</div><span id=two contenteditable=false>22</span><span id=three contenteditable=false>333</span><span id=four contenteditable=false>333</span></html>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<Node> one = document().querySelector("#one", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Node> two = document().querySelector("#two", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Node> three = document().querySelector("#three", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Node> four = document().querySelector("#four", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> html = document().createElement("html", ASSERT_NO_EXCEPTION); + RawPtr<Node> one = document().querySelector("#one", ASSERT_NO_EXCEPTION); + RawPtr<Node> two = document().querySelector("#two", ASSERT_NO_EXCEPTION); + RawPtr<Node> three = document().querySelector("#three", ASSERT_NO_EXCEPTION); + RawPtr<Node> four = document().querySelector("#four", ASSERT_NO_EXCEPTION); + RawPtr<Element> html = document().createElement("html", ASSERT_NO_EXCEPTION); // Move two, three and four into second html element. html->appendChild(two.get()); html->appendChild(three.get()); @@ -203,7 +203,7 @@ const char* bodyContent = "<p id=host><b id=one>1</b><b id=two>22</b></p><b id=three>333</b>"; const char* shadowContent = "<b id=four>4444</b><content select=#two></content><content select=#one></content><b id=five>5555</b>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -228,7 +228,7 @@ const char* bodyContent = "<p id=host><b id=one>1</b><b id=two>22</b></p><b id=three>333</b>"; const char* shadowContent = "<b id=four>4444</b><content select=#two></content><content select=#one></content><b id=five>5555</b>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -277,7 +277,7 @@ const char* bodyContent = "<a id=host><b id=one>11</b><b id=two>22</b></a><i id=three>333</i><i id=four>4444</i><br>"; const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -411,7 +411,7 @@ const char* shadowContent = "<p><i id=three>333</i> <content select=#two></content> <content select=#one></content> <i id=four>4444</i></p>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -443,7 +443,7 @@ const char* bodyContent = "<a id=host><b id=one>1</b> <b id=two>22</b></a><i id=three>333</i>"; const char* shadowContent = "<p><u id=four>44444</u><content select=#two></content><span id=space> </span><content select=#one></content><u id=five>55555</u></p>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -515,7 +515,7 @@ const char* bodyContent = "<a id=host><b id=one>11</b><b id=two>22</b></a><i id=three>333</i><i id=four>4444</i><br>"; const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -556,7 +556,7 @@ const char* bodyContent = "<a id=host><b id=one>11</b><b id=two>22</b></a><i id=three>333</i><i id=four>4444</i><br>"; const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -597,14 +597,14 @@ const char* bodyContent = "<p id='host'>00<b id='one'>11</b><b id='two'>22</b>33</p>"; const char* shadowContent = "<div><span id='s4'>44</span><content select=#two></content><br><span id='s5'>55</span><br><content select=#one></content><span id='s6'>66</span></div>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> body = document().body(); - RefPtrWillBeRawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> two = body->querySelector("#two", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> four = shadowRoot->querySelector("#s4", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> five = shadowRoot->querySelector("#s5", ASSERT_NO_EXCEPTION); + RawPtr<Element> body = document().body(); + RawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION); + RawPtr<Element> two = body->querySelector("#two", ASSERT_NO_EXCEPTION); + RawPtr<Element> four = shadowRoot->querySelector("#s4", ASSERT_NO_EXCEPTION); + RawPtr<Element> five = shadowRoot->querySelector("#s5", ASSERT_NO_EXCEPTION); EXPECT_TRUE(inSameLine(positionWithAffinityInDOMTree(*one, 0), positionWithAffinityInDOMTree(*two, 0))); EXPECT_TRUE(inSameLine(positionWithAffinityInDOMTree(*one->firstChild(), 0), positionWithAffinityInDOMTree(*two->firstChild(), 0))); @@ -660,7 +660,7 @@ const char* bodyContent = "<a id=host><b id=one>11</b><b id=two>22</b></a><i id=three>333</i><i id=four>4444</i><br>"; const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -730,11 +730,11 @@ const char* bodyContent = "<html><div id=one contenteditable>1</div><span id=two contenteditable=false>22</span><span id=three contenteditable=false>333</span><span id=four contenteditable=false>333</span></html>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<Node> one = document().querySelector("#one", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Node> two = document().querySelector("#two", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Node> three = document().querySelector("#three", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Node> four = document().querySelector("#four", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> html = document().createElement("html", ASSERT_NO_EXCEPTION); + RawPtr<Node> one = document().querySelector("#one", ASSERT_NO_EXCEPTION); + RawPtr<Node> two = document().querySelector("#two", ASSERT_NO_EXCEPTION); + RawPtr<Node> three = document().querySelector("#three", ASSERT_NO_EXCEPTION); + RawPtr<Node> four = document().querySelector("#four", ASSERT_NO_EXCEPTION); + RawPtr<Element> html = document().createElement("html", ASSERT_NO_EXCEPTION); // Move two, three and four into second html element. html->appendChild(two.get()); html->appendChild(three.get()); @@ -770,7 +770,7 @@ const char* bodyContent = "<b id=zero>0</b><p id=host><b id=one>1</b><b id=two>22</b></p><b id=three>333</b>"; const char* shadowContent = "<b id=four>4444</b><content select=#two></content><content select=#one></content><b id=five>55555</b>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Element* one = document().getElementById("one"); @@ -797,7 +797,7 @@ setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> one = document().getElementById("one"); + RawPtr<Element> one = document().getElementById("one"); LayoutObject* layoutObjectFromDOMTree; LayoutRect layoutRectFromDOMTree = localCaretRectOfPosition(Position(one->firstChild(), 0), layoutObjectFromDOMTree); @@ -816,7 +816,7 @@ const char* bodyContent = "<a id=host><b id=one>11</b><b id=two>22</b></a><i id=three>333</i><i id=four>4444</i><br>"; const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -862,7 +862,7 @@ const char* bodyContent = "<a id=host><b id=one>11</b><b id=two>22</b></a><i id=three>333</i><i id=four>4444</i><br>"; const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -911,7 +911,7 @@ setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> host = document().getElementById("host"); + RawPtr<Element> host = document().getElementById("host"); EXPECT_EQ(Position::lastPositionInNode(host.get()), mostForwardCaretPosition(Position::afterNode(host.get()))); EXPECT_EQ(PositionInFlatTree::lastPositionInNode(host.get()), mostForwardCaretPosition(PositionInFlatTree::afterNode(host.get()))); @@ -948,7 +948,7 @@ Node* sample = document().getElementById("sample"); Node* firstLetter = sample->firstChild(); // Split "abc" into "a" "bc" - RefPtrWillBeRawPtr<Text> remaining = toText(firstLetter)->splitText(1, ASSERT_NO_EXCEPTION); + RawPtr<Text> remaining = toText(firstLetter)->splitText(1, ASSERT_NO_EXCEPTION); updateLayoutAndStyleForPainting(); EXPECT_EQ(Position(sample, 0), mostBackwardCaretPosition(Position(firstLetter, 0))); @@ -965,12 +965,12 @@ const char* bodyContent = "<p id='host'><b id='one'>1</b></p>"; const char* shadowContent = "<b id='two'>22</b><content select=#one></content><b id='three'>333</b>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> host = document().getElementById("host"); - RefPtrWillBeRawPtr<Element> one = document().getElementById("one"); - RefPtrWillBeRawPtr<Element> three = shadowRoot->getElementById("three"); + RawPtr<Element> host = document().getElementById("host"); + RawPtr<Element> one = document().getElementById("one"); + RawPtr<Element> three = shadowRoot->getElementById("three"); EXPECT_EQ(Position(one->firstChild(), 1), mostBackwardCaretPosition(Position::afterNode(host.get()))); EXPECT_EQ(PositionInFlatTree(three->firstChild(), 3), mostBackwardCaretPosition(PositionInFlatTree::afterNode(host.get()))); @@ -1003,7 +1003,7 @@ const char* bodyContent = "<b id=zero>0</b><p id=host><b id=one>1</b><b id=two>22</b></p><b id=three>333</b>"; const char* shadowContent = "<b id=four>4444</b><content select=#two></content><content select=#one></content><b id=five>55555</b>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Element* zero = document().getElementById("zero"); @@ -1031,7 +1031,7 @@ const char* bodyContent = "<b id=zero>0</b><p id=host><b id=one>1</b><b id=two>22</b></p><b id=three>333</b>"; const char* shadowContent = "<b id=four>4444</b><content select=#two></content><content select=#one></content><b id=five>55555</b>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* zero = document().getElementById("zero")->firstChild(); @@ -1088,7 +1088,7 @@ const char* bodyContent = "<p id='sample'>00</p>"; setBodyContent(bodyContent); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> sample = document().getElementById("sample"); + RawPtr<Element> sample = document().getElementById("sample"); EXPECT_FALSE(rendersInDifferentPosition(Position(), Position())); EXPECT_FALSE(rendersInDifferentPosition(Position(), Position::afterNode(sample.get()))) @@ -1102,8 +1102,8 @@ const char* bodyContent = "<p><span id=one>11</span><span id=two style='display:none'> </span></p>"; setBodyContent(bodyContent); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> one = document().getElementById("one"); - RefPtrWillBeRawPtr<Element> two = document().getElementById("two"); + RawPtr<Element> one = document().getElementById("one"); + RawPtr<Element> two = document().getElementById("two"); EXPECT_TRUE(rendersInDifferentPosition(Position::lastPositionInNode(one.get()), Position(two.get(), 0))) << "two doesn't have layout object"; @@ -1114,8 +1114,8 @@ const char* bodyContent = "<p><span id=one>11</span><span id=two> </span></p>"; setBodyContent(bodyContent); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> one = document().getElementById("one"); - RefPtrWillBeRawPtr<Element> two = document().getElementById("two"); + RawPtr<Element> one = document().getElementById("one"); + RawPtr<Element> two = document().getElementById("two"); EXPECT_FALSE(rendersInDifferentPosition(Position::lastPositionInNode(one.get()), Position(two.get(), 0))); EXPECT_FALSE(rendersInDifferentPosition(Position::lastPositionInNode(one.get()), Position(two.get(), 1))) @@ -1127,8 +1127,8 @@ const char* bodyContent = "<div contenteditable><span id='sample1'>1</span><span id='sample2'>22</span></div>"; setBodyContent(bodyContent); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> sample1 = document().getElementById("sample1"); - RefPtrWillBeRawPtr<Element> sample2 = document().getElementById("sample2"); + RawPtr<Element> sample1 = document().getElementById("sample1"); + RawPtr<Element> sample2 = document().getElementById("sample2"); EXPECT_FALSE(rendersInDifferentPosition(Position::afterNode(sample1->firstChild()), Position(sample2->firstChild(), 0))); EXPECT_FALSE(rendersInDifferentPosition(Position::lastPositionInNode(sample1->firstChild()), Position(sample2->firstChild(), 0))); @@ -1139,7 +1139,7 @@ const char* bodyContent = "<b id=zero>0</b><p id=host><b id=one>1</b><b id=two>22</b></p><b id=three>333</b>"; const char* shadowContent = "<p id=four>4444</p><content select=#two></content><content select=#one></content><p id=five>55555</p>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -1184,7 +1184,7 @@ const char* bodyContent = "<a id=host><b id=one>11</b><b id=two>22</b></a><i id=three>333</i><i id=four>4444</i><br>"; const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -1253,7 +1253,7 @@ // position with nested editable <BODY>s. Element* root = document().documentElement(); root->setInnerHTML("<style>* { display:inline-table; }</style><body contenteditable=true><svg><svg><foreignObject>abc<svg></svg></foreignObject></svg></svg></body>", ASSERT_NO_EXCEPTION); - RefPtrWillBeRawPtr<Element> oldBody = document().body(); + RawPtr<Element> oldBody = document().body(); root->setInnerHTML("<body contenteditable=true><svg><foreignObject><style>def</style>", ASSERT_NO_EXCEPTION); ASSERT(oldBody != document().body()); Node* foreignObject = document().body()->firstChild()->firstChild(); @@ -1270,7 +1270,7 @@ const char* bodyContent = "<a id=host><b id=one>1</b><b id=two>22</b></a>"; const char* shadowContent = "<p><i id=three>333</i> <content select=#two></content> <content select=#one></content> <i id=four>4444</i></p>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -1302,7 +1302,7 @@ const char* bodyContent = "<a id=host><b id=one>1</b> <b id=two>22</b></a><i id=three>333</i>"; const char* shadowContent = "<p><u id=four>44444</u><content select=#two></content><span id=space> </span><content select=#one></content><u id=five>55555</u></p>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); + RawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent, "host"); updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); @@ -1341,7 +1341,7 @@ setBodyContent(bodyContent); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Node> button = document().querySelector("button", ASSERT_NO_EXCEPTION); + RawPtr<Node> button = document().querySelector("button", ASSERT_NO_EXCEPTION); EXPECT_TRUE(endsOfNodeAreVisuallyDistinctPositions(button.get())); } @@ -1352,7 +1352,7 @@ setBodyContent(bodyContent); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Node> button = document().querySelector("button", ASSERT_NO_EXCEPTION); + RawPtr<Node> button = document().querySelector("button", ASSERT_NO_EXCEPTION); EXPECT_TRUE(endsOfNodeAreVisuallyDistinctPositions(button.get())); }
diff --git a/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.cpp index 2f706e8..3def420 100644 --- a/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.cpp
@@ -29,7 +29,7 @@ namespace blink { -AppendNodeCommand::AppendNodeCommand(PassRefPtrWillBeRawPtr<ContainerNode> parent, PassRefPtrWillBeRawPtr<Node> node) +AppendNodeCommand::AppendNodeCommand(RawPtr<ContainerNode> parent, RawPtr<Node> node) : SimpleEditCommand(parent->document()) , m_parent(parent) , m_node(node)
diff --git a/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.h b/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.h index 46db77d2..b6d8847 100644 --- a/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.h
@@ -32,21 +32,21 @@ class AppendNodeCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<AppendNodeCommand> create(PassRefPtrWillBeRawPtr<ContainerNode> parent, PassRefPtrWillBeRawPtr<Node> node) + static RawPtr<AppendNodeCommand> create(RawPtr<ContainerNode> parent, RawPtr<Node> node) { - return adoptRefWillBeNoop(new AppendNodeCommand(parent, node)); + return new AppendNodeCommand(parent, node); } DECLARE_VIRTUAL_TRACE(); private: - AppendNodeCommand(PassRefPtrWillBeRawPtr<ContainerNode> parent, PassRefPtrWillBeRawPtr<Node>); + AppendNodeCommand(RawPtr<ContainerNode> parent, RawPtr<Node>); void doApply(EditingState*) override; void doUnapply() override; - RefPtrWillBeMember<ContainerNode> m_parent; - RefPtrWillBeMember<Node> m_node; + Member<ContainerNode> m_parent; + Member<Node> m_node; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp index 5b95e24..22407a7d 100644 --- a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
@@ -85,9 +85,9 @@ VisiblePosition endOfSelection = selection.visibleEnd(); ASSERT(!startOfSelection.isNull()); ASSERT(!endOfSelection.isNull()); - RefPtrWillBeRawPtr<ContainerNode> startScope = nullptr; + RawPtr<ContainerNode> startScope = nullptr; int startIndex = indexForVisiblePosition(startOfSelection, startScope); - RefPtrWillBeRawPtr<ContainerNode> endScope = nullptr; + RawPtr<ContainerNode> endScope = nullptr; int endIndex = indexForVisiblePosition(endOfSelection, endScope); formatSelection(startOfSelection, endOfSelection, editingState); @@ -113,11 +113,11 @@ // and there's nothing to move. Position start = mostForwardCaretPosition(startOfSelection.deepEquivalent()); if (isAtUnsplittableElement(start)) { - RefPtrWillBeRawPtr<HTMLElement> blockquote = createBlockElement(); + RawPtr<HTMLElement> blockquote = createBlockElement(); insertNodeAt(blockquote, start, editingState); if (editingState->isAborted()) return; - RefPtrWillBeRawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); + RawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); appendNode(placeholder, blockquote, editingState); if (editingState->isAborted()) return; @@ -125,7 +125,7 @@ return; } - RefPtrWillBeRawPtr<HTMLElement> blockquoteForNextIndent = nullptr; + RawPtr<HTMLElement> blockquoteForNextIndent = nullptr; VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection); VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection); VisiblePosition endAfterSelection = endOfParagraph(nextPositionOf(endOfLastParagraph)); @@ -239,7 +239,7 @@ // If end is in the middle of a text node, split. if (endStyle->userModify() != READ_ONLY && !endStyle->collapseWhiteSpace() && end.offsetInContainerNode() && end.offsetInContainerNode() < end.computeContainerNode()->maxCharacterOffset()) { - RefPtrWillBeRawPtr<Text> endContainer = toText(end.computeContainerNode()); + RawPtr<Text> endContainer = toText(end.computeContainerNode()); splitTextNode(endContainer, end.offsetInContainerNode()); if (isStartAndEndOnSameNode) start = firstPositionInOrBeforeNode(endContainer->previousSibling()); @@ -262,7 +262,7 @@ if (!style) return endOfNextParagraph; - RefPtrWillBeRawPtr<Text> text = toText(position.computeContainerNode()); + RawPtr<Text> text = toText(position.computeContainerNode()); if (!style->preserveNewline() || !position.offsetInContainerNode() || !isNewLineAtPosition(firstPositionInNode(text.get()))) return endOfNextParagraph; @@ -293,9 +293,9 @@ return createVisiblePosition(Position(text.get(), position.offsetInContainerNode() - 1)); } -PassRefPtrWillBeRawPtr<HTMLElement> ApplyBlockElementCommand::createBlockElement() const +RawPtr<HTMLElement> ApplyBlockElementCommand::createBlockElement() const { - RefPtrWillBeRawPtr<HTMLElement> element = createHTMLElement(document(), m_tagName); + RawPtr<HTMLElement> element = createHTMLElement(document(), m_tagName); if (m_inlineStyle.length()) element->setAttribute(styleAttr, m_inlineStyle); return element.release();
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.h b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.h index 7276b73..fb1c2d1 100644 --- a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.h
@@ -42,14 +42,14 @@ ApplyBlockElementCommand(Document&, const QualifiedName& tagName); virtual void formatSelection(const VisiblePosition& startOfSelection, const VisiblePosition& endOfSelection, EditingState*); - PassRefPtrWillBeRawPtr<HTMLElement> createBlockElement() const; + RawPtr<HTMLElement> createBlockElement() const; const QualifiedName& tagName() const { return m_tagName; } DECLARE_VIRTUAL_TRACE(); private: void doApply(EditingState*) final; - virtual void formatRange(const Position& start, const Position& end, const Position& endOfSelection, RefPtrWillBeRawPtr<HTMLElement>&, EditingState*) = 0; + virtual void formatRange(const Position& start, const Position& end, const Position& endOfSelection, RawPtr<HTMLElement>&, EditingState*) = 0; void rangeForParagraphSplittingTextNodesIfNeeded(const VisiblePosition&, Position&, Position&); VisiblePosition endOfNextParagrahSplittingTextNodesIfNeeded(VisiblePosition&, Position&, Position&);
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp index 18fe906..a0bb6d8 100644 --- a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
@@ -140,7 +140,7 @@ { } -ApplyStyleCommand::ApplyStyleCommand(PassRefPtrWillBeRawPtr<Element> element, bool removeOnly) +ApplyStyleCommand::ApplyStyleCommand(RawPtr<Element> element, bool removeOnly) : CompositeEditCommand(element->document()) , m_style(EditingStyle::create()) , m_editingAction(EditActionChangeAttributes) @@ -201,7 +201,7 @@ switch (m_propertyLevel) { case PropertyDefault: { // Apply the block-centric properties of the style. - RefPtrWillBeRawPtr<EditingStyle> blockStyle = m_style->extractAndRemoveBlockProperties(); + RawPtr<EditingStyle> blockStyle = m_style->extractAndRemoveBlockProperties(); if (!blockStyle->isEmpty()) { applyBlockStyle(blockStyle.get(), editingState); if (editingState->isAborted()) @@ -256,8 +256,8 @@ // addBlockStyleIfNeeded may moveParagraphs, which can remove these endpoints. // Calculate start and end indices from the start of the tree that they're in. Node& scope = NodeTraversal::highestAncestorOrSelf(*visibleStart.deepEquivalent().anchorNode()); - RefPtrWillBeRawPtr<Range> startRange = Range::create(document(), firstPositionInNode(&scope), visibleStart.deepEquivalent().parentAnchoredEquivalent()); - RefPtrWillBeRawPtr<Range> endRange = Range::create(document(), firstPositionInNode(&scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent()); + RawPtr<Range> startRange = Range::create(document(), firstPositionInNode(&scope), visibleStart.deepEquivalent().parentAnchoredEquivalent()); + RawPtr<Range> endRange = Range::create(document(), firstPositionInNode(&scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent()); int startIndex = TextIterator::rangeLength(startRange->startPosition(), startRange->endPosition(), true); int endIndex = TextIterator::rangeLength(endRange->startPosition(), endRange->endPosition(), true); @@ -267,10 +267,10 @@ while (paragraphStart.isNotNull() && paragraphStart.deepEquivalent() != beyondEnd.deepEquivalent()) { StyleChange styleChange(style, paragraphStart.deepEquivalent()); if (styleChange.cssStyle().length() || m_removeOnly) { - RefPtrWillBeRawPtr<Element> block = enclosingBlock(paragraphStart.deepEquivalent().anchorNode()); + RawPtr<Element> block = enclosingBlock(paragraphStart.deepEquivalent().anchorNode()); const Position& paragraphStartToMove = paragraphStart.deepEquivalent(); if (!m_removeOnly && isEditablePosition(paragraphStartToMove)) { - RefPtrWillBeRawPtr<HTMLElement> newBlock = moveParagraphContentsToNewBlockIfNecessary(paragraphStartToMove, editingState); + RawPtr<HTMLElement> newBlock = moveParagraphContentsToNewBlockIfNecessary(paragraphStartToMove, editingState); if (editingState->isAborted()) return; if (newBlock) @@ -301,7 +301,7 @@ updateStartEnd(startEphemeralRange.startPosition(), endEphemeralRange.startPosition()); } -static PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyStyleOrCreateEmpty(const StylePropertySet* style) +static RawPtr<MutableStylePropertySet> copyStyleOrCreateEmpty(const StylePropertySet* style) { if (!style) return MutableStylePropertySet::create(HTMLQuirksMode); @@ -384,19 +384,19 @@ // Store away font size before making any changes to the document. // This ensures that changes to one node won't effect another. - WillBeHeapHashMap<RawPtrWillBeMember<Node>, float> startingFontSizes; + HeapHashMap<Member<Node>, float> startingFontSizes; for (Node* node = startNode; node != beyondEnd; node = NodeTraversal::next(*node)) { ASSERT(node); startingFontSizes.set(node, computedFontSize(node)); } // These spans were added by us. If empty after font size changes, they can be removed. - WillBeHeapVector<RefPtrWillBeMember<HTMLElement>> unstyledSpans; + HeapVector<Member<HTMLElement>> unstyledSpans; Node* lastStyledNode = nullptr; for (Node* node = startNode; node != beyondEnd; node = NodeTraversal::next(*node)) { ASSERT(node); - RefPtrWillBeRawPtr<HTMLElement> element = nullptr; + RawPtr<HTMLElement> element = nullptr; if (node->isHTMLElement()) { // Only work on fully selected nodes. if (!elementFullySelected(toHTMLElement(*node), start, end)) @@ -405,7 +405,7 @@ } else if (node->isTextNode() && node->layoutObject() && node->parentNode() != lastStyledNode) { // Last styled node was not parent node of this text node, but we wish to style this // text node. To make this possible, add a style span to surround this text node. - RefPtrWillBeRawPtr<HTMLSpanElement> span = HTMLSpanElement::create(document()); + RawPtr<HTMLSpanElement> span = HTMLSpanElement::create(document()); surroundNodeRangeWithElement(node, node, span.get(), editingState); if (editingState->isAborted()) return; @@ -416,10 +416,10 @@ } lastStyledNode = node; - RefPtrWillBeRawPtr<MutableStylePropertySet> inlineStyle = copyStyleOrCreateEmpty(element->inlineStyle()); + RawPtr<MutableStylePropertySet> inlineStyle = copyStyleOrCreateEmpty(element->inlineStyle()); float currentFontSize = computedFontSize(node); float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node) + style->fontSizeDelta()); - RefPtrWillBeRawPtr<CSSValue> value = inlineStyle->getPropertyCSSValue(CSSPropertyFontSize); + RawPtr<CSSValue> value = inlineStyle->getPropertyCSSValue(CSSPropertyFontSize); if (value) { element->removeInlineStyleProperty(CSSPropertyFontSize); currentFontSize = computedFontSize(node); @@ -509,9 +509,9 @@ } // Split every ancestor through highest ancestor with embedding. - RefPtrWillBeRawPtr<Node> currentNode = node; + RawPtr<Node> currentNode = node; while (currentNode) { - RefPtrWillBeRawPtr<Element> parent = toElement(currentNode->parentNode()); + RawPtr<Element> parent = toElement(currentNode->parentNode()); if (before ? currentNode->previousSibling() : currentNode->nextSibling()) splitElement(parent, before ? currentNode.get() : currentNode->nextSibling()); if (parent == highestAncestorWithUnicodeBidi) @@ -545,7 +545,7 @@ // other attributes, like we (should) do with B and I elements. removeElementAttribute(element, dirAttr); } else { - RefPtrWillBeRawPtr<MutableStylePropertySet> inlineStyle = copyStyleOrCreateEmpty(element->inlineStyle()); + RawPtr<MutableStylePropertySet> inlineStyle = copyStyleOrCreateEmpty(element->inlineStyle()); inlineStyle->setProperty(CSSPropertyUnicodeBidi, CSSValueNormal); inlineStyle->removeProperty(CSSPropertyDirection); setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asText())); @@ -572,8 +572,8 @@ void ApplyStyleCommand::applyInlineStyle(EditingStyle* style, EditingState* editingState) { - RefPtrWillBeRawPtr<ContainerNode> startDummySpanAncestor = nullptr; - RefPtrWillBeRawPtr<ContainerNode> endDummySpanAncestor = nullptr; + RawPtr<ContainerNode> startDummySpanAncestor = nullptr; + RawPtr<ContainerNode> endDummySpanAncestor = nullptr; // update document layout once before removing styles // so that we avoid the expense of updating before each and every call @@ -629,8 +629,8 @@ Position removeStart = mostBackwardCaretPosition(start); WritingDirection textDirection = NaturalWritingDirection; bool hasTextDirection = style->textDirection(textDirection); - RefPtrWillBeRawPtr<EditingStyle> styleWithoutEmbedding = nullptr; - RefPtrWillBeRawPtr<EditingStyle> embeddingStyle = nullptr; + RawPtr<EditingStyle> styleWithoutEmbedding = nullptr; + RawPtr<EditingStyle> embeddingStyle = nullptr; if (hasTextDirection) { // Leave alone an ancestor that provides the desired single level embedding, if there is one. HTMLElement* startUnsplitAncestor = splitAncestorsWithUnicodeBidi(start.anchorNode(), true, textDirection); @@ -694,7 +694,7 @@ // to check a computed style document().updateLayoutIgnorePendingStylesheets(); - RefPtrWillBeRawPtr<EditingStyle> styleToApply = style; + RawPtr<EditingStyle> styleToApply = style; if (hasTextDirection) { // Avoid applying the unicode-bidi and direction properties beneath ancestors that already have them. HTMLElement* embeddingStartElement = highestEmbeddingAncestor(start.anchorNode(), enclosingBlock(start.anchorNode())); @@ -752,7 +752,7 @@ // Start from the highest fully selected ancestor so that we can modify the fully selected node. // e.g. When applying font-size: large on <font color="blue">hello</font>, we need to include the font element in our run // to generate <font color="blue" size="4">hello</font> instead of <font color="blue"><font size="4">hello</font></font> - RefPtrWillBeRawPtr<Range> range = Range::create(startNode->document(), start, end); + RawPtr<Range> range = Range::create(startNode->document(), start, end); Element* editableRoot = startNode->rootEditableElement(); if (startNode != editableRoot) { while (editableRoot && startNode->parentNode() != editableRoot && isNodeVisiblyContainedWithin(*startNode->parentNode(), *range)) @@ -801,11 +801,11 @@ visitor->trace(dummyElement); } - RefPtrWillBeMember<Node> start; - RefPtrWillBeMember<Node> end; - RefPtrWillBeMember<Node> pastEndNode; + Member<Node> start; + Member<Node> end; + Member<Node> pastEndNode; Position positionForStyleComputation; - RefPtrWillBeMember<HTMLSpanElement> dummyElement; + Member<HTMLSpanElement> dummyElement; StyleChange change; }; @@ -815,16 +815,16 @@ namespace blink { -void ApplyStyleCommand::applyInlineStyleToNodeRange(EditingStyle* style, PassRefPtrWillBeRawPtr<Node> startNode, PassRefPtrWillBeRawPtr<Node> pastEndNode, EditingState* editingState) +void ApplyStyleCommand::applyInlineStyleToNodeRange(EditingStyle* style, RawPtr<Node> startNode, RawPtr<Node> pastEndNode, EditingState* editingState) { if (m_removeOnly) return; document().updateLayoutIgnorePendingStylesheets(); - WillBeHeapVector<InlineRunToApplyStyle> runs; - RefPtrWillBeRawPtr<Node> node = startNode; - for (RefPtrWillBeRawPtr<Node> next; node && node != pastEndNode; node = next) { + HeapVector<InlineRunToApplyStyle> runs; + RawPtr<Node> node = startNode; + for (RawPtr<Node> next; node && node != pastEndNode; node = next) { next = NodeTraversal::next(*node); if (!node->layoutObject() || !node->hasEditableStyle()) @@ -841,7 +841,7 @@ next = NodeTraversal::nextSkippingChildren(*node); if (!style->style()) continue; - RefPtrWillBeRawPtr<MutableStylePropertySet> inlineStyle = copyStyleOrCreateEmpty(element->inlineStyle()); + RawPtr<MutableStylePropertySet> inlineStyle = copyStyleOrCreateEmpty(element->inlineStyle()); inlineStyle->mergeAndOverrideOnConflict(style->style()); setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asText())); continue; @@ -932,11 +932,11 @@ return false; } -void ApplyStyleCommand::removeConflictingInlineStyleFromRun(EditingStyle* style, RefPtrWillBeMember<Node>& runStart, RefPtrWillBeMember<Node>& runEnd, PassRefPtrWillBeRawPtr<Node> pastEndNode, EditingState* editingState) +void ApplyStyleCommand::removeConflictingInlineStyleFromRun(EditingStyle* style, Member<Node>& runStart, Member<Node>& runEnd, RawPtr<Node> pastEndNode, EditingState* editingState) { ASSERT(runStart && runEnd); - RefPtrWillBeRawPtr<Node> next = runStart; - for (RefPtrWillBeRawPtr<Node> node = next; node && node->inDocument() && node != pastEndNode; node = next) { + RawPtr<Node> next = runStart; + for (RawPtr<Node> node = next; node && node->inDocument() && node != pastEndNode; node = next) { if (editingIgnoresContent(node.get())) { ASSERT(!node->contains(pastEndNode.get())); next = NodeTraversal::nextSkippingChildren(*node); @@ -947,9 +947,9 @@ continue; HTMLElement& element = toHTMLElement(*node); - RefPtrWillBeRawPtr<Node> previousSibling = element.previousSibling(); - RefPtrWillBeRawPtr<Node> nextSibling = element.nextSibling(); - RefPtrWillBeRawPtr<ContainerNode> parent = element.parentNode(); + RawPtr<Node> previousSibling = element.previousSibling(); + RawPtr<Node> nextSibling = element.nextSibling(); + RawPtr<ContainerNode> parent = element.parentNode(); removeInlineStyleFromElement(style, &element, editingState, RemoveAlways); if (editingState->isAborted()) return; @@ -963,7 +963,7 @@ } } -bool ApplyStyleCommand::removeInlineStyleFromElement(EditingStyle* style, PassRefPtrWillBeRawPtr<HTMLElement> element, EditingState* editingState, InlineStyleRemovalMode mode, EditingStyle* extractedStyle) +bool ApplyStyleCommand::removeInlineStyleFromElement(EditingStyle* style, RawPtr<HTMLElement> element, EditingState* editingState, InlineStyleRemovalMode mode, EditingStyle* extractedStyle) { ASSERT(element); @@ -1091,7 +1091,7 @@ if (!style || style->isEmpty() || !node->layoutObject() || isHTMLIFrameElement(*node)) return; - RefPtrWillBeRawPtr<EditingStyle> newInlineStyle = style; + RawPtr<EditingStyle> newInlineStyle = style; if (node->isHTMLElement() && toHTMLElement(node)->inlineStyle()) { newInlineStyle = style->copy(); newInlineStyle->mergeInlineStyleOfElement(toHTMLElement(node), EditingStyle::OverrideValues); @@ -1120,20 +1120,20 @@ return; // The outer loop is traversing the tree vertically from highestAncestor to targetNode - RefPtrWillBeRawPtr<Node> current = highestAncestor; + RawPtr<Node> current = highestAncestor; // Along the way, styled elements that contain targetNode are removed and accumulated into elementsToPushDown. // Each child of the removed element, exclusing ancestors of targetNode, is then wrapped by clones of elements in elementsToPushDown. - WillBeHeapVector<RefPtrWillBeMember<Element>> elementsToPushDown; + HeapVector<Member<Element>> elementsToPushDown; while (current && current != targetNode && current->contains(targetNode)) { NodeVector currentChildren; getChildNodes(toContainerNode(*current), currentChildren); - RefPtrWillBeRawPtr<Element> styledElement = nullptr; + RawPtr<Element> styledElement = nullptr; if (current->isStyledElement() && isStyledInlineElementToRemove(toElement(current))) { styledElement = toElement(current); elementsToPushDown.append(styledElement); } - RefPtrWillBeRawPtr<EditingStyle> styleToPushDown = EditingStyle::create(); + RawPtr<EditingStyle> styleToPushDown = EditingStyle::create(); if (current->isHTMLElement()) { removeInlineStyleFromElement(style, toHTMLElement(current), editingState, RemoveIfNeeded, styleToPushDown.get()); if (editingState->isAborted()) @@ -1148,7 +1148,7 @@ continue; if (!child->contains(targetNode) && elementsToPushDown.size()) { for (const auto& element : elementsToPushDown) { - RefPtrWillBeRawPtr<Element> wrapper = element->cloneElementWithoutChildren(); + RawPtr<Element> wrapper = element->cloneElementWithoutChildren(); wrapper->removeAttribute(styleAttr); // Delete id attribute from the second element because the same id cannot be used for more than one element element->removeAttribute(HTMLNames::idAttr); @@ -1221,9 +1221,9 @@ if (!Position::commonAncestorTreeScope(start, end)) return; - RefPtrWillBeRawPtr<Node> node = start.anchorNode(); + RawPtr<Node> node = start.anchorNode(); while (node) { - RefPtrWillBeRawPtr<Node> next = nullptr; + RawPtr<Node> next = nullptr; if (editingIgnoresContent(node.get())) { ASSERT(node == end.anchorNode() || !node->contains(end.anchorNode())); next = NodeTraversal::nextSkippingChildren(*node); @@ -1231,11 +1231,11 @@ next = NodeTraversal::next(*node); } if (node->isHTMLElement() && elementFullySelected(toHTMLElement(*node), start, end)) { - RefPtrWillBeRawPtr<HTMLElement> elem = toHTMLElement(node); - RefPtrWillBeRawPtr<Node> prev = NodeTraversal::previousPostOrder(*elem); - RefPtrWillBeRawPtr<Node> next = NodeTraversal::next(*elem); - RefPtrWillBeRawPtr<EditingStyle> styleToPushDown = nullptr; - RefPtrWillBeRawPtr<Node> childNode = nullptr; + RawPtr<HTMLElement> elem = toHTMLElement(node); + RawPtr<Node> prev = NodeTraversal::previousPostOrder(*elem); + RawPtr<Node> next = NodeTraversal::next(*elem); + RawPtr<EditingStyle> styleToPushDown = nullptr; + RawPtr<Node> childNode = nullptr; if (isStyledInlineElementToRemove(elem.get())) { styleToPushDown = EditingStyle::create(); childNode = elem->firstChild(); @@ -1295,7 +1295,7 @@ else newEnd = end; - RefPtrWillBeRawPtr<Text> text = toText(start.computeContainerNode()); + RawPtr<Text> text = toText(start.computeContainerNode()); splitTextNode(text, start.offsetInContainerNode()); updateStartEnd(firstPositionInNode(text.get()), newEnd); } @@ -1445,20 +1445,20 @@ return false; } -void ApplyStyleCommand::surroundNodeRangeWithElement(PassRefPtrWillBeRawPtr<Node> passedStartNode, PassRefPtrWillBeRawPtr<Node> endNode, PassRefPtrWillBeRawPtr<Element> elementToInsert, EditingState* editingState) +void ApplyStyleCommand::surroundNodeRangeWithElement(RawPtr<Node> passedStartNode, RawPtr<Node> endNode, RawPtr<Element> elementToInsert, EditingState* editingState) { ASSERT(passedStartNode); ASSERT(endNode); ASSERT(elementToInsert); - RefPtrWillBeRawPtr<Node> node = passedStartNode; - RefPtrWillBeRawPtr<Element> element = elementToInsert; + RawPtr<Node> node = passedStartNode; + RawPtr<Element> element = elementToInsert; insertNodeBefore(element, node, editingState); if (editingState->isAborted()) return; while (node) { - RefPtrWillBeRawPtr<Node> next = node->nextSibling(); + RawPtr<Node> next = node->nextSibling(); if (node->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable)) { removeNode(node, editingState); if (editingState->isAborted()) @@ -1472,8 +1472,8 @@ node = next; } - RefPtrWillBeRawPtr<Node> nextSibling = element->nextSibling(); - RefPtrWillBeRawPtr<Node> previousSibling = element->previousSibling(); + RawPtr<Node> nextSibling = element->nextSibling(); + RawPtr<Node> previousSibling = element->previousSibling(); if (nextSibling && nextSibling->isElementNode() && nextSibling->hasEditableStyle() && areIdenticalElements(*element, toElement(*nextSibling))) { mergeIdenticalElements(element.get(), toElement(nextSibling), editingState); @@ -1514,13 +1514,13 @@ setNodeAttribute(block, styleAttr, cssText.toAtomicString()); } -void ApplyStyleCommand::addInlineStyleIfNeeded(EditingStyle* style, PassRefPtrWillBeRawPtr<Node> passedStart, PassRefPtrWillBeRawPtr<Node> passedEnd, EditingState* editingState) +void ApplyStyleCommand::addInlineStyleIfNeeded(EditingStyle* style, RawPtr<Node> passedStart, RawPtr<Node> passedEnd, EditingState* editingState) { if (!passedStart || !passedEnd || !passedStart->inDocument() || !passedEnd->inDocument()) return; - RefPtrWillBeRawPtr<Node> start = passedStart; - RefPtrWillBeMember<HTMLSpanElement> dummyElement = nullptr; + RawPtr<Node> start = passedStart; + Member<HTMLSpanElement> dummyElement = nullptr; StyleChange styleChange(style, positionToComputeInlineStyleChange(start, dummyElement, editingState)); if (editingState->isAborted()) return; @@ -1534,7 +1534,7 @@ applyInlineStyleChange(start, passedEnd, styleChange, DoNotAddStyledElement, editingState); } -Position ApplyStyleCommand::positionToComputeInlineStyleChange(PassRefPtrWillBeRawPtr<Node> startNode, RefPtrWillBeMember<HTMLSpanElement>& dummyElement, EditingState* editingState) +Position ApplyStyleCommand::positionToComputeInlineStyleChange(RawPtr<Node> startNode, Member<HTMLSpanElement>& dummyElement, EditingState* editingState) { // It's okay to obtain the style at the startNode because we've removed all relevant styles from the current run. if (!startNode->isElementNode()) { @@ -1548,10 +1548,10 @@ return firstPositionInOrBeforeNode(startNode.get()); } -void ApplyStyleCommand::applyInlineStyleChange(PassRefPtrWillBeRawPtr<Node> passedStart, PassRefPtrWillBeRawPtr<Node> passedEnd, StyleChange& styleChange, EAddStyledElement addStyledElement, EditingState* editingState) +void ApplyStyleCommand::applyInlineStyleChange(RawPtr<Node> passedStart, RawPtr<Node> passedEnd, StyleChange& styleChange, EAddStyledElement addStyledElement, EditingState* editingState) { - RefPtrWillBeRawPtr<Node> startNode = passedStart; - RefPtrWillBeRawPtr<Node> endNode = passedEnd; + RawPtr<Node> startNode = passedStart; + RawPtr<Node> endNode = passedEnd; ASSERT(startNode->inDocument()); ASSERT(endNode->inDocument()); @@ -1583,7 +1583,7 @@ if (styleChange.applyFontSize()) setNodeAttribute(fontContainer, sizeAttr, AtomicString(styleChange.fontSize())); } else { - RefPtrWillBeRawPtr<HTMLFontElement> fontElement = HTMLFontElement::create(document()); + RawPtr<HTMLFontElement> fontElement = HTMLFontElement::create(document()); if (styleChange.applyFontColor()) fontElement->setAttribute(colorAttr, AtomicString(styleChange.fontColor())); if (styleChange.applyFontFace()) @@ -1610,7 +1610,7 @@ setNodeAttribute(styleContainer, styleAttr, AtomicString(styleChange.cssStyle())); } } else { - RefPtrWillBeRawPtr<HTMLSpanElement> styleElement = HTMLSpanElement::create(document()); + RawPtr<HTMLSpanElement> styleElement = HTMLSpanElement::create(document()); styleElement->setAttribute(styleAttr, AtomicString(styleChange.cssStyle())); surroundNodeRangeWithElement(startNode, endNode, styleElement.release(), editingState); if (editingState->isAborted()) @@ -1661,11 +1661,11 @@ if (!node) return 0; - RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(node); + RawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(node); if (!style) return 0; - RefPtrWillBeRawPtr<CSSPrimitiveValue> value = static_pointer_cast<CSSPrimitiveValue>(style->getPropertyCSSValue(CSSPropertyFontSize)); + RawPtr<CSSPrimitiveValue> value = static_pointer_cast<CSSPrimitiveValue>(style->getPropertyCSSValue(CSSPropertyFontSize)); if (!value) return 0; @@ -1681,7 +1681,7 @@ Position newStart = start; Position newEnd = end; - WillBeHeapVector<RefPtrWillBeMember<Text>> textNodes; + HeapVector<Member<Text>> textNodes; for (Node* curr = node->firstChild(); curr; curr = curr->nextSibling()) { if (!curr->isTextNode()) continue;
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.h b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.h index 69832cf..85ef26dc 100644 --- a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.h
@@ -48,21 +48,21 @@ enum EAddStyledElement { AddStyledElement, DoNotAddStyledElement }; typedef bool (*IsInlineElementToRemoveFunction)(const Element*); - static PassRefPtrWillBeRawPtr<ApplyStyleCommand> create(Document& document, const EditingStyle* style, EditAction action, EPropertyLevel level = PropertyDefault) + static RawPtr<ApplyStyleCommand> create(Document& document, const EditingStyle* style, EditAction action, EPropertyLevel level = PropertyDefault) { - return adoptRefWillBeNoop(new ApplyStyleCommand(document, style, action, level)); + return new ApplyStyleCommand(document, style, action, level); } - static PassRefPtrWillBeRawPtr<ApplyStyleCommand> create(Document& document, const EditingStyle* style, const Position& start, const Position& end) + static RawPtr<ApplyStyleCommand> create(Document& document, const EditingStyle* style, const Position& start, const Position& end) { - return adoptRefWillBeNoop(new ApplyStyleCommand(document, style, start, end)); + return new ApplyStyleCommand(document, style, start, end); } - static PassRefPtrWillBeRawPtr<ApplyStyleCommand> create(PassRefPtrWillBeRawPtr<Element> element, bool removeOnly) + static RawPtr<ApplyStyleCommand> create(RawPtr<Element> element, bool removeOnly) { - return adoptRefWillBeNoop(new ApplyStyleCommand(element, removeOnly)); + return new ApplyStyleCommand(element, removeOnly); } - static PassRefPtrWillBeRawPtr<ApplyStyleCommand> create(Document& document, const EditingStyle* style, IsInlineElementToRemoveFunction isInlineElementToRemoveFunction, EditAction action) + static RawPtr<ApplyStyleCommand> create(Document& document, const EditingStyle* style, IsInlineElementToRemoveFunction isInlineElementToRemoveFunction, EditAction action) { - return adoptRefWillBeNoop(new ApplyStyleCommand(document, style, isInlineElementToRemoveFunction, action)); + return new ApplyStyleCommand(document, style, isInlineElementToRemoveFunction, action); } DECLARE_VIRTUAL_TRACE(); @@ -70,7 +70,7 @@ private: ApplyStyleCommand(Document&, const EditingStyle*, EditAction, EPropertyLevel); ApplyStyleCommand(Document&, const EditingStyle*, const Position& start, const Position& end); - ApplyStyleCommand(PassRefPtrWillBeRawPtr<Element>, bool removeOnly); + ApplyStyleCommand(RawPtr<Element>, bool removeOnly); ApplyStyleCommand(Document&, const EditingStyle*, bool (*isInlineElementToRemove)(const Element*), EditAction); void doApply(EditingState*) override; @@ -79,8 +79,8 @@ // style-removal helpers bool isStyledInlineElementToRemove(Element*) const; bool shouldApplyInlineStyleToRun(EditingStyle*, Node* runStart, Node* pastEndNode); - void removeConflictingInlineStyleFromRun(EditingStyle*, RefPtrWillBeMember<Node>& runStart, RefPtrWillBeMember<Node>& runEnd, PassRefPtrWillBeRawPtr<Node> pastEndNode, EditingState*); - bool removeInlineStyleFromElement(EditingStyle*, PassRefPtrWillBeRawPtr<HTMLElement>, EditingState*, InlineStyleRemovalMode = RemoveIfNeeded, EditingStyle* extractedStyle = nullptr); + void removeConflictingInlineStyleFromRun(EditingStyle*, Member<Node>& runStart, Member<Node>& runEnd, RawPtr<Node> pastEndNode, EditingState*); + bool removeInlineStyleFromElement(EditingStyle*, RawPtr<HTMLElement>, EditingState*, InlineStyleRemovalMode = RemoveIfNeeded, EditingStyle* extractedStyle = nullptr); inline bool shouldRemoveInlineStyleFromElement(EditingStyle* style, HTMLElement* element) { return removeInlineStyleFromElement(style, element, ASSERT_NO_EDITING_ABORT, RemoveNone); } void replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*, EditingState*); bool removeImplicitlyStyledElement(EditingStyle*, HTMLElement*, InlineStyleRemovalMode, EditingStyle* extractedStyle, EditingState*); @@ -96,11 +96,11 @@ void applyRelativeFontStyleChange(EditingStyle*, EditingState*); void applyInlineStyle(EditingStyle*, EditingState*); void fixRangeAndApplyInlineStyle(EditingStyle*, const Position& start, const Position& end, EditingState*); - void applyInlineStyleToNodeRange(EditingStyle*, PassRefPtrWillBeRawPtr<Node> startNode, PassRefPtrWillBeRawPtr<Node> pastEndNode, EditingState*); + void applyInlineStyleToNodeRange(EditingStyle*, RawPtr<Node> startNode, RawPtr<Node> pastEndNode, EditingState*); void addBlockStyle(const StyleChange&, HTMLElement*); - void addInlineStyleIfNeeded(EditingStyle*, PassRefPtrWillBeRawPtr<Node> start, PassRefPtrWillBeRawPtr<Node> end, EditingState*); - Position positionToComputeInlineStyleChange(PassRefPtrWillBeRawPtr<Node>, RefPtrWillBeMember<HTMLSpanElement>& dummyElement, EditingState*); - void applyInlineStyleChange(PassRefPtrWillBeRawPtr<Node> startNode, PassRefPtrWillBeRawPtr<Node> endNode, StyleChange&, EAddStyledElement, EditingState*); + void addInlineStyleIfNeeded(EditingStyle*, RawPtr<Node> start, RawPtr<Node> end, EditingState*); + Position positionToComputeInlineStyleChange(RawPtr<Node>, Member<HTMLSpanElement>& dummyElement, EditingState*); + void applyInlineStyleChange(RawPtr<Node> startNode, RawPtr<Node> endNode, StyleChange&, EAddStyledElement, EditingState*); void splitTextAtStart(const Position& start, const Position& end); void splitTextAtEnd(const Position& start, const Position& end); void splitTextElementAtStart(const Position& start, const Position& end); @@ -111,7 +111,7 @@ bool mergeEndWithNextIfIdentical(const Position& start, const Position& end, EditingState*); void cleanupUnstyledAppleStyleSpans(ContainerNode* dummySpanAncestor, EditingState*); - void surroundNodeRangeWithElement(PassRefPtrWillBeRawPtr<Node> start, PassRefPtrWillBeRawPtr<Node> end, PassRefPtrWillBeRawPtr<Element>, EditingState*); + void surroundNodeRangeWithElement(RawPtr<Node> start, RawPtr<Node> end, RawPtr<Element>, EditingState*); float computedFontSize(Node*); void joinChildTextNodes(ContainerNode*, const Position& start, const Position& end); @@ -122,13 +122,13 @@ Position startPosition(); Position endPosition(); - RefPtrWillBeMember<EditingStyle> m_style; + Member<EditingStyle> m_style; EditAction m_editingAction; EPropertyLevel m_propertyLevel; Position m_start; Position m_end; bool m_useEndingSelection; - RefPtrWillBeMember<Element> m_styledInlineElement; + Member<Element> m_styledInlineElement; bool m_removeOnly; IsInlineElementToRemoveFunction m_isInlineElementToRemoveFunction; };
diff --git a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp index 1f8dfbd8..2554c8fb 100644 --- a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
@@ -103,7 +103,7 @@ if (!topBlockquote || !topBlockquote->parentNode()) return; - RefPtrWillBeRawPtr<HTMLBRElement> breakElement = HTMLBRElement::create(document()); + RawPtr<HTMLBRElement> breakElement = HTMLBRElement::create(document()); bool isLastVisPosInNode = isLastVisiblePositionInNode(visiblePos, topBlockquote); @@ -172,12 +172,12 @@ } // Build up list of ancestors in between the start node and the top blockquote. - WillBeHeapVector<RefPtrWillBeMember<Element>> ancestors; + HeapVector<Member<Element>> ancestors; for (Element* node = startNode->parentElement(); node && node != topBlockquote; node = node->parentElement()) ancestors.append(node); // Insert a clone of the top blockquote after the break. - RefPtrWillBeRawPtr<Element> clonedBlockquote = topBlockquote->cloneElementWithoutChildren(); + RawPtr<Element> clonedBlockquote = topBlockquote->cloneElementWithoutChildren(); insertNodeAfter(clonedBlockquote.get(), breakElement.get(), editingState); if (editingState->isAborted()) return; @@ -186,9 +186,9 @@ // On exiting this loop, clonedAncestor is the lowest ancestor // that was cloned (i.e. the clone of either ancestors.last() // or clonedBlockquote if ancestors is empty). - RefPtrWillBeRawPtr<Element> clonedAncestor = clonedBlockquote; + RawPtr<Element> clonedAncestor = clonedBlockquote; for (size_t i = ancestors.size(); i != 0; --i) { - RefPtrWillBeRawPtr<Element> clonedChild = ancestors[i - 1]->cloneElementWithoutChildren(); + RawPtr<Element> clonedChild = ancestors[i - 1]->cloneElementWithoutChildren(); // Preserve list item numbering in cloned lists. if (isHTMLOListElement(*clonedChild)) { Node* listChildNode = i > 1 ? ancestors[i - 2].get() : startNode; @@ -215,8 +215,8 @@ // Throughout this loop, clonedParent is the clone of ancestor's parent. // This is so we can clone ancestor's siblings and place the clones // into the clone corresponding to the ancestor's parent. - RefPtrWillBeRawPtr<Element> ancestor = nullptr; - RefPtrWillBeRawPtr<Element> clonedParent = nullptr; + RawPtr<Element> ancestor = nullptr; + RawPtr<Element> clonedParent = nullptr; for (ancestor = ancestors.first(), clonedParent = clonedAncestor->parentElement(); ancestor && ancestor != topBlockquote; ancestor = ancestor->parentElement(), clonedParent = clonedParent->parentElement()) {
diff --git a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.h b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.h index 112ab37..e0fd2d02 100644 --- a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.h
@@ -32,9 +32,9 @@ class BreakBlockquoteCommand final : public CompositeEditCommand { public: - static PassRefPtrWillBeRawPtr<BreakBlockquoteCommand> create(Document& document) + static RawPtr<BreakBlockquoteCommand> create(Document& document) { - return adoptRefWillBeNoop(new BreakBlockquoteCommand(document)); + return new BreakBlockquoteCommand(document); } private:
diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp index aead3781..119bdb6b 100644 --- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -78,10 +78,10 @@ using namespace HTMLNames; -PassRefPtrWillBeRawPtr<EditCommandComposition> EditCommandComposition::create(Document* document, +RawPtr<EditCommandComposition> EditCommandComposition::create(Document* document, const VisibleSelection& startingSelection, const VisibleSelection& endingSelection, EditAction editAction) { - return adoptRefWillBeNoop(new EditCommandComposition(document, startingSelection, endingSelection, editAction)); + return new EditCommandComposition(document, startingSelection, endingSelection, editAction); } EditCommandComposition::EditCommandComposition(Document* document, const VisibleSelection& startingSelection, const VisibleSelection& endingSelection, EditAction editAction) @@ -103,7 +103,7 @@ void EditCommandComposition::unapply() { ASSERT(m_document); - RefPtrWillBeRawPtr<LocalFrame> frame = m_document->frame(); + RawPtr<LocalFrame> frame = m_document->frame(); ASSERT(frame); // Changes to the document may have been made since the last editing operation that require a layout, as in <rdar://problem/5658603>. @@ -123,7 +123,7 @@ void EditCommandComposition::reapply() { ASSERT(m_document); - RefPtrWillBeRawPtr<LocalFrame> frame = m_document->frame(); + RawPtr<LocalFrame> frame = m_document->frame(); ASSERT(frame); // Changes to the document may have been made since the last editing operation that require a layout, as in <rdar://problem/5658603>. @@ -248,9 +248,9 @@ // // sugary-sweet convenience functions to help create and apply edit commands in composite commands // -void CompositeEditCommand::applyCommandToComposite(PassRefPtrWillBeRawPtr<EditCommand> prpCommand, EditingState* editingState) +void CompositeEditCommand::applyCommandToComposite(RawPtr<EditCommand> prpCommand, EditingState* editingState) { - RefPtrWillBeRawPtr<EditCommand> command = prpCommand; + RawPtr<EditCommand> command = prpCommand; command->setParent(this); command->doApply(editingState); if (editingState->isAborted()) { @@ -264,7 +264,7 @@ m_commands.append(command.release()); } -void CompositeEditCommand::applyCommandToComposite(PassRefPtrWillBeRawPtr<CompositeEditCommand> command, const VisibleSelection& selection, EditingState* editingState) +void CompositeEditCommand::applyCommandToComposite(RawPtr<CompositeEditCommand> command, const VisibleSelection& selection, EditingState* editingState) { command->setParent(this); if (!equalSelectionsInDOMTree(selection, command->endingSelection())) { @@ -286,12 +286,12 @@ applyCommandToComposite(ApplyStyleCommand::create(document(), style, start, end), editingState); } -void CompositeEditCommand::applyStyledElement(PassRefPtrWillBeRawPtr<Element> element, EditingState* editingState) +void CompositeEditCommand::applyStyledElement(RawPtr<Element> element, EditingState* editingState) { applyCommandToComposite(ApplyStyleCommand::create(element, false), editingState); } -void CompositeEditCommand::removeStyledElement(PassRefPtrWillBeRawPtr<Element> element, EditingState* editingState) +void CompositeEditCommand::removeStyledElement(RawPtr<Element> element, EditingState* editingState) { applyCommandToComposite(ApplyStyleCommand::create(element, true), editingState); } @@ -318,14 +318,14 @@ return false; } -void CompositeEditCommand::insertNodeBefore(PassRefPtrWillBeRawPtr<Node> insertChild, PassRefPtrWillBeRawPtr<Node> refChild, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) +void CompositeEditCommand::insertNodeBefore(RawPtr<Node> insertChild, RawPtr<Node> refChild, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) { ASSERT(document().body() != refChild); ABORT_EDITING_COMMAND_IF(!refChild->parentNode()->hasEditableStyle() && refChild->parentNode()->inActiveDocument()); applyCommandToComposite(InsertNodeBeforeCommand::create(insertChild, refChild, shouldAssumeContentIsAlwaysEditable), editingState); } -void CompositeEditCommand::insertNodeAfter(PassRefPtrWillBeRawPtr<Node> insertChild, PassRefPtrWillBeRawPtr<Node> refChild, EditingState* editingState) +void CompositeEditCommand::insertNodeAfter(RawPtr<Node> insertChild, RawPtr<Node> refChild, EditingState* editingState) { ASSERT(insertChild); ASSERT(refChild); @@ -341,7 +341,7 @@ } } -void CompositeEditCommand::insertNodeAt(PassRefPtrWillBeRawPtr<Node> insertChild, const Position& editingPosition, EditingState* editingState) +void CompositeEditCommand::insertNodeAt(RawPtr<Node> insertChild, const Position& editingPosition, EditingState* editingState) { ABORT_EDITING_COMMAND_IF(!isEditablePosition(editingPosition, ContentIsEditable, DoNotUpdateStyle)); // For editing positions like [table, 0], insert before the table, @@ -372,7 +372,7 @@ } } -void CompositeEditCommand::appendNode(PassRefPtrWillBeRawPtr<Node> node, PassRefPtrWillBeRawPtr<ContainerNode> parent, EditingState* editingState) +void CompositeEditCommand::appendNode(RawPtr<Node> node, RawPtr<ContainerNode> parent, EditingState* editingState) { // When cloneParagraphUnderNewElement() clones the fallback content // of an OBJECT element, the ASSERT below may fire since the return @@ -389,9 +389,9 @@ applyCommandToComposite(AppendNodeCommand::create(parent, node), editingState); } -void CompositeEditCommand::removeChildrenInRange(PassRefPtrWillBeRawPtr<Node> node, unsigned from, unsigned to, EditingState* editingState) +void CompositeEditCommand::removeChildrenInRange(RawPtr<Node> node, unsigned from, unsigned to, EditingState* editingState) { - WillBeHeapVector<RefPtrWillBeMember<Node>> children; + HeapVector<Member<Node>> children; Node* child = NodeTraversal::childAt(*node, from); for (unsigned i = from; child && i < to; i++, child = child->nextSibling()) children.append(child); @@ -404,7 +404,7 @@ } } -void CompositeEditCommand::removeNode(PassRefPtrWillBeRawPtr<Node> node, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) +void CompositeEditCommand::removeNode(RawPtr<Node> node, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) { if (!node || !node->nonShadowBoundaryParentNode()) return; @@ -412,26 +412,26 @@ applyCommandToComposite(RemoveNodeCommand::create(node, shouldAssumeContentIsAlwaysEditable), editingState); } -void CompositeEditCommand::removeNodePreservingChildren(PassRefPtrWillBeRawPtr<Node> node, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) +void CompositeEditCommand::removeNodePreservingChildren(RawPtr<Node> node, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) { ABORT_EDITING_COMMAND_IF(!node->document().frame()); applyCommandToComposite(RemoveNodePreservingChildrenCommand::create(node, shouldAssumeContentIsAlwaysEditable), editingState); } -void CompositeEditCommand::removeNodeAndPruneAncestors(PassRefPtrWillBeRawPtr<Node> node, EditingState* editingState, Node* excludeNode) +void CompositeEditCommand::removeNodeAndPruneAncestors(RawPtr<Node> node, EditingState* editingState, Node* excludeNode) { ASSERT(node.get() != excludeNode); - RefPtrWillBeRawPtr<ContainerNode> parent = node->parentNode(); + RawPtr<ContainerNode> parent = node->parentNode(); removeNode(node, editingState); if (editingState->isAborted()) return; prune(parent.release(), editingState, excludeNode); } -void CompositeEditCommand::moveRemainingSiblingsToNewParent(Node* node, Node* pastLastNodeToMove, PassRefPtrWillBeRawPtr<Element> prpNewParent, EditingState* editingState) +void CompositeEditCommand::moveRemainingSiblingsToNewParent(Node* node, Node* pastLastNodeToMove, RawPtr<Element> prpNewParent, EditingState* editingState) { NodeVector nodesToRemove; - RefPtrWillBeRawPtr<Element> newParent = prpNewParent; + RawPtr<Element> newParent = prpNewParent; for (; node && node != pastLastNodeToMove; node = node->nextSibling()) nodesToRemove.append(node); @@ -455,12 +455,12 @@ position = Position(position.computeContainerNode(), offset); } -HTMLSpanElement* CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes(PassRefPtrWillBeRawPtr<HTMLElement> node) +HTMLSpanElement* CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes(RawPtr<HTMLElement> node) { // It would also be possible to implement all of ReplaceNodeWithSpanCommand // as a series of existing smaller edit commands. Someone who wanted to // reduce the number of edit commands could do so here. - RefPtrWillBeRawPtr<ReplaceNodeWithSpanCommand> command = ReplaceNodeWithSpanCommand::create(node); + RawPtr<ReplaceNodeWithSpanCommand> command = ReplaceNodeWithSpanCommand::create(node); // ReplaceNodeWithSpanCommand is never aborted. applyCommandToComposite(command, ASSERT_NO_EDITING_ABORT); // Returning a raw pointer here is OK because the command is retained by @@ -470,28 +470,28 @@ return command->spanElement(); } -void CompositeEditCommand::prune(PassRefPtrWillBeRawPtr<Node> node, EditingState* editingState, Node* excludeNode) +void CompositeEditCommand::prune(RawPtr<Node> node, EditingState* editingState, Node* excludeNode) { - if (RefPtrWillBeRawPtr<Node> highestNodeToRemove = highestNodeToRemoveInPruning(node.get(), excludeNode)) + if (RawPtr<Node> highestNodeToRemove = highestNodeToRemoveInPruning(node.get(), excludeNode)) removeNode(highestNodeToRemove.release(), editingState); } -void CompositeEditCommand::splitTextNode(PassRefPtrWillBeRawPtr<Text> node, unsigned offset) +void CompositeEditCommand::splitTextNode(RawPtr<Text> node, unsigned offset) { // SplitTextNodeCommand is never aborted. applyCommandToComposite(SplitTextNodeCommand::create(node, offset), ASSERT_NO_EDITING_ABORT); } -void CompositeEditCommand::splitElement(PassRefPtrWillBeRawPtr<Element> element, PassRefPtrWillBeRawPtr<Node> atChild) +void CompositeEditCommand::splitElement(RawPtr<Element> element, RawPtr<Node> atChild) { // SplitElementCommand is never aborted. applyCommandToComposite(SplitElementCommand::create(element, atChild), ASSERT_NO_EDITING_ABORT); } -void CompositeEditCommand::mergeIdenticalElements(PassRefPtrWillBeRawPtr<Element> prpFirst, PassRefPtrWillBeRawPtr<Element> prpSecond, EditingState* editingState) +void CompositeEditCommand::mergeIdenticalElements(RawPtr<Element> prpFirst, RawPtr<Element> prpSecond, EditingState* editingState) { - RefPtrWillBeRawPtr<Element> first = prpFirst; - RefPtrWillBeRawPtr<Element> second = prpSecond; + RawPtr<Element> first = prpFirst; + RawPtr<Element> second = prpSecond; ASSERT(!first->isDescendantOf(second.get()) && second != first); if (first->nextSibling() != second) { removeNode(second, editingState); @@ -504,34 +504,34 @@ applyCommandToComposite(MergeIdenticalElementsCommand::create(first, second), editingState); } -void CompositeEditCommand::wrapContentsInDummySpan(PassRefPtrWillBeRawPtr<Element> element) +void CompositeEditCommand::wrapContentsInDummySpan(RawPtr<Element> element) { // WrapContentsInDummySpanCommand is never aborted. applyCommandToComposite(WrapContentsInDummySpanCommand::create(element), ASSERT_NO_EDITING_ABORT); } -void CompositeEditCommand::splitTextNodeContainingElement(PassRefPtrWillBeRawPtr<Text> text, unsigned offset) +void CompositeEditCommand::splitTextNodeContainingElement(RawPtr<Text> text, unsigned offset) { // SplitTextNodeContainingElementCommand is never aborted. applyCommandToComposite(SplitTextNodeContainingElementCommand::create(text, offset), ASSERT_NO_EDITING_ABORT); } -void CompositeEditCommand::insertTextIntoNode(PassRefPtrWillBeRawPtr<Text> node, unsigned offset, const String& text) +void CompositeEditCommand::insertTextIntoNode(RawPtr<Text> node, unsigned offset, const String& text) { // InsertIntoTextNodeCommand is never aborted. if (!text.isEmpty()) applyCommandToComposite(InsertIntoTextNodeCommand::create(node, offset, text), ASSERT_NO_EDITING_ABORT); } -void CompositeEditCommand::deleteTextFromNode(PassRefPtrWillBeRawPtr<Text> node, unsigned offset, unsigned count) +void CompositeEditCommand::deleteTextFromNode(RawPtr<Text> node, unsigned offset, unsigned count) { // DeleteFromTextNodeCommand is never aborted. applyCommandToComposite(DeleteFromTextNodeCommand::create(node, offset, count), ASSERT_NO_EDITING_ABORT); } -void CompositeEditCommand::replaceTextInNode(PassRefPtrWillBeRawPtr<Text> prpNode, unsigned offset, unsigned count, const String& replacementText) +void CompositeEditCommand::replaceTextInNode(RawPtr<Text> prpNode, unsigned offset, unsigned count, const String& replacementText) { - RefPtrWillBeRawPtr<Text> node(prpNode); + RawPtr<Text> node(prpNode); // DeleteFromTextNodeCommand and InsertIntoTextNodeCommand are never // aborted. applyCommandToComposite(DeleteFromTextNodeCommand::create(node, offset, count), ASSERT_NO_EDITING_ABORT); @@ -546,7 +546,7 @@ if (start.computeContainerNode() != end.computeContainerNode() || !start.computeContainerNode()->isTextNode() || isTabHTMLSpanElementTextNode(start.computeContainerNode())) return Position(); - RefPtrWillBeRawPtr<Text> textNode = toText(start.computeContainerNode()); + RawPtr<Text> textNode = toText(start.computeContainerNode()); replaceTextInNode(textNode, start.offsetInContainerNode(), end.offsetInContainerNode() - start.offsetInContainerNode(), text); return Position(textNode.release(), start.offsetInContainerNode() + text.length()); @@ -563,9 +563,9 @@ } } -void CompositeEditCommand::replaceTextInNodePreservingMarkers(PassRefPtrWillBeRawPtr<Text> prpNode, unsigned offset, unsigned count, const String& replacementText) +void CompositeEditCommand::replaceTextInNodePreservingMarkers(RawPtr<Text> prpNode, unsigned offset, unsigned count, const String& replacementText) { - RefPtrWillBeRawPtr<Text> node(prpNode); + RawPtr<Text> node(prpNode); DocumentMarkerController& markerController = document().markers(); Vector<DocumentMarker::MarkerType> types; Vector<String> descriptions; @@ -609,7 +609,7 @@ return positionInParentBeforeNode(*tabSpan); } -void CompositeEditCommand::insertNodeAtTabSpanPosition(PassRefPtrWillBeRawPtr<Node> node, const Position& pos, EditingState* editingState) +void CompositeEditCommand::insertNodeAtTabSpanPosition(RawPtr<Node> node, const Position& pos, EditingState* editingState) { // insert node before, after, or at split of tab span insertNodeAt(node, positionOutsideTabSpan(pos), editingState); @@ -627,18 +627,18 @@ applyCommandToComposite(DeleteSelectionCommand::create(selection, smartDelete, mergeBlocksAfterDelete, expandForSpecialElements, sanitizeMarkup), editingState); } -void CompositeEditCommand::removeCSSProperty(PassRefPtrWillBeRawPtr<Element> element, CSSPropertyID property) +void CompositeEditCommand::removeCSSProperty(RawPtr<Element> element, CSSPropertyID property) { // RemoveCSSPropertyCommand is never aborted. applyCommandToComposite(RemoveCSSPropertyCommand::create(document(), element, property), ASSERT_NO_EDITING_ABORT); } -void CompositeEditCommand::removeElementAttribute(PassRefPtrWillBeRawPtr<Element> element, const QualifiedName& attribute) +void CompositeEditCommand::removeElementAttribute(RawPtr<Element> element, const QualifiedName& attribute) { setNodeAttribute(element, attribute, AtomicString()); } -void CompositeEditCommand::setNodeAttribute(PassRefPtrWillBeRawPtr<Element> element, const QualifiedName& attribute, const AtomicString& value) +void CompositeEditCommand::setNodeAttribute(RawPtr<Element> element, const QualifiedName& attribute, const AtomicString& value) { // SetNodeAttributeCommand is never aborted. applyCommandToComposite(SetNodeAttributeCommand::create(element, attribute, value), ASSERT_NO_EDITING_ABORT); @@ -695,9 +695,9 @@ rebalanceWhitespaceOnTextSubstring(toText(node), position.offsetInContainerNode(), position.offsetInContainerNode()); } -void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(PassRefPtrWillBeRawPtr<Text> prpTextNode, int startOffset, int endOffset) +void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(RawPtr<Text> prpTextNode, int startOffset, int endOffset) { - RefPtrWillBeRawPtr<Text> textNode = prpTextNode; + RawPtr<Text> textNode = prpTextNode; String text = textNode->data(); ASSERT(!text.isEmpty()); @@ -778,7 +778,7 @@ rebalanceWhitespaceAt(selection.end()); } -void CompositeEditCommand::deleteInsignificantText(PassRefPtrWillBeRawPtr<Text> textNode, unsigned start, unsigned end) +void CompositeEditCommand::deleteInsignificantText(RawPtr<Text> textNode, unsigned start, unsigned end) { if (!textNode || start >= end) return; @@ -868,7 +868,7 @@ if (comparePositions(start, end) >= 0) return; - WillBeHeapVector<RefPtrWillBeMember<Text>> nodes; + HeapVector<Member<Text>> nodes; for (Node& node : NodeTraversal::startsAt(start.anchorNode())) { if (node.isTextNode()) nodes.append(toText(&node)); @@ -890,7 +890,7 @@ deleteInsignificantText(pos, end); } -PassRefPtrWillBeRawPtr<HTMLBRElement> CompositeEditCommand::appendBlockPlaceholder(PassRefPtrWillBeRawPtr<Element> container, EditingState* editingState) +RawPtr<HTMLBRElement> CompositeEditCommand::appendBlockPlaceholder(RawPtr<Element> container, EditingState* editingState) { if (!container) return nullptr; @@ -900,14 +900,14 @@ // Should assert isLayoutBlockFlow || isInlineFlow when deletion improves. See 4244964. ASSERT(container->layoutObject()); - RefPtrWillBeRawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); + RawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); appendNode(placeholder, container, editingState); if (editingState->isAborted()) return nullptr; return placeholder.release(); } -PassRefPtrWillBeRawPtr<HTMLBRElement> CompositeEditCommand::insertBlockPlaceholder(const Position& pos, EditingState* editingState) +RawPtr<HTMLBRElement> CompositeEditCommand::insertBlockPlaceholder(const Position& pos, EditingState* editingState) { if (pos.isNull()) return nullptr; @@ -915,14 +915,14 @@ // Should assert isLayoutBlockFlow || isInlineFlow when deletion improves. See 4244964. ASSERT(pos.anchorNode()->layoutObject()); - RefPtrWillBeRawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); + RawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); insertNodeAt(placeholder, pos, editingState); if (editingState->isAborted()) return nullptr; return placeholder.release(); } -PassRefPtrWillBeRawPtr<HTMLBRElement> CompositeEditCommand::addBlockPlaceholderIfNeeded(Element* container, EditingState* editingState) +RawPtr<HTMLBRElement> CompositeEditCommand::addBlockPlaceholderIfNeeded(Element* container, EditingState* editingState) { if (!container) return nullptr; @@ -957,9 +957,9 @@ deleteTextFromNode(toText(p.anchorNode()), p.offsetInContainerNode(), 1); } -PassRefPtrWillBeRawPtr<HTMLElement> CompositeEditCommand::insertNewDefaultParagraphElementAt(const Position& position, EditingState* editingState) +RawPtr<HTMLElement> CompositeEditCommand::insertNewDefaultParagraphElementAt(const Position& position, EditingState* editingState) { - RefPtrWillBeRawPtr<HTMLElement> paragraphElement = createDefaultParagraphElement(document()); + RawPtr<HTMLElement> paragraphElement = createDefaultParagraphElement(document()); paragraphElement->appendChild(HTMLBRElement::create(document())); insertNodeAt(paragraphElement, position, editingState); if (editingState->isAborted()) @@ -969,7 +969,7 @@ // If the paragraph is not entirely within it's own block, create one and move the paragraph into // it, and return that block. Otherwise return 0. -PassRefPtrWillBeRawPtr<HTMLElement> CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary(const Position& pos, EditingState* editingState) +RawPtr<HTMLElement> CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary(const Position& pos, EditingState* editingState) { ASSERT(isEditablePosition(pos, ContentIsEditable, DoNotUpdateStyle)); @@ -1017,7 +1017,7 @@ if (visibleParagraphEnd.isNull()) return nullptr; - RefPtrWillBeRawPtr<HTMLElement> newBlock = insertNewDefaultParagraphElementAt(upstreamStart, editingState); + RawPtr<HTMLElement> newBlock = insertNewDefaultParagraphElementAt(upstreamStart, editingState); if (editingState->isAborted()) return nullptr; @@ -1067,8 +1067,8 @@ ASSERT(blockElement); // First we clone the outerNode - RefPtrWillBeRawPtr<Node> lastNode = nullptr; - RefPtrWillBeRawPtr<Node> outerNode = passedOuterNode; + RawPtr<Node> lastNode = nullptr; + RawPtr<Node> outerNode = passedOuterNode; if (outerNode->isRootEditableElement()) { lastNode = blockElement; @@ -1080,7 +1080,7 @@ } if (start.anchorNode() != outerNode && lastNode->isElementNode() && start.anchorNode()->isDescendantOf(outerNode.get())) { - WillBeHeapVector<RefPtrWillBeMember<Node>> ancestors; + HeapVector<Member<Node>> ancestors; // Insert each node from innerNode to outerNode (excluded) in a list. for (Node* n = start.anchorNode(); n && n != outerNode; n = n->parentNode()) @@ -1090,7 +1090,7 @@ for (size_t i = ancestors.size(); i != 0; --i) { Node* item = ancestors[i - 1].get(); - RefPtrWillBeRawPtr<Node> child = item->cloneNode(isDisplayInsideTable(item)); + RawPtr<Node> child = item->cloneNode(isDisplayInsideTable(item)); appendNode(child, toElement(lastNode), editingState); if (editingState->isAborted()) return; @@ -1117,8 +1117,8 @@ if (!outerNode) return; - RefPtrWillBeRawPtr<Node> startNode = start.anchorNode(); - for (RefPtrWillBeRawPtr<Node> node = NodeTraversal::nextSkippingChildren(*startNode, outerNode.get()); node; node = NodeTraversal::nextSkippingChildren(*node, outerNode.get())) { + RawPtr<Node> startNode = start.anchorNode(); + for (RawPtr<Node> node = NodeTraversal::nextSkippingChildren(*startNode, outerNode.get()); node; node = NodeTraversal::nextSkippingChildren(*node, outerNode.get())) { // Move lastNode up in the tree as much as node was moved up in the // tree by NodeTraversal::nextSkippingChildren, so that the relative depth between // node and the original start node is maintained in the clone. @@ -1130,7 +1130,7 @@ if (!lastNode || !lastNode->parentNode()) return; - RefPtrWillBeRawPtr<Node> clonedNode = node->cloneNode(true); + RawPtr<Node> clonedNode = node->cloneNode(true); insertNodeAfter(clonedNode, lastNode, editingState); if (editingState->isAborted()) return; @@ -1289,13 +1289,13 @@ // FIXME: This is an inefficient way to preserve style on nodes in the paragraph to move. It // shouldn't matter though, since moved paragraphs will usually be quite small. - RefPtrWillBeRawPtr<DocumentFragment> fragment = startOfParagraphToMove.deepEquivalent() != endOfParagraphToMove.deepEquivalent() ? + RawPtr<DocumentFragment> fragment = startOfParagraphToMove.deepEquivalent() != endOfParagraphToMove.deepEquivalent() ? createFragmentFromMarkup(document(), createMarkup(start.parentAnchoredEquivalent(), end.parentAnchoredEquivalent(), DoNotAnnotateForInterchange, ConvertBlocksToInlines::Convert, DoNotResolveURLs, constrainingAncestor), "") : nullptr; // A non-empty paragraph's style is moved when we copy and move it. We don't move // anything if we're given an empty paragraph, but an empty paragraph can have style // too, <div><b><br></b></div> for example. Save it so that we can preserve it later. - RefPtrWillBeRawPtr<EditingStyle> styleInEmptyParagraph = nullptr; + RawPtr<EditingStyle> styleInEmptyParagraph = nullptr; if (startOfParagraphToMove.deepEquivalent() == endOfParagraphToMove.deepEquivalent() && preserveStyle) { styleInEmptyParagraph = EditingStyle::create(startOfParagraphToMove.deepEquivalent()); styleInEmptyParagraph->mergeTypingStyle(&document()); @@ -1378,14 +1378,14 @@ // FIXME: Send an appropriate shouldDeleteRange call. bool CompositeEditCommand::breakOutOfEmptyListItem(EditingState* editingState) { - RefPtrWillBeRawPtr<Node> emptyListItem = enclosingEmptyListItem(endingSelection().visibleStart()); + RawPtr<Node> emptyListItem = enclosingEmptyListItem(endingSelection().visibleStart()); if (!emptyListItem) return false; - RefPtrWillBeRawPtr<EditingStyle> style = EditingStyle::create(endingSelection().start()); + RawPtr<EditingStyle> style = EditingStyle::create(endingSelection().start()); style->mergeTypingStyle(&document()); - RefPtrWillBeRawPtr<ContainerNode> listNode = emptyListItem->parentNode(); + RawPtr<ContainerNode> listNode = emptyListItem->parentNode(); // FIXME: Can't we do something better when the immediate parent wasn't a list node? if (!listNode || (!isHTMLUListElement(*listNode) && !isHTMLOListElement(*listNode)) @@ -1393,7 +1393,7 @@ || listNode == emptyListItem->rootEditableElement()) return false; - RefPtrWillBeRawPtr<HTMLElement> newBlock = nullptr; + RawPtr<HTMLElement> newBlock = nullptr; if (ContainerNode* blockEnclosingList = listNode->parentNode()) { if (isHTMLLIElement(*blockEnclosingList)) { // listNode is inside another list item if (visiblePositionAfterNode(*blockEnclosingList).deepEquivalent() == visiblePositionAfterNode(*listNode).deepEquivalent()) { @@ -1415,8 +1415,8 @@ if (!newBlock) newBlock = createDefaultParagraphElement(document()); - RefPtrWillBeRawPtr<Node> previousListNode = emptyListItem->isElementNode() ? ElementTraversal::previousSibling(*emptyListItem): emptyListItem->previousSibling(); - RefPtrWillBeRawPtr<Node> nextListNode = emptyListItem->isElementNode() ? ElementTraversal::nextSibling(*emptyListItem): emptyListItem->nextSibling(); + RawPtr<Node> previousListNode = emptyListItem->isElementNode() ? ElementTraversal::previousSibling(*emptyListItem): emptyListItem->previousSibling(); + RawPtr<Node> nextListNode = emptyListItem->isElementNode() ? ElementTraversal::nextSibling(*emptyListItem): emptyListItem->nextSibling(); if (isListItem(nextListNode.get()) || isHTMLListElement(nextListNode.get())) { // If emptyListItem follows another list item or nested list, split the list node. if (isListItem(previousListNode.get()) || isHTMLListElement(previousListNode.get())) @@ -1477,7 +1477,7 @@ if (enclosingNodeOfType(previous.deepEquivalent(), &isMailHTMLBlockquoteElement)) return false; - RefPtrWillBeRawPtr<HTMLBRElement> br = HTMLBRElement::create(document()); + RawPtr<HTMLBRElement> br = HTMLBRElement::create(document()); // We want to replace this quoted paragraph with an unquoted one, so insert a br // to hold the caret before the highest blockquote. insertNodeBefore(br, highestBlockquote, editingState); @@ -1587,7 +1587,7 @@ // Splits the tree parent by parent until we reach the specified ancestor. We use VisiblePositions // to determine if the split is necessary. Returns the last split node. -PassRefPtrWillBeRawPtr<Node> CompositeEditCommand::splitTreeToNode(Node* start, Node* end, bool shouldSplitAncestor) +RawPtr<Node> CompositeEditCommand::splitTreeToNode(Node* start, Node* end, bool shouldSplitAncestor) { ASSERT(start); ASSERT(end); @@ -1598,8 +1598,8 @@ if (!start->isDescendantOf(end)) return end; - RefPtrWillBeRawPtr<Node> endNode = end; - RefPtrWillBeRawPtr<Node> node = nullptr; + RawPtr<Node> endNode = end; + RawPtr<Node> node = nullptr; for (node = start; node->parentNode() != endNode; node = node->parentNode()) { Element* parentElement = node->parentElement(); if (!parentElement)
diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h index d3875cc6..b3a54e0 100644 --- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
@@ -43,7 +43,7 @@ class EditCommandComposition final : public UndoStep { public: - static PassRefPtrWillBeRawPtr<EditCommandComposition> create(Document*, const VisibleSelection&, const VisibleSelection&, EditAction); + static RawPtr<EditCommandComposition> create(Document*, const VisibleSelection&, const VisibleSelection&, EditAction); bool belongsTo(const LocalFrame&) const override; void unapply() override; @@ -63,12 +63,12 @@ private: EditCommandComposition(Document*, const VisibleSelection& startingSelection, const VisibleSelection& endingSelection, EditAction); - RefPtrWillBeMember<Document> m_document; + Member<Document> m_document; VisibleSelection m_startingSelection; VisibleSelection m_endingSelection; - WillBeHeapVector<RefPtrWillBeMember<SimpleEditCommand>> m_commands; - RefPtrWillBeMember<Element> m_startingRootEditableElement; - RefPtrWillBeMember<Element> m_endingRootEditableElement; + HeapVector<Member<SimpleEditCommand>> m_commands; + Member<Element> m_startingRootEditableElement; + Member<Element> m_endingRootEditableElement; EditAction m_editAction; }; @@ -96,63 +96,63 @@ // // sugary-sweet convenience functions to help create and apply edit commands in composite commands // - void appendNode(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<ContainerNode> parent, EditingState*); - void applyCommandToComposite(PassRefPtrWillBeRawPtr<EditCommand>, EditingState*); - void applyCommandToComposite(PassRefPtrWillBeRawPtr<CompositeEditCommand>, const VisibleSelection&, EditingState*); + void appendNode(RawPtr<Node>, RawPtr<ContainerNode> parent, EditingState*); + void applyCommandToComposite(RawPtr<EditCommand>, EditingState*); + void applyCommandToComposite(RawPtr<CompositeEditCommand>, const VisibleSelection&, EditingState*); void applyStyle(const EditingStyle*, EditingState*); void applyStyle(const EditingStyle*, const Position& start, const Position& end, EditingState*); - void applyStyledElement(PassRefPtrWillBeRawPtr<Element>, EditingState*); - void removeStyledElement(PassRefPtrWillBeRawPtr<Element>, EditingState*); + void applyStyledElement(RawPtr<Element>, EditingState*); + void removeStyledElement(RawPtr<Element>, EditingState*); void deleteSelection(EditingState*, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = true, bool sanitizeMarkup = true); void deleteSelection(const VisibleSelection&, EditingState*, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = true, bool sanitizeMarkup = true); - virtual void deleteTextFromNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset, unsigned count); + virtual void deleteTextFromNode(RawPtr<Text>, unsigned offset, unsigned count); bool isRemovableBlock(const Node*); - void insertNodeAfter(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<Node> refChild, EditingState*); - void insertNodeAt(PassRefPtrWillBeRawPtr<Node>, const Position&, EditingState*); - void insertNodeAtTabSpanPosition(PassRefPtrWillBeRawPtr<Node>, const Position&, EditingState*); - void insertNodeBefore(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<Node> refChild, EditingState*, ShouldAssumeContentIsAlwaysEditable = DoNotAssumeContentIsAlwaysEditable); + void insertNodeAfter(RawPtr<Node>, RawPtr<Node> refChild, EditingState*); + void insertNodeAt(RawPtr<Node>, const Position&, EditingState*); + void insertNodeAtTabSpanPosition(RawPtr<Node>, const Position&, EditingState*); + void insertNodeBefore(RawPtr<Node>, RawPtr<Node> refChild, EditingState*, ShouldAssumeContentIsAlwaysEditable = DoNotAssumeContentIsAlwaysEditable); void insertParagraphSeparator(EditingState*, bool useDefaultParagraphElement = false, bool pasteBlockqutoeIntoUnquotedArea = false); - void insertTextIntoNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset, const String& text); - void mergeIdenticalElements(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillBeRawPtr<Element>, EditingState*); + void insertTextIntoNode(RawPtr<Text>, unsigned offset, const String& text); + void mergeIdenticalElements(RawPtr<Element>, RawPtr<Element>, EditingState*); void rebalanceWhitespace(); void rebalanceWhitespaceAt(const Position&); - void rebalanceWhitespaceOnTextSubstring(PassRefPtrWillBeRawPtr<Text>, int startOffset, int endOffset); + void rebalanceWhitespaceOnTextSubstring(RawPtr<Text>, int startOffset, int endOffset); void prepareWhitespaceAtPositionForSplit(Position&); void replaceCollapsibleWhitespaceWithNonBreakingSpaceIfNeeded(const VisiblePosition&); bool canRebalance(const Position&) const; bool shouldRebalanceLeadingWhitespaceFor(const String&) const; - void removeCSSProperty(PassRefPtrWillBeRawPtr<Element>, CSSPropertyID); - void removeElementAttribute(PassRefPtrWillBeRawPtr<Element>, const QualifiedName& attribute); - void removeChildrenInRange(PassRefPtrWillBeRawPtr<Node>, unsigned from, unsigned to, EditingState*); - virtual void removeNode(PassRefPtrWillBeRawPtr<Node>, EditingState*, ShouldAssumeContentIsAlwaysEditable = DoNotAssumeContentIsAlwaysEditable); - HTMLSpanElement* replaceElementWithSpanPreservingChildrenAndAttributes(PassRefPtrWillBeRawPtr<HTMLElement>); - void removeNodePreservingChildren(PassRefPtrWillBeRawPtr<Node>, EditingState*, ShouldAssumeContentIsAlwaysEditable = DoNotAssumeContentIsAlwaysEditable); - void removeNodeAndPruneAncestors(PassRefPtrWillBeRawPtr<Node>, EditingState*, Node* excludeNode = nullptr); - void moveRemainingSiblingsToNewParent(Node*, Node* pastLastNodeToMove, PassRefPtrWillBeRawPtr<Element> prpNewParent, EditingState*); + void removeCSSProperty(RawPtr<Element>, CSSPropertyID); + void removeElementAttribute(RawPtr<Element>, const QualifiedName& attribute); + void removeChildrenInRange(RawPtr<Node>, unsigned from, unsigned to, EditingState*); + virtual void removeNode(RawPtr<Node>, EditingState*, ShouldAssumeContentIsAlwaysEditable = DoNotAssumeContentIsAlwaysEditable); + HTMLSpanElement* replaceElementWithSpanPreservingChildrenAndAttributes(RawPtr<HTMLElement>); + void removeNodePreservingChildren(RawPtr<Node>, EditingState*, ShouldAssumeContentIsAlwaysEditable = DoNotAssumeContentIsAlwaysEditable); + void removeNodeAndPruneAncestors(RawPtr<Node>, EditingState*, Node* excludeNode = nullptr); + void moveRemainingSiblingsToNewParent(Node*, Node* pastLastNodeToMove, RawPtr<Element> prpNewParent, EditingState*); void updatePositionForNodeRemovalPreservingChildren(Position&, Node&); - void prune(PassRefPtrWillBeRawPtr<Node>, EditingState*, Node* excludeNode = nullptr); - void replaceTextInNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset, unsigned count, const String& replacementText); + void prune(RawPtr<Node>, EditingState*, Node* excludeNode = nullptr); + void replaceTextInNode(RawPtr<Text>, unsigned offset, unsigned count, const String& replacementText); Position replaceSelectedTextInNode(const String&); - void replaceTextInNodePreservingMarkers(PassRefPtrWillBeRawPtr<Text>, unsigned offset, unsigned count, const String& replacementText); + void replaceTextInNodePreservingMarkers(RawPtr<Text>, unsigned offset, unsigned count, const String& replacementText); Position positionOutsideTabSpan(const Position&); - void setNodeAttribute(PassRefPtrWillBeRawPtr<Element>, const QualifiedName& attribute, const AtomicString& value); - void splitElement(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillBeRawPtr<Node> atChild); - void splitTextNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset); - void splitTextNodeContainingElement(PassRefPtrWillBeRawPtr<Text>, unsigned offset); - void wrapContentsInDummySpan(PassRefPtrWillBeRawPtr<Element>); + void setNodeAttribute(RawPtr<Element>, const QualifiedName& attribute, const AtomicString& value); + void splitElement(RawPtr<Element>, RawPtr<Node> atChild); + void splitTextNode(RawPtr<Text>, unsigned offset); + void splitTextNodeContainingElement(RawPtr<Text>, unsigned offset); + void wrapContentsInDummySpan(RawPtr<Element>); - void deleteInsignificantText(PassRefPtrWillBeRawPtr<Text>, unsigned start, unsigned end); + void deleteInsignificantText(RawPtr<Text>, unsigned start, unsigned end); void deleteInsignificantText(const Position& start, const Position& end); void deleteInsignificantTextDownstream(const Position&); - PassRefPtrWillBeRawPtr<HTMLBRElement> appendBlockPlaceholder(PassRefPtrWillBeRawPtr<Element>, EditingState*); - PassRefPtrWillBeRawPtr<HTMLBRElement> insertBlockPlaceholder(const Position&, EditingState*); - PassRefPtrWillBeRawPtr<HTMLBRElement> addBlockPlaceholderIfNeeded(Element*, EditingState*); + RawPtr<HTMLBRElement> appendBlockPlaceholder(RawPtr<Element>, EditingState*); + RawPtr<HTMLBRElement> insertBlockPlaceholder(const Position&, EditingState*); + RawPtr<HTMLBRElement> addBlockPlaceholderIfNeeded(Element*, EditingState*); void removePlaceholderAt(const Position&); - PassRefPtrWillBeRawPtr<HTMLElement> insertNewDefaultParagraphElementAt(const Position&, EditingState*); + RawPtr<HTMLElement> insertNewDefaultParagraphElementAt(const Position&, EditingState*); - PassRefPtrWillBeRawPtr<HTMLElement> moveParagraphContentsToNewBlockIfNecessary(const Position&, EditingState*); + RawPtr<HTMLElement> moveParagraphContentsToNewBlockIfNecessary(const Position&, EditingState*); void pushAnchorElementDown(Element*, EditingState*); @@ -168,14 +168,14 @@ Position positionAvoidingSpecialElementBoundary(const Position&, EditingState*); - PassRefPtrWillBeRawPtr<Node> splitTreeToNode(Node*, Node*, bool splitAncestor = false); + RawPtr<Node> splitTreeToNode(Node*, Node*, bool splitAncestor = false); - WillBeHeapVector<RefPtrWillBeMember<EditCommand>> m_commands; + HeapVector<Member<EditCommand>> m_commands; private: bool isCompositeEditCommand() const final { return true; } - RefPtrWillBeMember<EditCommandComposition> m_composition; + Member<EditCommandComposition> m_composition; }; DEFINE_TYPE_CASTS(CompositeEditCommand, EditCommand, command, command->isCompositeEditCommand(), command.isCompositeEditCommand());
diff --git a/third_party/WebKit/Source/core/editing/commands/CreateLinkCommand.cpp b/third_party/WebKit/Source/core/editing/commands/CreateLinkCommand.cpp index 7fb7da3e..83b1ad52 100644 --- a/third_party/WebKit/Source/core/editing/commands/CreateLinkCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/CreateLinkCommand.cpp
@@ -41,7 +41,7 @@ if (endingSelection().isNone()) return; - RefPtrWillBeRawPtr<HTMLAnchorElement> anchorElement = HTMLAnchorElement::create(document()); + RawPtr<HTMLAnchorElement> anchorElement = HTMLAnchorElement::create(document()); anchorElement->setHref(AtomicString(m_url)); if (endingSelection().isRange()) { @@ -52,7 +52,7 @@ insertNodeAt(anchorElement.get(), endingSelection().start(), editingState); if (editingState->isAborted()) return; - RefPtrWillBeRawPtr<Text> textNode = Text::create(document(), m_url); + RawPtr<Text> textNode = Text::create(document(), m_url); appendNode(textNode.get(), anchorElement.get(), editingState); if (editingState->isAborted()) return;
diff --git a/third_party/WebKit/Source/core/editing/commands/CreateLinkCommand.h b/third_party/WebKit/Source/core/editing/commands/CreateLinkCommand.h index a4ac6d5..025c07a2 100644 --- a/third_party/WebKit/Source/core/editing/commands/CreateLinkCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/CreateLinkCommand.h
@@ -32,9 +32,9 @@ class CreateLinkCommand final : public CompositeEditCommand { public: - static PassRefPtrWillBeRawPtr<CreateLinkCommand> create(Document& document, const String& linkURL) + static RawPtr<CreateLinkCommand> create(Document& document, const String& linkURL) { - return adoptRefWillBeNoop(new CreateLinkCommand(document, linkURL)); + return new CreateLinkCommand(document, linkURL); } private:
diff --git a/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.cpp index d66aa626..9e15dfb 100644 --- a/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.cpp
@@ -31,7 +31,7 @@ namespace blink { -DeleteFromTextNodeCommand::DeleteFromTextNodeCommand(PassRefPtrWillBeRawPtr<Text> node, unsigned offset, unsigned count) +DeleteFromTextNodeCommand::DeleteFromTextNodeCommand(RawPtr<Text> node, unsigned offset, unsigned count) : SimpleEditCommand(node->document()) , m_node(node) , m_offset(offset)
diff --git a/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.h b/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.h index 8f4469e..07f7df19 100644 --- a/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.h
@@ -34,20 +34,20 @@ class DeleteFromTextNodeCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<DeleteFromTextNodeCommand> create(PassRefPtrWillBeRawPtr<Text> node, unsigned offset, unsigned count) + static RawPtr<DeleteFromTextNodeCommand> create(RawPtr<Text> node, unsigned offset, unsigned count) { - return adoptRefWillBeNoop(new DeleteFromTextNodeCommand(node, offset, count)); + return new DeleteFromTextNodeCommand(node, offset, count); } DECLARE_VIRTUAL_TRACE(); private: - DeleteFromTextNodeCommand(PassRefPtrWillBeRawPtr<Text>, unsigned offset, unsigned count); + DeleteFromTextNodeCommand(RawPtr<Text>, unsigned offset, unsigned count); void doApply(EditingState*) override; void doUnapply() override; - RefPtrWillBeMember<Text> m_node; + Member<Text> m_node; unsigned m_offset; unsigned m_count; String m_text;
diff --git a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp index d7e92b0..d37e6d0 100644 --- a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
@@ -341,7 +341,7 @@ return next ? firstPositionInOrBeforeNode(next) : Position(); } -void DeleteSelectionCommand::removeNode(PassRefPtrWillBeRawPtr<Node> node, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) +void DeleteSelectionCommand::removeNode(RawPtr<Node> node, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) { if (!node) return; @@ -353,9 +353,9 @@ if (!node->hasChildren()) return; // Search this non-editable region for editable regions to empty. - RefPtrWillBeRawPtr<Node> child = node->firstChild(); + RawPtr<Node> child = node->firstChild(); while (child) { - RefPtrWillBeRawPtr<Node> nextChild = child->nextSibling(); + RawPtr<Node> nextChild = child->nextSibling(); removeNode(child.get(), editingState, shouldAssumeContentIsAlwaysEditable); if (editingState->isAborted()) return; @@ -423,7 +423,7 @@ position = Position(position.computeContainerNode(), offset); } -void DeleteSelectionCommand::deleteTextFromNode(PassRefPtrWillBeRawPtr<Text> node, unsigned offset, unsigned count) +void DeleteSelectionCommand::deleteTextFromNode(RawPtr<Text> node, unsigned offset, unsigned count) { // FIXME: Update the endpoints of the range being deleted. updatePositionForTextRemoval(node.get(), offset, count, m_endingPosition); @@ -436,13 +436,13 @@ void DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss(EditingState* editingState) { - RefPtrWillBeRawPtr<Range> range = createRange(m_selectionToDelete.toNormalizedEphemeralRange()); - RefPtrWillBeRawPtr<Node> node = range->firstNode(); + RawPtr<Range> range = createRange(m_selectionToDelete.toNormalizedEphemeralRange()); + RawPtr<Node> node = range->firstNode(); while (node && node != range->pastLastNode()) { - RefPtrWillBeRawPtr<Node> nextNode = NodeTraversal::next(*node); + RawPtr<Node> nextNode = NodeTraversal::next(*node); if (isHTMLStyleElement(*node) || isHTMLLinkElement(*node)) { nextNode = NodeTraversal::nextSkippingChildren(*node); - RefPtrWillBeRawPtr<Element> rootEditableElement = node->rootEditableElement(); + RawPtr<Element> rootEditableElement = node->rootEditableElement(); if (rootEditableElement.get()) { removeNode(node, editingState); if (editingState->isAborted()) @@ -515,7 +515,7 @@ } else { bool startNodeWasDescendantOfEndNode = m_upstreamStart.anchorNode()->isDescendantOf(m_downstreamEnd.anchorNode()); // The selection to delete spans more than one node. - RefPtrWillBeRawPtr<Node> node(startNode); + RawPtr<Node> node(startNode); if (startOffset > 0) { if (startNode->isTextNode()) { @@ -537,7 +537,7 @@ // NodeTraversal::nextSkippingChildren just blew past the end position, so stop deleting node = nullptr; } else if (!m_downstreamEnd.anchorNode()->isDescendantOf(node.get())) { - RefPtrWillBeRawPtr<Node> nextNode = NodeTraversal::nextSkippingChildren(*node); + RawPtr<Node> nextNode = NodeTraversal::nextSkippingChildren(*node); // if we just removed a node from the end container, update end position so the // check above will work updatePositionForNodeRemoval(m_downstreamEnd, *node); @@ -721,7 +721,7 @@ if (m_endTableRow && m_endTableRow->inDocument() && m_endTableRow != m_startTableRow) { Node* row = m_endTableRow->previousSibling(); while (row && row != m_startTableRow) { - RefPtrWillBeRawPtr<Node> previousRow = row->previousSibling(); + RawPtr<Node> previousRow = row->previousSibling(); if (isTableRowEmpty(row)) { // Use a raw removeNode, instead of DeleteSelectionCommand's, // because that won't remove rows, it only empties them in @@ -738,7 +738,7 @@ if (m_startTableRow && m_startTableRow->inDocument() && m_startTableRow != m_endTableRow) { Node* row = m_startTableRow->nextSibling(); while (row && row != m_endTableRow) { - RefPtrWillBeRawPtr<Node> nextRow = row->nextSibling(); + RawPtr<Node> nextRow = row->nextSibling(); if (isTableRowEmpty(row)) { CompositeEditCommand::removeNode(row, editingState); if (editingState->isAborted()) @@ -906,7 +906,7 @@ m_needPlaceholder = hasPlaceholder && lineBreakBeforeStart && !lineBreakAtEndOfSelectionToDelete; } - RefPtrWillBeRawPtr<HTMLBRElement> placeholder = m_needPlaceholder ? HTMLBRElement::create(document()) : nullptr; + RawPtr<HTMLBRElement> placeholder = m_needPlaceholder ? HTMLBRElement::create(document()) : nullptr; if (placeholder) { if (m_sanitizeMarkup) {
diff --git a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.h b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.h index a87e80f..ca95f512 100644 --- a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.h
@@ -35,13 +35,13 @@ class DeleteSelectionCommand final : public CompositeEditCommand { public: - static PassRefPtrWillBeRawPtr<DeleteSelectionCommand> create(Document& document, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = false, bool sanitizeMarkup = true) + static RawPtr<DeleteSelectionCommand> create(Document& document, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = false, bool sanitizeMarkup = true) { - return adoptRefWillBeNoop(new DeleteSelectionCommand(document, smartDelete, mergeBlocksAfterDelete, expandForSpecialElements, sanitizeMarkup)); + return new DeleteSelectionCommand(document, smartDelete, mergeBlocksAfterDelete, expandForSpecialElements, sanitizeMarkup); } - static PassRefPtrWillBeRawPtr<DeleteSelectionCommand> create(const VisibleSelection& selection, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = false, bool sanitizeMarkup = true) + static RawPtr<DeleteSelectionCommand> create(const VisibleSelection& selection, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = false, bool sanitizeMarkup = true) { - return adoptRefWillBeNoop(new DeleteSelectionCommand(selection, smartDelete, mergeBlocksAfterDelete, expandForSpecialElements, sanitizeMarkup)); + return new DeleteSelectionCommand(selection, smartDelete, mergeBlocksAfterDelete, expandForSpecialElements, sanitizeMarkup); } DECLARE_VIRTUAL_TRACE(); @@ -67,8 +67,8 @@ void calculateTypingStyleAfterDelete(); void clearTransientState(); void makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss(EditingState*); - void removeNode(PassRefPtrWillBeRawPtr<Node>, EditingState*, ShouldAssumeContentIsAlwaysEditable = DoNotAssumeContentIsAlwaysEditable) override; - void deleteTextFromNode(PassRefPtrWillBeRawPtr<Text>, unsigned, unsigned) override; + void removeNode(RawPtr<Node>, EditingState*, ShouldAssumeContentIsAlwaysEditable = DoNotAssumeContentIsAlwaysEditable) override; + void deleteTextFromNode(RawPtr<Text>, unsigned, unsigned) override; void removeRedundantBlocks(EditingState*); bool m_hasSelectionToDelete; @@ -89,15 +89,15 @@ Position m_endingPosition; Position m_leadingWhitespace; Position m_trailingWhitespace; - RefPtrWillBeMember<Node> m_startBlock; - RefPtrWillBeMember<Node> m_endBlock; - RefPtrWillBeMember<EditingStyle> m_typingStyle; - RefPtrWillBeMember<EditingStyle> m_deleteIntoBlockquoteStyle; - RefPtrWillBeMember<Element> m_startRoot; - RefPtrWillBeMember<Element> m_endRoot; - RefPtrWillBeMember<HTMLTableRowElement> m_startTableRow; - RefPtrWillBeMember<HTMLTableRowElement> m_endTableRow; - RefPtrWillBeMember<Node> m_temporaryPlaceholder; + Member<Node> m_startBlock; + Member<Node> m_endBlock; + Member<EditingStyle> m_typingStyle; + Member<EditingStyle> m_deleteIntoBlockquoteStyle; + Member<Element> m_startRoot; + Member<Element> m_endRoot; + Member<HTMLTableRowElement> m_startTableRow; + Member<HTMLTableRowElement> m_endTableRow; + Member<Node> m_temporaryPlaceholder; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/commands/EditCommand.h b/third_party/WebKit/Source/core/editing/commands/EditCommand.h index 18a3b11..562137c6 100644 --- a/third_party/WebKit/Source/core/editing/commands/EditCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/EditCommand.h
@@ -36,7 +36,7 @@ class Document; class EditingState; -class EditCommand : public RefCountedWillBeGarbageCollectedFinalized<EditCommand> { +class EditCommand : public GarbageCollectedFinalized<EditCommand> { public: virtual ~EditCommand(); @@ -71,10 +71,10 @@ static bool isRenderedCharacter(const Position&); private: - RefPtrWillBeMember<Document> m_document; + Member<Document> m_document; VisibleSelection m_startingSelection; VisibleSelection m_endingSelection; - RawPtrWillBeMember<CompositeEditCommand> m_parent; + Member<CompositeEditCommand> m_parent; }; enum ShouldAssumeContentIsAlwaysEditable {
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp index ede33f9..587d7ab 100644 --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -122,14 +122,14 @@ static bool executeApplyStyle(LocalFrame& frame, EditorCommandSource source, EditAction action, CSSPropertyID propertyID, const String& propertyValue) { - RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); + RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); style->setProperty(propertyID, propertyValue); return applyCommandToFrame(frame, source, action, style.get()); } static bool executeApplyStyle(LocalFrame& frame, EditorCommandSource source, EditAction action, CSSPropertyID propertyID, CSSValueID propertyValue) { - RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); + RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); style->setProperty(propertyID, propertyValue); return applyCommandToFrame(frame, source, action, style.get()); } @@ -139,14 +139,14 @@ // until https://bugs.webkit.org/show_bug.cgi?id=27818 is resolved. static bool executeToggleStyleInList(LocalFrame& frame, EditorCommandSource source, EditAction action, CSSPropertyID propertyID, CSSValue* value) { - RefPtrWillBeRawPtr<EditingStyle> selectionStyle = EditingStyle::styleAtSelectionStart(frame.selection().selection()); + RawPtr<EditingStyle> selectionStyle = EditingStyle::styleAtSelectionStart(frame.selection().selection()); if (!selectionStyle || !selectionStyle->style()) return false; - RefPtrWillBeRawPtr<CSSValue> selectedCSSValue = selectionStyle->style()->getPropertyCSSValue(propertyID); + RawPtr<CSSValue> selectedCSSValue = selectionStyle->style()->getPropertyCSSValue(propertyID); String newStyle("none"); if (selectedCSSValue->isValueList()) { - RefPtrWillBeRawPtr<CSSValueList> selectedCSSValueList = toCSSValueList(selectedCSSValue.get()); + RawPtr<CSSValueList> selectedCSSValueList = toCSSValueList(selectedCSSValue.get()); if (!selectedCSSValueList->removeAll(value)) selectedCSSValueList->append(value); if (selectedCSSValueList->length()) @@ -157,7 +157,7 @@ } // FIXME: We shouldn't be having to convert new style into text. We should have setPropertyCSSValue. - RefPtrWillBeRawPtr<MutableStylePropertySet> newMutableStyle = MutableStylePropertySet::create(HTMLQuirksMode); + RawPtr<MutableStylePropertySet> newMutableStyle = MutableStylePropertySet::create(HTMLQuirksMode); newMutableStyle->setProperty(propertyID, newStyle); return applyCommandToFrame(frame, source, action, newMutableStyle.get()); } @@ -174,13 +174,13 @@ else styleIsPresent = frame.editor().selectionHasStyle(propertyID, onValue) == TrueTriState; - RefPtrWillBeRawPtr<EditingStyle> style = EditingStyle::create(propertyID, styleIsPresent ? offValue : onValue); + RawPtr<EditingStyle> style = EditingStyle::create(propertyID, styleIsPresent ? offValue : onValue); return applyCommandToFrame(frame, source, action, style->style()); } static bool executeApplyParagraphStyle(LocalFrame& frame, EditorCommandSource source, EditAction action, CSSPropertyID propertyID, const String& propertyValue) { - RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); + RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); style->setProperty(propertyID, propertyValue); // FIXME: We don't call shouldApplyStyle when the source is DOM; is there a good reason for that? switch (source) { @@ -195,16 +195,16 @@ return false; } -static bool executeInsertFragment(LocalFrame& frame, PassRefPtrWillBeRawPtr<DocumentFragment> fragment) +static bool executeInsertFragment(LocalFrame& frame, RawPtr<DocumentFragment> fragment) { ASSERT(frame.document()); return ReplaceSelectionCommand::create(*frame.document(), fragment, ReplaceSelectionCommand::PreventNesting, EditActionUnspecified)->apply(); } -static bool executeInsertElement(LocalFrame& frame, PassRefPtrWillBeRawPtr<HTMLElement> content) +static bool executeInsertElement(LocalFrame& frame, RawPtr<HTMLElement> content) { ASSERT(frame.document()); - RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(*frame.document()); + RawPtr<DocumentFragment> fragment = DocumentFragment::create(*frame.document()); TrackExceptionState exceptionState; fragment->appendChild(content, exceptionState); if (exceptionState.hadException()) @@ -481,7 +481,7 @@ QualifiedName qualifiedTagName(prefix, localName, xhtmlNamespaceURI); ASSERT(frame.document()); - RefPtrWillBeRawPtr<FormatBlockCommand> command = FormatBlockCommand::create(*frame.document(), qualifiedTagName); + RawPtr<FormatBlockCommand> command = FormatBlockCommand::create(*frame.document(), qualifiedTagName); command->apply(); return command->didApply(); } @@ -527,7 +527,7 @@ static bool executeInsertHorizontalRule(LocalFrame& frame, Event*, EditorCommandSource, const String& value) { ASSERT(frame.document()); - RefPtrWillBeRawPtr<HTMLHRElement> rule = HTMLHRElement::create(*frame.document()); + RawPtr<HTMLHRElement> rule = HTMLHRElement::create(*frame.document()); if (!value.isEmpty()) rule->setIdAttribute(AtomicString(value)); return executeInsertElement(frame, rule.release()); @@ -542,7 +542,7 @@ static bool executeInsertImage(LocalFrame& frame, Event*, EditorCommandSource, const String& value) { ASSERT(frame.document()); - RefPtrWillBeRawPtr<HTMLImageElement> image = HTMLImageElement::create(*frame.document()); + RawPtr<HTMLImageElement> image = HTMLImageElement::create(*frame.document()); if (!value.isEmpty()) image->setSrc(value); return executeInsertElement(frame, image.release()); @@ -628,7 +628,7 @@ static bool executeMakeTextWritingDirectionLeftToRight(LocalFrame& frame, Event*, EditorCommandSource, const String&) { - RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); + RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); style->setProperty(CSSPropertyUnicodeBidi, CSSValueIsolate); style->setProperty(CSSPropertyDirection, CSSValueLtr); frame.editor().applyStyle(style.get(), EditActionSetWritingDirection); @@ -637,7 +637,7 @@ static bool executeMakeTextWritingDirectionNatural(LocalFrame& frame, Event*, EditorCommandSource, const String&) { - RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); + RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); style->setProperty(CSSPropertyUnicodeBidi, CSSValueNormal); frame.editor().applyStyle(style.get(), EditActionSetWritingDirection); return true; @@ -645,7 +645,7 @@ static bool executeMakeTextWritingDirectionRightToLeft(LocalFrame& frame, Event*, EditorCommandSource, const String&) { - RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); + RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode); style->setProperty(CSSPropertyUnicodeBidi, CSSValueIsolate); style->setProperty(CSSPropertyDirection, CSSValueRtl); frame.editor().applyStyle(style.get(), EditActionSetWritingDirection); @@ -1103,7 +1103,7 @@ static bool executeStrikethrough(LocalFrame& frame, Event*, EditorCommandSource source, const String&) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> lineThrough = CSSPrimitiveValue::createIdentifier(CSSValueLineThrough); + RawPtr<CSSPrimitiveValue> lineThrough = CSSPrimitiveValue::createIdentifier(CSSValueLineThrough); return executeToggleStyleInList(frame, source, EditActionUnderline, CSSPropertyWebkitTextDecorationsInEffect, lineThrough.get()); } @@ -1158,7 +1158,7 @@ static bool executeUnderline(LocalFrame& frame, Event*, EditorCommandSource source, const String&) { - RefPtrWillBeRawPtr<CSSPrimitiveValue> underline = CSSPrimitiveValue::createIdentifier(CSSValueUnderline); + RawPtr<CSSPrimitiveValue> underline = CSSPrimitiveValue::createIdentifier(CSSValueUnderline); return executeToggleStyleInList(frame, source, EditActionUnderline, CSSPropertyWebkitTextDecorationsInEffect, underline.get()); } @@ -1756,7 +1756,7 @@ { } -Editor::Command::Command(const EditorInternalCommand* command, EditorCommandSource source, PassRefPtrWillBeRawPtr<LocalFrame> frame) +Editor::Command::Command(const EditorInternalCommand* command, EditorCommandSource source, RawPtr<LocalFrame> frame) : m_command(command) , m_source(source) , m_frame(command ? frame : nullptr)
diff --git a/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp b/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp index c2885ad..97cf3ee4 100644 --- a/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp
@@ -66,7 +66,7 @@ m_didApply = true; } -void FormatBlockCommand::formatRange(const Position& start, const Position& end, const Position& endOfSelection, RefPtrWillBeRawPtr<HTMLElement>& blockElement, EditingState* editingState) +void FormatBlockCommand::formatRange(const Position& start, const Position& end, const Position& endOfSelection, RawPtr<HTMLElement>& blockElement, EditingState* editingState) { Element* refElement = enclosingBlockFlowElement(createVisiblePosition(end)); Element* root = rootEditableElementOf(start); @@ -75,9 +75,9 @@ return; Node* nodeToSplitTo = enclosingBlockToSplitTreeTo(start.anchorNode()); - RefPtrWillBeRawPtr<Node> outerBlock = (start.anchorNode() == nodeToSplitTo) ? start.anchorNode() : splitTreeToNode(start.anchorNode(), nodeToSplitTo).get(); - RefPtrWillBeRawPtr<Node> nodeAfterInsertionPosition = outerBlock; - RefPtrWillBeRawPtr<Range> range = Range::create(document(), start, endOfSelection); + RawPtr<Node> outerBlock = (start.anchorNode() == nodeToSplitTo) ? start.anchorNode() : splitTreeToNode(start.anchorNode(), nodeToSplitTo).get(); + RawPtr<Node> nodeAfterInsertionPosition = outerBlock; + RawPtr<Range> range = Range::create(document(), start, endOfSelection); if (isElementForFormatBlock(refElement->tagQName()) && createVisiblePosition(start).deepEquivalent() == startOfBlock(createVisiblePosition(start)).deepEquivalent() && (createVisiblePosition(end).deepEquivalent() == endOfBlock(createVisiblePosition(end)).deepEquivalent() || isNodeVisiblyContainedWithin(*refElement, *range))
diff --git a/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.h b/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.h index 71dc422..31e64bc 100644 --- a/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.h
@@ -40,9 +40,9 @@ class FormatBlockCommand final : public ApplyBlockElementCommand { public: - static PassRefPtrWillBeRawPtr<FormatBlockCommand> create(Document& document, const QualifiedName& tagName) + static RawPtr<FormatBlockCommand> create(Document& document, const QualifiedName& tagName) { - return adoptRefWillBeNoop(new FormatBlockCommand(document, tagName)); + return new FormatBlockCommand(document, tagName); } bool preservesTypingStyle() const override { return true; } @@ -54,7 +54,7 @@ FormatBlockCommand(Document&, const QualifiedName& tagName); void formatSelection(const VisiblePosition& startOfSelection, const VisiblePosition& endOfSelection, EditingState*) override; - void formatRange(const Position& start, const Position& end, const Position& endOfSelection, RefPtrWillBeRawPtr<HTMLElement>&, EditingState*) override; + void formatRange(const Position& start, const Position& end, const Position& endOfSelection, RawPtr<HTMLElement>&, EditingState*) override; EditAction editingAction() const override { return EditActionFormatBlock; } bool m_didApply;
diff --git a/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp b/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp index 0e2eb49..34f6042 100644 --- a/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp
@@ -69,26 +69,26 @@ bool IndentOutdentCommand::tryIndentingAsListItem(const Position& start, const Position& end, EditingState* editingState) { // If our selection is not inside a list, bail out. - RefPtrWillBeRawPtr<Node> lastNodeInSelectedParagraph = start.anchorNode(); - RefPtrWillBeRawPtr<HTMLElement> listElement = enclosingList(lastNodeInSelectedParagraph.get()); + RawPtr<Node> lastNodeInSelectedParagraph = start.anchorNode(); + RawPtr<HTMLElement> listElement = enclosingList(lastNodeInSelectedParagraph.get()); if (!listElement) return false; // Find the block that we want to indent. If it's not a list item (e.g., a div inside a list item), we bail out. - RefPtrWillBeRawPtr<Element> selectedListItem = enclosingBlock(lastNodeInSelectedParagraph.get()); + RawPtr<Element> selectedListItem = enclosingBlock(lastNodeInSelectedParagraph.get()); // FIXME: we need to deal with the case where there is no li (malformed HTML) if (!isHTMLLIElement(selectedListItem)) return false; // FIXME: previousElementSibling does not ignore non-rendered content like <span></span>. Should we? - RefPtrWillBeRawPtr<Element> previousList = ElementTraversal::previousSibling(*selectedListItem); - RefPtrWillBeRawPtr<Element> nextList = ElementTraversal::nextSibling(*selectedListItem); + RawPtr<Element> previousList = ElementTraversal::previousSibling(*selectedListItem); + RawPtr<Element> nextList = ElementTraversal::nextSibling(*selectedListItem); // We should calculate visible range in list item because inserting new // list element will change visibility of list item, e.g. :first-child // CSS selector. - RefPtrWillBeRawPtr<HTMLElement> newList = toHTMLElement(document().createElement(listElement->tagQName(), false).get()); + RawPtr<HTMLElement> newList = toHTMLElement(document().createElement(listElement->tagQName(), false).get()); insertNodeBefore(newList, selectedListItem.get(), editingState); if (editingState->isAborted()) return false; @@ -121,7 +121,7 @@ return true; } -void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Position& end, RefPtrWillBeRawPtr<HTMLElement>& targetBlockquote, EditingState* editingState) +void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Position& end, RawPtr<HTMLElement>& targetBlockquote, EditingState* editingState) { Element* enclosingCell = toElement(enclosingNodeOfType(start, &isTableCell)); Element* elementToSplitTo; @@ -135,7 +135,7 @@ if (!elementToSplitTo) return; - RefPtrWillBeRawPtr<Node> outerBlock = (start.computeContainerNode() == elementToSplitTo) ? start.computeContainerNode() : splitTreeToNode(start.computeContainerNode(), elementToSplitTo).get(); + RawPtr<Node> outerBlock = (start.computeContainerNode() == elementToSplitTo) ? start.computeContainerNode() : splitTreeToNode(start.computeContainerNode(), elementToSplitTo).get(); VisiblePosition startOfContents = createVisiblePosition(start); if (!targetBlockquote) { @@ -213,7 +213,7 @@ insertNodeAt(HTMLBRElement::create(document()), visibleEndOfParagraph.deepEquivalent(), editingState); return; } - RefPtrWillBeRawPtr<Node> splitBlockquoteNode = enclosingElement; + RawPtr<Node> splitBlockquoteNode = enclosingElement; if (Element* enclosingBlockFlow = enclosingBlock(visibleStartOfParagraph.deepEquivalent().anchorNode())) { if (enclosingBlockFlow != enclosingElement) { splitBlockquoteNode = splitTreeToNode(enclosingBlockFlow, enclosingElement, true); @@ -227,7 +227,7 @@ VisiblePosition endOfParagraphToMove = endOfParagraph(visibleEndOfParagraph); if (startOfParagraphToMove.isNull() || endOfParagraphToMove.isNull()) return; - RefPtrWillBeRawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); + RawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); insertNodeBefore(placeholder, splitBlockquoteNode, editingState); if (editingState->isAborted()) return; @@ -281,7 +281,7 @@ outdentRegion(startOfSelection, endOfSelection, editingState); } -void IndentOutdentCommand::formatRange(const Position& start, const Position& end, const Position&, RefPtrWillBeRawPtr<HTMLElement>& blockquoteForNextIndent, EditingState* editingState) +void IndentOutdentCommand::formatRange(const Position& start, const Position& end, const Position&, RawPtr<HTMLElement>& blockquoteForNextIndent, EditingState* editingState) { bool indentingAsListItemResult = tryIndentingAsListItem(start, end, editingState); if (editingState->isAborted())
diff --git a/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.h b/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.h index 45fe406a..013bdfc 100644 --- a/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.h
@@ -34,9 +34,9 @@ class IndentOutdentCommand final : public ApplyBlockElementCommand { public: enum EIndentType { Indent, Outdent }; - static PassRefPtrWillBeRawPtr<IndentOutdentCommand> create(Document& document, EIndentType type) + static RawPtr<IndentOutdentCommand> create(Document& document, EIndentType type) { - return adoptRefWillBeNoop(new IndentOutdentCommand(document, type)); + return new IndentOutdentCommand(document, type); } bool preservesTypingStyle() const override { return true; } @@ -49,10 +49,10 @@ void outdentRegion(const VisiblePosition&, const VisiblePosition&, EditingState*); void outdentParagraph(EditingState*); bool tryIndentingAsListItem(const Position&, const Position&, EditingState*); - void indentIntoBlockquote(const Position&, const Position&, RefPtrWillBeRawPtr<HTMLElement>&, EditingState*); + void indentIntoBlockquote(const Position&, const Position&, RawPtr<HTMLElement>&, EditingState*); void formatSelection(const VisiblePosition& startOfSelection, const VisiblePosition& endOfSelection, EditingState*) override; - void formatRange(const Position& start, const Position& end, const Position& endOfSelection, RefPtrWillBeRawPtr<HTMLElement>& blockquoteForNextIndent, EditingState*) override; + void formatRange(const Position& start, const Position& end, const Position& endOfSelection, RawPtr<HTMLElement>& blockquoteForNextIndent, EditingState*) override; EIndentType m_typeOfAction; };
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.cpp index f689f5af..552d3ff 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.cpp
@@ -33,7 +33,7 @@ namespace blink { -InsertIntoTextNodeCommand::InsertIntoTextNodeCommand(PassRefPtrWillBeRawPtr<Text> node, unsigned offset, const String& text) +InsertIntoTextNodeCommand::InsertIntoTextNodeCommand(RawPtr<Text> node, unsigned offset, const String& text) : SimpleEditCommand(node->document()) , m_node(node) , m_offset(offset)
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.h b/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.h index 963192c3..9a1f291c9 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.h
@@ -34,20 +34,20 @@ class InsertIntoTextNodeCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<InsertIntoTextNodeCommand> create(PassRefPtrWillBeRawPtr<Text> node, unsigned offset, const String& text) + static RawPtr<InsertIntoTextNodeCommand> create(RawPtr<Text> node, unsigned offset, const String& text) { - return adoptRefWillBeNoop(new InsertIntoTextNodeCommand(node, offset, text)); + return new InsertIntoTextNodeCommand(node, offset, text); } DECLARE_VIRTUAL_TRACE(); private: - InsertIntoTextNodeCommand(PassRefPtrWillBeRawPtr<Text> node, unsigned offset, const String& text); + InsertIntoTextNodeCommand(RawPtr<Text> node, unsigned offset, const String& text); void doApply(EditingState*) override; void doUnapply() override; - RefPtrWillBeMember<Text> m_node; + Member<Text> m_node; unsigned m_offset; String m_text; };
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp index 44c6fd9..7abb0c5 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp
@@ -87,7 +87,7 @@ pos = positionOutsideTabSpan(pos); - RefPtrWillBeRawPtr<Node> nodeToInsert = nullptr; + RawPtr<Node> nodeToInsert = nullptr; if (shouldUseBreakElement(pos)) nodeToInsert = HTMLBRElement::create(document()); else @@ -103,7 +103,7 @@ return; if (needExtraLineBreak) { - RefPtrWillBeRawPtr<Node> extraNode; + RawPtr<Node> extraNode; // TODO(tkent): Can we remove HTMLTextFormControlElement dependency? if (HTMLTextFormControlElement* textControl = enclosingTextFormControl(nodeToInsert.get())) extraNode = textControl->createPlaceholderBreakElement(); @@ -159,7 +159,7 @@ if (textNode->inDocument()) { insertTextIntoNode(textNode, 0, nonBreakingSpaceString()); } else { - RefPtrWillBeRawPtr<Text> nbspNode = document().createTextNode(nonBreakingSpaceString()); + RawPtr<Text> nbspNode = document().createTextNode(nonBreakingSpaceString()); insertNodeAt(nbspNode.get(), positionBeforeTextNode, editingState); if (editingState->isAborted()) return; @@ -172,7 +172,7 @@ // Handle the case where there is a typing style. - RefPtrWillBeRawPtr<EditingStyle> typingStyle = document().frame()->selection().typingStyle(); + RawPtr<EditingStyle> typingStyle = document().frame()->selection().typingStyle(); if (typingStyle && !typingStyle->isEmpty()) { // Apply the typing style to the inserted line break, so that if the selection
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.h b/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.h index 16b32e0b..a995083 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.h
@@ -32,9 +32,9 @@ class InsertLineBreakCommand final : public CompositeEditCommand { public: - static PassRefPtrWillBeRawPtr<InsertLineBreakCommand> create(Document& document) + static RawPtr<InsertLineBreakCommand> create(Document& document) { - return adoptRefWillBeNoop(new InsertLineBreakCommand(document)); + return new InsertLineBreakCommand(document); } private:
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp index 5010d235..35f06d1 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
@@ -52,7 +52,7 @@ HTMLUListElement* InsertListCommand::fixOrphanedListChild(Node* node, EditingState* editingState) { - RefPtrWillBeRawPtr<HTMLUListElement> listElement = HTMLUListElement::create(document()); + RawPtr<HTMLUListElement> listElement = HTMLUListElement::create(document()); insertNodeBefore(listElement, node, editingState); if (editingState->isAborted()) return nullptr; @@ -65,9 +65,9 @@ return listElement.get(); } -PassRefPtrWillBeRawPtr<HTMLElement> InsertListCommand::mergeWithNeighboringLists(PassRefPtrWillBeRawPtr<HTMLElement> passedList, EditingState* editingState) +RawPtr<HTMLElement> InsertListCommand::mergeWithNeighboringLists(RawPtr<HTMLElement> passedList, EditingState* editingState) { - RefPtrWillBeRawPtr<HTMLElement> list = passedList; + RawPtr<HTMLElement> list = passedList; Element* previousList = ElementTraversal::previousSibling(*list); if (canMergeLists(previousList, list.get())) { mergeIdenticalElements(previousList, list, editingState); @@ -82,7 +82,7 @@ if (!nextSibling || !nextSibling->isHTMLElement()) return list.release(); - RefPtrWillBeRawPtr<HTMLElement> nextList = toHTMLElement(nextSibling); + RawPtr<HTMLElement> nextList = toHTMLElement(nextSibling); if (canMergeLists(list.get(), nextList.get())) { mergeIdenticalElements(list, nextList, editingState); if (editingState->isAborted()) @@ -155,9 +155,9 @@ VisiblePosition endOfSelection = selection.visibleEnd(); VisiblePosition startOfLastParagraph = startOfParagraph(endOfSelection, CanSkipOverEditingBoundary); - RefPtrWillBeRawPtr<Range> currentSelection = firstRangeOf(endingSelection()); - RefPtrWillBeRawPtr<ContainerNode> scopeForStartOfSelection = nullptr; - RefPtrWillBeRawPtr<ContainerNode> scopeForEndOfSelection = nullptr; + RawPtr<Range> currentSelection = firstRangeOf(endingSelection()); + RawPtr<ContainerNode> scopeForStartOfSelection = nullptr; + RawPtr<ContainerNode> scopeForEndOfSelection = nullptr; // FIXME: This is an inefficient way to keep selection alive because // indexForVisiblePosition walks from the beginning of the document to the // endOfSelection everytime this code is executed. But not using index is hard @@ -234,7 +234,7 @@ if (!listChildNode->parentNode()->hasEditableStyle()) return false; // Remove the list child. - RefPtrWillBeRawPtr<HTMLElement> listElement = enclosingList(listChildNode); + RawPtr<HTMLElement> listElement = enclosingList(listChildNode); if (listElement) { if (!listElement->hasEditableStyle()) { // Since, |listElement| is uneditable, we can't move |listChild| @@ -273,7 +273,7 @@ bool rangeStartIsInList = visiblePositionBeforeNode(*listElement).deepEquivalent() == createVisiblePosition(currentSelection.startPosition()).deepEquivalent(); bool rangeEndIsInList = visiblePositionAfterNode(*listElement).deepEquivalent() == createVisiblePosition(currentSelection.endPosition()).deepEquivalent(); - RefPtrWillBeRawPtr<HTMLElement> newList = createHTMLElement(document(), listTag); + RawPtr<HTMLElement> newList = createHTMLElement(document(), listTag); insertNodeBefore(newList, listElement, editingState); if (editingState->isAborted()) return false; @@ -347,8 +347,8 @@ } // When removing a list, we must always create a placeholder to act as a point of insertion // for the list content being removed. - RefPtrWillBeRawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); - RefPtrWillBeRawPtr<HTMLElement> elementToInsert = placeholder; + RawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); + RawPtr<HTMLElement> elementToInsert = placeholder; // If the content of the list item will be moved into another list, put it in a list item // so that we don't create an orphaned list child. if (enclosingList(listElement)) { @@ -418,7 +418,7 @@ HTMLElement* const nextList = adjacentEnclosingList(start, nextPositionOf(end, CannotCrossEditingBoundary), listTag); if (previousList || nextList) { // Place list item into adjoining lists. - const RefPtrWillBeRawPtr<HTMLLIElement> listItemElement = HTMLLIElement::create(document()); + const RawPtr<HTMLLIElement> listItemElement = HTMLLIElement::create(document()); if (previousList) appendNode(listItemElement, previousList, editingState); else @@ -443,7 +443,7 @@ // a placeholder and then recompute start and end. Position startPos = start.deepEquivalent(); if (start.deepEquivalent() == end.deepEquivalent() && isEnclosingBlock(start.deepEquivalent().anchorNode())) { - const RefPtrWillBeRawPtr<HTMLBRElement> placeholder = insertBlockPlaceholder(startPos, editingState); + const RawPtr<HTMLBRElement> placeholder = insertBlockPlaceholder(startPos, editingState); if (editingState->isAborted()) return; startPos = Position::beforeNode(placeholder.get()); @@ -460,11 +460,11 @@ if (isHTMLLIElement(listChild)) insertionPos = positionInParentBeforeNode(*listChild); - const RefPtrWillBeRawPtr<HTMLElement> listElement = createHTMLElement(document(), listTag); + const RawPtr<HTMLElement> listElement = createHTMLElement(document(), listTag); insertNodeAt(listElement, insertionPos, editingState); if (editingState->isAborted()) return; - const RefPtrWillBeRawPtr<HTMLLIElement> listItemElement = HTMLLIElement::create(document()); + const RawPtr<HTMLLIElement> listItemElement = HTMLLIElement::create(document()); appendNode(listItemElement, listElement, editingState); if (editingState->isAborted()) return; @@ -483,10 +483,10 @@ mergeWithNeighboringLists(listElement, editingState); } -void InsertListCommand::moveParagraphOverPositionIntoEmptyListItem(const VisiblePosition& pos, PassRefPtrWillBeRawPtr<HTMLLIElement> listItemElement, EditingState* editingState) +void InsertListCommand::moveParagraphOverPositionIntoEmptyListItem(const VisiblePosition& pos, RawPtr<HTMLLIElement> listItemElement, EditingState* editingState) { ASSERT(!listItemElement->hasChildren()); - const RefPtrWillBeRawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); + const RawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); appendNode(placeholder, listItemElement, editingState); if (editingState->isAborted()) return;
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.h b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.h index 7385533..4beb6f3 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.h
@@ -37,9 +37,9 @@ public: enum Type { OrderedList, UnorderedList }; - static PassRefPtrWillBeRawPtr<InsertListCommand> create(Document& document, Type listType) + static RawPtr<InsertListCommand> create(Document& document, Type listType) { - return adoptRefWillBeNoop(new InsertListCommand(document, listType)); + return new InsertListCommand(document, listType); } bool preservesTypingStyle() const override { return true; } @@ -54,11 +54,11 @@ HTMLUListElement* fixOrphanedListChild(Node*, EditingState*); bool selectionHasListOfType(const VisibleSelection&, const HTMLQualifiedName&); - PassRefPtrWillBeRawPtr<HTMLElement> mergeWithNeighboringLists(PassRefPtrWillBeRawPtr<HTMLElement>, EditingState*); + RawPtr<HTMLElement> mergeWithNeighboringLists(RawPtr<HTMLElement>, EditingState*); bool doApplyForSingleParagraph(bool forceCreateList, const HTMLQualifiedName&, Range& currentSelection, EditingState*); void unlistifyParagraph(const VisiblePosition& originalStart, HTMLElement* listNode, Node* listChildNode, EditingState*); void listifyParagraph(const VisiblePosition& originalStart, const HTMLQualifiedName& listTag, EditingState*); - void moveParagraphOverPositionIntoEmptyListItem(const VisiblePosition&, PassRefPtrWillBeRawPtr<HTMLLIElement>, EditingState*); + void moveParagraphOverPositionIntoEmptyListItem(const VisiblePosition&, RawPtr<HTMLLIElement>, EditingState*); Type m_type; };
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.cpp index d1b6460..7c301e0 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.cpp
@@ -29,7 +29,7 @@ namespace blink { -InsertNodeBeforeCommand::InsertNodeBeforeCommand(PassRefPtrWillBeRawPtr<Node> insertChild, PassRefPtrWillBeRawPtr<Node> refChild, +InsertNodeBeforeCommand::InsertNodeBeforeCommand(RawPtr<Node> insertChild, RawPtr<Node> refChild, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) : SimpleEditCommand(refChild->document()) , m_insertChild(insertChild)
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.h b/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.h index 4c8569e..55dc7c79 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.h
@@ -32,22 +32,22 @@ class InsertNodeBeforeCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<InsertNodeBeforeCommand> create(PassRefPtrWillBeRawPtr<Node> childToInsert, PassRefPtrWillBeRawPtr<Node> childToInsertBefore, + static RawPtr<InsertNodeBeforeCommand> create(RawPtr<Node> childToInsert, RawPtr<Node> childToInsertBefore, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) { - return adoptRefWillBeNoop(new InsertNodeBeforeCommand(childToInsert, childToInsertBefore, shouldAssumeContentIsAlwaysEditable)); + return new InsertNodeBeforeCommand(childToInsert, childToInsertBefore, shouldAssumeContentIsAlwaysEditable); } DECLARE_VIRTUAL_TRACE(); private: - InsertNodeBeforeCommand(PassRefPtrWillBeRawPtr<Node> childToInsert, PassRefPtrWillBeRawPtr<Node> childToInsertBefore, ShouldAssumeContentIsAlwaysEditable); + InsertNodeBeforeCommand(RawPtr<Node> childToInsert, RawPtr<Node> childToInsertBefore, ShouldAssumeContentIsAlwaysEditable); void doApply(EditingState*) override; void doUnapply() override; - RefPtrWillBeMember<Node> m_insertChild; - RefPtrWillBeMember<Node> m_refChild; + Member<Node> m_insertChild; + Member<Node> m_refChild; ShouldAssumeContentIsAlwaysEditable m_shouldAssumeContentIsAlwaysEditable; };
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp index 6b2719db..2fdfe657 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp
@@ -122,7 +122,7 @@ || enclosingBlock->hasTagName(h5Tag); } -void InsertParagraphSeparatorCommand::getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, WillBeHeapVector<RefPtrWillBeMember<Element>>& ancestors) +void InsertParagraphSeparatorCommand::getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, HeapVector<Member<Element>>& ancestors) { ancestors.clear(); @@ -133,12 +133,12 @@ } } -PassRefPtrWillBeRawPtr<Element> InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock(const WillBeHeapVector<RefPtrWillBeMember<Element>>& ancestors, PassRefPtrWillBeRawPtr<Element> blockToInsert, EditingState* editingState) +RawPtr<Element> InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock(const HeapVector<Member<Element>>& ancestors, RawPtr<Element> blockToInsert, EditingState* editingState) { // Make clones of ancestors in between the start node and the start block. - RefPtrWillBeRawPtr<Element> parent = blockToInsert; + RawPtr<Element> parent = blockToInsert; for (size_t i = ancestors.size(); i != 0; --i) { - RefPtrWillBeRawPtr<Element> child = ancestors[i - 1]->cloneElementWithoutChildren(); + RawPtr<Element> child = ancestors[i - 1]->cloneElementWithoutChildren(); // It should always be okay to remove id from the cloned elements, since the originals are not deleted. child->removeAttribute(idAttr); appendNode(child, parent, editingState); @@ -170,9 +170,9 @@ } // FIXME: The parentAnchoredEquivalent conversion needs to be moved into enclosingBlock. - RefPtrWillBeRawPtr<Element> startBlock = enclosingBlock(insertionPosition.parentAnchoredEquivalent().computeContainerNode()); + RawPtr<Element> startBlock = enclosingBlock(insertionPosition.parentAnchoredEquivalent().computeContainerNode()); Node* listChildNode = enclosingListChild(insertionPosition.parentAnchoredEquivalent().computeContainerNode()); - RefPtrWillBeRawPtr<HTMLElement> listChild = listChildNode && listChildNode->isHTMLElement() ? toHTMLElement(listChildNode) : 0; + RawPtr<HTMLElement> listChild = listChildNode && listChildNode->isHTMLElement() ? toHTMLElement(listChildNode) : 0; Position canonicalPos = createVisiblePosition(insertionPosition).deepEquivalent(); if (!startBlock || !startBlock->nonShadowBoundaryParentNode() @@ -217,7 +217,7 @@ bool nestNewBlock = false; // Create block to be inserted. - RefPtrWillBeRawPtr<Element> blockToInsert = nullptr; + RawPtr<Element> blockToInsert = nullptr; if (startBlock->isRootEditableElement()) { blockToInsert = createDefaultParagraphElement(document()); nestNewBlock = true; @@ -235,7 +235,7 @@ if (isFirstInBlock && !lineBreakExistsAtVisiblePosition(visiblePos)) { // The block is empty. Create an empty block to // represent the paragraph that we're leaving. - RefPtrWillBeRawPtr<HTMLElement> extraBlock = createDefaultParagraphElement(document()); + RawPtr<HTMLElement> extraBlock = createDefaultParagraphElement(document()); appendNode(extraBlock, startBlock, editingState); if (editingState->isAborted()) return; @@ -255,7 +255,7 @@ } if (listChild && listChild != startBlock) { - RefPtrWillBeRawPtr<Element> listChildToInsert = listChild->cloneElementWithoutChildren(); + RawPtr<Element> listChildToInsert = listChild->cloneElementWithoutChildren(); appendNode(blockToInsert, listChildToInsert.get(), editingState); if (editingState->isAborted()) return; @@ -274,9 +274,9 @@ // Recreate the same structure in the new paragraph. - WillBeHeapVector<RefPtrWillBeMember<Element>> ancestors; + HeapVector<Member<Element>> ancestors; getAncestorsInsideBlock(positionOutsideTabSpan(insertionPosition).anchorNode(), startBlock.get(), ancestors); - RefPtrWillBeRawPtr<Element> parent = cloneHierarchyUnderNewBlock(ancestors, blockToInsert, editingState); + RawPtr<Element> parent = cloneHierarchyUnderNewBlock(ancestors, blockToInsert, editingState); if (editingState->isAborted()) return; @@ -298,7 +298,7 @@ if (isFirstInBlock && !nestNewBlock) { if (listChild && listChild != startBlock) { - RefPtrWillBeRawPtr<Element> listChildToInsert = listChild->cloneElementWithoutChildren(); + RawPtr<Element> listChildToInsert = listChild->cloneElementWithoutChildren(); appendNode(blockToInsert, listChildToInsert.get(), editingState); if (editingState->isAborted()) return; @@ -330,13 +330,13 @@ // Recreate the same structure in the new paragraph. - WillBeHeapVector<RefPtrWillBeMember<Element>> ancestors; + HeapVector<Member<Element>> ancestors; insertionPosition = positionAvoidingSpecialElementBoundary(positionOutsideTabSpan(insertionPosition), editingState); if (editingState->isAborted()) return; getAncestorsInsideBlock(insertionPosition.anchorNode(), startBlock.get(), ancestors); - RefPtrWillBeRawPtr<Element> placeholder = cloneHierarchyUnderNewBlock(ancestors, blockToInsert, editingState); + RawPtr<Element> placeholder = cloneHierarchyUnderNewBlock(ancestors, blockToInsert, editingState); if (editingState->isAborted()) return; appendBlockPlaceholder(placeholder.release(), editingState); @@ -356,7 +356,7 @@ // it if visiblePos is at the start of a paragraph so that the // content will move down a line. if (isStartOfParagraph(visiblePos)) { - RefPtrWillBeRawPtr<HTMLBRElement> br = HTMLBRElement::create(document()); + RawPtr<HTMLBRElement> br = HTMLBRElement::create(document()); insertNodeAt(br.get(), insertionPosition, editingState); if (editingState->isAborted()) return; @@ -401,7 +401,7 @@ // Split at pos if in the middle of a text node. Position positionAfterSplit; if (insertionPosition.isOffsetInAnchor() && insertionPosition.computeContainerNode()->isTextNode()) { - RefPtrWillBeRawPtr<Text> textNode = toText(insertionPosition.computeContainerNode()); + RawPtr<Text> textNode = toText(insertionPosition.computeContainerNode()); int textOffset = insertionPosition.offsetInContainerNode(); bool atEnd = static_cast<unsigned>(textOffset) >= textNode->length(); if (textOffset > 0 && !atEnd) { @@ -420,7 +420,7 @@ if (nestNewBlock) { appendNode(blockToInsert.get(), startBlock, editingState); } else if (listChild && listChild != startBlock) { - RefPtrWillBeRawPtr<Element> listChildToInsert = listChild->cloneElementWithoutChildren(); + RawPtr<Element> listChildToInsert = listChild->cloneElementWithoutChildren(); appendNode(blockToInsert.get(), listChildToInsert.get(), editingState); if (editingState->isAborted()) return;
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.h b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.h index 86f0fdd..474041ca 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.h
@@ -34,9 +34,9 @@ class InsertParagraphSeparatorCommand final : public CompositeEditCommand { public: - static PassRefPtrWillBeRawPtr<InsertParagraphSeparatorCommand> create(Document& document, bool useDefaultParagraphElement = false, bool pasteBlockquoteIntoUnquotedArea = false) + static RawPtr<InsertParagraphSeparatorCommand> create(Document& document, bool useDefaultParagraphElement = false, bool pasteBlockquoteIntoUnquotedArea = false) { - return adoptRefWillBeNoop(new InsertParagraphSeparatorCommand(document, useDefaultParagraphElement, pasteBlockquoteIntoUnquotedArea)); + return new InsertParagraphSeparatorCommand(document, useDefaultParagraphElement, pasteBlockquoteIntoUnquotedArea); } DECLARE_VIRTUAL_TRACE(); @@ -48,14 +48,14 @@ void calculateStyleBeforeInsertion(const Position&); void applyStyleAfterInsertion(Element* originalEnclosingBlock, EditingState*); - void getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, WillBeHeapVector<RefPtrWillBeMember<Element>>& ancestors); - PassRefPtrWillBeRawPtr<Element> cloneHierarchyUnderNewBlock(const WillBeHeapVector<RefPtrWillBeMember<Element>>& ancestors, PassRefPtrWillBeRawPtr<Element> blockToInsert, EditingState*); + void getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, HeapVector<Member<Element>>& ancestors); + RawPtr<Element> cloneHierarchyUnderNewBlock(const HeapVector<Member<Element>>& ancestors, RawPtr<Element> blockToInsert, EditingState*); bool shouldUseDefaultParagraphElement(Element*) const; bool preservesTypingStyle() const override; - RefPtrWillBeMember<EditingStyle> m_style; + Member<EditingStyle> m_style; bool m_mustUseDefaultParagraphElement; bool m_pasteBlockquoteIntoUnquotedArea;
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp index 8bb607a..0960b60 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp
@@ -48,7 +48,7 @@ { Position pos = p; if (isTabHTMLSpanElementTextNode(pos.anchorNode())) { - RefPtrWillBeRawPtr<Text> textNode = document().createEditingTextNode(""); + RawPtr<Text> textNode = document().createEditingTextNode(""); insertNodeAtTabSpanPosition(textNode.get(), pos, editingState); if (editingState->isAborted()) return Position(); @@ -58,7 +58,7 @@ // Prepare for text input by looking at the specified position. // It may be necessary to insert a text node to receive characters. if (!pos.computeContainerNode()->isTextNode()) { - RefPtrWillBeRawPtr<Text> textNode = document().createEditingTextNode(""); + RawPtr<Text> textNode = document().createEditingTextNode(""); insertNodeAt(textNode.get(), pos, editingState); if (editingState->isAborted()) return Position(); @@ -106,7 +106,7 @@ Position start = endingSelection().start(); if (start.isNull() || !start.isOffsetInAnchor() || !start.computeContainerNode()->isTextNode()) return false; - RefPtrWillBeRawPtr<Text> textNode = toText(start.computeContainerNode()); + RawPtr<Text> textNode = toText(start.computeContainerNode()); if (!textNode) return false; @@ -210,7 +210,7 @@ ASSERT(startPosition.computeContainerNode()->isTextNode()); if (placeholder.isNotNull()) removePlaceholderAt(placeholder); - RefPtrWillBeRawPtr<Text> textNode = toText(startPosition.computeContainerNode()); + RawPtr<Text> textNode = toText(startPosition.computeContainerNode()); const unsigned offset = startPosition.offsetInContainerNode(); insertTextIntoNode(textNode, offset, m_text); @@ -232,7 +232,7 @@ setEndingSelectionWithoutValidation(startPosition, endPosition); // Handle the case where there is a typing style. - if (RefPtrWillBeRawPtr<EditingStyle> typingStyle = document().frame()->selection().typingStyle()) { + if (RawPtr<EditingStyle> typingStyle = document().frame()->selection().typingStyle()) { typingStyle->prepareToApplyAt(endPosition, EditingStyle::PreserveWritingDirection); if (!typingStyle->isEmpty()) { applyStyle(typingStyle.get(), editingState); @@ -256,19 +256,19 @@ // keep tabs coalesced in tab span if (isTabHTMLSpanElementTextNode(node)) { - RefPtrWillBeRawPtr<Text> textNode = toText(node); + RawPtr<Text> textNode = toText(node); insertTextIntoNode(textNode, offset, "\t"); return Position(textNode.release(), offset + 1); } // create new tab span - RefPtrWillBeRawPtr<HTMLSpanElement> spanElement = createTabSpanElement(document()); + RawPtr<HTMLSpanElement> spanElement = createTabSpanElement(document()); // place it if (!node->isTextNode()) { insertNodeAt(spanElement.get(), insertPos, editingState); } else { - RefPtrWillBeRawPtr<Text> textNode = toText(node); + RawPtr<Text> textNode = toText(node); if (offset >= textNode->length()) { insertNodeAfter(spanElement, textNode.release(), editingState); } else {
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.h b/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.h index d83fdcd..04494a2 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.h
@@ -37,10 +37,10 @@ RebalanceAllWhitespaces }; - static PassRefPtrWillBeRawPtr<InsertTextCommand> create(Document& document, const String& text, bool selectInsertedText = false, + static RawPtr<InsertTextCommand> create(Document& document, const String& text, bool selectInsertedText = false, RebalanceType rebalanceType = RebalanceLeadingAndTrailingWhitespaces) { - return adoptRefWillBeNoop(new InsertTextCommand(document, text, selectInsertedText, rebalanceType)); + return new InsertTextCommand(document, text, selectInsertedText, rebalanceType); } private:
diff --git a/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.cpp b/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.cpp index fbe0e46..af1f918 100644 --- a/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.cpp
@@ -31,7 +31,7 @@ namespace blink { -MergeIdenticalElementsCommand::MergeIdenticalElementsCommand(PassRefPtrWillBeRawPtr<Element> first, PassRefPtrWillBeRawPtr<Element> second) +MergeIdenticalElementsCommand::MergeIdenticalElementsCommand(RawPtr<Element> first, RawPtr<Element> second) : SimpleEditCommand(first->document()) , m_element1(first) , m_element2(second) @@ -62,7 +62,7 @@ ASSERT(m_element1); ASSERT(m_element2); - RefPtrWillBeRawPtr<Node> atChild = m_atChild.release(); + RawPtr<Node> atChild = m_atChild.release(); ContainerNode* parent = m_element2->parentNode(); if (!parent || !parent->hasEditableStyle()) @@ -74,7 +74,7 @@ if (exceptionState.hadException()) return; - WillBeHeapVector<RefPtrWillBeMember<Node>> children; + HeapVector<Member<Node>> children; for (Node* child = m_element2->firstChild(); child && child != atChild; child = child->nextSibling()) children.append(child);
diff --git a/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.h b/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.h index cdd0a1e..3d4ae1f 100644 --- a/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.h
@@ -32,22 +32,22 @@ class MergeIdenticalElementsCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<MergeIdenticalElementsCommand> create(PassRefPtrWillBeRawPtr<Element> element1, PassRefPtrWillBeRawPtr<Element> element2) + static RawPtr<MergeIdenticalElementsCommand> create(RawPtr<Element> element1, RawPtr<Element> element2) { - return adoptRefWillBeNoop(new MergeIdenticalElementsCommand(element1, element2)); + return new MergeIdenticalElementsCommand(element1, element2); } DECLARE_VIRTUAL_TRACE(); private: - MergeIdenticalElementsCommand(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillBeRawPtr<Element>); + MergeIdenticalElementsCommand(RawPtr<Element>, RawPtr<Element>); void doApply(EditingState*) override; void doUnapply() override; - RefPtrWillBeMember<Element> m_element1; - RefPtrWillBeMember<Element> m_element2; - RefPtrWillBeMember<Node> m_atChild; + Member<Element> m_element1; + Member<Element> m_element2; + Member<Node> m_atChild; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.cpp index 4a3af35..655b95e 100644 --- a/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.cpp
@@ -30,7 +30,7 @@ namespace blink { -MoveSelectionCommand::MoveSelectionCommand(PassRefPtrWillBeRawPtr<DocumentFragment> fragment, const Position& position, bool smartInsert, bool smartDelete) +MoveSelectionCommand::MoveSelectionCommand(RawPtr<DocumentFragment> fragment, const Position& position, bool smartInsert, bool smartDelete) : CompositeEditCommand(*position.document()), m_fragment(fragment), m_position(position), m_smartInsert(smartInsert), m_smartDelete(smartDelete) { ASSERT(m_fragment);
diff --git a/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.h b/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.h index 72c862d..c3b6de3 100644 --- a/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.h
@@ -34,20 +34,20 @@ class MoveSelectionCommand final : public CompositeEditCommand { public: - static PassRefPtrWillBeRawPtr<MoveSelectionCommand> create(PassRefPtrWillBeRawPtr<DocumentFragment> fragment, const Position& position, bool smartInsert = false, bool smartDelete = false) + static RawPtr<MoveSelectionCommand> create(RawPtr<DocumentFragment> fragment, const Position& position, bool smartInsert = false, bool smartDelete = false) { - return adoptRefWillBeNoop(new MoveSelectionCommand(fragment, position, smartInsert, smartDelete)); + return new MoveSelectionCommand(fragment, position, smartInsert, smartDelete); } DECLARE_VIRTUAL_TRACE(); private: - MoveSelectionCommand(PassRefPtrWillBeRawPtr<DocumentFragment>, const Position&, bool smartInsert, bool smartDelete); + MoveSelectionCommand(RawPtr<DocumentFragment>, const Position&, bool smartInsert, bool smartDelete); void doApply(EditingState*) override; EditAction editingAction() const override; - RefPtrWillBeMember<DocumentFragment> m_fragment; + Member<DocumentFragment> m_fragment; Position m_position; bool m_smartInsert; bool m_smartDelete;
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.cpp b/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.cpp index 1017bef..ec118c3 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.cpp
@@ -33,7 +33,7 @@ namespace blink { -RemoveCSSPropertyCommand::RemoveCSSPropertyCommand(Document& document, PassRefPtrWillBeRawPtr<Element> element, CSSPropertyID property) +RemoveCSSPropertyCommand::RemoveCSSPropertyCommand(Document& document, RawPtr<Element> element, CSSPropertyID property) : SimpleEditCommand(document) , m_element(element) , m_property(property)
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.h b/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.h index 6fce4aee..b072bcb 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.h
@@ -35,21 +35,21 @@ class RemoveCSSPropertyCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<RemoveCSSPropertyCommand> create(Document& document, PassRefPtrWillBeRawPtr<Element> element, CSSPropertyID property) + static RawPtr<RemoveCSSPropertyCommand> create(Document& document, RawPtr<Element> element, CSSPropertyID property) { - return adoptRefWillBeNoop(new RemoveCSSPropertyCommand(document, element, property)); + return new RemoveCSSPropertyCommand(document, element, property); } DECLARE_VIRTUAL_TRACE(); private: - RemoveCSSPropertyCommand(Document&, PassRefPtrWillBeRawPtr<Element>, CSSPropertyID); + RemoveCSSPropertyCommand(Document&, RawPtr<Element>, CSSPropertyID); ~RemoveCSSPropertyCommand() override; void doApply(EditingState*) override; void doUnapply() override; - RefPtrWillBeMember<Element> m_element; + Member<Element> m_element; CSSPropertyID m_property; String m_oldValue; bool m_important;
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveFormatCommand.cpp b/third_party/WebKit/Source/core/editing/commands/RemoveFormatCommand.cpp index e05f9fd..97bd45ee 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveFormatCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/RemoveFormatCommand.cpp
@@ -87,7 +87,7 @@ // Get the default style for this editable root, it's the style that we'll give the // content that we're operating on. Element* root = frame->selection().rootEditableElement(); - RefPtrWillBeRawPtr<EditingStyle> defaultStyle = EditingStyle::create(root); + RawPtr<EditingStyle> defaultStyle = EditingStyle::create(root); // We want to remove everything but transparent background. // FIXME: We shouldn't access style().
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveFormatCommand.h b/third_party/WebKit/Source/core/editing/commands/RemoveFormatCommand.h index 79294ab7..43d4804 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveFormatCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/RemoveFormatCommand.h
@@ -32,9 +32,9 @@ class RemoveFormatCommand final : public CompositeEditCommand { public: - static PassRefPtrWillBeRawPtr<RemoveFormatCommand> create(Document& document) + static RawPtr<RemoveFormatCommand> create(Document& document) { - return adoptRefWillBeNoop(new RemoveFormatCommand(document)); + return new RemoveFormatCommand(document); } private:
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.cpp index 636dd916..a6954a93 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.cpp
@@ -32,7 +32,7 @@ namespace blink { -RemoveNodeCommand::RemoveNodeCommand(PassRefPtrWillBeRawPtr<Node> node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) +RemoveNodeCommand::RemoveNodeCommand(RawPtr<Node> node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) : SimpleEditCommand(node->document()) , m_node(node) , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable) @@ -62,8 +62,8 @@ void RemoveNodeCommand::doUnapply() { - RefPtrWillBeRawPtr<ContainerNode> parent = m_parent.release(); - RefPtrWillBeRawPtr<Node> refChild = m_refChild.release(); + RawPtr<ContainerNode> parent = m_parent.release(); + RawPtr<Node> refChild = m_refChild.release(); if (!parent || !parent->hasEditableStyle()) return;
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.h b/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.h index 9bb703c..8d23965b 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.h
@@ -32,22 +32,22 @@ class RemoveNodeCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<RemoveNodeCommand> create(PassRefPtrWillBeRawPtr<Node> node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) + static RawPtr<RemoveNodeCommand> create(RawPtr<Node> node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) { - return adoptRefWillBeNoop(new RemoveNodeCommand(node, shouldAssumeContentIsAlwaysEditable)); + return new RemoveNodeCommand(node, shouldAssumeContentIsAlwaysEditable); } DECLARE_VIRTUAL_TRACE(); private: - explicit RemoveNodeCommand(PassRefPtrWillBeRawPtr<Node>, ShouldAssumeContentIsAlwaysEditable); + explicit RemoveNodeCommand(RawPtr<Node>, ShouldAssumeContentIsAlwaysEditable); void doApply(EditingState*) override; void doUnapply() override; - RefPtrWillBeMember<Node> m_node; - RefPtrWillBeMember<ContainerNode> m_parent; - RefPtrWillBeMember<Node> m_refChild; + Member<Node> m_node; + Member<ContainerNode> m_parent; + Member<Node> m_refChild; ShouldAssumeContentIsAlwaysEditable m_shouldAssumeContentIsAlwaysEditable; };
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.cpp b/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.cpp index 3a1d33c..b09ac3a 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.cpp
@@ -30,7 +30,7 @@ namespace blink { -RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand(PassRefPtrWillBeRawPtr<Node> node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) +RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand(RawPtr<Node> node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) : CompositeEditCommand(node->document()) , m_node(node) , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable) @@ -47,7 +47,7 @@ getChildNodes(toContainerNode(*m_node), children); for (auto& currentChild : children) { - RefPtrWillBeRawPtr<Node> child = currentChild.release(); + RawPtr<Node> child = currentChild.release(); removeNode(child, editingState, m_shouldAssumeContentIsAlwaysEditable); if (editingState->isAborted()) return;
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.h b/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.h index c6a4f7dc..4ecabdc4 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.h
@@ -32,19 +32,19 @@ class RemoveNodePreservingChildrenCommand final : public CompositeEditCommand { public: - static PassRefPtrWillBeRawPtr<RemoveNodePreservingChildrenCommand> create(PassRefPtrWillBeRawPtr<Node> node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) + static RawPtr<RemoveNodePreservingChildrenCommand> create(RawPtr<Node> node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) { - return adoptRefWillBeNoop(new RemoveNodePreservingChildrenCommand(node, shouldAssumeContentIsAlwaysEditable)); + return new RemoveNodePreservingChildrenCommand(node, shouldAssumeContentIsAlwaysEditable); } DECLARE_VIRTUAL_TRACE(); private: - RemoveNodePreservingChildrenCommand(PassRefPtrWillBeRawPtr<Node>, ShouldAssumeContentIsAlwaysEditable); + RemoveNodePreservingChildrenCommand(RawPtr<Node>, ShouldAssumeContentIsAlwaysEditable); void doApply(EditingState*) override; - RefPtrWillBeMember<Node> m_node; + Member<Node> m_node; ShouldAssumeContentIsAlwaysEditable m_shouldAssumeContentIsAlwaysEditable; };
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp index 31e8423..e552937 100644 --- a/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp
@@ -41,7 +41,7 @@ using namespace HTMLNames; -ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand(PassRefPtrWillBeRawPtr<HTMLElement> element) +ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand(RawPtr<HTMLElement> element) : SimpleEditCommand(element->document()) , m_elementToReplace(element) { @@ -51,7 +51,7 @@ static void swapInNodePreservingAttributesAndChildren(HTMLElement* newElement, HTMLElement& elementToReplace) { ASSERT(elementToReplace.inDocument()); - RefPtrWillBeRawPtr<ContainerNode> parentNode = elementToReplace.parentNode(); + RawPtr<ContainerNode> parentNode = elementToReplace.parentNode(); parentNode->insertBefore(newElement, &elementToReplace); NodeVector children;
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.h b/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.h index 067d8b2..c45cd8c9 100644 --- a/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.h
@@ -41,9 +41,9 @@ // More accurately, this is ReplaceElementWithSpanPreservingChildrenAndAttributesCommand class ReplaceNodeWithSpanCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<ReplaceNodeWithSpanCommand> create(PassRefPtrWillBeRawPtr<HTMLElement> element) + static RawPtr<ReplaceNodeWithSpanCommand> create(RawPtr<HTMLElement> element) { - return adoptRefWillBeNoop(new ReplaceNodeWithSpanCommand(element)); + return new ReplaceNodeWithSpanCommand(element); } HTMLSpanElement* spanElement() { return m_spanElement.get(); } @@ -51,13 +51,13 @@ DECLARE_VIRTUAL_TRACE(); private: - explicit ReplaceNodeWithSpanCommand(PassRefPtrWillBeRawPtr<HTMLElement>); + explicit ReplaceNodeWithSpanCommand(RawPtr<HTMLElement>); void doApply(EditingState*) override; void doUnapply() override; - RefPtrWillBeMember<HTMLElement> m_elementToReplace; - RefPtrWillBeMember<HTMLSpanElement> m_spanElement; + Member<HTMLElement> m_elementToReplace; + Member<HTMLSpanElement> m_spanElement; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp index 169bccf..b600cbc 100644 --- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -84,19 +84,19 @@ bool hasInterchangeNewlineAtStart() const { return m_hasInterchangeNewlineAtStart; } bool hasInterchangeNewlineAtEnd() const { return m_hasInterchangeNewlineAtEnd; } - void removeNode(PassRefPtrWillBeRawPtr<Node>); - void removeNodePreservingChildren(PassRefPtrWillBeRawPtr<ContainerNode>); + void removeNode(RawPtr<Node>); + void removeNodePreservingChildren(RawPtr<ContainerNode>); private: - PassRefPtrWillBeRawPtr<HTMLElement> insertFragmentForTestRendering(Element* rootEditableElement); + RawPtr<HTMLElement> insertFragmentForTestRendering(Element* rootEditableElement); void removeUnrenderedNodes(ContainerNode*); void restoreAndRemoveTestRenderingNodesToFragment(Element*); void removeInterchangeNodes(ContainerNode*); - void insertNodeBefore(PassRefPtrWillBeRawPtr<Node>, Node* refNode); + void insertNodeBefore(RawPtr<Node>, Node* refNode); - RefPtrWillBeMember<Document> m_document; - RefPtrWillBeMember<DocumentFragment> m_fragment; + Member<Document> m_document; + Member<DocumentFragment> m_fragment; bool m_hasInterchangeNewlineAtStart; bool m_hasInterchangeNewlineAtEnd; }; @@ -157,7 +157,7 @@ return; TRACE_EVENT0("blink", "ReplacementFragment constructor"); - RefPtrWillBeRawPtr<Element> editableRoot = selection.rootEditableElement(); + RawPtr<Element> editableRoot = selection.rootEditableElement(); ASSERT(editableRoot); if (!editableRoot) return; @@ -190,7 +190,7 @@ if (isPlainText) { removeInterchangeNodes(m_fragment.get()); String originalText = m_fragment->textContent(); - RefPtrWillBeRawPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(originalText); + RawPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(originalText); editableRoot->dispatchEvent(event); if (originalText != event->text()) { m_fragment = createFragmentFromText(selection.toNormalizedEphemeralRange(), event->text()); @@ -200,7 +200,7 @@ } } - RefPtrWillBeRawPtr<HTMLElement> holder = insertFragmentForTestRendering(editableRoot.get()); + RawPtr<HTMLElement> holder = insertFragmentForTestRendering(editableRoot.get()); if (!holder) { removeInterchangeNodes(m_fragment.get()); return; @@ -214,7 +214,7 @@ restoreAndRemoveTestRenderingNodesToFragment(holder.get()); // Give the root a chance to change the text. - RefPtrWillBeRawPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text); + RawPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text); editableRoot->dispatchEvent(evt); if (text != evt->text() || !editableRoot->layoutObjectIsRichlyEditable()) { restoreAndRemoveTestRenderingNodesToFragment(holder.get()); @@ -245,19 +245,19 @@ return m_fragment ? m_fragment->lastChild() : 0; } -void ReplacementFragment::removeNodePreservingChildren(PassRefPtrWillBeRawPtr<ContainerNode> node) +void ReplacementFragment::removeNodePreservingChildren(RawPtr<ContainerNode> node) { if (!node) return; - while (RefPtrWillBeRawPtr<Node> n = node->firstChild()) { + while (RawPtr<Node> n = node->firstChild()) { removeNode(n); insertNodeBefore(n.release(), node.get()); } removeNode(node); } -void ReplacementFragment::removeNode(PassRefPtrWillBeRawPtr<Node> node) +void ReplacementFragment::removeNode(RawPtr<Node> node) { if (!node) return; @@ -269,7 +269,7 @@ parent->removeChild(node.get()); } -void ReplacementFragment::insertNodeBefore(PassRefPtrWillBeRawPtr<Node> node, Node* refNode) +void ReplacementFragment::insertNodeBefore(RawPtr<Node> node, Node* refNode) { if (!node || !refNode) return; @@ -281,11 +281,11 @@ parent->insertBefore(node, refNode); } -PassRefPtrWillBeRawPtr<HTMLElement> ReplacementFragment::insertFragmentForTestRendering(Element* rootEditableElement) +RawPtr<HTMLElement> ReplacementFragment::insertFragmentForTestRendering(Element* rootEditableElement) { TRACE_EVENT0("blink", "ReplacementFragment::insertFragmentForTestRendering"); ASSERT(m_document); - RefPtrWillBeRawPtr<HTMLElement> holder = createDefaultParagraphElement(*m_document.get()); + RawPtr<HTMLElement> holder = createDefaultParagraphElement(*m_document.get()); holder->appendChild(m_fragment); rootEditableElement->appendChild(holder.get()); @@ -299,7 +299,7 @@ if (!holder) return; - while (RefPtrWillBeRawPtr<Node> node = holder->firstChild()) { + while (RawPtr<Node> node = holder->firstChild()) { holder->removeChild(node.get()); m_fragment->appendChild(node.get()); } @@ -309,7 +309,7 @@ void ReplacementFragment::removeUnrenderedNodes(ContainerNode* holder) { - WillBeHeapVector<RefPtrWillBeMember<Node>> unrendered; + HeapVector<Member<Node>> unrendered; for (Node& node : NodeTraversal::descendantsOf(*holder)) { if (!isNodeRendered(node) && !isTableStructureNode(&node)) @@ -352,7 +352,7 @@ node = container->firstChild(); while (node) { - RefPtrWillBeRawPtr<Node> next = NodeTraversal::next(*node); + RawPtr<Node> next = NodeTraversal::next(*node); if (isHTMLInterchangeConvertedSpaceSpan(node)) { HTMLElement& element = toHTMLElement(*node); next = NodeTraversal::nextSkippingChildren(element); @@ -398,7 +398,7 @@ m_lastNodeInserted = &newNode; } -ReplaceSelectionCommand::ReplaceSelectionCommand(Document& document, PassRefPtrWillBeRawPtr<DocumentFragment> fragment, CommandOptions options, EditAction editAction) +ReplaceSelectionCommand::ReplaceSelectionCommand(Document& document, RawPtr<DocumentFragment> fragment, CommandOptions options, EditAction editAction) : CompositeEditCommand(document) , m_selectReplacement(options & SelectReplacement) , m_smartReplace(options & SmartReplace) @@ -511,9 +511,9 @@ // a div inserted into a document with div { display:inline; }. void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(InsertedNodes& insertedNodes, EditingState* editingState) { - RefPtrWillBeRawPtr<Node> pastEndNode = insertedNodes.pastLastLeaf(); - RefPtrWillBeRawPtr<Node> next = nullptr; - for (RefPtrWillBeRawPtr<Node> node = insertedNodes.firstNodeInserted(); node && node != pastEndNode; node = next) { + RawPtr<Node> pastEndNode = insertedNodes.pastLastLeaf(); + RawPtr<Node> next = nullptr; + for (RawPtr<Node> node = insertedNodes.firstNodeInserted(); node && node != pastEndNode; node = next) { // FIXME: <rdar://problem/5371536> Style rules that match pasted content can change it's appearance next = NodeTraversal::next(*node); @@ -523,7 +523,7 @@ Element* element = toElement(node); const StylePropertySet* inlineStyle = element->inlineStyle(); - RefPtrWillBeRawPtr<EditingStyle> newInlineStyle = EditingStyle::create(inlineStyle); + RawPtr<EditingStyle> newInlineStyle = EditingStyle::create(inlineStyle); if (inlineStyle) { if (element->isHTMLElement()) { Vector<QualifiedName> attributes; @@ -668,9 +668,9 @@ void ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder(const InsertedNodes& insertedNodes, EditingState* editingState) { - RefPtrWillBeRawPtr<Node> pastEndNode = insertedNodes.pastLastLeaf(); - RefPtrWillBeRawPtr<Node> next = nullptr; - for (RefPtrWillBeRawPtr<Node> node = insertedNodes.firstNodeInserted(); node && node != pastEndNode; node = next) { + RawPtr<Node> pastEndNode = insertedNodes.pastLastLeaf(); + RawPtr<Node> next = nullptr; + for (RawPtr<Node> node = insertedNodes.firstNodeInserted(); node && node != pastEndNode; node = next) { next = NodeTraversal::next(*node); if (!node->isHTMLElement()) @@ -699,10 +699,10 @@ } } -void ReplaceSelectionCommand::moveElementOutOfAncestor(PassRefPtrWillBeRawPtr<Element> prpElement, PassRefPtrWillBeRawPtr<Element> prpAncestor, EditingState* editingState) +void ReplaceSelectionCommand::moveElementOutOfAncestor(RawPtr<Element> prpElement, RawPtr<Element> prpAncestor, EditingState* editingState) { - RefPtrWillBeRawPtr<Element> element = prpElement; - RefPtrWillBeRawPtr<Element> ancestor = prpAncestor; + RawPtr<Element> element = prpElement; + RawPtr<Element> ancestor = prpAncestor; if (!ancestor->parentNode()->hasEditableStyle()) return; @@ -720,7 +720,7 @@ if (editingState->isAborted()) return; } else { - RefPtrWillBeRawPtr<Node> nodeToSplitTo = splitTreeToNode(element.get(), ancestor.get(), true); + RawPtr<Node> nodeToSplitTo = splitTreeToNode(element.get(), ancestor.get(), true); removeNode(element, editingState); if (editingState->isAborted()) return; @@ -806,7 +806,7 @@ return false; HTMLSpanElement* wrappingStyleSpan = toHTMLSpanElement(topNode); - RefPtrWillBeRawPtr<EditingStyle> styleAtInsertionPos = EditingStyle::create(insertionPos.parentAnchoredEquivalent()); + RawPtr<EditingStyle> styleAtInsertionPos = EditingStyle::create(insertionPos.parentAnchoredEquivalent()); String styleText = styleAtInsertionPos->style()->asText(); // FIXME: This string comparison is a naive way of comparing two styles. @@ -845,7 +845,7 @@ if (!wrappingStyleSpan) return; - RefPtrWillBeRawPtr<EditingStyle> style = EditingStyle::create(wrappingStyleSpan->inlineStyle()); + RawPtr<EditingStyle> style = EditingStyle::create(wrappingStyleSpan->inlineStyle()); ContainerNode* context = wrappingStyleSpan->parentNode(); // If Mail wraps the fragment with a Paste as Quotation blockquote, or if you're pasting into a quoted region, @@ -900,7 +900,7 @@ // Merging forward could result in deleting the destination anchor node. // To avoid this, we add a placeholder node before the start of the paragraph. if (endOfParagraph(startOfParagraphToMove).deepEquivalent() == destination.deepEquivalent()) { - RefPtrWillBeRawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); + RawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document()); insertNodeBefore(placeholder, startOfParagraphToMove.deepEquivalent().anchorNode(), editingState); if (editingState->isAborted()) return; @@ -1100,7 +1100,7 @@ if (endBR) originalVisPosBeforeEndBR = previousPositionOf(createVisiblePosition(positionBeforeNode(endBR))); - RefPtrWillBeRawPtr<Element> enclosingBlockOfInsertionPos = enclosingBlock(insertionPos.anchorNode()); + RawPtr<Element> enclosingBlockOfInsertionPos = enclosingBlock(insertionPos.anchorNode()); // Adjust insertionPos to prevent nesting. // If the start was in a Mail blockquote, we will have already handled adjusting insertionPos above. @@ -1151,12 +1151,12 @@ insertionPos = firstPositionInNode(insertionPos.computeContainerNode()); } - if (RefPtrWillBeRawPtr<HTMLElement> elementToSplitTo = elementToSplitToAvoidPastingIntoInlineElementsWithStyle(insertionPos)) { + if (RawPtr<HTMLElement> elementToSplitTo = elementToSplitToAvoidPastingIntoInlineElementsWithStyle(insertionPos)) { if (insertionPos.computeContainerNode() != elementToSplitTo->parentNode()) { Node* splitStart = insertionPos.computeNodeAfterPosition(); if (!splitStart) splitStart = insertionPos.computeContainerNode(); - RefPtrWillBeRawPtr<Node> nodeToSplitTo = splitTreeToNode(splitStart, elementToSplitTo->parentNode()).get(); + RawPtr<Node> nodeToSplitTo = splitTreeToNode(splitStart, elementToSplitTo->parentNode()).get(); insertionPos = positionInParentBeforeNode(*nodeToSplitTo); } } @@ -1176,9 +1176,9 @@ // 6) Select the replacement if requested, and match style if requested. InsertedNodes insertedNodes; - RefPtrWillBeRawPtr<Node> refNode = fragment.firstChild(); + RawPtr<Node> refNode = fragment.firstChild(); ASSERT(refNode); - RefPtrWillBeRawPtr<Node> node = refNode->nextSibling(); + RawPtr<Node> node = refNode->nextSibling(); fragment.removeNode(refNode); @@ -1202,7 +1202,7 @@ bool plainTextFragment = isPlainTextMarkup(refNode.get()); while (node) { - RefPtrWillBeRawPtr<Node> next = node->nextSibling(); + RawPtr<Node> next = node->nextSibling(); fragment.removeNode(node.get()); insertNodeAfter(node, refNode, editingState); if (editingState->isAborted()) @@ -1248,7 +1248,7 @@ } if (endBR && (plainTextFragment || (shouldRemoveEndBR(endBR, originalVisPosBeforeEndBR) && !(fragment.hasInterchangeNewlineAtEnd() && selectionIsPlainText)))) { - RefPtrWillBeRawPtr<ContainerNode> parent = endBR->parentNode(); + RawPtr<ContainerNode> parent = endBR->parentNode(); insertedNodes.willRemoveNode(*endBR); removeNode(endBR, editingState); if (editingState->isAborted()) @@ -1342,7 +1342,7 @@ setEndingSelection(endOfInsertedContent); Element* enclosingBlockElement = enclosingBlock(endOfInsertedContent.deepEquivalent().anchorNode()); if (isListItem(enclosingBlockElement)) { - RefPtrWillBeRawPtr<HTMLLIElement> newListItem = HTMLLIElement::create(document()); + RawPtr<HTMLLIElement> newListItem = HTMLLIElement::create(document()); insertNodeAfter(newListItem, enclosingBlockElement, editingState); if (editingState->isAborted()) return; @@ -1445,7 +1445,7 @@ if (m_endOfInsertedContent.computeContainerNode() == endNode) m_endOfInsertedContent = Position(endNode, m_endOfInsertedContent.offsetInContainerNode() + 1); } else { - RefPtrWillBeRawPtr<Text> node = document().createEditingTextNode(collapseWhiteSpace ? nonBreakingSpaceString() : " "); + RawPtr<Text> node = document().createEditingTextNode(collapseWhiteSpace ? nonBreakingSpaceString() : " "); insertNodeAfter(node, endNode, editingState); if (editingState->isAborted()) return; @@ -1471,7 +1471,7 @@ if (m_endOfInsertedContent.computeContainerNode() == startNode && m_endOfInsertedContent.offsetInContainerNode()) m_endOfInsertedContent = Position(startNode, m_endOfInsertedContent.offsetInContainerNode() + 1); } else { - RefPtrWillBeRawPtr<Text> node = document().createEditingTextNode(collapseWhiteSpace ? nonBreakingSpaceString() : " "); + RawPtr<Text> node = document().createEditingTextNode(collapseWhiteSpace ? nonBreakingSpaceString() : " "); // Don't updateNodesInserted. Doing so would set m_endOfInsertedContent to be the node containing the leading space, // but m_endOfInsertedContent is supposed to mark the end of pasted content. insertNodeBefore(node, startNode, editingState); @@ -1525,7 +1525,7 @@ { bool positionIsOffsetInAnchor = position.isOffsetInAnchor(); bool positionOnlyToBeUpdatedIsOffsetInAnchor = positionOnlyToBeUpdated.isOffsetInAnchor(); - RefPtrWillBeRawPtr<Text> text = nullptr; + RawPtr<Text> text = nullptr; if (positionIsOffsetInAnchor && position.computeContainerNode() && position.computeContainerNode()->isTextNode()) { text = toText(position.computeContainerNode()); } else { @@ -1549,7 +1549,7 @@ if (!hasIncompleteSurrogate && text->data().length() > kMergeSizeLimit) return; if (text->previousSibling() && text->previousSibling()->isTextNode()) { - RefPtrWillBeRawPtr<Text> previous = toText(text->previousSibling()); + RawPtr<Text> previous = toText(text->previousSibling()); if (hasIncompleteSurrogate || previous->data().length() <= kMergeSizeLimit) { insertTextIntoNode(text, 0, previous->data()); @@ -1573,7 +1573,7 @@ } } if (text->nextSibling() && text->nextSibling()->isTextNode()) { - RefPtrWillBeRawPtr<Text> next = toText(text->nextSibling()); + RawPtr<Text> next = toText(text->nextSibling()); if (!hasIncompleteSurrogate && next->data().length() > kMergeSizeLimit) return; unsigned originalLength = text->length(); @@ -1600,9 +1600,9 @@ // If the user is inserting a list into an existing list, instead of nesting the list, // we put the list items into the existing list. -Node* ReplaceSelectionCommand::insertAsListItems(PassRefPtrWillBeRawPtr<HTMLElement> prpListElement, Element* insertionBlock, const Position& insertPos, InsertedNodes& insertedNodes, EditingState* editingState) +Node* ReplaceSelectionCommand::insertAsListItems(RawPtr<HTMLElement> prpListElement, Element* insertionBlock, const Position& insertPos, InsertedNodes& insertedNodes, EditingState* editingState) { - RefPtrWillBeRawPtr<HTMLElement> listElement = prpListElement; + RawPtr<HTMLElement> listElement = prpListElement; while (listElement->hasOneChild() && isHTMLListElement(listElement->firstChild())) listElement = toHTMLElement(listElement->firstChild()); @@ -1621,7 +1621,7 @@ splitTreeToNode(insertPos.anchorNode(), lastNode, true); } - while (RefPtrWillBeRawPtr<Node> listItem = listElement->firstChild()) { + while (RawPtr<Node> listItem = listElement->firstChild()) { listElement->removeChild(listItem.get(), ASSERT_NO_EXCEPTION); if (isStart || isMiddle) { insertNodeBefore(listItem, lastNode, editingState); @@ -1673,7 +1673,7 @@ if (elementToSplitToAvoidPastingIntoInlineElementsWithStyle(endingSelection().start())) return false; - RefPtrWillBeRawPtr<Node> nodeAfterInsertionPos = mostForwardCaretPosition(endingSelection().end()).anchorNode(); + RawPtr<Node> nodeAfterInsertionPos = mostForwardCaretPosition(endingSelection().end()).anchorNode(); Text* textNode = toText(fragment.firstChild()); // Our fragment creation code handles tabs, spaces, and newlines, so we don't have to worry about those here.
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.h b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.h index 299819114..d998cca 100644 --- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.h
@@ -47,9 +47,9 @@ typedef unsigned CommandOptions; - static PassRefPtrWillBeRawPtr<ReplaceSelectionCommand> create(Document& document, PassRefPtrWillBeRawPtr<DocumentFragment> fragment, CommandOptions options, EditAction action = EditActionPaste) + static RawPtr<ReplaceSelectionCommand> create(Document& document, RawPtr<DocumentFragment> fragment, CommandOptions options, EditAction action = EditActionPaste) { - return adoptRefWillBeNoop(new ReplaceSelectionCommand(document, fragment, options, action)); + return new ReplaceSelectionCommand(document, fragment, options, action); } EphemeralRange insertedRange() const; @@ -57,7 +57,7 @@ DECLARE_VIRTUAL_TRACE(); private: - ReplaceSelectionCommand(Document&, PassRefPtrWillBeRawPtr<DocumentFragment>, CommandOptions, EditAction); + ReplaceSelectionCommand(Document&, RawPtr<DocumentFragment>, CommandOptions, EditAction); void doApply(EditingState*) override; EditAction editingAction() const override; @@ -76,11 +76,11 @@ Node* pastLastLeaf() const { return m_lastNodeInserted ? NodeTraversal::next(NodeTraversal::lastWithinOrSelf(*m_lastNodeInserted)) : 0; } private: - RefPtrWillBeMember<Node> m_firstNodeInserted; - RefPtrWillBeMember<Node> m_lastNodeInserted; + Member<Node> m_firstNodeInserted; + Member<Node> m_lastNodeInserted; }; - Node* insertAsListItems(PassRefPtrWillBeRawPtr<HTMLElement> listElement, Element* insertionBlock, const Position&, InsertedNodes&, EditingState*); + Node* insertAsListItems(RawPtr<HTMLElement> listElement, Element* insertionBlock, const Position&, InsertedNodes&, EditingState*); void updateNodesInserted(Node*); bool shouldRemoveEndBR(HTMLBRElement*, const VisiblePosition&); @@ -95,7 +95,7 @@ void removeRedundantStylesAndKeepStyleSpanInline(InsertedNodes&, EditingState*); void makeInsertedContentRoundTrippableWithHTMLTreeBuilder(const InsertedNodes&, EditingState*); - void moveElementOutOfAncestor(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillBeRawPtr<Element> ancestor, EditingState*); + void moveElementOutOfAncestor(RawPtr<Element>, RawPtr<Element> ancestor, EditingState*); void handleStyleSpans(InsertedNodes&, EditingState*); VisiblePosition positionAtStartOfInsertedContent() const; @@ -110,11 +110,11 @@ Position m_startOfInsertedContent; Position m_endOfInsertedContent; - RefPtrWillBeMember<EditingStyle> m_insertionStyle; + Member<EditingStyle> m_insertionStyle; bool m_selectReplacement; bool m_smartReplace; bool m_matchStyle; - RefPtrWillBeMember<DocumentFragment> m_documentFragment; + Member<DocumentFragment> m_documentFragment; bool m_preventNesting; bool m_movingParagraph; EditAction m_editAction;
diff --git a/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.cpp index 9ec30165..72e1c0c3 100644 --- a/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.cpp
@@ -30,7 +30,7 @@ namespace blink { -SetNodeAttributeCommand::SetNodeAttributeCommand(PassRefPtrWillBeRawPtr<Element> element, +SetNodeAttributeCommand::SetNodeAttributeCommand(RawPtr<Element> element, const QualifiedName& attribute, const AtomicString& value) : SimpleEditCommand(element->document()) , m_element(element)
diff --git a/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.h b/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.h index 33e901e..9a75e3d 100644 --- a/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.h
@@ -33,20 +33,20 @@ class SetNodeAttributeCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<SetNodeAttributeCommand> create(PassRefPtrWillBeRawPtr<Element> element, const QualifiedName& attribute, const AtomicString& value) + static RawPtr<SetNodeAttributeCommand> create(RawPtr<Element> element, const QualifiedName& attribute, const AtomicString& value) { - return adoptRefWillBeNoop(new SetNodeAttributeCommand(element, attribute, value)); + return new SetNodeAttributeCommand(element, attribute, value); } DECLARE_VIRTUAL_TRACE(); private: - SetNodeAttributeCommand(PassRefPtrWillBeRawPtr<Element>, const QualifiedName& attribute, const AtomicString& value); + SetNodeAttributeCommand(RawPtr<Element>, const QualifiedName& attribute, const AtomicString& value); void doApply(EditingState*) override; void doUnapply() override; - RefPtrWillBeMember<Element> m_element; + Member<Element> m_element; QualifiedName m_attribute; AtomicString m_value; AtomicString m_oldValue;
diff --git a/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp index 359b0f2..e8fd980 100644 --- a/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp
@@ -41,7 +41,7 @@ void SimplifyMarkupCommand::doApply(EditingState* editingState) { ContainerNode* rootNode = m_firstNode->parentNode(); - WillBeHeapVector<RefPtrWillBeMember<ContainerNode>> nodesToRemove; + HeapVector<Member<ContainerNode>> nodesToRemove; // Walk through the inserted nodes, to see if there are elements that could be removed // without affecting the style. The goal is to produce leaner markup even when starting @@ -100,7 +100,7 @@ } } -int SimplifyMarkupCommand::pruneSubsequentAncestorsToRemove(WillBeHeapVector<RefPtrWillBeMember<ContainerNode>>& nodesToRemove, size_t startNodeIndex, EditingState* editingState) +int SimplifyMarkupCommand::pruneSubsequentAncestorsToRemove(HeapVector<Member<ContainerNode>>& nodesToRemove, size_t startNodeIndex, EditingState* editingState) { size_t pastLastNodeToRemove = startNodeIndex + 1; for (; pastLastNodeToRemove < nodesToRemove.size(); ++pastLastNodeToRemove) { @@ -110,7 +110,7 @@ } ContainerNode* highestAncestorToRemove = nodesToRemove[pastLastNodeToRemove - 1].get(); - RefPtrWillBeRawPtr<ContainerNode> parent = highestAncestorToRemove->parentNode(); + RawPtr<ContainerNode> parent = highestAncestorToRemove->parentNode(); if (!parent) // Parent has already been removed. return -1;
diff --git a/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.h b/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.h index 257d8d8..43d2b79e 100644 --- a/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.h
@@ -32,9 +32,9 @@ class SimplifyMarkupCommand final : public CompositeEditCommand { public: - static PassRefPtrWillBeRawPtr<SimplifyMarkupCommand> create(Document& document, Node* firstNode, Node* nodeAfterLast) + static RawPtr<SimplifyMarkupCommand> create(Document& document, Node* firstNode, Node* nodeAfterLast) { - return adoptRefWillBeNoop(new SimplifyMarkupCommand(document, firstNode, nodeAfterLast)); + return new SimplifyMarkupCommand(document, firstNode, nodeAfterLast); } DECLARE_VIRTUAL_TRACE(); @@ -43,10 +43,10 @@ SimplifyMarkupCommand(Document&, Node* firstNode, Node* nodeAfterLast); void doApply(EditingState*) override; - int pruneSubsequentAncestorsToRemove(WillBeHeapVector<RefPtrWillBeMember<ContainerNode>>& nodesToRemove, size_t startNodeIndex, EditingState*); + int pruneSubsequentAncestorsToRemove(HeapVector<Member<ContainerNode>>& nodesToRemove, size_t startNodeIndex, EditingState*); - RefPtrWillBeMember<Node> m_firstNode; - RefPtrWillBeMember<Node> m_nodeAfterLast; + Member<Node> m_firstNode; + Member<Node> m_nodeAfterLast; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.cpp index fa3f458b..d2b43e7 100644 --- a/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.cpp
@@ -33,7 +33,7 @@ namespace blink { -SplitElementCommand::SplitElementCommand(PassRefPtrWillBeRawPtr<Element> element, PassRefPtrWillBeRawPtr<Node> atChild) +SplitElementCommand::SplitElementCommand(RawPtr<Element> element, RawPtr<Node> atChild) : SimpleEditCommand(element->document()) , m_element2(element) , m_atChild(atChild) @@ -48,7 +48,7 @@ if (m_atChild->parentNode() != m_element2) return; - WillBeHeapVector<RefPtrWillBeMember<Node>> children; + HeapVector<Member<Node>> children; for (Node* node = m_element2->firstChild(); node != m_atChild; node = node->nextSibling()) children.append(node); @@ -83,7 +83,7 @@ NodeVector children; getChildNodes(*m_element1, children); - RefPtrWillBeRawPtr<Node> refChild = m_element2->firstChild(); + RawPtr<Node> refChild = m_element2->firstChild(); for (const auto& child : children) m_element2->insertBefore(child.get(), refChild.get(), IGNORE_EXCEPTION);
diff --git a/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.h b/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.h index ee619d5..c42d559a 100644 --- a/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.h
@@ -32,24 +32,24 @@ class SplitElementCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<SplitElementCommand> create(PassRefPtrWillBeRawPtr<Element> element, PassRefPtrWillBeRawPtr<Node> splitPointChild) + static RawPtr<SplitElementCommand> create(RawPtr<Element> element, RawPtr<Node> splitPointChild) { - return adoptRefWillBeNoop(new SplitElementCommand(element, splitPointChild)); + return new SplitElementCommand(element, splitPointChild); } DECLARE_VIRTUAL_TRACE(); private: - SplitElementCommand(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillBeRawPtr<Node> splitPointChild); + SplitElementCommand(RawPtr<Element>, RawPtr<Node> splitPointChild); void doApply(EditingState*) override; void doUnapply() override; void doReapply() override; void executeApply(); - RefPtrWillBeMember<Element> m_element1; - RefPtrWillBeMember<Element> m_element2; - RefPtrWillBeMember<Node> m_atChild; + Member<Element> m_element1; + Member<Element> m_element2; + Member<Node> m_atChild; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp index 7f3b6771..e306348 100644 --- a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp
@@ -34,7 +34,7 @@ namespace blink { -SplitTextNodeCommand::SplitTextNodeCommand(PassRefPtrWillBeRawPtr<Text> text, int offset) +SplitTextNodeCommand::SplitTextNodeCommand(RawPtr<Text> text, int offset) : SimpleEditCommand(text->document()) , m_text2(text) , m_offset(offset)
diff --git a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.h b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.h index f743c13..0d4cafae 100644 --- a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.h
@@ -34,23 +34,23 @@ class SplitTextNodeCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<SplitTextNodeCommand> create(PassRefPtrWillBeRawPtr<Text> node, int offset) + static RawPtr<SplitTextNodeCommand> create(RawPtr<Text> node, int offset) { - return adoptRefWillBeNoop(new SplitTextNodeCommand(node, offset)); + return new SplitTextNodeCommand(node, offset); } DECLARE_VIRTUAL_TRACE(); private: - SplitTextNodeCommand(PassRefPtrWillBeRawPtr<Text>, int offset); + SplitTextNodeCommand(RawPtr<Text>, int offset); void doApply(EditingState*) override; void doUnapply() override; void doReapply() override; void insertText1AndTrimText2(); - RefPtrWillBeMember<Text> m_text1; - RefPtrWillBeMember<Text> m_text2; + Member<Text> m_text1; + Member<Text> m_text2; unsigned m_offset; };
diff --git a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.cpp index 496fe88..83e0a4e 100644 --- a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.cpp
@@ -32,7 +32,7 @@ namespace blink { -SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand(PassRefPtrWillBeRawPtr<Text> text, int offset) +SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand(RawPtr<Text> text, int offset) : CompositeEditCommand(text->document()), m_text(text), m_offset(offset) { ASSERT(m_text);
diff --git a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.h b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.h index c17b43f..6ef8b1b1 100644 --- a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.h
@@ -32,19 +32,19 @@ class SplitTextNodeContainingElementCommand final : public CompositeEditCommand { public: - static PassRefPtrWillBeRawPtr<SplitTextNodeContainingElementCommand> create(PassRefPtrWillBeRawPtr<Text> node, int offset) + static RawPtr<SplitTextNodeContainingElementCommand> create(RawPtr<Text> node, int offset) { - return adoptRefWillBeNoop(new SplitTextNodeContainingElementCommand(node, offset)); + return new SplitTextNodeContainingElementCommand(node, offset); } DECLARE_VIRTUAL_TRACE(); private: - SplitTextNodeContainingElementCommand(PassRefPtrWillBeRawPtr<Text>, int offset); + SplitTextNodeContainingElementCommand(RawPtr<Text>, int offset); void doApply(EditingState*) override; - RefPtrWillBeMember<Text> m_text; + Member<Text> m_text; int m_offset; };
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp index a173fee..1db70e16 100644 --- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -73,7 +73,7 @@ if (!frame->selection().isRange()) return; - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) { + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) { updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand.get(), frame); lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking); @@ -90,7 +90,7 @@ { if (granularity == CharacterGranularity) { LocalFrame* frame = document.frame(); - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) { + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) { // If the last typing command is not Delete, open a new typing command. // We need to group continuous delete commands alone in a single typing command. if (lastTypingCommand->commandTypeOfOpenCommand() == DeleteKey) { @@ -111,7 +111,7 @@ // FIXME: Forward delete in TextEdit appears to open and close a new typing command. if (granularity == CharacterGranularity) { LocalFrame* frame = document.frame(); - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) { + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) { updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand.get(), frame); lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking); lastTypingCommand->forwardDeleteKeyPressed(granularity, options & KillRing, editingState); @@ -142,7 +142,7 @@ if (Node* startNode = selectionForInsertion.start().computeContainerNode()) { if (startNode->rootEditableElement()) { // Send BeforeTextInsertedEvent. The event handler will update text if necessary. - RefPtrWillBeRawPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text); + RawPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text); startNode->rootEditableElement()->dispatchEvent(evt); newText = evt->text(); } @@ -164,7 +164,7 @@ // FIXME: We shouldn't need to take selectionForInsertion. It should be identical to FrameSelection's current selection. void TypingCommand::insertText(Document& document, const String& text, const VisibleSelection& selectionForInsertion, Options options, TextCompositionType compositionType) { - RefPtrWillBeRawPtr<LocalFrame> frame = document.frame(); + RawPtr<LocalFrame> frame = document.frame(); ASSERT(frame); VisibleSelection currentSelection = frame->selection().selection(); @@ -174,7 +174,7 @@ // Set the starting and ending selection appropriately if we are using a selection // that is different from the current selection. In the future, we should change EditCommand // to deal with custom selections in a general way that can be used by all of the commands. - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame.get())) { + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame.get())) { if (!equalSelectionsInDOMTree(lastTypingCommand->endingSelection(), selectionForInsertion)) { lastTypingCommand->setStartingSelection(selectionForInsertion); lastTypingCommand->setEndingSelection(selectionForInsertion); @@ -189,7 +189,7 @@ return; } - RefPtrWillBeRawPtr<TypingCommand> command = TypingCommand::create(document, InsertText, newText, options, compositionType); + RawPtr<TypingCommand> command = TypingCommand::create(document, InsertText, newText, options, compositionType); bool changeSelection = !equalSelectionsInDOMTree(selectionForInsertion, currentSelection); if (changeSelection) { command->setStartingSelection(selectionForInsertion); @@ -204,7 +204,7 @@ bool TypingCommand::insertLineBreak(Document& document) { - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) { + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) { lastTypingCommand->setShouldRetainAutocorrectionIndicator(false); EditingState editingState; lastTypingCommand->insertLineBreak(&editingState); @@ -216,7 +216,7 @@ bool TypingCommand::insertParagraphSeparatorInQuotedContent(Document& document) { - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) { + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) { EditingState editingState; lastTypingCommand->insertParagraphSeparatorInQuotedContent(&editingState); return !editingState.isAborted(); @@ -227,7 +227,7 @@ bool TypingCommand::insertParagraphSeparator(Document& document) { - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) { + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) { lastTypingCommand->setShouldRetainAutocorrectionIndicator(false); EditingState editingState; lastTypingCommand->insertParagraphSeparator(&editingState); @@ -237,11 +237,11 @@ return TypingCommand::create(document, InsertParagraphSeparator, "", 0)->apply(); } -PassRefPtrWillBeRawPtr<TypingCommand> TypingCommand::lastTypingCommandIfStillOpenForTyping(LocalFrame* frame) +RawPtr<TypingCommand> TypingCommand::lastTypingCommandIfStillOpenForTyping(LocalFrame* frame) { ASSERT(frame); - RefPtrWillBeRawPtr<CompositeEditCommand> lastEditCommand = frame->editor().lastEditCommand(); + RawPtr<CompositeEditCommand> lastEditCommand = frame->editor().lastEditCommand(); if (!lastEditCommand || !lastEditCommand->isTypingCommand() || !static_cast<TypingCommand*>(lastEditCommand.get())->isOpenForMoreTyping()) return nullptr; @@ -250,7 +250,7 @@ void TypingCommand::closeTyping(LocalFrame* frame) { - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) lastTypingCommand->closeTyping(); } @@ -383,7 +383,7 @@ void TypingCommand::insertTextRunWithoutNewlines(const String &text, bool selectInsertedText, EditingState* editingState) { - RefPtrWillBeRawPtr<InsertTextCommand> command = InsertTextCommand::create(document(), text, selectInsertedText, + RawPtr<InsertTextCommand> command = InsertTextCommand::create(document(), text, selectInsertedText, m_compositionType == TextCompositionNone ? InsertTextCommand::RebalanceLeadingAndTrailingWhitespaces : InsertTextCommand::RebalanceAllWhitespaces); applyCommandToComposite(command, endingSelection(), editingState); @@ -398,7 +398,7 @@ if (!element) return false; - RefPtrWillBeRawPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n")); + RawPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n")); element->dispatchEvent(event); return event->text().length(); } @@ -495,7 +495,7 @@ m_smartDelete = false; - OwnPtrWillBeRawPtr<FrameSelection> selection = FrameSelection::create(); + RawPtr<FrameSelection> selection = FrameSelection::create(); selection->setSelection(endingSelection()); selection->modify(FrameSelection::AlterationExtend, DirectionBackward, granularity); if (killRing && selection->isCaret() && granularity != CharacterGranularity) @@ -605,7 +605,7 @@ // Handle delete at beginning-of-block case. // Do nothing in the case that the caret is at the start of a // root editable element or at the start of a document. - OwnPtrWillBeRawPtr<FrameSelection> selection = FrameSelection::create(); + RawPtr<FrameSelection> selection = FrameSelection::create(); selection->setSelection(endingSelection()); selection->modify(FrameSelection::AlterationExtend, DirectionForward, granularity); if (killRing && selection->isCaret() && granularity != CharacterGranularity)
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.h b/third_party/WebKit/Source/core/editing/commands/TypingCommand.h index 56120ab..4e6e07cd 100644 --- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.h
@@ -78,14 +78,14 @@ void setCompositionType(TextCompositionType type) { m_compositionType = type; } private: - static PassRefPtrWillBeRawPtr<TypingCommand> create(Document& document, ETypingCommand command, const String& text = "", Options options = 0, TextGranularity granularity = CharacterGranularity) + static RawPtr<TypingCommand> create(Document& document, ETypingCommand command, const String& text = "", Options options = 0, TextGranularity granularity = CharacterGranularity) { - return adoptRefWillBeNoop(new TypingCommand(document, command, text, options, granularity, TextCompositionNone)); + return new TypingCommand(document, command, text, options, granularity, TextCompositionNone); } - static PassRefPtrWillBeRawPtr<TypingCommand> create(Document& document, ETypingCommand command, const String& text, Options options, TextCompositionType compositionType) + static RawPtr<TypingCommand> create(Document& document, ETypingCommand command, const String& text, Options options, TextCompositionType compositionType) { - return adoptRefWillBeNoop(new TypingCommand(document, command, text, options, CharacterGranularity, compositionType)); + return new TypingCommand(document, command, text, options, CharacterGranularity, compositionType); } TypingCommand(Document&, ETypingCommand, const String& text, Options, TextGranularity, TextCompositionType); @@ -94,7 +94,7 @@ bool isOpenForMoreTyping() const { return m_openForMoreTyping; } void closeTyping() { m_openForMoreTyping = false; } - static PassRefPtrWillBeRawPtr<TypingCommand> lastTypingCommandIfStillOpenForTyping(LocalFrame*); + static RawPtr<TypingCommand> lastTypingCommandIfStillOpenForTyping(LocalFrame*); void doApply(EditingState*) override; EditAction editingAction() const override;
diff --git a/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp b/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp index bff41c2..07b20f67 100644 --- a/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp +++ b/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp
@@ -44,14 +44,12 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(UndoStack) - -PassOwnPtrWillBeRawPtr<UndoStack> UndoStack::create() +RawPtr<UndoStack> UndoStack::create() { - return adoptPtrWillBeNoop(new UndoStack()); + return new UndoStack(); } -void UndoStack::registerUndoStep(PassRefPtrWillBeRawPtr<UndoStep> step) +void UndoStack::registerUndoStep(RawPtr<UndoStep> step) { if (m_undoStack.size() == maximumUndoStackDepth) m_undoStack.removeFirst(); // drop oldest item off the far end @@ -60,7 +58,7 @@ m_undoStack.append(step); } -void UndoStack::registerRedoStep(PassRefPtrWillBeRawPtr<UndoStep> step) +void UndoStack::registerRedoStep(RawPtr<UndoStep> step) { m_redoStack.append(step); } @@ -98,7 +96,7 @@ { if (canUndo()) { UndoStepStack::iterator back = --m_undoStack.end(); - RefPtrWillBeRawPtr<UndoStep> step(back->get()); + RawPtr<UndoStep> step(back->get()); m_undoStack.remove(back); step->unapply(); // unapply will call us back to push this command onto the redo stack. @@ -109,7 +107,7 @@ { if (canRedo()) { UndoStepStack::iterator back = --m_redoStack.end(); - RefPtrWillBeRawPtr<UndoStep> step(back->get()); + RawPtr<UndoStep> step(back->get()); m_redoStack.remove(back); ASSERT(!m_inRedo);
diff --git a/third_party/WebKit/Source/core/editing/commands/UndoStack.h b/third_party/WebKit/Source/core/editing/commands/UndoStack.h index a3fd5e4d..c185b6f 100644 --- a/third_party/WebKit/Source/core/editing/commands/UndoStack.h +++ b/third_party/WebKit/Source/core/editing/commands/UndoStack.h
@@ -40,15 +40,13 @@ class LocalFrame; class UndoStep; -class UndoStack final : public NoBaseWillBeGarbageCollected<UndoStack> { - USING_FAST_MALLOC_WILL_BE_REMOVED(UndoStack); +class UndoStack final : public GarbageCollected<UndoStack> { WTF_MAKE_NONCOPYABLE(UndoStack); - DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(UndoStack) public: - static PassOwnPtrWillBeRawPtr<UndoStack> create(); + static RawPtr<UndoStack> create(); - void registerUndoStep(PassRefPtrWillBeRawPtr<UndoStep>); - void registerRedoStep(PassRefPtrWillBeRawPtr<UndoStep>); + void registerUndoStep(RawPtr<UndoStep>); + void registerRedoStep(RawPtr<UndoStep>); void didUnloadFrame(const LocalFrame&); bool canUndo() const; bool canRedo() const; @@ -60,7 +58,7 @@ private: UndoStack(); - typedef WillBeHeapDeque<RefPtrWillBeMember<UndoStep>> UndoStepStack; + typedef HeapDeque<Member<UndoStep>> UndoStepStack; void filterOutUndoSteps(UndoStepStack&, const LocalFrame&);
diff --git a/third_party/WebKit/Source/core/editing/commands/UndoStep.h b/third_party/WebKit/Source/core/editing/commands/UndoStep.h index 316e1f8..d678babf 100644 --- a/third_party/WebKit/Source/core/editing/commands/UndoStep.h +++ b/third_party/WebKit/Source/core/editing/commands/UndoStep.h
@@ -39,7 +39,7 @@ class LocalFrame; -class UndoStep : public RefCountedWillBeGarbageCollectedFinalized<UndoStep> { +class UndoStep : public GarbageCollectedFinalized<UndoStep> { public: virtual ~UndoStep() { } DEFINE_INLINE_VIRTUAL_TRACE() { }
diff --git a/third_party/WebKit/Source/core/editing/commands/UnlinkCommand.h b/third_party/WebKit/Source/core/editing/commands/UnlinkCommand.h index 22b0d28..307f405c 100644 --- a/third_party/WebKit/Source/core/editing/commands/UnlinkCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/UnlinkCommand.h
@@ -32,9 +32,9 @@ class UnlinkCommand final : public CompositeEditCommand { public: - static PassRefPtrWillBeRawPtr<UnlinkCommand> create(Document& document) + static RawPtr<UnlinkCommand> create(Document& document) { - return adoptRefWillBeNoop(new UnlinkCommand(document)); + return new UnlinkCommand(document); } private:
diff --git a/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.cpp b/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.cpp index bf3b4a0..c82b9aa 100644 --- a/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.cpp
@@ -31,7 +31,7 @@ namespace blink { -WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand(PassRefPtrWillBeRawPtr<Element> element) +WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand(RawPtr<Element> element) : SimpleEditCommand(element->document()) , m_element(element) {
diff --git a/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.h b/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.h index eb38e28..a2d1058 100644 --- a/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.h
@@ -34,23 +34,23 @@ class WrapContentsInDummySpanCommand final : public SimpleEditCommand { public: - static PassRefPtrWillBeRawPtr<WrapContentsInDummySpanCommand> create(PassRefPtrWillBeRawPtr<Element> element) + static RawPtr<WrapContentsInDummySpanCommand> create(RawPtr<Element> element) { - return adoptRefWillBeNoop(new WrapContentsInDummySpanCommand(element)); + return new WrapContentsInDummySpanCommand(element); } DECLARE_VIRTUAL_TRACE(); private: - explicit WrapContentsInDummySpanCommand(PassRefPtrWillBeRawPtr<Element>); + explicit WrapContentsInDummySpanCommand(RawPtr<Element>); void doApply(EditingState*) override; void doUnapply() override; void doReapply() override; void executeApply(); - RefPtrWillBeMember<Element> m_element; - RefPtrWillBeMember<HTMLSpanElement> m_dummySpan; + Member<Element> m_element; + Member<HTMLSpanElement> m_dummySpan; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/iterators/CharacterIteratorTest.cpp b/third_party/WebKit/Source/core/editing/iterators/CharacterIteratorTest.cpp index ad67277..6829901d 100644 --- a/third_party/WebKit/Source/core/editing/iterators/CharacterIteratorTest.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/CharacterIteratorTest.cpp
@@ -46,7 +46,7 @@ document().view()->updateAllLifecyclePhases(); Node* divNode = document().getElementById("div"); - RefPtrWillBeRawPtr<Range> entireRange = Range::create(document(), divNode, 0, divNode, 3); + RawPtr<Range> entireRange = Range::create(document(), divNode, 0, divNode, 3); EphemeralRange result = calculateCharacterSubrange(EphemeralRange(entireRange.get()), 2, 3); Node* textNode = divNode->lastChild();
diff --git a/third_party/WebKit/Source/core/editing/iterators/FullyClippedStateStack.cpp b/third_party/WebKit/Source/core/editing/iterators/FullyClippedStateStack.cpp index 6e39b3a..17cc709 100644 --- a/third_party/WebKit/Source/core/editing/iterators/FullyClippedStateStack.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/FullyClippedStateStack.cpp
@@ -74,7 +74,7 @@ void FullyClippedStateStackAlgorithm<Strategy>::setUpFullyClippedStack(Node* node) { // Put the nodes in a vector so we can iterate in reverse order. - WillBeHeapVector<RawPtrWillBeMember<ContainerNode>, 100> ancestry; + HeapVector<Member<ContainerNode>, 100> ancestry; for (ContainerNode* parent = parentCrossingShadowBoundaries<Strategy>(*node); parent; parent = parentCrossingShadowBoundaries<Strategy>(*parent)) ancestry.append(parent);
diff --git a/third_party/WebKit/Source/core/editing/iterators/SearchBufferTest.cpp b/third_party/WebKit/Source/core/editing/iterators/SearchBufferTest.cpp index 5185b6a..32e48286 100644 --- a/third_party/WebKit/Source/core/editing/iterators/SearchBufferTest.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/SearchBufferTest.cpp
@@ -38,12 +38,12 @@ class SearchBufferTest : public EditingTestBase { protected: - PassRefPtrWillBeRawPtr<Range> getBodyRange() const; + RawPtr<Range> getBodyRange() const; }; -PassRefPtrWillBeRawPtr<Range> SearchBufferTest::getBodyRange() const +RawPtr<Range> SearchBufferTest::getBodyRange() const { - RefPtrWillBeRawPtr<Range> range(Range::create(document())); + RawPtr<Range> range(Range::create(document())); range->selectNode(document().body()); return range.release(); } @@ -52,9 +52,9 @@ { static const char* bodyContent = "<div>foo bar test</div>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<Range> range = getBodyRange(); + RawPtr<Range> range = getBodyRange(); - RefPtrWillBeRawPtr<Range> expectedRange = range->cloneRange(); + RawPtr<Range> expectedRange = range->cloneRange(); expectedRange->collapse(false); // A lone lead surrogate (0xDA0A) example taken from fuzz-58. @@ -78,7 +78,7 @@ for (size_t i = 0; i < WTF_ARRAY_LENGTH(invalidUStrings); ++i) { String invalidTarget(invalidUStrings[i]); EphemeralRange foundRange = findPlainText(EphemeralRange(range.get()), invalidTarget, 0); - RefPtrWillBeRawPtr<Range> actualRange = Range::create(document(), foundRange.startPosition(), foundRange.endPosition()); + RawPtr<Range> actualRange = Range::create(document(), foundRange.startPosition(), foundRange.endPosition()); EXPECT_TRUE(areRangesEqual(expectedRange.get(), actualRange.get())); } }
diff --git a/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h b/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h index 9102bb6..3157fa2a 100644 --- a/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h +++ b/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h
@@ -91,21 +91,21 @@ // Current position, not necessarily of the text being returned, but position // as we walk through the DOM tree. - RawPtrWillBeMember<Node> m_node; + Member<Node> m_node; int m_offset; bool m_handledNode; bool m_handledChildren; FullyClippedStateStackAlgorithm<Strategy> m_fullyClippedStack; // End of the range. - RawPtrWillBeMember<Node> m_startNode; + Member<Node> m_startNode; int m_startOffset; // Start of the range. - RawPtrWillBeMember<Node> m_endNode; + Member<Node> m_endNode; int m_endOffset; // The current text and its position, in the form to be returned from the iterator. - RawPtrWillBeMember<Node> m_positionNode; + Member<Node> m_positionNode; int m_positionStartOffset; int m_positionEndOffset;
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h index 29eebff..5845bb3 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h +++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
@@ -157,18 +157,18 @@ // Current position, not necessarily of the text being returned, but position // as we walk through the DOM tree. - RawPtrWillBeMember<Node> m_node; + Member<Node> m_node; int m_offset; IterationProgress m_iterationProgress; FullyClippedStateStackAlgorithm<Strategy> m_fullyClippedStack; int m_shadowDepth; // The range. - RawPtrWillBeMember<Node> m_startContainer; + Member<Node> m_startContainer; int m_startOffset; - RawPtrWillBeMember<Node> m_endContainer; + Member<Node> m_endContainer; int m_endOffset; - RawPtrWillBeMember<Node> m_pastEndNode; + Member<Node> m_pastEndNode; // Used when there is still some pending text from the current node; when these // are false and 0, we go back to normal iterating. @@ -181,7 +181,7 @@ LayoutText* m_firstLetterText; // Used to do the whitespace collapsing logic. - RawPtrWillBeMember<Text> m_lastTextNode; + Member<Text> m_lastTextNode; bool m_lastTextNodeEndedWithCollapsedSpace; // Used when text boxes are out of order (Hebrew/Arabic w/ embeded LTR text)
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp index 0587b2d..8fbb9186 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
@@ -53,7 +53,7 @@ template <typename Tree> std::string iteratePartial(const typename Tree::PositionType& start, const typename Tree::PositionType& end, TextIteratorBehavior = TextIteratorDefaultBehavior); - PassRefPtrWillBeRawPtr<Range> getBodyRange() const; + RawPtr<Range> getBodyRange() const; private: template <typename Tree> @@ -63,7 +63,7 @@ template <typename Tree> std::string TextIteratorTest::iterate(TextIteratorBehavior iteratorBehavior) { - RefPtrWillBeRawPtr<Element> body = document().body(); + RawPtr<Element> body = document().body(); using PositionType = typename Tree::PositionType; auto start = PositionType(body, 0); auto end = PositionType(body, Tree::countChildren(*body)); @@ -90,9 +90,9 @@ return std::string(textChunks.utf8().data()); } -PassRefPtrWillBeRawPtr<Range> TextIteratorTest::getBodyRange() const +RawPtr<Range> TextIteratorTest::getBodyRange() const { - RefPtrWillBeRawPtr<Range> range(Range::create(document())); + RawPtr<Range> range(Range::create(document())); range->selectNode(document().body()); return range.release(); } @@ -200,7 +200,7 @@ static const char* shadowContent1 = "<span>first <span id='host-in-shadow'>shadow</span></span>"; static const char* shadowContent2 = "<span>second shadow</span>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot1 = createShadowRootForElementWithIDAndSetInnerHTML(document(), "host-in-document", shadowContent1); + RawPtr<ShadowRoot> shadowRoot1 = createShadowRootForElementWithIDAndSetInnerHTML(document(), "host-in-document", shadowContent1); createShadowRootForElementWithIDAndSetInnerHTML(*shadowRoot1, "host-in-shadow", shadowContent2); EXPECT_EQ("[Hello, ][ iterator.]", iterate<DOMTree>()); EXPECT_EQ("[Hello, ][first ][second shadow][ iterator.]", iterate<FlatTree>()); @@ -247,7 +247,7 @@ static const char* shadowContent1 = "<span>first <span id='host-in-shadow'>shadow</span></span>"; static const char* shadowContent2 = "<span>second shadow</span>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot1 = createShadowRootForElementWithIDAndSetInnerHTML(document(), "host-in-document", shadowContent1); + RawPtr<ShadowRoot> shadowRoot1 = createShadowRootForElementWithIDAndSetInnerHTML(document(), "host-in-document", shadowContent1); createShadowRootForElementWithIDAndSetInnerHTML(*shadowRoot1, "host-in-shadow", shadowContent2); EXPECT_EQ("[Hello, ][first ][second shadow][ iterator.]", iterate<DOMTree>(TextIteratorEntersOpenShadowRoots)); EXPECT_EQ("[Hello, ][first ][second shadow][ iterator.]", iterate<FlatTree>(TextIteratorEntersOpenShadowRoots)); @@ -271,7 +271,7 @@ static const char* bodyContent = "<div id='outer'>Hello, <span id='host'>text</span> iterator.</div>"; static const char* shadowContent = "<span><content>content</content> shadow</span>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithIDAndSetInnerHTML(document(), "host", shadowContent); + RawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithIDAndSetInnerHTML(document(), "host", shadowContent); Node* outerDiv = document().getElementById("outer"); Node* spanInShadow = shadowRoot->firstChild(); Position start(spanInShadow, PositionAnchorType::BeforeChildren); @@ -288,7 +288,7 @@ static const char* bodyContent = "<div id='outer'>Hello, <span id='host'>text</span> iterator.</div>"; static const char* shadowContent = "<span><content>content</content> shadow</span>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithIDAndSetInnerHTML(document(), "host", shadowContent); + RawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithIDAndSetInnerHTML(document(), "host", shadowContent); Node* outerDiv = document().getElementById("outer"); Node* spanInShadow = shadowRoot->firstChild(); Position start(outerDiv, PositionAnchorType::BeforeChildren); @@ -381,7 +381,7 @@ document().view()->updateAllLifecyclePhases(); Node* divNode = document().getElementById("div"); - RefPtrWillBeRawPtr<Range> range = Range::create(document(), divNode, 0, divNode, 3); + RawPtr<Range> range = Range::create(document(), divNode, 0, divNode, 3); EXPECT_EQ(3, TextIterator::rangeLength(range->startPosition(), range->endPosition())); }
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h index 2182e9b..ebd4907b 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h +++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h
@@ -74,8 +74,8 @@ UChar m_singleCharacterBuffer; // The current text and its position, in the form to be returned from the iterator. - RawPtrWillBeMember<Node> m_positionNode; - mutable RawPtrWillBeMember<Node> m_positionOffsetBaseNode; + Member<Node> m_positionNode; + mutable Member<Node> m_positionOffsetBaseNode; mutable int m_positionStartOffset; mutable int m_positionEndOffset;
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp index f4c2d3e..1e4c490 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
@@ -38,7 +38,7 @@ class DocumentMarkerDescription final : public DocumentMarkerDetails { public: - static PassRefPtrWillBeRawPtr<DocumentMarkerDescription> create(const String&); + static RawPtr<DocumentMarkerDescription> create(const String&); const String& description() const { return m_description; } bool isDescription() const override { return true; } @@ -52,9 +52,9 @@ String m_description; }; -PassRefPtrWillBeRawPtr<DocumentMarkerDescription> DocumentMarkerDescription::create(const String& description) +RawPtr<DocumentMarkerDescription> DocumentMarkerDescription::create(const String& description) { - return adoptRefWillBeNoop(new DocumentMarkerDescription(description)); + return new DocumentMarkerDescription(description); } inline DocumentMarkerDescription* toDocumentMarkerDescription(DocumentMarkerDetails* details) @@ -67,7 +67,7 @@ class DocumentMarkerTextMatch final : public DocumentMarkerDetails { public: - static PassRefPtrWillBeRawPtr<DocumentMarkerTextMatch> create(bool); + static RawPtr<DocumentMarkerTextMatch> create(bool); bool activeMatch() const { return m_match; } bool isTextMatch() const override { return true; } @@ -81,10 +81,10 @@ bool m_match; }; -PassRefPtrWillBeRawPtr<DocumentMarkerTextMatch> DocumentMarkerTextMatch::create(bool match) +RawPtr<DocumentMarkerTextMatch> DocumentMarkerTextMatch::create(bool match) { - DEFINE_STATIC_REF_WILL_BE_PERSISTENT(DocumentMarkerTextMatch, trueInstance, (adoptRefWillBeNoop(new DocumentMarkerTextMatch(true)))); - DEFINE_STATIC_REF_WILL_BE_PERSISTENT(DocumentMarkerTextMatch, falseInstance, (adoptRefWillBeNoop(new DocumentMarkerTextMatch(false)))); + DEFINE_STATIC_REF_WILL_BE_PERSISTENT(DocumentMarkerTextMatch, trueInstance, (new DocumentMarkerTextMatch(true))); + DEFINE_STATIC_REF_WILL_BE_PERSISTENT(DocumentMarkerTextMatch, falseInstance, (new DocumentMarkerTextMatch(false))); return match ? trueInstance : falseInstance; } @@ -97,7 +97,7 @@ class TextCompositionMarkerDetails final : public DocumentMarkerDetails { public: - static PassRefPtrWillBeRawPtr<TextCompositionMarkerDetails> create(Color underlineColor, bool thick, Color backgroundColor); + static RawPtr<TextCompositionMarkerDetails> create(Color underlineColor, bool thick, Color backgroundColor); bool isComposition() const override { return true; } Color underlineColor() const { return m_underlineColor; } @@ -117,9 +117,9 @@ bool m_thick; }; -PassRefPtrWillBeRawPtr<TextCompositionMarkerDetails> TextCompositionMarkerDetails::create(Color underlineColor, bool thick, Color backgroundColor) +RawPtr<TextCompositionMarkerDetails> TextCompositionMarkerDetails::create(Color underlineColor, bool thick, Color backgroundColor) { - return adoptRefWillBeNoop(new TextCompositionMarkerDetails(underlineColor, thick, backgroundColor)); + return new TextCompositionMarkerDetails(underlineColor, thick, backgroundColor); } inline TextCompositionMarkerDetails* toTextCompositionMarkerDetails(DocumentMarkerDetails* details)
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h index 47a050e..329be70 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
@@ -37,7 +37,7 @@ // It optionally includes a description that could be displayed in the user interface. // It also optionally includes a flag specifying whether the match is active, which is ignored // for all types other than type TextMatch. -class CORE_EXPORT DocumentMarker : public NoBaseWillBeGarbageCollected<DocumentMarker> { +class CORE_EXPORT DocumentMarker : public GarbageCollected<DocumentMarker> { public: enum MarkerTypeIndex { SpellingMarkerIndex = 0, @@ -139,18 +139,18 @@ MarkerType m_type; unsigned m_startOffset; unsigned m_endOffset; - RefPtrWillBeMember<DocumentMarkerDetails> m_details; + Member<DocumentMarkerDetails> m_details; uint32_t m_hash; }; -using DocumentMarkerVector = WillBeHeapVector<RawPtrWillBeMember<DocumentMarker>>; +using DocumentMarkerVector = HeapVector<Member<DocumentMarker>>; inline DocumentMarkerDetails* DocumentMarker::details() const { return m_details.get(); } -class DocumentMarkerDetails : public RefCountedWillBeGarbageCollectedFinalized<DocumentMarkerDetails> { +class DocumentMarkerDetails : public GarbageCollectedFinalized<DocumentMarkerDetails> { public: DocumentMarkerDetails() { } virtual ~DocumentMarkerDetails();
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp index b7211a6..04446715 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
@@ -89,8 +89,6 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DocumentMarkerController); - void DocumentMarkerController::clear() { m_markers.clear(); @@ -143,39 +141,39 @@ DocumentMarkerController::removeMarkers(markedText, markerTypes, shouldRemovePartiallyOverlappingMarker); } -static bool startsFurther(const OwnPtrWillBeMember<RenderedDocumentMarker>& lhv, const DocumentMarker* rhv) +static bool startsFurther(const Member<RenderedDocumentMarker>& lhv, const DocumentMarker* rhv) { return lhv->startOffset() < rhv->startOffset(); } -static bool startsAfter(const OwnPtrWillBeMember<RenderedDocumentMarker>& marker, size_t startOffset) +static bool startsAfter(const Member<RenderedDocumentMarker>& marker, size_t startOffset) { return marker->startOffset() < startOffset; } -static bool endsBefore(size_t startOffset, const OwnPtrWillBeMember<RenderedDocumentMarker>& rhv) +static bool endsBefore(size_t startOffset, const Member<RenderedDocumentMarker>& rhv) { return startOffset < rhv->endOffset(); } -static bool compareByStart(const RawPtrWillBeMember<DocumentMarker>& lhv, const RawPtrWillBeMember<DocumentMarker>& rhv) +static bool compareByStart(const Member<DocumentMarker>& lhv, const Member<DocumentMarker>& rhv) { return lhv->startOffset() < rhv->startOffset(); } -static bool doesNotOverlap(const OwnPtrWillBeMember<RenderedDocumentMarker>& lhv, const DocumentMarker* rhv) +static bool doesNotOverlap(const Member<RenderedDocumentMarker>& lhv, const DocumentMarker* rhv) { return lhv->endOffset() < rhv->startOffset(); } -static bool doesNotInclude(const OwnPtrWillBeMember<RenderedDocumentMarker>& marker, size_t startOffset) +static bool doesNotInclude(const Member<RenderedDocumentMarker>& marker, size_t startOffset) { return marker->endOffset() < startOffset; } static bool updateMarkerRenderedRect(Node* node, RenderedDocumentMarker& marker) { - RefPtrWillBeRawPtr<Range> range = Range::create(node->document()); + RawPtr<Range> range = Range::create(node->document()); // The offsets of the marker may be out-dated, so check for exceptions. TrackExceptionState exceptionState; range->setStart(node, marker.startOffset(), exceptionState); @@ -197,7 +195,7 @@ m_possiblyExistingMarkerTypes.add(newMarker.type()); - OwnPtrWillBeMember<MarkerLists>& markers = m_markers.add(node, nullptr).storedValue->value; + Member<MarkerLists>& markers = m_markers.add(node, nullptr).storedValue->value; if (!markers) { markers = adoptPtrWillBeNoop(new MarkerLists); markers->grow(DocumentMarker::MarkerTypeIndexesCount); @@ -208,8 +206,8 @@ markers->insert(markerListIndex, adoptPtrWillBeNoop(new MarkerList)); } - OwnPtrWillBeMember<MarkerList>& list = markers->at(markerListIndex); - OwnPtrWillBeRawPtr<RenderedDocumentMarker> newRenderedMarker = RenderedDocumentMarker::create(newMarker); + Member<MarkerList>& list = markers->at(markerListIndex); + RawPtr<RenderedDocumentMarker> newRenderedMarker = RenderedDocumentMarker::create(newMarker); updateMarkerRenderedRect(node, *newRenderedMarker); if (list->isEmpty() || list->last()->endOffset() < newMarker.startOffset()) { list->append(newRenderedMarker.release()); @@ -227,7 +225,7 @@ node->layoutObject()->setShouldDoFullPaintInvalidation(); } -void DocumentMarkerController::mergeOverlapping(MarkerList* list, PassOwnPtrWillBeRawPtr<RenderedDocumentMarker> toInsert) +void DocumentMarkerController::mergeOverlapping(MarkerList* list, RawPtr<RenderedDocumentMarker> toInsert) { MarkerList::iterator firstOverlapping = std::lower_bound(list->begin(), list->end(), toInsert.get(), doesNotOverlap); size_t index = firstOverlapping - list->begin(); @@ -258,7 +256,7 @@ bool docDirty = false; for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) { - OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; + Member<MarkerList>& list = (*markers)[markerListIndex]; if (!list) continue; @@ -304,7 +302,7 @@ bool docDirty = false; size_t emptyListsCount = 0; for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) { - OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; + Member<MarkerList>& list = (*markers)[markerListIndex]; if (!list || list->isEmpty()) { if (list.get() && list->isEmpty()) list.clear(); @@ -380,7 +378,7 @@ for (MarkerMap::iterator nodeIterator = m_markers.begin(); nodeIterator != end; ++nodeIterator) { // inner loop; process each marker in this node MarkerLists* markers = nodeIterator->value.get(); - OwnPtrWillBeMember<MarkerList>& list = (*markers)[MarkerTypeToMarkerIndex(markerType)]; + Member<MarkerList>& list = (*markers)[MarkerTypeToMarkerIndex(markerType)]; unsigned markerCount = list.get() ? list->size() : 0; for (unsigned markerIndex = 0; markerIndex < markerCount; ++markerIndex) { RenderedDocumentMarker* marker = list->at(markerIndex).get(); @@ -401,7 +399,7 @@ return result; for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) { - OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; + Member<MarkerList>& list = (*markers)[markerListIndex]; if (!list || list->isEmpty() || !markerTypes.contains((*list->begin())->type())) continue; @@ -419,7 +417,7 @@ for (MarkerMap::iterator i = m_markers.begin(); i != m_markers.end(); ++i) { MarkerLists* markers = i->value.get(); for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) { - OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; + Member<MarkerList>& list = (*markers)[markerListIndex]; for (size_t j = 0; list.get() && j < list->size(); ++j) result.append(list->at(j).get()); } @@ -471,7 +469,7 @@ // inner loop; process each marker in this node MarkerLists* markers = nodeIterator->value.get(); for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) { - OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; + Member<MarkerList>& list = (*markers)[markerListIndex]; if (!list || list->isEmpty() || (*list->begin())->type() != markerType) continue; for (unsigned markerIndex = 0; markerIndex < list->size(); ++markerIndex) { @@ -535,7 +533,7 @@ continue; MarkerLists& markers = *nodeMarkers.value; for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) { - OwnPtrWillBeMember<MarkerList>& list = markers[markerListIndex]; + Member<MarkerList>& list = markers[markerListIndex]; if (!list) continue; bool removedMarkers = false; @@ -557,7 +555,7 @@ return; ASSERT(!m_markers.isEmpty()); - WillBeHeapVector<RawPtrWillBeMember<const Node>> nodesWithMarkers; + HeapVector<Member<const Node>> nodesWithMarkers; copyKeysToVector(m_markers, nodesWithMarkers); unsigned size = nodesWithMarkers.size(); for (unsigned i = 0; i < size; ++i) { @@ -582,7 +580,7 @@ MarkerLists* markers = iterator->value.get(); for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) { - OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; + Member<MarkerList>& list = (*markers)[markerListIndex]; if (!list || list->isEmpty()) { if (list.get() && list->isEmpty()) list.clear(); @@ -628,7 +626,7 @@ // inner loop: process each marker in the current node MarkerLists* markers = i->value.get(); for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) { - OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; + Member<MarkerList>& list = (*markers)[markerListIndex]; if (!list || list->isEmpty() || !markerTypes.contains((*list->begin())->type())) continue; @@ -653,7 +651,7 @@ bool docDirty = false; for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) { - OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; + Member<MarkerList>& list = (*markers)[markerListIndex]; if (!list) continue; MarkerList::iterator startPos = std::lower_bound(list->begin(), list->end(), startOffset, startsAfter); @@ -702,7 +700,7 @@ return false; bool docDirty = false; - OwnPtrWillBeMember<MarkerList>& list = (*markers)[MarkerTypeToMarkerIndex(DocumentMarker::TextMatch)]; + Member<MarkerList>& list = (*markers)[MarkerTypeToMarkerIndex(DocumentMarker::TextMatch)]; if (!list) return false; MarkerList::iterator startPos = std::upper_bound(list->begin(), list->end(), startOffset, endsBefore); @@ -732,7 +730,7 @@ fprintf(stderr, "%p", node); MarkerLists* markers = m_markers.get(node); for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) { - OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; + Member<MarkerList>& list = (*markers)[markerListIndex]; for (unsigned markerIndex = 0; list.get() && markerIndex < list->size(); ++markerIndex) { DocumentMarker* marker = list->at(markerIndex).get(); fprintf(stderr, " %d:[%d:%d](%d)", marker->type(), marker->startOffset(), marker->endOffset(), marker->activeMatch());
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h index decf631..77f8a72 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
@@ -53,9 +53,8 @@ Vector<String> m_words; }; -class CORE_EXPORT DocumentMarkerController final : public NoBaseWillBeGarbageCollected<DocumentMarkerController> { - WTF_MAKE_NONCOPYABLE(DocumentMarkerController); USING_FAST_MALLOC_WILL_BE_REMOVED(DocumentMarkerController); - DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DocumentMarkerController); +class CORE_EXPORT DocumentMarkerController final : public GarbageCollected<DocumentMarkerController> { + WTF_MAKE_NONCOPYABLE(DocumentMarkerController); public: DocumentMarkerController(); @@ -102,10 +101,10 @@ private: void addMarker(Node*, const DocumentMarker&); - using MarkerList = WillBeHeapVector<OwnPtrWillBeMember<RenderedDocumentMarker>>; - using MarkerLists = WillBeHeapVector<OwnPtrWillBeMember<MarkerList>, DocumentMarker::MarkerTypeIndexesCount>; - using MarkerMap = WillBeHeapHashMap<RawPtrWillBeWeakMember<const Node>, OwnPtrWillBeMember<MarkerLists>>; - void mergeOverlapping(MarkerList*, PassOwnPtrWillBeRawPtr<RenderedDocumentMarker>); + using MarkerList = HeapVector<Member<RenderedDocumentMarker>>; + using MarkerLists = HeapVector<Member<MarkerList>, DocumentMarker::MarkerTypeIndexesCount>; + using MarkerMap = HeapHashMap<WeakMember<const Node>, Member<MarkerLists>>; + void mergeOverlapping(MarkerList*, RawPtr<RenderedDocumentMarker>); bool possiblyHasMarkers(DocumentMarker::MarkerTypes); void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes); void removeMarkers(TextIterator&, DocumentMarker::MarkerTypes, RemovePartiallyOverlappingMarkerOrNot);
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp index 07f81c7..9106956 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp
@@ -54,21 +54,21 @@ Document& document() const { return m_dummyPageHolder->document(); } DocumentMarkerController& markerController() const { return document().markers(); } - PassRefPtrWillBeRawPtr<Text> createTextNode(const char*); - void markNodeContents(PassRefPtrWillBeRawPtr<Node>); - void markNodeContentsWithComposition(PassRefPtrWillBeRawPtr<Node>); + RawPtr<Text> createTextNode(const char*); + void markNodeContents(RawPtr<Node>); + void markNodeContentsWithComposition(RawPtr<Node>); void setBodyInnerHTML(const char*); private: OwnPtr<DummyPageHolder> m_dummyPageHolder; }; -PassRefPtrWillBeRawPtr<Text> DocumentMarkerControllerTest::createTextNode(const char* textContents) +RawPtr<Text> DocumentMarkerControllerTest::createTextNode(const char* textContents) { return document().createTextNode(String::fromUTF8(textContents)); } -void DocumentMarkerControllerTest::markNodeContents(PassRefPtrWillBeRawPtr<Node> node) +void DocumentMarkerControllerTest::markNodeContents(RawPtr<Node> node) { // Force layoutObjects to be created; TextIterator, which is used in // DocumentMarkerControllerTest::addMarker(), needs them. @@ -77,7 +77,7 @@ markerController().addMarker(range.startPosition(), range.endPosition(), DocumentMarker::Spelling); } -void DocumentMarkerControllerTest::markNodeContentsWithComposition(PassRefPtrWillBeRawPtr<Node> node) +void DocumentMarkerControllerTest::markNodeContentsWithComposition(RawPtr<Node> node) { // Force layoutObjects to be created; TextIterator, which is used in // DocumentMarkerControllerTest::addMarker(), needs them. @@ -94,10 +94,10 @@ TEST_F(DocumentMarkerControllerTest, DidMoveToNewDocument) { setBodyInnerHTML("<b><i>foo</i></b>"); - RefPtrWillBeRawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); + RawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); markNodeContents(parent.get()); EXPECT_EQ(1u, markerController().markers().size()); - RefPtrWillBePersistent<Document> anotherDocument = Document::create(); + Persistent<Document> anotherDocument = Document::create(); anotherDocument->adoptNode(parent.get(), ASSERT_NO_EXCEPTION); // No more reference to marked node. @@ -110,7 +110,7 @@ { setBodyInnerHTML("<b><i>foo</i></b>"); { - RefPtrWillBeRawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); + RawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); parent->appendChild(createTextNode("bar").get()); markNodeContents(parent.get()); EXPECT_EQ(2u, markerController().markers().size()); @@ -124,7 +124,7 @@ TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedMarkedByRemoveChildren) { setBodyInnerHTML("<b><i>foo</i></b>"); - RefPtrWillBeRawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); + RawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); markNodeContents(parent.get()); EXPECT_EQ(1u, markerController().markers().size()); parent->removeChildren(); @@ -137,7 +137,7 @@ { setBodyInnerHTML("<b><i>foo</i></b>"); { - RefPtrWillBeRawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); + RawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); markNodeContents(parent); EXPECT_EQ(1u, markerController().markers().size()); parent->removeChild(parent->firstChild()); @@ -151,7 +151,7 @@ { setBodyInnerHTML("<b><i>foo</i></b>"); { - RefPtrWillBeRawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); + RawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); markNodeContents(parent); EXPECT_EQ(1u, markerController().markers().size()); parent->parentNode()->parentNode()->removeChild(parent->parentNode()); @@ -165,7 +165,7 @@ { setBodyInnerHTML("<b><i>foo</i></b>"); { - RefPtrWillBeRawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); + RawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); markNodeContents(parent); EXPECT_EQ(1u, markerController().markers().size()); parent->parentNode()->removeChild(parent.get()); @@ -179,7 +179,7 @@ { setBodyInnerHTML("<b><i>foo</i></b>"); { - RefPtrWillBeRawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); + RawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); markNodeContents(parent.get()); EXPECT_EQ(1u, markerController().markers().size()); parent->replaceChild(createTextNode("bar").get(), parent->firstChild()); @@ -193,7 +193,7 @@ { setBodyInnerHTML("<b><i>foo</i></b>"); { - RefPtrWillBeRawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); + RawPtr<Element> parent = toElement(document().body()->firstChild()->firstChild()); markNodeContents(parent); EXPECT_EQ(1u, markerController().markers().size()); setBodyInnerHTML(""); @@ -208,7 +208,7 @@ IntRect invalidRect(RenderedDocumentMarker::create(DocumentMarker(0, 0, false))->renderedRect()); setBodyInnerHTML("<div style='margin: 100px'>foo</div>"); - RefPtrWillBeRawPtr<Element> div = toElement(document().body()->firstChild()); + RawPtr<Element> div = toElement(document().body()->firstChild()); markNodeContents(div); Vector<IntRect> renderedRects = markerController().renderedRectsForMarkers(DocumentMarker::Spelling); EXPECT_EQ(1u, renderedRects.size()); @@ -226,7 +226,7 @@ IntRect invalidRect(RenderedDocumentMarker::create(DocumentMarker(0, 0, false))->renderedRect()); setBodyInnerHTML("<div style='margin: 100px'>foo</div>"); - RefPtrWillBeRawPtr<Element> div = toElement(document().body()->firstChild()); + RawPtr<Element> div = toElement(document().body()->firstChild()); markNodeContentsWithComposition(div); Vector<IntRect> renderedRects = markerController().renderedRectsForMarkers(DocumentMarker::Composition); EXPECT_EQ(1u, renderedRects.size()); @@ -244,7 +244,7 @@ IntRect invalidRect(RenderedDocumentMarker::create(DocumentMarker(0, 0, false))->renderedRect()); setBodyInnerHTML("<div style='margin: 100px'>foo</div>"); - RefPtrWillBeRawPtr<Node> text = document().body()->firstChild()->firstChild(); + RawPtr<Node> text = document().body()->firstChild()->firstChild(); document().updateLayout(); markerController().addCompositionMarker(Position(text, 0), Position(text, 1), Color::black, false, Color::black); markerController().addCompositionMarker(Position(text, 1), Position(text, 3), Color::black, true, Color::black); @@ -255,11 +255,11 @@ TEST_F(DocumentMarkerControllerTest, SetMarkerActiveTest) { setBodyInnerHTML("<b>foo</b>"); - RefPtrWillBeRawPtr<Element> bElement = toElement(document().body()->firstChild()); + RawPtr<Element> bElement = toElement(document().body()->firstChild()); EphemeralRange ephemeralRange = EphemeralRange::rangeOfContents(*bElement); Position startBElement = toPositionInDOMTree(ephemeralRange.startPosition()); Position endBElement = toPositionInDOMTree(ephemeralRange.endPosition()); - RefPtrWillBeRawPtr<Range> range = Range::create(document(), startBElement, endBElement); + RawPtr<Range> range = Range::create(document(), startBElement, endBElement); // Try to make active a marker that doesn't exist. EXPECT_FALSE(markerController().setMarkersActive(range.get(), true));
diff --git a/third_party/WebKit/Source/core/editing/markers/RenderedDocumentMarker.h b/third_party/WebKit/Source/core/editing/markers/RenderedDocumentMarker.h index fc4ef69c..236e78c4 100644 --- a/third_party/WebKit/Source/core/editing/markers/RenderedDocumentMarker.h +++ b/third_party/WebKit/Source/core/editing/markers/RenderedDocumentMarker.h
@@ -34,9 +34,9 @@ class RenderedDocumentMarker final : public DocumentMarker { public: - static PassOwnPtrWillBeRawPtr<RenderedDocumentMarker> create(const DocumentMarker& marker) + static RawPtr<RenderedDocumentMarker> create(const DocumentMarker& marker) { - return adoptPtrWillBeNoop(new RenderedDocumentMarker(marker)); + return new RenderedDocumentMarker(marker); } bool isRendered() const { return invalidMarkerRect() != m_renderedRect; }
diff --git a/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp b/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp index 173e4a4..3d3bd0f 100644 --- a/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp +++ b/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp
@@ -79,7 +79,7 @@ { } - AttributeChange(PassRefPtrWillBeRawPtr<Element> element, const QualifiedName& name, const String& value) + AttributeChange(RawPtr<Element> element, const QualifiedName& name, const String& value) : m_element(element), m_name(name), m_value(value) { } @@ -95,7 +95,7 @@ } private: - RefPtrWillBeMember<Element> m_element; + Member<Element> m_element; QualifiedName m_name; String m_value; }; @@ -108,7 +108,7 @@ static void completeURLs(DocumentFragment& fragment, const String& baseURL) { - WillBeHeapVector<AttributeChange> changes; + HeapVector<AttributeChange> changes; KURL parsedBaseURL(ParsedURLString, baseURL); @@ -161,7 +161,7 @@ { if (!style) return false; - RefPtrWillBeRawPtr<CSSValue> value = style->getPropertyCSSValue(propertyID); + RawPtr<CSSValue> value = style->getPropertyCSSValue(propertyID); if (!value) return true; if (!value->isPrimitiveValue()) @@ -272,11 +272,11 @@ return CreateMarkupAlgorithm<EditingInFlatTreeStrategy>::createMarkup(startPosition, endPosition, shouldAnnotate, convertBlocksToInlines, shouldResolveURLs, constrainingAncestor); } -PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentFromMarkup(Document& document, const String& markup, const String& baseURL, ParserContentPolicy parserContentPolicy) +RawPtr<DocumentFragment> createFragmentFromMarkup(Document& document, const String& markup, const String& baseURL, ParserContentPolicy parserContentPolicy) { // We use a fake body element here to trick the HTML parser to using the InBody insertion mode. - RefPtrWillBeRawPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(document); - RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(document); + RawPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(document); + RawPtr<DocumentFragment> fragment = DocumentFragment::create(document); fragment->parseHTML(markup, fakeBody.get(), parserContentPolicy); @@ -288,7 +288,7 @@ static const char fragmentMarkerTag[] = "webkit-fragment-marker"; -static bool findNodesSurroundingContext(DocumentFragment* fragment, RefPtrWillBeRawPtr<Comment>& nodeBeforeContext, RefPtrWillBeRawPtr<Comment>& nodeAfterContext) +static bool findNodesSurroundingContext(DocumentFragment* fragment, RawPtr<Comment>& nodeBeforeContext, RawPtr<Comment>& nodeAfterContext) { for (Node& node : NodeTraversal::startsAt(fragment->firstChild())) { if (node.getNodeType() == Node::COMMENT_NODE && toComment(node).data() == fragmentMarkerTag) { @@ -305,8 +305,8 @@ static void trimFragment(DocumentFragment* fragment, Comment* nodeBeforeContext, Comment* nodeAfterContext) { - RefPtrWillBeRawPtr<Node> next = nullptr; - for (RefPtrWillBeRawPtr<Node> node = fragment->firstChild(); node; node = next) { + RawPtr<Node> next = nullptr; + for (RawPtr<Node> node = fragment->firstChild(); node; node = next) { if (nodeBeforeContext->isDescendantOf(node.get())) { next = NodeTraversal::next(*node); continue; @@ -319,13 +319,13 @@ } ASSERT(nodeAfterContext->parentNode()); - for (RefPtrWillBeRawPtr<Node> node = nodeAfterContext; node; node = next) { + for (RawPtr<Node> node = nodeAfterContext; node; node = next) { next = NodeTraversal::nextSkippingChildren(*node); node->parentNode()->removeChild(node.get(), ASSERT_NO_EXCEPTION); } } -PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentFromMarkupWithContext(Document& document, const String& markup, unsigned fragmentStart, unsigned fragmentEnd, +RawPtr<DocumentFragment> createFragmentFromMarkupWithContext(Document& document, const String& markup, unsigned fragmentStart, unsigned fragmentEnd, const String& baseURL, ParserContentPolicy parserContentPolicy) { // FIXME: Need to handle the case where the markup already contains these markers. @@ -337,21 +337,21 @@ MarkupFormatter::appendComment(taggedMarkup, fragmentMarkerTag); taggedMarkup.append(markup.substring(fragmentEnd)); - RefPtrWillBeRawPtr<DocumentFragment> taggedFragment = createFragmentFromMarkup(document, taggedMarkup.toString(), baseURL, parserContentPolicy); + RawPtr<DocumentFragment> taggedFragment = createFragmentFromMarkup(document, taggedMarkup.toString(), baseURL, parserContentPolicy); - RefPtrWillBeRawPtr<Comment> nodeBeforeContext = nullptr; - RefPtrWillBeRawPtr<Comment> nodeAfterContext = nullptr; + RawPtr<Comment> nodeBeforeContext = nullptr; + RawPtr<Comment> nodeAfterContext = nullptr; if (!findNodesSurroundingContext(taggedFragment.get(), nodeBeforeContext, nodeAfterContext)) return nullptr; - RefPtrWillBeRawPtr<Document> taggedDocument = Document::create(); + RawPtr<Document> taggedDocument = Document::create(); taggedDocument->setContextFeatures(document.contextFeatures()); - RefPtrWillBeRawPtr<Element> root = Element::create(QualifiedName::null(), taggedDocument.get()); + RawPtr<Element> root = Element::create(QualifiedName::null(), taggedDocument.get()); root->appendChild(taggedFragment.get()); taggedDocument->appendChild(root); - RefPtrWillBeRawPtr<Range> range = Range::create(*taggedDocument.get(), + RawPtr<Range> range = Range::create(*taggedDocument.get(), positionAfterNode(nodeBeforeContext.get()).parentAnchoredEquivalent(), positionBeforeNode(nodeAfterContext.get()).parentAnchoredEquivalent()); @@ -361,7 +361,7 @@ // When there's a special common ancestor outside of the fragment, we must include it as well to // preserve the structure and appearance of the fragment. For example, if the fragment contains // TD, we need to include the enclosing TABLE tag as well. - RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(document); + RawPtr<DocumentFragment> fragment = DocumentFragment::create(document); if (specialCommonAncestor) fragment->appendChild(specialCommonAncestor); else @@ -406,7 +406,7 @@ paragraph->appendChild(createTabSpanElement(document, tabText.toString())); tabText.clear(); } - RefPtrWillBeRawPtr<Text> textNode = document.createTextNode(stringWithRebalancedWhitespace(s, first, i + 1 == numEntries)); + RawPtr<Text> textNode = document.createTextNode(stringWithRebalancedWhitespace(s, first, i + 1 == numEntries)); paragraph->appendChild(textNode.release()); } @@ -452,13 +452,13 @@ return false; } -PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentFromText(const EphemeralRange& context, const String& text) +RawPtr<DocumentFragment> createFragmentFromText(const EphemeralRange& context, const String& text) { if (context.isNull()) return nullptr; Document& document = context.document(); - RefPtrWillBeRawPtr<DocumentFragment> fragment = document.createDocumentFragment(); + RawPtr<DocumentFragment> fragment = document.createDocumentFragment(); if (text.isEmpty()) return fragment.release(); @@ -470,7 +470,7 @@ if (!isRichlyEditablePosition(context.startPosition()) || shouldPreserveNewline(context)) { fragment->appendChild(document.createTextNode(string)); if (string.endsWith('\n')) { - RefPtrWillBeRawPtr<HTMLBRElement> element = HTMLBRElement::create(document); + RawPtr<HTMLBRElement> element = HTMLBRElement::create(document); element->setAttribute(classAttr, AppleInterchangeNewline); fragment->appendChild(element.release()); } @@ -496,7 +496,7 @@ for (size_t i = 0; i < numLines; ++i) { const String& s = list[i]; - RefPtrWillBeRawPtr<Element> element = nullptr; + RawPtr<Element> element = nullptr; if (s.isEmpty() && i + 1 == numLines) { // For last line, use the "magic BR" rather than a P. element = HTMLBRElement::create(document); @@ -524,11 +524,11 @@ return markup.toString(); } -PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentForInnerOuterHTML(const String& markup, Element* contextElement, ParserContentPolicy parserContentPolicy, const char* method, ExceptionState& exceptionState) +RawPtr<DocumentFragment> createFragmentForInnerOuterHTML(const String& markup, Element* contextElement, ParserContentPolicy parserContentPolicy, const char* method, ExceptionState& exceptionState) { ASSERT(contextElement); Document& document = isHTMLTemplateElement(*contextElement) ? contextElement->document().ensureTemplateDocument() : contextElement->document(); - RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(document); + RawPtr<DocumentFragment> fragment = DocumentFragment::create(document); if (document.isHTMLDocument()) { fragment->parseHTML(markup, contextElement, parserContentPolicy); @@ -543,16 +543,16 @@ return fragment.release(); } -PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentForTransformToFragment(const String& sourceString, const String& sourceMIMEType, Document& outputDoc) +RawPtr<DocumentFragment> createFragmentForTransformToFragment(const String& sourceString, const String& sourceMIMEType, Document& outputDoc) { - RefPtrWillBeRawPtr<DocumentFragment> fragment = outputDoc.createDocumentFragment(); + RawPtr<DocumentFragment> fragment = outputDoc.createDocumentFragment(); if (sourceMIMEType == "text/html") { // As far as I can tell, there isn't a spec for how transformToFragment is supposed to work. // Based on the documentation I can find, it looks like we want to start parsing the fragment in the InBody insertion mode. // Unfortunately, that's an implementation detail of the parser. // We achieve that effect here by passing in a fake body element as context for the fragment. - RefPtrWillBeRawPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(outputDoc); + RawPtr<HTMLBodyElement> fakeBody = HTMLBodyElement::create(outputDoc); fragment->parseHTML(sourceString, fakeBody.get()); } else if (sourceMIMEType == "text/plain") { fragment->parserAppendChild(Text::create(outputDoc, sourceString)); @@ -567,10 +567,10 @@ return fragment.release(); } -static inline void removeElementPreservingChildren(PassRefPtrWillBeRawPtr<DocumentFragment> fragment, HTMLElement* element) +static inline void removeElementPreservingChildren(RawPtr<DocumentFragment> fragment, HTMLElement* element) { - RefPtrWillBeRawPtr<Node> nextChild = nullptr; - for (RefPtrWillBeRawPtr<Node> child = element->firstChild(); child; child = nextChild) { + RawPtr<Node> nextChild = nullptr; + for (RawPtr<Node> child = element->firstChild(); child; child = nextChild) { nextChild = child->nextSibling(); element->removeChild(child.get()); fragment->insertBefore(child, element); @@ -592,7 +592,7 @@ return !htmlElement.ieForbidsInsertHTML(); } -PassRefPtrWillBeRawPtr<DocumentFragment> createContextualFragment(const String& markup, Element* element, ParserContentPolicy parserContentPolicy, ExceptionState& exceptionState) +RawPtr<DocumentFragment> createContextualFragment(const String& markup, Element* element, ParserContentPolicy parserContentPolicy, ExceptionState& exceptionState) { ASSERT(element); if (!isSupportedContainer(element)) { @@ -600,7 +600,7 @@ return nullptr; } - RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, element, parserContentPolicy, "createContextualFragment", exceptionState); + RawPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, element, parserContentPolicy, "createContextualFragment", exceptionState); if (!fragment) return nullptr; @@ -608,8 +608,8 @@ // accommodate folks passing complete HTML documents to make the // child of an element. - RefPtrWillBeRawPtr<Node> nextNode = nullptr; - for (RefPtrWillBeRawPtr<Node> node = fragment->firstChild(); node; node = nextNode) { + RawPtr<Node> nextNode = nullptr; + for (RawPtr<Node> node = fragment->firstChild(); node; node = nextNode) { nextNode = node->nextSibling(); if (isHTMLHtmlElement(*node) || isHTMLHeadElement(*node) || isHTMLBodyElement(*node)) { HTMLElement* element = toHTMLElement(node); @@ -621,10 +621,10 @@ return fragment.release(); } -void replaceChildrenWithFragment(ContainerNode* container, PassRefPtrWillBeRawPtr<DocumentFragment> fragment, ExceptionState& exceptionState) +void replaceChildrenWithFragment(ContainerNode* container, RawPtr<DocumentFragment> fragment, ExceptionState& exceptionState) { ASSERT(container); - RefPtrWillBeRawPtr<ContainerNode> containerNode(container); + RawPtr<ContainerNode> containerNode(container); ChildListMutationScope mutation(*containerNode); @@ -652,7 +652,7 @@ void replaceChildrenWithText(ContainerNode* container, const String& text, ExceptionState& exceptionState) { ASSERT(container); - RefPtrWillBeRawPtr<ContainerNode> containerNode(container); + RawPtr<ContainerNode> containerNode(container); ChildListMutationScope mutation(*containerNode); @@ -672,7 +672,7 @@ } // NOTE: This method currently always creates a text node, even if that text node will be empty. - RefPtrWillBeRawPtr<Text> textNode = Text::create(containerNode->document(), text); + RawPtr<Text> textNode = Text::create(containerNode->document(), text); // FIXME: No need to replace the child it is a text node and its contents are already == text. if (containerNode->hasOneChild()) { @@ -691,7 +691,7 @@ if (!next || !next->isTextNode()) return; - RefPtrWillBeRawPtr<Text> textNext = toText(next); + RawPtr<Text> textNext = toText(next); textNode->appendData(textNext->data()); if (textNext->parentNode()) // Might have been removed by mutation event. textNext->remove(exceptionState);
diff --git a/third_party/WebKit/Source/core/editing/serializers/Serialization.h b/third_party/WebKit/Source/core/editing/serializers/Serialization.h index 9c3fdec..1fae14dd 100644 --- a/third_party/WebKit/Source/core/editing/serializers/Serialization.h +++ b/third_party/WebKit/Source/core/editing/serializers/Serialization.h
@@ -51,18 +51,18 @@ enum EAbsoluteURLs { DoNotResolveURLs, ResolveAllURLs, ResolveNonLocalURLs }; enum class ConvertBlocksToInlines { NotConvert, Convert }; -PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentFromText(const EphemeralRange& context, const String& text); -PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentFromMarkup(Document&, const String& markup, const String& baseURL, ParserContentPolicy = AllowScriptingContent); -PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentFromMarkupWithContext(Document&, const String& markup, unsigned fragmentStart, unsigned fragmentEnd, const String& baseURL, ParserContentPolicy); -PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentForInnerOuterHTML(const String&, Element*, ParserContentPolicy, const char* method, ExceptionState&); -PassRefPtrWillBeRawPtr<DocumentFragment> createFragmentForTransformToFragment(const String&, const String& sourceMIMEType, Document& outputDoc); -PassRefPtrWillBeRawPtr<DocumentFragment> createContextualFragment(const String&, Element*, ParserContentPolicy, ExceptionState&); +RawPtr<DocumentFragment> createFragmentFromText(const EphemeralRange& context, const String& text); +RawPtr<DocumentFragment> createFragmentFromMarkup(Document&, const String& markup, const String& baseURL, ParserContentPolicy = AllowScriptingContent); +RawPtr<DocumentFragment> createFragmentFromMarkupWithContext(Document&, const String& markup, unsigned fragmentStart, unsigned fragmentEnd, const String& baseURL, ParserContentPolicy); +RawPtr<DocumentFragment> createFragmentForInnerOuterHTML(const String&, Element*, ParserContentPolicy, const char* method, ExceptionState&); +RawPtr<DocumentFragment> createFragmentForTransformToFragment(const String&, const String& sourceMIMEType, Document& outputDoc); +RawPtr<DocumentFragment> createContextualFragment(const String&, Element*, ParserContentPolicy, ExceptionState&); bool isPlainTextMarkup(Node*); // These methods are used by HTMLElement & ShadowRoot to replace the // children with respected fragment/text. -void replaceChildrenWithFragment(ContainerNode*, PassRefPtrWillBeRawPtr<DocumentFragment>, ExceptionState&); +void replaceChildrenWithFragment(ContainerNode*, RawPtr<DocumentFragment>, ExceptionState&); void replaceChildrenWithText(ContainerNode*, const String&, ExceptionState&); CORE_EXPORT String createMarkup(const Node*, EChildrenOnly = IncludeNode, EAbsoluteURLs = DoNotResolveURLs);
diff --git a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.cpp b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.cpp index 83d4b788..b541cc2 100644 --- a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.cpp +++ b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.cpp
@@ -50,7 +50,7 @@ using namespace HTMLNames; -StyledMarkupAccumulator::StyledMarkupAccumulator(EAbsoluteURLs shouldResolveURLs, const TextOffset& start, const TextOffset& end, const PassRefPtrWillBeRawPtr<Document> document, EAnnotateForInterchange shouldAnnotate, ConvertBlocksToInlines convertBlocksToInlines) +StyledMarkupAccumulator::StyledMarkupAccumulator(EAbsoluteURLs shouldResolveURLs, const TextOffset& start, const TextOffset& end, const RawPtr<Document> document, EAnnotateForInterchange shouldAnnotate, ConvertBlocksToInlines convertBlocksToInlines) : m_formatter(shouldResolveURLs) , m_start(start) , m_end(end) @@ -93,7 +93,7 @@ MarkupFormatter::appendCharactersReplacingEntities(m_result, str, start, length, m_formatter.entityMaskForText(text)); } -void StyledMarkupAccumulator::appendTextWithInlineStyle(Text& text, PassRefPtrWillBeRawPtr<EditingStyle> inlineStyle) +void StyledMarkupAccumulator::appendTextWithInlineStyle(Text& text, RawPtr<EditingStyle> inlineStyle) { if (inlineStyle) { // wrappingStyleForAnnotatedSerialization should have removed -webkit-text-decorations-in-effect @@ -117,12 +117,12 @@ m_result.append("</span>"); } -void StyledMarkupAccumulator::appendElementWithInlineStyle(const Element& element, PassRefPtrWillBeRawPtr<EditingStyle> style) +void StyledMarkupAccumulator::appendElementWithInlineStyle(const Element& element, RawPtr<EditingStyle> style) { appendElementWithInlineStyle(m_result, element, style); } -void StyledMarkupAccumulator::appendElementWithInlineStyle(StringBuilder& out, const Element& element, PassRefPtrWillBeRawPtr<EditingStyle> style) +void StyledMarkupAccumulator::appendElementWithInlineStyle(StringBuilder& out, const Element& element, RawPtr<EditingStyle> style) { const bool documentIsHTML = element.document().isHTMLDocument(); m_formatter.appendOpenTag(out, element, nullptr);
diff --git a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.h b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.h index 74bb3ce..99f3841 100644 --- a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.h +++ b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.h
@@ -44,13 +44,13 @@ WTF_MAKE_NONCOPYABLE(StyledMarkupAccumulator); STACK_ALLOCATED(); public: - StyledMarkupAccumulator(EAbsoluteURLs, const TextOffset& start, const TextOffset& end, const PassRefPtrWillBeRawPtr<Document>, EAnnotateForInterchange, ConvertBlocksToInlines); + StyledMarkupAccumulator(EAbsoluteURLs, const TextOffset& start, const TextOffset& end, const RawPtr<Document>, EAnnotateForInterchange, ConvertBlocksToInlines); void appendEndTag(const Element&); void appendInterchangeNewline(); void appendText(Text&); - void appendTextWithInlineStyle(Text&, PassRefPtrWillBeRawPtr<EditingStyle>); + void appendTextWithInlineStyle(Text&, RawPtr<EditingStyle>); void wrapWithStyleNode(StylePropertySet*); String takeResults(); @@ -59,8 +59,8 @@ void appendElement(const Element&); void appendElement(StringBuilder&, const Element&); - void appendElementWithInlineStyle(const Element&, PassRefPtrWillBeRawPtr<EditingStyle>); - void appendElementWithInlineStyle(StringBuilder&, const Element&, PassRefPtrWillBeRawPtr<EditingStyle>); + void appendElementWithInlineStyle(const Element&, RawPtr<EditingStyle>); + void appendElementWithInlineStyle(StringBuilder&, const Element&, RawPtr<EditingStyle>); void appendStartMarkup(Node&); bool shouldAnnotate() const; @@ -75,7 +75,7 @@ MarkupFormatter m_formatter; const TextOffset m_start; const TextOffset m_end; - const RefPtrWillBeMember<Document> m_document; + const Member<Document> m_document; const EAnnotateForInterchange m_shouldAnnotate; StringBuilder m_result; Vector<String> m_reversedPrecedingMarkup;
diff --git a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp index 8e931d63b..fe31d23 100644 --- a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp +++ b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp
@@ -92,21 +92,21 @@ StyledMarkupTraverser(StyledMarkupAccumulator*, Node*); Node* traverse(Node*, Node*); - void wrapWithNode(ContainerNode&, PassRefPtrWillBeRawPtr<EditingStyle>); - RefPtrWillBeRawPtr<EditingStyle> createInlineStyleIfNeeded(Node&); + void wrapWithNode(ContainerNode&, RawPtr<EditingStyle>); + RawPtr<EditingStyle> createInlineStyleIfNeeded(Node&); private: bool shouldAnnotate() const; bool convertBlocksToInlines() const; void appendStartMarkup(Node&); void appendEndMarkup(Node&); - RefPtrWillBeRawPtr<EditingStyle> createInlineStyle(Element&); + RawPtr<EditingStyle> createInlineStyle(Element&); bool needsInlineStyle(const Element&); bool shouldApplyWrappingStyle(const Node&) const; StyledMarkupAccumulator* m_accumulator; - RefPtrWillBeMember<Node> m_lastClosed; - RefPtrWillBeMember<EditingStyle> m_wrappingStyle; + Member<Node> m_lastClosed; + Member<EditingStyle> m_wrappingStyle; }; template<typename Strategy> @@ -157,9 +157,9 @@ return toPositionInDOMTree(startPosition) == range.startPosition() && toPositionInDOMTree(endPosition) == range.endPosition(); } -static PassRefPtrWillBeRawPtr<EditingStyle> styleFromMatchedRulesAndInlineDecl(const HTMLElement* element) +static RawPtr<EditingStyle> styleFromMatchedRulesAndInlineDecl(const HTMLElement* element) { - RefPtrWillBeRawPtr<EditingStyle> style = EditingStyle::create(element->inlineStyle()); + RawPtr<EditingStyle> style = EditingStyle::create(element->inlineStyle()); // FIXME: Having to const_cast here is ugly, but it is quite a bit of work to untangle // the non-const-ness of styleFromMatchedRulesForElement. style->mergeStyleFromRules(const_cast<HTMLElement*>(element)); @@ -208,7 +208,7 @@ // FIXME: What is ancestor? for (ContainerNode* ancestor = Strategy::parent(*lastClosed); ancestor; ancestor = Strategy::parent(*ancestor)) { if (ancestor == fullySelectedRoot && !markupAccumulator.convertBlocksToInlines()) { - RefPtrWillBeRawPtr<EditingStyle> fullySelectedRootStyle = styleFromMatchedRulesAndInlineDecl(fullySelectedRoot); + RawPtr<EditingStyle> fullySelectedRootStyle = styleFromMatchedRulesAndInlineDecl(fullySelectedRoot); // Bring the background attribute over, but not as an attribute because a background attribute on a div // appears to have no effect. @@ -227,7 +227,7 @@ markupAccumulator.wrapWithStyleNode(fullySelectedRootStyle->style()); } } else { - RefPtrWillBeRawPtr<EditingStyle> style = traverser.createInlineStyleIfNeeded(*ancestor); + RawPtr<EditingStyle> style = traverser.createInlineStyleIfNeeded(*ancestor); // Since this node and all the other ancestors are not in the selection we want // styles that affect the exterior of the node not to be not included. // If the node is not fully selected by the range, then we don't want to keep styles that affect its relationship to the nodes around it @@ -280,7 +280,7 @@ template<typename Strategy> Node* StyledMarkupTraverser<Strategy>::traverse(Node* startNode, Node* pastEnd) { - WillBeHeapVector<RawPtrWillBeMember<ContainerNode>> ancestorsToClose; + HeapVector<Member<ContainerNode>> ancestorsToClose; Node* next; Node* lastClosed = nullptr; for (Node* n = startNode; n && n != pastEnd; n = next) { @@ -346,7 +346,7 @@ // or b) ancestors that we never encountered during a pre-order traversal starting at startNode: ASSERT(startNode); ASSERT(Strategy::isDescendantOf(*startNode, *parent)); - RefPtrWillBeRawPtr<EditingStyle> style = createInlineStyleIfNeeded(*parent); + RawPtr<EditingStyle> style = createInlineStyleIfNeeded(*parent); wrapWithNode(*parent, style); lastClosed = parent; } @@ -366,7 +366,7 @@ } template<typename Strategy> -void StyledMarkupTraverser<Strategy>::wrapWithNode(ContainerNode& node, PassRefPtrWillBeRawPtr<EditingStyle> style) +void StyledMarkupTraverser<Strategy>::wrapWithNode(ContainerNode& node, RawPtr<EditingStyle> style) { if (!m_accumulator) return; @@ -388,13 +388,13 @@ } template<typename Strategy> -RefPtrWillBeRawPtr<EditingStyle> StyledMarkupTraverser<Strategy>::createInlineStyleIfNeeded(Node& node) +RawPtr<EditingStyle> StyledMarkupTraverser<Strategy>::createInlineStyleIfNeeded(Node& node) { if (!m_accumulator) return nullptr; if (!node.isElementNode()) return nullptr; - RefPtrWillBeRawPtr<EditingStyle> inlineStyle = createInlineStyle(toElement(node)); + RawPtr<EditingStyle> inlineStyle = createInlineStyle(toElement(node)); if (convertBlocksToInlines() && isEnclosingBlock(&node)) inlineStyle->forceInline(); return inlineStyle; @@ -412,7 +412,7 @@ m_accumulator->appendText(text); break; } - RefPtrWillBeRawPtr<EditingStyle> inlineStyle = nullptr; + RawPtr<EditingStyle> inlineStyle = nullptr; if (shouldApplyWrappingStyle(text)) { inlineStyle = m_wrappingStyle->copy(); // FIXME: <rdar://problem/5371536> Style rules that match pasted content can change it's appearance @@ -427,7 +427,7 @@ case Node::ELEMENT_NODE: { Element& element = toElement(node); if ((element.isHTMLElement() && shouldAnnotate()) || shouldApplyWrappingStyle(element)) { - RefPtrWillBeRawPtr<EditingStyle> inlineStyle = createInlineStyle(element); + RawPtr<EditingStyle> inlineStyle = createInlineStyle(element); m_accumulator->appendElementWithInlineStyle(element, inlineStyle); break; } @@ -456,9 +456,9 @@ } template<typename Strategy> -RefPtrWillBeRawPtr<EditingStyle> StyledMarkupTraverser<Strategy>::createInlineStyle(Element& element) +RawPtr<EditingStyle> StyledMarkupTraverser<Strategy>::createInlineStyle(Element& element) { - RefPtrWillBeRawPtr<EditingStyle> inlineStyle = nullptr; + RawPtr<EditingStyle> inlineStyle = nullptr; if (shouldApplyWrappingStyle(element)) { inlineStyle = m_wrappingStyle->copy();
diff --git a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.h b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.h index 0a13f70d..806d034 100644 --- a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.h +++ b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.h
@@ -53,10 +53,10 @@ const PositionTemplate<Strategy> m_end; const EAbsoluteURLs m_shouldResolveURLs; const EAnnotateForInterchange m_shouldAnnotate; - const RefPtrWillBeMember<Node> m_highestNodeToBeSerialized; + const Member<Node> m_highestNodeToBeSerialized; const ConvertBlocksToInlines m_convertBlocksToInlines; - RawPtrWillBeMember<Node> m_lastClosed; - RefPtrWillBeMember<EditingStyle> m_wrappingStyle; + Member<Node> m_lastClosed; + Member<EditingStyle> m_wrappingStyle; }; extern template class StyledMarkupSerializer<EditingStrategy>;
diff --git a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializerTest.cpp b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializerTest.cpp index 272bc18..7cb3875 100644 --- a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializerTest.cpp +++ b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializerTest.cpp
@@ -153,7 +153,7 @@ const char* shadowContent1 = "<a><content select=#two></content><b id=host2></b><content select=#one></content></a>"; const char* shadowContent2 = "NESTED"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<ShadowRoot> shadowRoot1 = setShadowContent(shadowContent1, "host"); + RawPtr<ShadowRoot> shadowRoot1 = setShadowContent(shadowContent1, "host"); createShadowRootForElementWithIDAndSetInnerHTML(*shadowRoot1, "host2", shadowContent2); EXPECT_EQ("<p id=\"host\"><b id=\"one\">11</b><b id=\"two\">22</b></p>", serialize<EditingStrategy>()) @@ -201,8 +201,8 @@ { const char* bodyContent = "<p id='host' style='color: red'><span style='font-weight: bold;'><span id='one'>11</span></span></p>\n"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<Element> one = document().getElementById("one"); - RefPtrWillBeRawPtr<Text> text = toText(one->firstChild()); + RawPtr<Element> one = document().getElementById("one"); + RawPtr<Text> text = toText(one->firstChild()); Position startDOM(text, 0); Position endDOM(text, 2); const std::string& serializedDOM = serializePart<EditingStrategy>(startDOM, endDOM, AnnotateForInterchange); @@ -224,8 +224,8 @@ { const char* bodyContent = "<p id='host1'>[<span id='one'>11</span>]</p><p id='host2'>[<span id='two'>22</span>]</p>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<Element> one = document().getElementById("one"); - RefPtrWillBeRawPtr<Element> two = document().getElementById("two"); + RawPtr<Element> one = document().getElementById("one"); + RawPtr<Element> two = document().getElementById("two"); Position startDOM(toText(one->firstChild()), 0); Position endDOM(toText(two->firstChild()), 2); const std::string& serializedDOM = serializePart<EditingStrategy>(startDOM, endDOM, AnnotateForInterchange); @@ -249,8 +249,8 @@ { const char* bodyContent = "<span id='span1' style='display: none'>11</span><span id='span2' style='display: none'>22</span>"; setBodyContent(bodyContent); - RefPtrWillBeRawPtr<Element> span1 = document().getElementById("span1"); - RefPtrWillBeRawPtr<Element> span2 = document().getElementById("span2"); + RawPtr<Element> span1 = document().getElementById("span1"); + RawPtr<Element> span2 = document().getElementById("span2"); Position startDOM = Position::firstPositionInNode(span1.get()); Position endDOM = Position::lastPositionInNode(span2.get()); EXPECT_EQ("", serializePart<EditingStrategy>(startDOM, endDOM));
diff --git a/third_party/WebKit/Source/core/editing/serializers/TextOffset.cpp b/third_party/WebKit/Source/core/editing/serializers/TextOffset.cpp index efdc11c..1c83919 100644 --- a/third_party/WebKit/Source/core/editing/serializers/TextOffset.cpp +++ b/third_party/WebKit/Source/core/editing/serializers/TextOffset.cpp
@@ -13,7 +13,7 @@ { } -TextOffset::TextOffset(PassRefPtrWillBeRawPtr<Text> text, int offset) +TextOffset::TextOffset(RawPtr<Text> text, int offset) : m_text(text) , m_offset(offset) {
diff --git a/third_party/WebKit/Source/core/editing/serializers/TextOffset.h b/third_party/WebKit/Source/core/editing/serializers/TextOffset.h index 2f995ab7..955422c 100644 --- a/third_party/WebKit/Source/core/editing/serializers/TextOffset.h +++ b/third_party/WebKit/Source/core/editing/serializers/TextOffset.h
@@ -16,7 +16,7 @@ STACK_ALLOCATED(); public: TextOffset(); - TextOffset(PassRefPtrWillBeRawPtr<Text>, int); + TextOffset(RawPtr<Text>, int); TextOffset(const TextOffset&); Text* text() const { return m_text.get(); } @@ -26,7 +26,7 @@ bool isNotNull() const; private: - RefPtrWillBeMember<Text> m_text; + Member<Text> m_text; int m_offset; };
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp index b224719..082e02fb 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
@@ -36,8 +36,8 @@ namespace blink { SpellCheckRequest::SpellCheckRequest( - PassRefPtrWillBeRawPtr<Range> checkingRange, - PassRefPtrWillBeRawPtr<Range> paragraphRange, + RawPtr<Range> checkingRange, + RawPtr<Range> paragraphRange, const String& text, TextCheckingTypeMask mask, TextCheckingProcessType processType, @@ -80,7 +80,7 @@ } // static -PassRefPtrWillBeRawPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask textCheckingOptions, TextCheckingProcessType processType, const EphemeralRange& checkingRange, const EphemeralRange& paragraphRange, int requestNumber) +RawPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask textCheckingOptions, TextCheckingProcessType processType, const EphemeralRange& checkingRange, const EphemeralRange& paragraphRange, int requestNumber) { if (checkingRange.isNull()) return nullptr; @@ -91,8 +91,8 @@ if (text.isEmpty()) return nullptr; - RefPtrWillBeRawPtr<Range> checkingRangeObject = createRange(checkingRange); - RefPtrWillBeRawPtr<Range> paragraphRangeObject = nullptr; + RawPtr<Range> checkingRangeObject = createRange(checkingRange); + RawPtr<Range> paragraphRangeObject = nullptr; // Share identical Range objects. if (checkingRange == paragraphRange) paragraphRangeObject = checkingRangeObject; @@ -107,7 +107,7 @@ offsets[i] = markers[i]->startOffset(); } - return adoptRefWillBeNoop(new SpellCheckRequest(checkingRangeObject, paragraphRangeObject, text, textCheckingOptions, processType, hashes, offsets, requestNumber)); + return new SpellCheckRequest(checkingRangeObject, paragraphRangeObject, text, textCheckingOptions, processType, hashes, offsets, requestNumber); } const TextCheckingRequestData& SpellCheckRequest::data() const @@ -200,7 +200,7 @@ return true; } -void SpellCheckRequester::requestCheckingFor(PassRefPtrWillBeRawPtr<SpellCheckRequest> request) +void SpellCheckRequester::requestCheckingFor(RawPtr<SpellCheckRequest> request) { if (!request || !canCheckAsynchronously(request->paragraphRange().get())) return; @@ -239,7 +239,7 @@ m_requestQueue.clear(); } -void SpellCheckRequester::invokeRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest> request) +void SpellCheckRequester::invokeRequest(RawPtr<SpellCheckRequest> request) { ASSERT(!m_processingRequest); m_processingRequest = request; @@ -255,12 +255,12 @@ m_processingRequest.clear(); } -void SpellCheckRequester::enqueueRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest> request) +void SpellCheckRequester::enqueueRequest(RawPtr<SpellCheckRequest> request) { ASSERT(request); bool continuation = false; if (!m_requestQueue.isEmpty()) { - RefPtrWillBeRawPtr<SpellCheckRequest> lastRequest = m_requestQueue.last(); + RawPtr<SpellCheckRequest> lastRequest = m_requestQueue.last(); // It's a continuation if the number of the last request got incremented in the new one and // both apply to the same editable. continuation = request->rootEditableElement() == lastRequest->rootEditableElement() @@ -310,7 +310,7 @@ if (!requestData.maskContains(TextCheckingTypeGrammar)) markers.remove(DocumentMarker::Grammar); if (m_processingRequest->isValid()) { - RefPtrWillBeRawPtr<Range> checkingRange = m_processingRequest->checkingRange(); + RawPtr<Range> checkingRange = m_processingRequest->checkingRange(); frame().document()->markers().removeMarkers(EphemeralRange(checkingRange.get()), markers); } }
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h index 0f58b1b8..51bc920 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h
@@ -45,14 +45,14 @@ class SpellCheckRequest final : public TextCheckingRequest { public: - static PassRefPtrWillBeRawPtr<SpellCheckRequest> create(TextCheckingTypeMask, TextCheckingProcessType, const EphemeralRange& checkingRange, const EphemeralRange& paragraphRange, int requestNumber = 0); + static RawPtr<SpellCheckRequest> create(TextCheckingTypeMask, TextCheckingProcessType, const EphemeralRange& checkingRange, const EphemeralRange& paragraphRange, int requestNumber = 0); ~SpellCheckRequest() override; void dispose(); - PassRefPtrWillBeRawPtr<Range> checkingRange() const { return m_checkingRange; } - PassRefPtrWillBeRawPtr<Range> paragraphRange() const { return m_paragraphRange; } - PassRefPtrWillBeRawPtr<Element> rootEditableElement() const { return m_rootEditableElement; } + RawPtr<Range> checkingRange() const { return m_checkingRange; } + RawPtr<Range> paragraphRange() const { return m_paragraphRange; } + RawPtr<Element> rootEditableElement() const { return m_rootEditableElement; } void setCheckerAndSequence(SpellCheckRequester*, int sequence); #if !ENABLE(OILPAN) @@ -69,22 +69,22 @@ DECLARE_VIRTUAL_TRACE(); private: - SpellCheckRequest(PassRefPtrWillBeRawPtr<Range> checkingRange, PassRefPtrWillBeRawPtr<Range> paragraphRange, const String&, TextCheckingTypeMask, TextCheckingProcessType, const Vector<uint32_t>& documentMarkersInRange, const Vector<unsigned>& documentMarkerOffsets, int requestNumber); + SpellCheckRequest(RawPtr<Range> checkingRange, RawPtr<Range> paragraphRange, const String&, TextCheckingTypeMask, TextCheckingProcessType, const Vector<uint32_t>& documentMarkersInRange, const Vector<unsigned>& documentMarkerOffsets, int requestNumber); - RawPtrWillBeMember<SpellCheckRequester> m_requester; - RefPtrWillBeMember<Range> m_checkingRange; - RefPtrWillBeMember<Range> m_paragraphRange; - RefPtrWillBeMember<Element> m_rootEditableElement; + Member<SpellCheckRequester> m_requester; + Member<Range> m_checkingRange; + Member<Range> m_paragraphRange; + Member<Element> m_rootEditableElement; TextCheckingRequestData m_requestData; int m_requestNumber; }; -class SpellCheckRequester final : public NoBaseWillBeGarbageCollectedFinalized<SpellCheckRequester> { - WTF_MAKE_NONCOPYABLE(SpellCheckRequester); USING_FAST_MALLOC_WILL_BE_REMOVED(SpellCheckRequester); +class SpellCheckRequester final : public GarbageCollectedFinalized<SpellCheckRequester> { + WTF_MAKE_NONCOPYABLE(SpellCheckRequester); public: - static PassOwnPtrWillBeRawPtr<SpellCheckRequester> create(LocalFrame& frame) + static RawPtr<SpellCheckRequester> create(LocalFrame& frame) { - return adoptPtrWillBeNoop(new SpellCheckRequester(frame)); + return new SpellCheckRequester(frame); } ~SpellCheckRequester(); @@ -92,7 +92,7 @@ bool isCheckable(Range*) const; - void requestCheckingFor(PassRefPtrWillBeRawPtr<SpellCheckRequest>); + void requestCheckingFor(RawPtr<SpellCheckRequest>); void cancelCheck(); int lastRequestSequence() const @@ -117,15 +117,15 @@ bool canCheckAsynchronously(Range*) const; TextCheckerClient& client() const; void timerFiredToProcessQueuedRequest(Timer<SpellCheckRequester>*); - void invokeRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest>); - void enqueueRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest>); + void invokeRequest(RawPtr<SpellCheckRequest>); + void enqueueRequest(RawPtr<SpellCheckRequest>); void didCheckSucceed(int sequence, const Vector<TextCheckingResult>&); void didCheckCancel(int sequence); void didCheck(int sequence, const Vector<TextCheckingResult>&); void clearProcessingRequest(); - RawPtrWillBeMember<LocalFrame> m_frame; + Member<LocalFrame> m_frame; LocalFrame& frame() const { ASSERT(m_frame); @@ -137,9 +137,9 @@ Timer<SpellCheckRequester> m_timerToProcessQueuedRequest; - RefPtrWillBeMember<SpellCheckRequest> m_processingRequest; + Member<SpellCheckRequest> m_processingRequest; - typedef WillBeHeapDeque<RefPtrWillBeMember<SpellCheckRequest>> RequestQueue; + typedef HeapDeque<Member<SpellCheckRequest>> RequestQueue; RequestQueue m_requestQueue; };
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp index d743d14..2a09955 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -74,9 +74,9 @@ } // namespace -PassOwnPtrWillBeRawPtr<SpellChecker> SpellChecker::create(LocalFrame& frame) +RawPtr<SpellChecker> SpellChecker::create(LocalFrame& frame) { - return adoptPtrWillBeNoop(new SpellChecker(frame)); + return new SpellChecker(frame); } static SpellCheckerClient& emptySpellCheckerClient() @@ -538,7 +538,7 @@ // Check the full paragraph instead if the paragraph is short, which saves // the cost on sentence boundary finding. if (fullParagraphToCheck.rangeLength() <= kChunkSize) { - RefPtrWillBeRawPtr<SpellCheckRequest> request = SpellCheckRequest::create(resolveTextCheckingTypeMask(textCheckingOptions), TextCheckingProcessBatch, paragraphRange, paragraphRange, 0); + RawPtr<SpellCheckRequest> request = SpellCheckRequest::create(resolveTextCheckingTypeMask(textCheckingOptions), TextCheckingProcessBatch, paragraphRange, paragraphRange, 0); if (request) m_spellCheckRequester->requestCheckingFor(request); return; @@ -549,7 +549,7 @@ EphemeralRange chunkRange = checkRangeIterator.calculateCharacterSubrange(0, kChunkSize); EphemeralRange checkRange = requestNum ? expandEndToSentenceBoundary(chunkRange) : expandRangeToSentenceBoundary(chunkRange); - RefPtrWillBeRawPtr<SpellCheckRequest> request = SpellCheckRequest::create(resolveTextCheckingTypeMask(textCheckingOptions), TextCheckingProcessBatch, checkRange, paragraphRange, requestNum); + RawPtr<SpellCheckRequest> request = SpellCheckRequest::create(resolveTextCheckingTypeMask(textCheckingOptions), TextCheckingProcessBatch, checkRange, paragraphRange, requestNum); if (request) m_spellCheckRequester->requestCheckingFor(request); @@ -563,7 +563,7 @@ } } -void SpellChecker::markAndReplaceFor(PassRefPtrWillBeRawPtr<SpellCheckRequest> request, const Vector<TextCheckingResult>& results) +void SpellChecker::markAndReplaceFor(RawPtr<SpellCheckRequest> request, const Vector<TextCheckingResult>& results) { TRACE_EVENT0("blink", "SpellChecker::markAndReplaceFor"); ASSERT(request);
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h index cd97d2d..f9fae06d 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h
@@ -43,11 +43,10 @@ class TextCheckingParagraph; struct TextCheckingResult; -class CORE_EXPORT SpellChecker final : public NoBaseWillBeGarbageCollectedFinalized<SpellChecker> { - USING_FAST_MALLOC_WILL_BE_REMOVED(SpellChecker); +class CORE_EXPORT SpellChecker final : public GarbageCollectedFinalized<SpellChecker> { WTF_MAKE_NONCOPYABLE(SpellChecker); public: - static PassOwnPtrWillBeRawPtr<SpellChecker> create(LocalFrame&); + static RawPtr<SpellChecker> create(LocalFrame&); ~SpellChecker(); DECLARE_TRACE(); @@ -66,7 +65,7 @@ bool markMisspellings(const VisibleSelection&); void markBadGrammar(const VisibleSelection&); void markMisspellingsAndBadGrammar(const VisibleSelection& spellingSelection, bool markGrammar, const VisibleSelection& grammarSelection); - void markAndReplaceFor(PassRefPtrWillBeRawPtr<SpellCheckRequest>, const Vector<TextCheckingResult>&); + void markAndReplaceFor(RawPtr<SpellCheckRequest>, const Vector<TextCheckingResult>&); void markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeMask, const EphemeralRange& spellingRange, const EphemeralRange& grammarRange); void advanceToNextMisspelling(bool startBeforeSelection = false); void showSpellingGuessPanel(); @@ -116,8 +115,8 @@ void chunkAndMarkAllMisspellingsAndBadGrammar(TextCheckingTypeMask textCheckingOptions, const TextCheckingParagraph& fullParagraphToCheck); - RawPtrWillBeMember<LocalFrame> m_frame; - const OwnPtrWillBeMember<SpellCheckRequester> m_spellCheckRequester; + Member<LocalFrame> m_frame; + const Member<SpellCheckRequester> m_spellCheckRequester; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp index 83cfbc7..1c2a3e3 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp
@@ -17,7 +17,7 @@ { setBodyContent("<input placeholder='placeholder'>abc"); updateLayoutAndStyleForPainting(); - RefPtrWillBeRawPtr<Element> input = document().querySelector("input", ASSERT_NO_EXCEPTION); + RawPtr<Element> input = document().querySelector("input", ASSERT_NO_EXCEPTION); input->focus(); document().settings()->setUnifiedTextCheckerEnabled(true); // Do not crash in AdvanceToNextMisspelling command.
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp index ea5dd9c8..c908db9 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp +++ b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp
@@ -117,7 +117,7 @@ { } -TextCheckingParagraph::TextCheckingParagraph(PassRefPtrWillBeRawPtr<Range> checkingRange, PassRefPtrWillBeRawPtr<Range> paragraphRange) +TextCheckingParagraph::TextCheckingParagraph(RawPtr<Range> checkingRange, RawPtr<Range> paragraphRange) : m_checkingRange(checkingRange.get()) , m_paragraphRange(paragraphRange.get()) , m_checkingStart(-1)
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.h b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.h index 5f778934..fc30fee 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.h +++ b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.h
@@ -40,7 +40,7 @@ public: explicit TextCheckingParagraph(const EphemeralRange& checkingRange); TextCheckingParagraph(const EphemeralRange& checkingRange, const EphemeralRange& paragraphRange); - TextCheckingParagraph(PassRefPtrWillBeRawPtr<Range> checkingRange, PassRefPtrWillBeRawPtr<Range> paragraphRange); + TextCheckingParagraph(RawPtr<Range> checkingRange, RawPtr<Range> paragraphRange); ~TextCheckingParagraph(); int rangeLength() const;
diff --git a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp index 035bdcf..7d833f2 100644 --- a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp +++ b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
@@ -290,6 +290,10 @@ for (int i = size - 1; i >= 0; i--) { // Remove from the tail, since this is the least frequently accessed of the objects. MemoryCacheEntry* current = m_allResources[i].m_tail; + if (current) { + ASSERT(current->m_resource); + ASSERT(contains(current->m_resource.get())); + } // First flush all the decoded data in this queue. while (current) { @@ -298,10 +302,7 @@ ASSERT(previous->m_resource); ASSERT(contains(previous->m_resource.get())); } - // TODO(leon.han@intel.com): We shouldn't be hitting the case - // that current->m_resource is null here, would turn the case into - // ASSERT(current->m_resource) after crbug.com/594644 got resolved. - if (current->m_resource && !current->m_resource->hasClientsOrObservers() && !current->m_resource->isPreloaded() && current->m_resource->isLoaded()) { + if (!current->m_resource->hasClientsOrObservers() && !current->m_resource->isPreloaded() && current->m_resource->isLoaded()) { // Destroy our decoded data. This will remove us from // m_liveDecodedResources, and possibly move us to a different // LRU list in m_allResources. @@ -319,16 +320,17 @@ // Now evict objects from this queue. current = m_allResources[i].m_tail; + if (current) { + ASSERT(current->m_resource); + ASSERT(contains(current->m_resource.get())); + } while (current) { MemoryCacheEntry* previous = current->m_previousInAllResourcesList; if (previous) { ASSERT(previous->m_resource); ASSERT(contains(previous->m_resource.get())); } - // TODO(leon.han@intel.com): We shouldn't be hitting the case - // that current->m_resource is null here, would turn the case into - // ASSERT(current->m_resource) after crbug.com/594644 got resolved. - if (current->m_resource && !current->m_resource->hasClientsOrObservers() && !current->m_resource->isPreloaded()) { + if (!current->m_resource->hasClientsOrObservers() && !current->m_resource->isPreloaded()) { evict(current); if (targetSize && m_deadSize <= targetSize) return;
diff --git a/third_party/WebKit/Source/core/frame/Console.cpp b/third_party/WebKit/Source/core/frame/Console.cpp index 56b1228..8a99747 100644 --- a/third_party/WebKit/Source/core/frame/Console.cpp +++ b/third_party/WebKit/Source/core/frame/Console.cpp
@@ -56,7 +56,7 @@ { ConsoleBase::trace(visitor); DOMWindowProperty::trace(visitor); - HeapSupplementable<Console>::trace(visitor); + Supplementable<Console>::trace(visitor); } ExecutionContext* Console::context()
diff --git a/third_party/WebKit/Source/core/frame/Console.h b/third_party/WebKit/Source/core/frame/Console.h index e8f1bf0..6375e0e 100644 --- a/third_party/WebKit/Source/core/frame/Console.h +++ b/third_party/WebKit/Source/core/frame/Console.h
@@ -41,7 +41,7 @@ class LocalFrame; -class Console final : public ConsoleBase, public DOMWindowProperty, public HeapSupplementable<Console> { +class Console final : public ConsoleBase, public DOMWindowProperty, public Supplementable<Console> { USING_GARBAGE_COLLECTED_MIXIN(Console); DEFINE_WRAPPERTYPEINFO(); public:
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp index bfe3fce..41bc723 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.cpp +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -86,6 +86,7 @@ #include "core/style/ComputedStyle.h" #include "core/svg/SVGDocumentExtensions.h" #include "core/svg/SVGSVGElement.h" +#include "platform/Histogram.h" #include "platform/HostWindow.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/ScriptForbiddenScope.h" @@ -2487,6 +2488,7 @@ void FrameView::synchronizedPaint() { TRACE_EVENT0("blink", "FrameView::synchronizedPaint"); + SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Paint.UpdateTime"); ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalFrame())); @@ -2574,6 +2576,12 @@ void FrameView::updateStyleAndLayoutIfNeededRecursive() { + SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.StyleAndLayout.UpdateTime"); + updateStyleAndLayoutIfNeededRecursiveInternal(); +} + +void FrameView::updateStyleAndLayoutIfNeededRecursiveInternal() +{ if (shouldThrottleRendering()) return; @@ -2617,7 +2625,7 @@ } for (const auto& frameView : frameViews) - frameView->updateStyleAndLayoutIfNeededRecursive(); + frameView->updateStyleAndLayoutIfNeededRecursiveInternal(); RELEASE_ASSERT(!needsLayout()); @@ -2650,6 +2658,12 @@ void FrameView::invalidateTreeIfNeededRecursive() { + SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PaintInvalidation.UpdateTime"); + invalidateTreeIfNeededRecursiveInternal(); +} + +void FrameView::invalidateTreeIfNeededRecursiveInternal() +{ RELEASE_ASSERT(layoutView()); // We need to stop recursing here since a child frame view might not be throttled @@ -2677,7 +2691,7 @@ // invalidation onto them here. if (!childFrameView.layoutView()) continue; - childFrameView.invalidateTreeIfNeededRecursive(); + childFrameView.invalidateTreeIfNeededRecursiveInternal(); } }
diff --git a/third_party/WebKit/Source/core/frame/FrameView.h b/third_party/WebKit/Source/core/frame/FrameView.h index 2aaeb9b..087f54b 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.h +++ b/third_party/WebKit/Source/core/frame/FrameView.h
@@ -649,6 +649,9 @@ void synchronizedPaint(); void synchronizedPaintRecursively(GraphicsLayer*); + void updateStyleAndLayoutIfNeededRecursiveInternal(); + void invalidateTreeIfNeededRecursiveInternal(); + void pushPaintArtifactToCompositor(); void reset();
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp index d17b5ac..1cf63e1 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -1498,7 +1498,6 @@ DEFINE_TRACE(LocalDOMWindow) { -#if ENABLE(OILPAN) visitor->trace(m_frameObserver); visitor->trace(m_document); visitor->trace(m_properties); @@ -1516,9 +1515,8 @@ visitor->trace(m_applicationCache); visitor->trace(m_eventQueue); visitor->trace(m_postMessageTimers); - HeapSupplementable<LocalDOMWindow>::trace(visitor); -#endif DOMWindow::trace(visitor); + Supplementable<LocalDOMWindow>::trace(visitor); DOMWindowLifecycleNotifier::trace(visitor); }
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.h b/third_party/WebKit/Source/core/frame/LocalDOMWindow.h index 8ce40c9..347186a 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.h +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.h
@@ -63,7 +63,7 @@ // Note: if you're thinking of returning something DOM-related by reference, // please ping dcheng@chromium.org first. You probably don't want to do that. -class CORE_EXPORT LocalDOMWindow final : public DOMWindow, public HeapSupplementable<LocalDOMWindow>, public DOMWindowLifecycleNotifier { +class CORE_EXPORT LocalDOMWindow final : public DOMWindow, public Supplementable<LocalDOMWindow>, public DOMWindowLifecycleNotifier { USING_GARBAGE_COLLECTED_MIXIN(LocalDOMWindow); USING_PRE_FINALIZER(LocalDOMWindow, dispose); public:
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp index b8e3f6c..a3b80df0 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -245,7 +245,6 @@ DEFINE_TRACE(LocalFrame) { visitor->trace(m_instrumentingAgents); -#if ENABLE(OILPAN) visitor->trace(m_loader); visitor->trace(m_navigationScheduler); visitor->trace(m_view); @@ -258,10 +257,9 @@ visitor->trace(m_eventHandler); visitor->trace(m_console); visitor->trace(m_inputMethodController); - HeapSupplementable<LocalFrame>::trace(visitor); -#endif - LocalFrameLifecycleNotifier::trace(visitor); Frame::trace(visitor); + LocalFrameLifecycleNotifier::trace(visitor); + Supplementable<LocalFrame>::trace(visitor); } DOMWindow* LocalFrame::domWindow() const
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.h b/third_party/WebKit/Source/core/frame/LocalFrame.h index 32a5f51..447c6d8 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.h +++ b/third_party/WebKit/Source/core/frame/LocalFrame.h
@@ -77,7 +77,7 @@ class WebFrameScheduler; template <typename Strategy> class PositionWithAffinityTemplate; -class CORE_EXPORT LocalFrame : public Frame, public LocalFrameLifecycleNotifier, public HeapSupplementable<LocalFrame>, public DisplayItemClient { +class CORE_EXPORT LocalFrame : public Frame, public LocalFrameLifecycleNotifier, public Supplementable<LocalFrame>, public DisplayItemClient { USING_GARBAGE_COLLECTED_MIXIN(LocalFrame); public: static RawPtr<LocalFrame> create(FrameLoaderClient*, FrameHost*, FrameOwner*);
diff --git a/third_party/WebKit/Source/core/frame/Navigator.cpp b/third_party/WebKit/Source/core/frame/Navigator.cpp index 7f74b1dd..9db07da5 100644 --- a/third_party/WebKit/Source/core/frame/Navigator.cpp +++ b/third_party/WebKit/Source/core/frame/Navigator.cpp
@@ -111,8 +111,8 @@ DEFINE_TRACE(Navigator) { - HeapSupplementable<Navigator>::trace(visitor); DOMWindowProperty::trace(visitor); + Supplementable<Navigator>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/Navigator.h b/third_party/WebKit/Source/core/frame/Navigator.h index 9351b69..395b935 100644 --- a/third_party/WebKit/Source/core/frame/Navigator.h +++ b/third_party/WebKit/Source/core/frame/Navigator.h
@@ -44,7 +44,7 @@ , public NavigatorOnLine , public ScriptWrappable , public DOMWindowProperty - , public HeapSupplementable<Navigator> { + , public Supplementable<Navigator> { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(Navigator); public:
diff --git a/third_party/WebKit/Source/core/frame/Screen.cpp b/third_party/WebKit/Source/core/frame/Screen.cpp index cdc6e9a..49482215 100644 --- a/third_party/WebKit/Source/core/frame/Screen.cpp +++ b/third_party/WebKit/Source/core/frame/Screen.cpp
@@ -144,8 +144,8 @@ DEFINE_TRACE(Screen) { - HeapSupplementable<Screen>::trace(visitor); DOMWindowProperty::trace(visitor); + Supplementable<Screen>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/Screen.h b/third_party/WebKit/Source/core/frame/Screen.h index c6caa4e7..4a4dc6b2 100644 --- a/third_party/WebKit/Source/core/frame/Screen.h +++ b/third_party/WebKit/Source/core/frame/Screen.h
@@ -39,7 +39,7 @@ class LocalFrame; -class Screen final : public GarbageCollectedFinalized<Screen>, public ScriptWrappable, public DOMWindowProperty, public HeapSupplementable<Screen> { +class Screen final : public GarbageCollectedFinalized<Screen>, public ScriptWrappable, public DOMWindowProperty, public Supplementable<Screen> { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(Screen); public:
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h index fd7e7351..1cd5a79a 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.h +++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -1022,7 +1022,6 @@ DocumentCreateEventRTCDTMFToneChangeEvent = 1205, DocumentCreateEventRTCDataChannelEvent = 1206, DocumentCreateEventRTCIceCandidateEvent = 1207, - DocumentCreateEventServicePortConnectEvent = 1208, DocumentCreateEventNotificationEvent = 1209, DocumentCreateEventPresentationConnectionAvailableEvent = 1210, DocumentCreateEventPresentationConnectionCloseEvent = 1211,
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp index 1c3684d2..c1819813 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -3610,7 +3610,6 @@ DEFINE_TRACE(HTMLMediaElement) { -#if ENABLE(OILPAN) visitor->trace(m_playedTimeRanges); visitor->trace(m_asyncEventQueue); visitor->trace(m_error); @@ -3627,8 +3626,7 @@ visitor->trace(m_autoplayHelperClient); visitor->trace(m_autoplayHelper); visitor->template registerWeakMembers<HTMLMediaElement, &HTMLMediaElement::clearWeakMembers>(this); - HeapSupplementable<HTMLMediaElement>::trace(visitor); -#endif + Supplementable<HTMLMediaElement>::trace(visitor); HTMLElement::trace(visitor); ActiveDOMObject::trace(visitor); }
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.h b/third_party/WebKit/Source/core/html/HTMLMediaElement.h index dc921222..a90d467 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h
@@ -70,7 +70,7 @@ class WebLayer; class WebRemotePlaybackClient; -class CORE_EXPORT HTMLMediaElement : public HTMLElement, public HeapSupplementable<HTMLMediaElement>, public ActiveScriptWrappable, public ActiveDOMObject, private WebMediaPlayerClient { +class CORE_EXPORT HTMLMediaElement : public HTMLElement, public Supplementable<HTMLMediaElement>, public ActiveScriptWrappable, public ActiveDOMObject, private WebMediaPlayerClient { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement); USING_PRE_FINALIZER(HTMLMediaElement, dispose);
diff --git a/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp b/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp index 1b9e7c0..727dbfd 100644 --- a/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp +++ b/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp
@@ -50,7 +50,7 @@ { RawPtr<HTMLImportsController> controller = new HTMLImportsController(master); master.setImportsController(controller.get()); - HeapSupplement<Document>::provideTo(master, supplementName(), controller.release()); + Supplement<Document>::provideTo(master, supplementName(), controller.release()); } void HTMLImportsController::removeFrom(Document& master) @@ -58,7 +58,7 @@ HTMLImportsController* controller = master.importsController(); ASSERT(controller); controller->dispose(); - static_cast<HeapSupplementable<Document>&>(master).removeSupplement(supplementName()); + static_cast<Supplementable<Document>&>(master).removeSupplement(supplementName()); master.setImportsController(nullptr); } @@ -176,7 +176,7 @@ { visitor->trace(m_root); visitor->trace(m_loaders); - HeapSupplement<Document>::trace(visitor); + Supplement<Document>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp index d52ddf134..6b2b0eb 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp
@@ -28,6 +28,7 @@ #include "bindings/core/v8/Microtask.h" #include "bindings/core/v8/ScriptSourceCode.h" #include "bindings/core/v8/V8PerIsolateData.h" +#include "core/dom/DocumentParserTiming.h" #include "core/dom/Element.h" #include "core/events/Event.h" #include "core/dom/IgnoreDestructiveWriteCountIncrementer.h" @@ -203,6 +204,7 @@ } TextPosition scriptStartPosition = pendingScript->startingPosition(); + double scriptParserBlockingTime = pendingScript->parserBlockingLoadStartTime(); // Clear the pending script before possible re-entrancy from executeScript() RawPtr<Element> element = pendingScript->releaseElementAndClear(); if (ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element.get())) { @@ -214,6 +216,9 @@ scriptLoader->dispatchErrorEvent(); } else { ASSERT(isExecutingScript()); + if (scriptParserBlockingTime > 0.0) { + DocumentParserTiming::from(*m_document).recordParserBlockedOnScriptLoadDuration(monotonicallyIncreasingTime() - scriptParserBlockingTime); + } if (!doExecuteScript(element.get(), sourceCode, scriptStartPosition)) { scriptLoader->dispatchErrorEvent(); } else { @@ -276,6 +281,7 @@ return; // Unwind to the outermost HTMLScriptRunner::execute before continuing parsing. traceParserBlockingScript(m_parserBlockingScript.get(), !m_document->isScriptExecutionReady()); + m_parserBlockingScript->markParserBlockingLoadStartTime(); // If preload scanner got created, it is missing the source after the current insertion point. Append it and scan. if (!hadPreloadScanner && m_host->hasPreloadScanner()) @@ -327,6 +333,7 @@ if (!m_scriptsToExecuteAfterParsing.first()->isReady()) { m_scriptsToExecuteAfterParsing.first()->watchForLoad(this); traceParserBlockingScript(m_scriptsToExecuteAfterParsing.first().get(), !m_document->isScriptExecutionReady()); + m_scriptsToExecuteAfterParsing.first()->markParserBlockingLoadStartTime(); return false; } RawPtr<PendingScript> first = m_scriptsToExecuteAfterParsing.takeFirst();
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp index b882dc5..164b666 100644 --- a/third_party/WebKit/Source/core/input/EventHandler.cpp +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -586,10 +586,10 @@ // mousemove events before the first layout should not lead to a premature layout() // happening, which could show a flash of white. // See also the similar code in Document::prepareMouseEvent. - if (!m_frame->contentLayoutObject() || !m_frame->view() || !m_frame->view()->didFirstLayout()) + if (m_frame->contentLayoutItem().isNull() || !m_frame->view() || !m_frame->view()->didFirstLayout()) return result; - m_frame->contentLayoutObject()->hitTest(result); + m_frame->contentLayoutItem().hitTest(result); if (!request.readOnly()) m_frame->document()->updateHoverActiveState(request, result.innerElement()); @@ -1707,8 +1707,8 @@ WebInputEventResult EventHandler::handleMouseFocus(const MouseEventWithHitTestResults& targetedEvent, InputDeviceCapabilities* sourceCapabilities) { // If clicking on a frame scrollbar, do not mess up with content focus. - if (targetedEvent.hitTestResult().scrollbar() && m_frame->contentLayoutObject()) { - if (targetedEvent.hitTestResult().scrollbar()->getScrollableArea() == m_frame->contentLayoutObject()->getScrollableArea()) + if (targetedEvent.hitTestResult().scrollbar() && !m_frame->contentLayoutItem().isNull()) { + if (targetedEvent.hitTestResult().scrollbar()->getScrollableArea() == m_frame->contentLayoutItem().getScrollableArea()) return WebInputEventResult::NotHandled; } @@ -3036,11 +3036,11 @@ ASSERT(m_frame); ASSERT(m_frame->document()); - if (LayoutView* layoutObject = m_frame->contentLayoutObject()) { + if (LayoutViewItem layoutItem = m_frame->contentLayoutItem()) { if (FrameView* view = m_frame->view()) { HitTestRequest request(HitTestRequest::Move); HitTestResult result(request, view->rootFrameToContents(m_lastKnownMousePosition)); - layoutObject->hitTest(result); + layoutItem.hitTest(result); m_frame->document()->updateHoverActiveState(request, result.innerElement()); } } @@ -3297,7 +3297,7 @@ if (m_mouseDownMayStartDrag) { HitTestRequest request(HitTestRequest::ReadOnly); HitTestResult result(request, m_mouseDownPos); - m_frame->contentLayoutObject()->hitTest(result); + m_frame->contentLayoutItem().hitTest(result); Node* node = result.innerNode(); if (node) { DragController::SelectionDragPolicy selectionDragPolicy = event.event().timestamp() - m_mouseDownTimestamp < TextDragDelay @@ -3558,14 +3558,14 @@ { HitTestResult result(HitTestRequest(hitType), point); - if (!frame || !frame->contentLayoutObject()) + if (!frame || frame->contentLayoutItem().isNull()) return result; if (frame->view()) { IntRect rect = frame->view()->visibleContentRect(IncludeScrollbars); if (!rect.contains(roundedIntPoint(point))) return result; } - frame->contentLayoutObject()->hitTest(result); + frame->contentLayoutItem().hitTest(result); return result; }
diff --git a/third_party/WebKit/Source/core/layout/ImageQualityController.cpp b/third_party/WebKit/Source/core/layout/ImageQualityController.cpp index f85d2d84..c9ef4c3 100644 --- a/third_party/WebKit/Source/core/layout/ImageQualityController.cpp +++ b/third_party/WebKit/Source/core/layout/ImageQualityController.cpp
@@ -129,16 +129,14 @@ void ImageQualityController::highQualityRepaintTimerFired(Timer<ImageQualityController>*) { - for (auto* layoutObject : m_objectLayerSizeMap.keys()) { - ObjectLayerSizeMap::iterator i = m_objectLayerSizeMap.find(layoutObject); - if (i != m_objectLayerSizeMap.end()) { - // Only invalidate the object if it is animating. - if (i->value.isResizing) { - // TODO(wangxianzhu): Use LayoutObject::getMutableForPainting(). - const_cast<LayoutObject*>(layoutObject)->setShouldDoFullPaintInvalidation(); - } - i->value.isResizing = false; - } + for (auto& i : m_objectLayerSizeMap) { + // Only invalidate the object if it is animating. + if (!i.value.isResizing) + continue; + + // TODO(wangxianzhu): Use LayoutObject::getMutableForPainting(). + const_cast<LayoutObject*>(i.key)->setShouldDoFullPaintInvalidation(); + i.value.isResizing = false; } }
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp index 27e2f75..3888503 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -859,7 +859,7 @@ ++gDelayUpdateScrollInfo; } -bool LayoutBlock::finishDelayUpdateScrollInfo(SubtreeLayoutScope* layoutScope) +bool LayoutBlock::finishDelayUpdateScrollInfo(SubtreeLayoutScope* layoutScope, ScrollPositionMap* scrollMap) { bool childrenMarkedForRelayout = false; @@ -873,7 +873,10 @@ for (auto* block : *infoSet) { if (block->hasOverflowClip()) { - childrenMarkedForRelayout |= block->layer()->getScrollableArea()->updateAfterLayout(layoutScope); + PaintLayerScrollableArea* scrollableArea = block->layer()->getScrollableArea(); + if (scrollMap) + scrollMap->add(scrollableArea, scrollableArea->scrollPositionDouble()); + childrenMarkedForRelayout |= scrollableArea->updateAfterLayout(layoutScope); } } }
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.h b/third_party/WebKit/Source/core/layout/LayoutBlock.h index c621c78..0a150fe 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBlock.h +++ b/third_party/WebKit/Source/core/layout/LayoutBlock.h
@@ -341,8 +341,17 @@ // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScrollInfo() // is called the same number of times. // finishDelayUpdateScrollInfo returns true when it marked something for layout. + // It will also return a map of saved scroll positions that the caller should restore + // on the given scrollable areas after performing the layout. + // This can be necessary because Flexbox's multi-pass layout can lose the scroll position. + // TODO(cbiesinger): This is a temporary hack. The right solution is to delay the scroll + // clamping that currently happens in PaintLayerScrollableArea::updateAfterLayout to only + // happen after all layout is done, i.e. during updateLayerPositionsAfterLayout. However, + // that currently fails a layout test. To fix this bug in time for M50, we use this temporary + // hack. The real fix is tracked in crbug.com/600036 + typedef WTF::HashMap<PaintLayerScrollableArea*, DoublePoint> ScrollPositionMap; static void startDelayUpdateScrollInfo(); - static bool finishDelayUpdateScrollInfo(SubtreeLayoutScope*); + static bool finishDelayUpdateScrollInfo(SubtreeLayoutScope*, ScrollPositionMap*); void updateScrollInfoAfterLayout();
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp index 45deb669..00eac21 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -2180,11 +2180,9 @@ if (!style()->isFlippedBlocksWritingMode()) return point; - // This is similar to LayoutBox::flipForWritingModeForChild. We have to subtract out our left/top offsets twice, since + // This is similar to LayoutBox::flipForWritingModeForChild. We have to subtract out our left offsets twice, since // it's going to get added back in. We hide this complication here so that the calling code looks normal for the unflipped // case. - if (isHorizontalWritingMode()) - return LayoutPoint(point.x(), point.y() + size().height() - child.layoutObject()->size().height() - 2 * yPositionForFloatIncludingMargin(child)); return LayoutPoint(point.x() + size().width() - child.layoutObject()->size().width() - 2 * xPositionForFloatIncludingMargin(child), point.y()); }
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp index b2a52fc..95d95708 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -964,12 +964,8 @@ ASSERT(hasOverflowClip()); LayoutSize offset = LayoutSize(-scrolledContentOffset()); - if (UNLIKELY(hasFlippedBlocksWritingMode())) { - if (isHorizontalWritingMode()) - offset.setHeight(-offset.height()); - else - offset.setWidth(-offset.width()); - } + if (UNLIKELY(hasFlippedBlocksWritingMode())) + offset.setWidth(-offset.width()); rect.move(offset); } @@ -4017,6 +4013,10 @@ left = std::max(left, borderOutsets.left()); } + // Box-shadow and border-image-outsets are in physical direction. Flip into block direction. + if (UNLIKELY(hasFlippedBlocksWritingMode())) + std::swap(left, right); + if (style()->hasOutline()) { Vector<LayoutRect> outlineRects; // The result rects are in coordinates of this object's border box. @@ -4374,10 +4374,8 @@ if (!style()->isFlippedBlocksWritingMode()) return point; - // The child is going to add in its x() and y(), so we have to make sure it ends up in + // The child is going to add in its x(), so we have to make sure it ends up in // the right place. - if (isHorizontalWritingMode()) - return LayoutPoint(point.x(), point.y() + size().height() - child->size().height() - (2 * child->location().y())); return LayoutPoint(point.x() + size().width() - child->size().width() - (2 * child->location().x()), point.y()); }
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.h b/third_party/WebKit/Source/core/layout/LayoutBox.h index 4890d59..1cf0809 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBox.h +++ b/third_party/WebKit/Source/core/layout/LayoutBox.h
@@ -800,30 +800,24 @@ LayoutSize flipForWritingMode(const LayoutSize& offset) const WARN_UNUSED_RETURN { if (!UNLIKELY(hasFlippedBlocksWritingMode())) return offset; - return isHorizontalWritingMode() ? LayoutSize(offset.width(), m_frameRect.height() - offset.height()) : LayoutSize(m_frameRect.width() - offset.width(), offset.height()); + return LayoutSize(m_frameRect.width() - offset.width(), offset.height()); } void flipForWritingMode(LayoutRect& rect) const { if (!UNLIKELY(hasFlippedBlocksWritingMode())) return; - if (isHorizontalWritingMode()) - rect.setY(m_frameRect.height() - rect.maxY()); - else - rect.setX(m_frameRect.width() - rect.maxX()); + rect.setX(m_frameRect.width() - rect.maxX()); } FloatPoint flipForWritingMode(const FloatPoint& position) const WARN_UNUSED_RETURN { if (!UNLIKELY(hasFlippedBlocksWritingMode())) return position; - return isHorizontalWritingMode() ? FloatPoint(position.x(), m_frameRect.height() - position.y()) : FloatPoint(m_frameRect.width() - position.x(), position.y()); + return FloatPoint(m_frameRect.width() - position.x(), position.y()); } void flipForWritingMode(FloatRect& rect) const { if (!UNLIKELY(hasFlippedBlocksWritingMode())) return; - if (isHorizontalWritingMode()) - rect.setY(m_frameRect.height() - rect.maxY()); - else - rect.setX(m_frameRect.width() - rect.maxX()); + rect.setX(m_frameRect.width() - rect.maxX()); } // These represent your location relative to your container as a physical offset. // In layout related methods you almost always want the logical location (e.g. x() and y()).
diff --git a/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp index 6f95120..e8b9413 100644 --- a/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp
@@ -532,7 +532,7 @@ } } while (haveFlex); - LayoutBlock::finishDelayUpdateScrollInfo(nullptr); + LayoutBlock::finishDelayUpdateScrollInfo(nullptr, nullptr); if (remainingSpace > 0 && ((style()->isLeftToRightDirection() && style()->boxPack() != Start) || (!style()->isLeftToRightDirection() && style()->boxPack() != End))) { @@ -783,7 +783,7 @@ } } while (haveFlex); - LayoutBlock::finishDelayUpdateScrollInfo(nullptr); + LayoutBlock::finishDelayUpdateScrollInfo(nullptr, nullptr); if (style()->boxPack() != Start && remainingSpace > 0) { // Children must be repositioned.
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp index 994c3a8..7c43f50 100644 --- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -288,8 +288,13 @@ layoutFlexItems(relayoutChildren, layoutScope); - if (LayoutBlock::finishDelayUpdateScrollInfo(&layoutScope)) + ScrollPositionMap scrollMap; + if (LayoutBlock::finishDelayUpdateScrollInfo(&layoutScope, &scrollMap)) { layoutFlexItems(false, layoutScope); + for (auto& entry : scrollMap) { + entry.key->scrollToPosition(entry.value); + } + } if (logicalHeight() != previousHeight) relayoutChildren = true;
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp index 1238313e..9710729 100644 --- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -1537,6 +1537,10 @@ end = m_columnPositions[endLine] - m_columnPositions[0] + paddingStart(); else end = m_rowPositions[endLine] - m_rowPositions[0] + paddingBefore(); + + // These vectors store line positions including gaps, but we shouldn't consider them for the edges of the grid. + if (endLine > firstExplicitLine && endLine < lastExplicitLine) + end -= guttersSize(direction, 2); } breadth = end - start; @@ -1551,6 +1555,9 @@ LayoutUnit alignmentOffset = m_columnPositions[0] - borderAndPaddingStart(); LayoutUnit offsetFromLastLine = m_columnPositions[m_columnPositions.size() - 1] - m_columnPositions[endLine]; offset = paddingLeft() + alignmentOffset + offsetFromLastLine; + + if (endLine > firstExplicitLine && endLine < lastExplicitLine) + offset += guttersSize(direction, 2); } }
diff --git a/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp b/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp index 554ecb7..f56793a 100644 --- a/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
@@ -203,4 +203,55 @@ EXPECT_EQ(LayoutRect(LayoutPoint(DoublePoint(0.5, 0)), LayoutSize(101, 100)), rect); } +TEST_F(LayoutObjectTest, OverflowRectMappingWithSelfFlippedWritingMode) +{ + setBodyInnerHTML( + "<div id='target' style='writing-mode: vertical-rl; box-shadow: 40px 20px black;" + " width: 100px; height: 50px; position: absolute; top: 111px; left: 222px'>" + "</div>"); + + LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target")); + LayoutRect overflowRect = target->localOverflowRectForPaintInvalidation(); + EXPECT_EQ(LayoutRect(-40, 0, 140, 70), overflowRect); + LayoutRect rect = overflowRect; + EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(target, rect)); + EXPECT_EQ(LayoutRect(0, 0, 140, 70), rect); + rect = overflowRect; + EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); + EXPECT_EQ(LayoutRect(222, 111, 140, 70), rect); +} + +TEST_F(LayoutObjectTest, OverflowRectMappingWithContainerFlippedWritingMode) +{ + setBodyInnerHTML( + "<div id='container' style='writing-mode: vertical-rl; position: absolute; top: 111px; left: 222px'>" + " <div id='target' style='box-shadow: 40px 20px black; width: 100px; height: 90px'></div>" + " <div style='width: 100px; height: 100px'></div>" + "</div>"); + + LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target")); + LayoutRect targetOverflowRect = target->localOverflowRectForPaintInvalidation(); + EXPECT_EQ(LayoutRect(-40, 0, 140, 110), targetOverflowRect); + LayoutRect rect = targetOverflowRect; + EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(target, rect)); + EXPECT_EQ(LayoutRect(0, 0, 140, 110), rect); + + LayoutBlock* container = toLayoutBlock(getLayoutObjectByElementId("container")); + rect = targetOverflowRect; + EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect)); + EXPECT_EQ(LayoutRect(100, 0, 140, 110), rect); + rect = targetOverflowRect; + EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); + EXPECT_EQ(LayoutRect(322, 111, 140, 110), rect); + + LayoutRect containerOverflowRect = container->localOverflowRectForPaintInvalidation(); + EXPECT_EQ(LayoutRect(-40, 0, 240, 110), containerOverflowRect); + rect = containerOverflowRect; + EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect)); + EXPECT_EQ(LayoutRect(0, 0, 240, 110), rect); + rect = containerOverflowRect; + EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); + EXPECT_EQ(LayoutRect(222, 111, 240, 110), rect); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp index e38188c..7abdf095 100644 --- a/third_party/WebKit/Source/core/layout/LayoutView.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -490,12 +490,9 @@ return true; if (style()->isFlippedBlocksWritingMode()) { - // We have to flip by hand since the view's logical height has not been determined. We - // can use the viewport width and height. - if (style()->isHorizontalWritingMode()) - rect.setY(viewHeight() - rect.maxY()); - else - rect.setX(viewWidth() - rect.maxX()); + // We have to flip by hand since the view's logical width has not been determined. We + // can use the viewport width. + rect.setX(viewWidth() - rect.maxX()); } if (mode & IsFixed)
diff --git a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp index 0f58fcef..67822a1 100644 --- a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp +++ b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp
@@ -110,10 +110,11 @@ LayoutSize enclosingTranslation; if (LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosingFlowThread()) { + const MultiColumnFragmentainerGroup& firstRow = flowThread->firstMultiColumnSet()->firstFragmentainerGroup(); // Translation that would map points in the coordinate space of the outermost flow thread to // visual points in the first column in the first fragmentainer group (row) in our multicol // container. - LayoutSize enclosingTranslationOrigin = enclosingFlowThread->flowThreadTranslationAtOffset(flowThread->blockOffsetInEnclosingFragmentationContext()); + LayoutSize enclosingTranslationOrigin = enclosingFlowThread->flowThreadTranslationAtOffset(firstRow.blockOffsetInEnclosingFragmentationContext()); // Translation that would map points in the coordinate space of the outermost flow thread to // visual points in the first column in this fragmentainer group.
diff --git a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp index e3d3783..33a0c38 100644 --- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp +++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
@@ -322,11 +322,6 @@ static void slowMapToVisualRectInAncestorSpace(const LayoutObject& object, const LayoutBoxModelObject& ancestor, LayoutRect& rect) { - // TODO(crbug.com/597965): LayoutBox::mapToVisualRectInAncestorSpace() incorrectly flips a rect - // in its own space for writing mode. Here flip to workaround the flip. - if (object.isBox() && (toLayoutBox(object).isWritingModeRoot() || (ancestor == object && object.styleRef().isFlippedBlocksWritingMode()))) - toLayoutBox(object).flipForWritingMode(rect); - if (object.isLayoutView()) { toLayoutView(object).mapToVisualRectInAncestorSpace(&ancestor, rect, InputIsInFrameCoordinates, DefaultVisualRectFlags); } else if (object.isSVGRoot()) {
diff --git a/third_party/WebKit/Source/core/layout/api/LayoutBoxModel.h b/third_party/WebKit/Source/core/layout/api/LayoutBoxModel.h index 98c2754..f7a269f 100644 --- a/third_party/WebKit/Source/core/layout/api/LayoutBoxModel.h +++ b/third_party/WebKit/Source/core/layout/api/LayoutBoxModel.h
@@ -34,6 +34,11 @@ return toBoxModel()->layer(); } + PaintLayerScrollableArea* getScrollableArea() const + { + return toBoxModel()->getScrollableArea(); + } + private: LayoutBoxModelObject* toBoxModel() { return toLayoutBoxModelObject(layoutObject()); } const LayoutBoxModelObject* toBoxModel() const { return toLayoutBoxModelObject(layoutObject()); }
diff --git a/third_party/WebKit/Source/core/layout/api/LayoutViewItem.h b/third_party/WebKit/Source/core/layout/api/LayoutViewItem.h index 2faba23..f7fd8d3 100644 --- a/third_party/WebKit/Source/core/layout/api/LayoutViewItem.h +++ b/third_party/WebKit/Source/core/layout/api/LayoutViewItem.h
@@ -70,6 +70,11 @@ return toView()->clearSelection(); } + bool hitTest(HitTestResult& result) + { + return toView()->hitTest(result); + } + private: LayoutView* toView() { return toLayoutView(layoutObject()); } const LayoutView* toView() const { return toLayoutView(layoutObject()); }
diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp index e7ca1485..a0f657d6 100644 --- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp +++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
@@ -196,6 +196,12 @@ void PaintLayerCompositor::updateIfNeededRecursive() { + SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime"); + updateIfNeededRecursiveInternal(); +} + +void PaintLayerCompositor::updateIfNeededRecursiveInternal() +{ FrameView* view = m_layoutView.frameView(); if (view->shouldThrottleRendering()) return; @@ -208,7 +214,7 @@ // the frame tree is in an inconsistent state, such as in the middle of frame detach. // TODO(bbudge) Remove this check when trusted Pepper plugins are gone. if (localFrame->document()->isActive() && localFrame->contentLayoutObject()) - localFrame->contentLayoutObject()->compositor()->updateIfNeededRecursive(); + localFrame->contentLayoutObject()->compositor()->updateIfNeededRecursiveInternal(); } TRACE_EVENT0("blink", "PaintLayerCompositor::updateIfNeededRecursive");
diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.h b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.h index 0a95658..cda3347 100644 --- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.h +++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.h
@@ -179,6 +179,8 @@ void assertNoUnresolvedDirtyBits(); #endif + void updateIfNeededRecursiveInternal(); + // GraphicsLayerClient implementation // TODO(wkorman): Fix up needsRepaint implementation as part of reworking scrollbar compositing visual rects. bool needsRepaint(const GraphicsLayer&) const { return true; }
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp index 2be4dbc..326ddda3 100644 --- a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp +++ b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp
@@ -149,25 +149,17 @@ TextPosition wholeTextPosition(outermostTextElement, 0, m_textLength); fillCharacterDataMap(wholeTextPosition); - // Handle x/y default attributes. - SVGCharacterDataMap::iterator it = m_characterDataMap.find(1); - if (it == m_characterDataMap.end()) { - SVGCharacterData data; - data.x = 0; - data.y = 0; - m_characterDataMap.set(1, data); - } else { - SVGCharacterData& data = it->value; - if (SVGTextLayoutAttributes::isEmptyValue(data.x)) - data.x = 0; - if (SVGTextLayoutAttributes::isEmptyValue(data.y)) - data.y = 0; - } - // Fill character data map using child text positioning elements in top-down order. unsigned size = m_textPositions.size(); for (unsigned i = 0; i < size; ++i) fillCharacterDataMap(m_textPositions[i]); + + // Handle x/y default attributes. + SVGCharacterData& data = m_characterDataMap.add(1, SVGCharacterData()).storedValue->value; + if (SVGTextLayoutAttributes::isEmptyValue(data.x)) + data.x = 0; + if (SVGTextLayoutAttributes::isEmptyValue(data.y)) + data.y = 0; } static inline void updateCharacterData(unsigned i, float& lastRotation, SVGCharacterData& data, const SVGLengthContext& lengthContext, const SVGLengthList* xList, const SVGLengthList* yList, const SVGLengthList* dxList, const SVGLengthList* dyList, const SVGNumberList* rotateList) @@ -213,15 +205,8 @@ if (!xListPtr && !yListPtr && !dxListPtr && !dyListPtr && !rotateListPtr) break; - SVGCharacterDataMap::iterator it = m_characterDataMap.find(position.start + i + 1); - if (it == m_characterDataMap.end()) { - SVGCharacterData data; - updateCharacterData(i, lastRotation, data, lengthContext, xListPtr, yListPtr, dxListPtr, dyListPtr, rotateListPtr); - m_characterDataMap.set(position.start + i + 1, data); - continue; - } - - updateCharacterData(i, lastRotation, it->value, lengthContext, xListPtr, yListPtr, dxListPtr, dyListPtr, rotateListPtr); + SVGCharacterData& data = m_characterDataMap.add(position.start + i + 1, SVGCharacterData()).storedValue->value; + updateCharacterData(i, lastRotation, data, lengthContext, xListPtr, yListPtr, dxListPtr, dyListPtr, rotateListPtr); } // The last rotation value always spans the whole scope. @@ -229,15 +214,8 @@ return; for (unsigned i = rotateList->length(); i < position.length; ++i) { - SVGCharacterDataMap::iterator it = m_characterDataMap.find(position.start + i + 1); - if (it == m_characterDataMap.end()) { - SVGCharacterData data; - data.rotate = lastRotation; - m_characterDataMap.set(position.start + i + 1, data); - continue; - } - - it->value.rotate = lastRotation; + SVGCharacterData& data = m_characterDataMap.add(position.start + i + 1, SVGCharacterData()).storedValue->value; + data.rotate = lastRotation; } }
diff --git a/third_party/WebKit/Source/core/page/FocusController.cpp b/third_party/WebKit/Source/core/page/FocusController.cpp index 7b7421a..c50abf7 100644 --- a/third_party/WebKit/Source/core/page/FocusController.cpp +++ b/third_party/WebKit/Source/core/page/FocusController.cpp
@@ -88,13 +88,17 @@ static ScopedFocusNavigation ownedByShadowInsertionPoint(HTMLShadowElement&); static ScopedFocusNavigation ownedByHTMLSlotElement(const HTMLSlotElement&); static ScopedFocusNavigation ownedByIFrame(const HTMLFrameOwnerElement&); + static HTMLSlotElement* findFallbackScopeOwnerSlot(const Element&); + static bool isSlotFallbackScoped(const Element&); + static bool isSlotFallbackScopedForThisSlot(const HTMLSlotElement&, const Element&); private: ScopedFocusNavigation(TreeScope&, const Element*); ScopedFocusNavigation(HTMLSlotElement&, const Element*); - Member<ContainerNode> m_rootNode; - Member<HTMLSlotElement> m_rootSlot; - Member<Element> m_current; + RawPtrWillBeMember<ContainerNode> m_rootNode; + RawPtrWillBeMember<HTMLSlotElement> m_rootSlot; + RawPtrWillBeMember<Element> m_current; + bool m_slotFallbackTraversal; }; ScopedFocusNavigation::ScopedFocusNavigation(TreeScope& treeScope, const Element* current) @@ -108,6 +112,7 @@ : m_rootNode(nullptr) , m_rootSlot(&slot) , m_current(const_cast<Element*>(current)) + , m_slotFallbackTraversal(slot.getAssignedNodes().isEmpty()) { } @@ -125,10 +130,16 @@ { ASSERT(m_current); if (m_rootSlot) { - m_current = SlotScopedTraversal::next(*m_current); + if (m_slotFallbackTraversal) { + m_current = ElementTraversal::next(*m_current, m_rootSlot); + while (m_current && !ScopedFocusNavigation::isSlotFallbackScopedForThisSlot(*m_rootSlot, *m_current)) + m_current = ElementTraversal::next(*m_current, m_rootSlot); + } else { + m_current = SlotScopedTraversal::next(*m_current); + } } else { m_current = ElementTraversal::next(*m_current); - while (m_current && SlotScopedTraversal::isSlotScoped(*m_current)) + while (m_current && (SlotScopedTraversal::isSlotScoped(*m_current) || ScopedFocusNavigation::isSlotFallbackScoped(*m_current))) m_current = ElementTraversal::next(*m_current); } } @@ -137,10 +148,18 @@ { ASSERT(m_current); if (m_rootSlot) { - m_current = SlotScopedTraversal::previous(*m_current); + if (m_slotFallbackTraversal) { + m_current = ElementTraversal::previous(*m_current, m_rootSlot); + if (m_current == m_rootSlot) + m_current = nullptr; + while (m_current && !ScopedFocusNavigation::isSlotFallbackScopedForThisSlot(*m_rootSlot, *m_current)) + m_current = ElementTraversal::previous(*m_current); + } else { + m_current = SlotScopedTraversal::previous(*m_current); + } } else { m_current = ElementTraversal::previous(*m_current); - while (m_current && SlotScopedTraversal::isSlotScoped(*m_current)) + while (m_current && (SlotScopedTraversal::isSlotScoped(*m_current) || ScopedFocusNavigation::isSlotFallbackScoped(*m_current))) m_current = ElementTraversal::previous(*m_current); } } @@ -148,8 +167,8 @@ void ScopedFocusNavigation::moveToFirst() { if (m_rootSlot) { - if (!m_rootSlot->getAssignedNodes().isEmpty()) { - HeapVector<Member<Node>> assignedNodes = m_rootSlot->getAssignedNodes(); + if (!m_slotFallbackTraversal) { + WillBeHeapVector<RefPtrWillBeMember<Node>> assignedNodes = m_rootSlot->getAssignedNodes(); for (auto assignedNode : assignedNodes) { if (assignedNode->isElementNode()) { m_current = toElement(assignedNode); @@ -157,21 +176,25 @@ } } } else { - m_current = nullptr; + Element* first = ElementTraversal::firstChild(*m_rootSlot); + while (first && !ScopedFocusNavigation::isSlotFallbackScopedForThisSlot(*m_rootSlot, *first)) + first = ElementTraversal::next(*first, m_rootSlot); + m_current = first; } } else { Element* first = m_rootNode->isElementNode() ? &toElement(*m_rootNode) : ElementTraversal::next(*m_rootNode); - while (first && SlotScopedTraversal::isSlotScoped(*first)) + while (first && (SlotScopedTraversal::isSlotScoped(*first) || ScopedFocusNavigation::isSlotFallbackScoped(*first))) first = ElementTraversal::next(*first, m_rootNode); m_current = first; } + } void ScopedFocusNavigation::moveToLast() { if (m_rootSlot) { - if (!m_rootSlot->getAssignedNodes().isEmpty()) { - HeapVector<Member<Node>> assignedNodes = m_rootSlot->getAssignedNodes(); + if (!m_slotFallbackTraversal) { + WillBeHeapVector<RefPtrWillBeMember<Node>> assignedNodes = m_rootSlot->getAssignedNodes(); for (auto assignedNode = assignedNodes.rbegin(); assignedNode != assignedNodes.rend(); ++assignedNode) { if ((*assignedNode)->isElementNode()) { m_current = ElementTraversal::lastWithinOrSelf(*toElement(*assignedNode)); @@ -179,11 +202,14 @@ } } } else { - m_current = nullptr; + Element* last = ElementTraversal::lastWithin(*m_rootSlot); + while (last && !ScopedFocusNavigation::isSlotFallbackScopedForThisSlot(*m_rootSlot, *last)) + last = ElementTraversal::previous(*last, m_rootSlot); + m_current = last; } } else { Element* last = ElementTraversal::lastWithin(*m_rootNode); - while (last && SlotScopedTraversal::isSlotScoped(*last)) + while (last && (SlotScopedTraversal::isSlotScoped(*last) || ScopedFocusNavigation::isSlotFallbackScoped(*last))) last = ElementTraversal::previous(*last, m_rootNode); m_current = last; } @@ -193,6 +219,7 @@ { if (m_rootSlot) return m_rootSlot; + ASSERT(m_rootNode); if (m_rootNode->isShadowRoot()) { ShadowRoot& shadowRoot = toShadowRoot(*m_rootNode); return shadowRoot.isYoungest() ? shadowRoot.host() : shadowRoot.shadowInsertionPointOfYoungerShadowRoot(); @@ -205,8 +232,10 @@ ScopedFocusNavigation ScopedFocusNavigation::createFor(const Element& current) { - if (SlotScopedTraversal::isSlotScoped(current)) - return ScopedFocusNavigation(*SlotScopedTraversal::findScopeOwnerSlot(current), ¤t); + if (HTMLSlotElement* slot = SlotScopedTraversal::findScopeOwnerSlot(current)) + return ScopedFocusNavigation(*slot, ¤t); + if (HTMLSlotElement* slot = ScopedFocusNavigation::findFallbackScopeOwnerSlot(current)) + return ScopedFocusNavigation(*slot, ¤t); return ScopedFocusNavigation(current.treeScope(), ¤t); } @@ -250,6 +279,33 @@ return ScopedFocusNavigation(const_cast<HTMLSlotElement&>(element), nullptr); } +HTMLSlotElement* ScopedFocusNavigation::findFallbackScopeOwnerSlot(const Element& element) +{ + Element* parent = const_cast<Element*>(element.parentElement()); + while (parent) { + if (isHTMLSlotElement(parent)) + return toHTMLSlotElement(parent)->getAssignedNodes().isEmpty() ? toHTMLSlotElement(parent) : nullptr; + parent = parent->parentElement(); + } + return nullptr; +} + +bool ScopedFocusNavigation::isSlotFallbackScoped(const Element& element) +{ + return ScopedFocusNavigation::findFallbackScopeOwnerSlot(element); +} + +bool ScopedFocusNavigation::isSlotFallbackScopedForThisSlot(const HTMLSlotElement& slot, const Element& current) +{ + Element* parent = current.parentElement(); + while (parent) { + if (isHTMLSlotElement(parent) && toHTMLSlotElement(parent)->getAssignedNodes().isEmpty()) + return !SlotScopedTraversal::isSlotScoped(current) && toHTMLSlotElement(parent) == slot; + parent = parent->parentElement(); + } + return false; +} + inline void dispatchBlurEvent(const Document& document, Element& focusedElement) { focusedElement.dispatchBlurEvent(nullptr, WebFocusTypePage); @@ -867,8 +923,7 @@ document->updateLayoutIgnorePendingStylesheets(); ScopedFocusNavigation scope = current ? ScopedFocusNavigation::createFor(*current) : ScopedFocusNavigation::createForDocument(*document); - RawPtr<Element> element = findFocusableElementAcrossFocusScopes(type, scope); - + RefPtrWillBeRawPtr<Element> element = findFocusableElementAcrossFocusScopes(type, scope); if (!element) { // If there's a RemoteFrame on the ancestor chain, we need to continue // searching for focusable elements there.
diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp index d303c21..7f785597 100644 --- a/third_party/WebKit/Source/core/page/Page.cpp +++ b/third_party/WebKit/Source/core/page/Page.cpp
@@ -526,7 +526,6 @@ DEFINE_TRACE(Page) { -#if ENABLE(OILPAN) visitor->trace(m_animator); visitor->trace(m_autoscrollController); visitor->trace(m_chromeClient); @@ -542,8 +541,7 @@ visitor->trace(m_multisamplingChangedObservers); visitor->trace(m_frameHost); visitor->trace(m_memoryPurgeController); - HeapSupplementable<Page>::trace(visitor); -#endif + Supplementable<Page>::trace(visitor); PageLifecycleNotifier::trace(visitor); MemoryPurgeClient::trace(visitor); } @@ -610,6 +608,6 @@ { } -template class CORE_TEMPLATE_EXPORT HeapSupplement<Page>; +template class CORE_TEMPLATE_EXPORT Supplement<Page>; } // namespace blink
diff --git a/third_party/WebKit/Source/core/page/Page.h b/third_party/WebKit/Source/core/page/Page.h index bae0ad77..1b0a2ca 100644 --- a/third_party/WebKit/Source/core/page/Page.h +++ b/third_party/WebKit/Source/core/page/Page.h
@@ -72,7 +72,7 @@ float deviceScaleFactor(LocalFrame*); -class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>, public HeapSupplementable<Page>, public PageLifecycleNotifier, public SettingsDelegate, public MemoryPurgeClient { +class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>, public Supplementable<Page>, public PageLifecycleNotifier, public SettingsDelegate, public MemoryPurgeClient { USING_GARBAGE_COLLECTED_MIXIN(Page); WTF_MAKE_NONCOPYABLE(Page); friend class Settings; @@ -298,7 +298,7 @@ Timer<Page> m_timerForCompressStrings; }; -extern template class CORE_EXTERN_TEMPLATE_EXPORT HeapSupplement<Page>; +extern template class CORE_EXTERN_TEMPLATE_EXPORT Supplement<Page>; } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp b/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp index a362e111..a3369ee9 100644 --- a/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp +++ b/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
@@ -124,7 +124,7 @@ } } - ASSERT_NOT_REACHED(); + NOTREACHED(); return LayoutSize(); } @@ -163,6 +163,7 @@ m_destRect.move(std::max(xOffset, LayoutUnit()), LayoutUnit()); m_phase.setX(-std::min(xOffset, LayoutUnit())); m_destRect.setWidth(m_tileSize.width() + std::min(xOffset, LayoutUnit())); + setSpaceSize(LayoutSize(LayoutUnit(), spaceSize().height())); } void BackgroundImageGeometry::setNoRepeatY(LayoutUnit yOffset) @@ -170,6 +171,75 @@ m_destRect.move(LayoutUnit(), std::max(yOffset, LayoutUnit())); m_phase.setY(-std::min(yOffset, LayoutUnit())); m_destRect.setHeight(m_tileSize.height() + std::min(yOffset, LayoutUnit())); + setSpaceSize(LayoutSize(spaceSize().width(), LayoutUnit())); +} + +void BackgroundImageGeometry::setRepeatX( + const FillLayer& fillLayer, + LayoutUnit unsnappedTileWidth, + LayoutUnit snappedAvailableWidth, + LayoutUnit unsnappedAvailableWidth, + LayoutUnit extraOffset) +{ + // We would like to identify the phase as a fraction of the image size in the absence of snapping, + // then re-apply it to the snapped values. This is to handle large positions. + if (unsnappedTileWidth) { + LayoutUnit computedXPosition = roundedMinimumValueForLength(fillLayer.xPosition(), unsnappedAvailableWidth); + if (fillLayer.backgroundXOrigin() == RightEdge) { + float numberOfTilesInPosition = (snappedAvailableWidth - computedXPosition + extraOffset).toFloat() / unsnappedTileWidth.toFloat(); + float fractionalPositionWithinTile = numberOfTilesInPosition - truncf(numberOfTilesInPosition); + setPhaseX(LayoutUnit(fractionalPositionWithinTile * tileSize().width())); + } else { + float numberOfTilesInPosition = (computedXPosition + extraOffset).toFloat() / unsnappedTileWidth.toFloat(); + float fractionalPositionWithinTile = 1.0f - (numberOfTilesInPosition - truncf(numberOfTilesInPosition)); + setPhaseX(LayoutUnit(fractionalPositionWithinTile * tileSize().width())); + } + } else { + setPhaseX(LayoutUnit()); + } + setSpaceSize(LayoutSize(LayoutUnit(), spaceSize().height())); +} + +void BackgroundImageGeometry::setRepeatY( + const FillLayer& fillLayer, + LayoutUnit unsnappedTileHeight, + LayoutUnit snappedAvailableHeight, + LayoutUnit unsnappedAvailableHeight, + LayoutUnit extraOffset) +{ + // We would like to identify the phase as a fraction of the image size in the absence of snapping, + // then re-apply it to the snapped values. This is to handle large positions. + if (unsnappedTileHeight) { + LayoutUnit computedYPosition = roundedMinimumValueForLength(fillLayer.yPosition(), unsnappedAvailableHeight); + if (fillLayer.backgroundYOrigin() == BottomEdge) { + float numberOfTilesInPosition = (snappedAvailableHeight - computedYPosition + extraOffset).toFloat() / unsnappedTileHeight.toFloat(); + float fractionalPositionWithinTile = numberOfTilesInPosition - truncf(numberOfTilesInPosition); + setPhaseY(LayoutUnit(fractionalPositionWithinTile * tileSize().height())); + } else { + float numberOfTilesInPosition = (computedYPosition + extraOffset).toFloat() / unsnappedTileHeight.toFloat(); + float fractionalPositionWithinTile = 1.0f - (numberOfTilesInPosition - truncf(numberOfTilesInPosition)); + setPhaseY(LayoutUnit(fractionalPositionWithinTile * tileSize().height())); + } + } else { + setPhaseY(LayoutUnit()); + } + setSpaceSize(LayoutSize(spaceSize().width(), LayoutUnit())); +} + +void BackgroundImageGeometry::setSpaceX(LayoutUnit space, LayoutUnit availableWidth, LayoutUnit extraOffset) +{ + LayoutUnit computedXPosition = roundedMinimumValueForLength(Length(), availableWidth); + setSpaceSize(LayoutSize(space.round(), spaceSize().height())); + LayoutUnit actualWidth = tileSize().width() + space; + setPhaseX(actualWidth ? LayoutUnit(actualWidth - fmodf((computedXPosition + extraOffset), actualWidth)) : LayoutUnit()); +} + +void BackgroundImageGeometry::setSpaceY(LayoutUnit space, LayoutUnit availableHeight, LayoutUnit extraOffset) +{ + LayoutUnit computedYPosition = roundedMinimumValueForLength(Length(), availableHeight); + setSpaceSize(LayoutSize(spaceSize().width(), space.round())); + LayoutUnit actualHeight = tileSize().height() + space; + setPhaseY(actualHeight ? LayoutUnit(actualHeight - fmodf((computedYPosition + extraOffset), actualHeight)) : LayoutUnit()); } void BackgroundImageGeometry::useFixedAttachment(const LayoutPoint& attachmentPoint) @@ -189,9 +259,9 @@ if (isLayoutView) { // It is only possible reach here when root element has a box. Element* documentElement = obj.document().documentElement(); - ASSERT(documentElement); - ASSERT(documentElement->layoutObject()); - ASSERT(documentElement->layoutObject()->isBox()); + DCHECK(documentElement); + DCHECK(documentElement->layoutObject()); + DCHECK(documentElement->layoutObject()->isBox()); rootBox = toLayoutBox(documentElement->layoutObject()); } const LayoutBoxModelObject& positioningBox = isLayoutView ? static_cast<const LayoutBoxModelObject&>(*rootBox) : obj; @@ -269,6 +339,8 @@ EFillRepeat backgroundRepeatX = fillLayer.repeatX(); EFillRepeat backgroundRepeatY = fillLayer.repeatY(); + LayoutUnit unsnappedAvailableWidth = positioningAreaSize.width() - fillTileSize.width(); + LayoutUnit unsnappedAvailableHeight = positioningAreaSize.height() - fillTileSize.height(); positioningAreaSize = LayoutSize(snapSizeToPixel(positioningAreaSize.width(), m_destRect.x()), snapSizeToPixel(positioningAreaSize.height(), m_destRect.y())); LayoutUnit availableWidth = positioningAreaSize.width() - tileSize().width(); LayoutUnit availableHeight = positioningAreaSize.height() - tileSize().height(); @@ -306,49 +378,31 @@ } if (backgroundRepeatX == RepeatFill) { - LayoutUnit xOffset = fillLayer.backgroundXOrigin() == RightEdge ? availableWidth - computedXPosition : computedXPosition; - setPhaseX(tileSize().width() ? LayoutUnit(tileSize().width() - fmodf((xOffset + left), tileSize().width())) - : LayoutUnit()); - setSpaceSize(LayoutSize()); + setRepeatX(fillLayer, fillTileSize.width(), availableWidth, unsnappedAvailableWidth, left); } else if (backgroundRepeatX == SpaceFill && tileSize().width() > LayoutUnit()) { LayoutUnit space = getSpaceBetweenImageTiles(positioningAreaSize.width(), tileSize().width()); - LayoutUnit actualWidth = tileSize().width() + space; - - if (space >= LayoutUnit()) { - computedXPosition = roundedMinimumValueForLength(Length(), availableWidth); - setSpaceSize(LayoutSize(space.round(), LayoutUnit())); - setPhaseX(actualWidth ? LayoutUnit(actualWidth - fmodf((computedXPosition + left), actualWidth)) : LayoutUnit()); - } else { + if (space >= LayoutUnit()) + setSpaceX(space, availableWidth, left); + else backgroundRepeatX = NoRepeatFill; - } } if (backgroundRepeatX == NoRepeatFill) { LayoutUnit xOffset = fillLayer.backgroundXOrigin() == RightEdge ? availableWidth - computedXPosition : computedXPosition; setNoRepeatX(left + xOffset); - setSpaceSize(LayoutSize(LayoutUnit(), spaceSize().height())); } if (backgroundRepeatY == RepeatFill) { - LayoutUnit yOffset = fillLayer.backgroundYOrigin() == BottomEdge ? availableHeight - computedYPosition : computedYPosition; - setPhaseY(tileSize().height() ? LayoutUnit(tileSize().height() - fmodf((yOffset + top), tileSize().height())) - : LayoutUnit()); - setSpaceSize(LayoutSize(spaceSize().width(), LayoutUnit())); + setRepeatY(fillLayer, fillTileSize.height(), availableHeight, unsnappedAvailableHeight, top); } else if (backgroundRepeatY == SpaceFill && tileSize().height() > LayoutUnit()) { LayoutUnit space = getSpaceBetweenImageTiles(positioningAreaSize.height(), tileSize().height()); - LayoutUnit actualHeight = tileSize().height() + space; - - if (space >= LayoutUnit()) { - computedYPosition = roundedMinimumValueForLength(Length(), availableHeight); - setSpaceSize(LayoutSize(spaceSize().width(), space.round())); - setPhaseY(actualHeight ? LayoutUnit(actualHeight - fmodf((computedYPosition + top), actualHeight)) : LayoutUnit()); - } else { + if (space >= LayoutUnit()) + setSpaceY(space, availableHeight, top); + else backgroundRepeatY = NoRepeatFill; - } } if (backgroundRepeatY == NoRepeatFill) { LayoutUnit yOffset = fillLayer.backgroundYOrigin() == BottomEdge ? availableHeight - computedYPosition : computedYPosition; setNoRepeatY(top + yOffset); - setSpaceSize(LayoutSize(spaceSize().width(), LayoutUnit())); } if (fixedAttachment)
diff --git a/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.h b/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.h index b34cd98..9796cc3b8 100644 --- a/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.h +++ b/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.h
@@ -46,6 +46,10 @@ void setPhaseY(LayoutUnit y) { m_phase.setY(y); } void setNoRepeatX(LayoutUnit xOffset); void setNoRepeatY(LayoutUnit yOffset); + void setRepeatX(const FillLayer&, LayoutUnit, LayoutUnit, LayoutUnit, LayoutUnit); + void setRepeatY(const FillLayer&, LayoutUnit, LayoutUnit, LayoutUnit, LayoutUnit); + void setSpaceX(LayoutUnit, LayoutUnit, LayoutUnit); + void setSpaceY(LayoutUnit, LayoutUnit, LayoutUnit); void useFixedAttachment(const LayoutPoint& attachmentPoint); void setHasNonLocalGeometry() { m_hasNonLocalGeometry = true; }
diff --git a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp index 55218db..38ebea3 100644 --- a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp +++ b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
@@ -22,8 +22,11 @@ void SVGRootPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) { + // Pixel-snap to match BoxPainter's alignment. + const IntRect adjustedRect = pixelSnappedIntRect(paintOffset, m_layoutSVGRoot.size()); + // An empty viewport disables rendering. - if (m_layoutSVGRoot.pixelSnappedBorderBoxRect().isEmpty()) + if (adjustedRect.isEmpty()) return; // SVG outlines are painted during PaintPhaseForeground. @@ -70,8 +73,14 @@ // Convert from container offsets (html layoutObjects) to a relative transform (svg layoutObjects). // Transform from our paint container's coordinate system to our local coords. - IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset); - AffineTransform paintOffsetToBorderBox = AffineTransform::translation(adjustedPaintOffset.x(), adjustedPaintOffset.y()) * m_layoutSVGRoot.localToBorderBoxTransform(); + AffineTransform paintOffsetToBorderBox = + AffineTransform::translation(adjustedRect.x(), adjustedRect.y()); + // Compensate for size snapping. + paintOffsetToBorderBox.scale( + adjustedRect.width() / m_layoutSVGRoot.size().width().toFloat(), + adjustedRect.height() / m_layoutSVGRoot.size().height().toFloat()); + paintOffsetToBorderBox.multiply(m_layoutSVGRoot.localToBorderBoxTransform()); + paintInfoBeforeFiltering.updateCullRect(paintOffsetToBorderBox); TransformRecorder transformRecorder(paintInfoBeforeFiltering.context, m_layoutSVGRoot, paintOffsetToBorderBox);
diff --git a/third_party/WebKit/Source/core/paint/TableCellPainter.cpp b/third_party/WebKit/Source/core/paint/TableCellPainter.cpp index d30a773..063e9fe 100644 --- a/third_party/WebKit/Source/core/paint/TableCellPainter.cpp +++ b/third_party/WebKit/Source/core/paint/TableCellPainter.cpp
@@ -16,37 +16,42 @@ inline const CollapsedBorderValue* TableCellPainter::cachedCollapsedLeftBorder(const ComputedStyle& styleForCellFlow) const { if (styleForCellFlow.isHorizontalWritingMode()) { - return styleForCellFlow.isLeftToRightDirection() ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSStart) + return styleForCellFlow.isLeftToRightDirection() + ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSStart) : m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSEnd); } - return styleForCellFlow.isFlippedBlocksWritingMode() ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSAfter) + return styleForCellFlow.isFlippedBlocksWritingMode() + ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSAfter) : m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSBefore); } inline const CollapsedBorderValue* TableCellPainter::cachedCollapsedRightBorder(const ComputedStyle& styleForCellFlow) const { if (styleForCellFlow.isHorizontalWritingMode()) { - return styleForCellFlow.isLeftToRightDirection() ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSEnd) + return styleForCellFlow.isLeftToRightDirection() + ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSEnd) : m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSStart); } - return styleForCellFlow.isFlippedBlocksWritingMode() ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSBefore) + return styleForCellFlow.isFlippedBlocksWritingMode() + ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSBefore) : m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSAfter); } inline const CollapsedBorderValue* TableCellPainter::cachedCollapsedTopBorder(const ComputedStyle& styleForCellFlow) const { if (styleForCellFlow.isHorizontalWritingMode()) - return styleForCellFlow.isFlippedBlocksWritingMode() ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSAfter) : m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSBefore); - return styleForCellFlow.isLeftToRightDirection() ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSStart) : m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSEnd); + return m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSBefore); + return styleForCellFlow.isLeftToRightDirection() + ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSStart) + : m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSEnd); } inline const CollapsedBorderValue* TableCellPainter::cachedCollapsedBottomBorder(const ComputedStyle& styleForCellFlow) const { - if (styleForCellFlow.isHorizontalWritingMode()) { - return styleForCellFlow.isFlippedBlocksWritingMode() ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSBefore) - : m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSAfter); - } - return styleForCellFlow.isLeftToRightDirection() ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSEnd) + if (styleForCellFlow.isHorizontalWritingMode()) + return m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSAfter); + return styleForCellFlow.isLeftToRightDirection() + ? m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSEnd) : m_layoutTableCell.section()->cachedCollapsedBorder(&m_layoutTableCell, CBSStart); }
diff --git a/third_party/WebKit/Source/core/testing/InternalSettings.cpp b/third_party/WebKit/Source/core/testing/InternalSettings.cpp index 69012c4d..aae34cf 100644 --- a/third_party/WebKit/Source/core/testing/InternalSettings.cpp +++ b/third_party/WebKit/Source/core/testing/InternalSettings.cpp
@@ -100,39 +100,12 @@ RuntimeEnabledFeatures::setCompositorWorkerEnabled(m_originalCompositorWorkerEnabled); } -#if ENABLE(OILPAN) InternalSettings* InternalSettings::from(Page& page) { if (!HeapSupplement<Page>::from(page, supplementName())) HeapSupplement<Page>::provideTo(page, supplementName(), new InternalSettings(page)); return static_cast<InternalSettings*>(HeapSupplement<Page>::from(page, supplementName())); } -#else -// We can't use RefCountedSupplement because that would try to make InternalSettings RefCounted -// and InternalSettings is already RefCounted via its base class, InternalSettingsGenerated. -// Instead, we manually make InternalSettings supplement Page. -class InternalSettingsWrapper : public Supplement<Page> { -public: - explicit InternalSettingsWrapper(Page& page) - : m_internalSettings(InternalSettings::create(page)) { } - virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); } -#if ENABLE(ASSERT) - bool isRefCountedWrapper() const override { return true; } -#endif - InternalSettings* internalSettings() const { return m_internalSettings.get(); } - -private: - RefPtr<InternalSettings> m_internalSettings; -}; - -InternalSettings* InternalSettings::from(Page& page) -{ - if (!Supplement<Page>::from(page, supplementName())) - Supplement<Page>::provideTo(page, supplementName(), adoptPtr(new InternalSettingsWrapper(page))); - return static_cast<InternalSettingsWrapper*>(Supplement<Page>::from(page, supplementName()))->internalSettings(); -} -#endif - const char* InternalSettings::supplementName() { return "InternalSettings"; @@ -356,9 +329,7 @@ { visitor->trace(m_page); InternalSettingsGenerated::trace(visitor); -#if ENABLE(OILPAN) - HeapSupplement<Page>::trace(visitor); -#endif + Supplement<Page>::trace(visitor); } void InternalSettings::setAvailablePointerTypes(const String& pointers, ExceptionState& exceptionState)
diff --git a/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp b/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp index efab824..8392c7e 100644 --- a/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp +++ b/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp
@@ -33,6 +33,7 @@ #include "bindings/core/v8/ScriptValue.h" #include "bindings/core/v8/V8ObjectBuilder.h" #include "core/dom/Document.h" +#include "core/dom/DocumentParserTiming.h" #include "core/dom/DocumentTiming.h" #include "core/frame/LocalFrame.h" #include "core/loader/DocumentLoadTiming.h" @@ -360,6 +361,33 @@ return monotonicTimeToIntegerMilliseconds(timing->firstContentfulPaint()); } +unsigned long long PerformanceTiming::parseStart() const +{ + const DocumentParserTiming* timing = documentParserTiming(); + if (!timing) + return 0; + + return monotonicTimeToIntegerMilliseconds(timing->parserStart()); +} + +unsigned long long PerformanceTiming::parseStop() const +{ + const DocumentParserTiming* timing = documentParserTiming(); + if (!timing) + return 0; + + return monotonicTimeToIntegerMilliseconds(timing->parserStop()); +} + +unsigned long long PerformanceTiming::parseBlockedOnScriptLoadDuration() const +{ + const DocumentParserTiming* timing = documentParserTiming(); + if (!timing) + return 0; + + return toIntegerMilliseconds(timing->parserBlockedOnScriptLoadDuration()); +} + DocumentLoader* PerformanceTiming::documentLoader() const { if (!m_frame) @@ -392,6 +420,18 @@ return &PaintTiming::from(*document); } +const DocumentParserTiming* PerformanceTiming::documentParserTiming() const +{ + if (!m_frame) + return nullptr; + + Document* document = m_frame->document(); + if (!document) + return nullptr; + + return &DocumentParserTiming::from(*document); +} + DocumentLoadTiming* PerformanceTiming::documentLoadTiming() const { DocumentLoader* loader = documentLoader();
diff --git a/third_party/WebKit/Source/core/timing/PerformanceTiming.h b/third_party/WebKit/Source/core/timing/PerformanceTiming.h index 329cf89c..cff29bfe 100644 --- a/third_party/WebKit/Source/core/timing/PerformanceTiming.h +++ b/third_party/WebKit/Source/core/timing/PerformanceTiming.h
@@ -40,6 +40,7 @@ class DocumentLoadTiming; class DocumentLoader; +class DocumentParserTiming; class DocumentTiming; class LocalFrame; class PaintTiming; @@ -92,6 +93,10 @@ // that includes content of some kind (for example, text or image content). unsigned long long firstContentfulPaint() const; + unsigned long long parseStart() const; + unsigned long long parseStop() const; + unsigned long long parseBlockedOnScriptLoadDuration() const; + ScriptValue toJSONForBinding(ScriptState*) const; DECLARE_VIRTUAL_TRACE(); @@ -103,6 +108,7 @@ explicit PerformanceTiming(LocalFrame*); const DocumentTiming* documentTiming() const; + const DocumentParserTiming* documentParserTiming() const; const PaintTiming* paintTiming() const; DocumentLoader* documentLoader() const; DocumentLoadTiming* documentLoadTiming() const;
diff --git a/third_party/WebKit/Source/core/workers/SharedWorker.cpp b/third_party/WebKit/Source/core/workers/SharedWorker.cpp index 7746ca77..7652a04 100644 --- a/third_party/WebKit/Source/core/workers/SharedWorker.cpp +++ b/third_party/WebKit/Source/core/workers/SharedWorker.cpp
@@ -104,8 +104,8 @@ DEFINE_TRACE(SharedWorker) { visitor->trace(m_port); - HeapSupplementable<SharedWorker>::trace(visitor); AbstractWorker::trace(visitor); + Supplementable<SharedWorker>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/workers/SharedWorker.h b/third_party/WebKit/Source/core/workers/SharedWorker.h index f2a2abf..c50cb49b 100644 --- a/third_party/WebKit/Source/core/workers/SharedWorker.h +++ b/third_party/WebKit/Source/core/workers/SharedWorker.h
@@ -42,7 +42,7 @@ class ExceptionState; -class CORE_EXPORT SharedWorker final : public AbstractWorker, public HeapSupplementable<SharedWorker>, public ActiveScriptWrappable { +class CORE_EXPORT SharedWorker final : public AbstractWorker, public Supplementable<SharedWorker>, public ActiveScriptWrappable { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(SharedWorker); public:
diff --git a/third_party/WebKit/Source/core/workers/WorkerClients.h b/third_party/WebKit/Source/core/workers/WorkerClients.h index e993c42..1faf6878 100644 --- a/third_party/WebKit/Source/core/workers/WorkerClients.h +++ b/third_party/WebKit/Source/core/workers/WorkerClients.h
@@ -39,23 +39,19 @@ // This is created on the main thread, passed to the worker thread and // attached to WorkerGlobalScope when it is created. // This class can be used to provide "client" implementations to Workers. -class WorkerClients final : public GarbageCollectedFinalized<WorkerClients>, public HeapSupplementable<WorkerClients> { +class WorkerClients final : public GarbageCollectedFinalized<WorkerClients>, public Supplementable<WorkerClients> { USING_GARBAGE_COLLECTED_MIXIN(WorkerClients); WTF_MAKE_NONCOPYABLE(WorkerClients); public: - static RawPtr<WorkerClients> create() + static WorkerClients* create() { - return new WorkerClients(); + return new WorkerClients; } - virtual ~WorkerClients() { } - -#if ENABLE(OILPAN) DEFINE_INLINE_VIRTUAL_TRACE() { - HeapSupplementable<WorkerClients>::trace(visitor); + Supplementable<WorkerClients>::trace(visitor); } -#endif private: WorkerClients() { }
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp index acff95c..ea59969c 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
@@ -411,7 +411,6 @@ DEFINE_TRACE(WorkerGlobalScope) { -#if ENABLE(OILPAN) visitor->trace(m_console); visitor->trace(m_location); visitor->trace(m_navigator); @@ -423,11 +422,10 @@ visitor->trace(m_messageStorage); visitor->trace(m_pendingMessages); visitor->trace(m_eventListeners); - HeapSupplementable<WorkerGlobalScope>::trace(visitor); -#endif ExecutionContext::trace(visitor); EventTargetWithInlineData::trace(visitor); SecurityContext::trace(visitor); + Supplementable<WorkerGlobalScope>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h index 042871f..c5b392e 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
@@ -47,7 +47,6 @@ #include "wtf/ListHashSet.h" #include "wtf/OwnPtr.h" #include "wtf/PassRefPtr.h" -#include "wtf/RefCounted.h" #include "wtf/RefPtr.h" #include "wtf/text/AtomicStringHash.h" @@ -64,7 +63,7 @@ class WorkerNavigator; class WorkerThread; -class CORE_EXPORT WorkerGlobalScope : public EventTargetWithInlineData, public SecurityContext, public WorkerOrWorkletGlobalScope, public HeapSupplementable<WorkerGlobalScope>, public DOMWindowBase64 { +class CORE_EXPORT WorkerGlobalScope : public EventTargetWithInlineData, public SecurityContext, public WorkerOrWorkletGlobalScope, public Supplementable<WorkerGlobalScope>, public DOMWindowBase64 { DEFINE_WRAPPERTYPEINFO(); REFCOUNTED_EVENT_TARGET(WorkerGlobalScope); USING_GARBAGE_COLLECTED_MIXIN(WorkerGlobalScope);
diff --git a/third_party/WebKit/Source/core/workers/WorkerNavigator.cpp b/third_party/WebKit/Source/core/workers/WorkerNavigator.cpp index 84e7dabe..91a235c 100644 --- a/third_party/WebKit/Source/core/workers/WorkerNavigator.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerNavigator.cpp
@@ -44,7 +44,7 @@ DEFINE_TRACE(WorkerNavigator) { - HeapSupplementable<WorkerNavigator>::trace(visitor); + Supplementable<WorkerNavigator>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/workers/WorkerNavigator.h b/third_party/WebKit/Source/core/workers/WorkerNavigator.h index f6c8b28..b11fdb4 100644 --- a/third_party/WebKit/Source/core/workers/WorkerNavigator.h +++ b/third_party/WebKit/Source/core/workers/WorkerNavigator.h
@@ -36,7 +36,7 @@ namespace blink { -class WorkerNavigator final : public GarbageCollectedFinalized<WorkerNavigator>, public ScriptWrappable, public NavigatorCPU, public NavigatorID, public NavigatorOnLine, public HeapSupplementable<WorkerNavigator> { +class WorkerNavigator final : public GarbageCollectedFinalized<WorkerNavigator>, public ScriptWrappable, public NavigatorCPU, public NavigatorID, public NavigatorOnLine, public Supplementable<WorkerNavigator> { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(WorkerNavigator); public:
diff --git a/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.cpp b/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.cpp index b2bec9d7..58849940 100644 --- a/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.cpp +++ b/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.cpp
@@ -35,17 +35,17 @@ { } -DocumentXPathEvaluator& DocumentXPathEvaluator::from(HeapSupplementable<Document>& document) +DocumentXPathEvaluator& DocumentXPathEvaluator::from(Supplementable<Document>& document) { - DocumentXPathEvaluator* cache = static_cast<DocumentXPathEvaluator*>(HeapSupplement<Document>::from(document, supplementName())); + DocumentXPathEvaluator* cache = static_cast<DocumentXPathEvaluator*>(Supplement<Document>::from(document, supplementName())); if (!cache) { - cache = new DocumentXPathEvaluator(); - HeapSupplement<Document>::provideTo(document, supplementName(), adoptPtrWillBeNoop(cache)); + cache = new DocumentXPathEvaluator; + Supplement<Document>::provideTo(document, supplementName(), cache); } return *cache; } -XPathExpression* DocumentXPathEvaluator::createExpression(HeapSupplementable<Document>& document, const String& expression, XPathNSResolver* resolver, ExceptionState& exceptionState) +XPathExpression* DocumentXPathEvaluator::createExpression(Supplementable<Document>& document, const String& expression, XPathNSResolver* resolver, ExceptionState& exceptionState) { DocumentXPathEvaluator& suplement = from(document); if (!suplement.m_xpathEvaluator) @@ -53,7 +53,7 @@ return suplement.m_xpathEvaluator->createExpression(expression, resolver, exceptionState); } -XPathNSResolver* DocumentXPathEvaluator::createNSResolver(HeapSupplementable<Document>& document, Node* nodeResolver) +XPathNSResolver* DocumentXPathEvaluator::createNSResolver(Supplementable<Document>& document, Node* nodeResolver) { DocumentXPathEvaluator& suplement = from(document); if (!suplement.m_xpathEvaluator) @@ -61,7 +61,7 @@ return suplement.m_xpathEvaluator->createNSResolver(nodeResolver); } -XPathResult* DocumentXPathEvaluator::evaluate(HeapSupplementable<Document>& document, const String& expression, +XPathResult* DocumentXPathEvaluator::evaluate(Supplementable<Document>& document, const String& expression, Node* contextNode, XPathNSResolver* resolver, unsigned short type, const ScriptValue&, ExceptionState& exceptionState) { @@ -74,7 +74,7 @@ DEFINE_TRACE(DocumentXPathEvaluator) { visitor->trace(m_xpathEvaluator); - HeapSupplement<Document>::trace(visitor); + Supplement<Document>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.h b/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.h index 2887a8e..93bc68d 100644 --- a/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.h +++ b/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.h
@@ -36,15 +36,15 @@ class XPathExpression; class XPathResult; -class DocumentXPathEvaluator final : public GarbageCollected<DocumentXPathEvaluator>, public HeapSupplement<Document> { +class DocumentXPathEvaluator final : public GarbageCollected<DocumentXPathEvaluator>, public Supplement<Document> { USING_GARBAGE_COLLECTED_MIXIN(DocumentXPathEvaluator); public: - static DocumentXPathEvaluator& from(HeapSupplementable<Document>&); + static DocumentXPathEvaluator& from(Supplementable<Document>&); - static XPathExpression* createExpression(HeapSupplementable<Document>&, + static XPathExpression* createExpression(Supplementable<Document>&, const String& expression, XPathNSResolver*, ExceptionState&); - static XPathNSResolver* createNSResolver(HeapSupplementable<Document>&, Node* nodeResolver); - static XPathResult* evaluate(HeapSupplementable<Document>&, + static XPathNSResolver* createNSResolver(Supplementable<Document>&, Node* nodeResolver); + static XPathResult* evaluate(Supplementable<Document>&, const String& expression, Node* contextNode, XPathNSResolver*, unsigned short type, const ScriptValue&, ExceptionState&);
diff --git a/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp b/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp index 32ba2b9a..dfe0279 100644 --- a/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp +++ b/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp
@@ -192,16 +192,16 @@ bool DocumentXSLT::hasTransformSourceDocument(Document& document) { - return static_cast<DocumentXSLT*>(HeapSupplement<Document>::from(document, supplementName())); + return static_cast<DocumentXSLT*>(Supplement<Document>::from(document, supplementName())); } -DocumentXSLT& DocumentXSLT::from(HeapSupplementable<Document>& document) +DocumentXSLT& DocumentXSLT::from(Supplementable<Document>& document) { - DocumentXSLT* supplement = static_cast<DocumentXSLT*>(HeapSupplement<Document>::from(document, supplementName())); + DocumentXSLT* supplement = static_cast<DocumentXSLT*>(Supplement<Document>::from(document, supplementName())); if (!supplement) { - supplement = new DocumentXSLT(); - HeapSupplement<Document>::provideTo(document, supplementName(), adoptPtrWillBeNoop(supplement)); + supplement = new DocumentXSLT; + Supplement<Document>::provideTo(document, supplementName(), supplement); } return *supplement; } @@ -209,7 +209,7 @@ DEFINE_TRACE(DocumentXSLT) { visitor->trace(m_transformSourceDocument); - HeapSupplement<Document>::trace(visitor); + Supplement<Document>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/xml/DocumentXSLT.h b/third_party/WebKit/Source/core/xml/DocumentXSLT.h index bc6e200..952ad95 100644 --- a/third_party/WebKit/Source/core/xml/DocumentXSLT.h +++ b/third_party/WebKit/Source/core/xml/DocumentXSLT.h
@@ -14,7 +14,7 @@ class Document; class ProcessingInstruction; -class DocumentXSLT final : public GarbageCollected<DocumentXSLT>, public HeapSupplement<Document> { +class DocumentXSLT final : public GarbageCollected<DocumentXSLT>, public Supplement<Document> { WTF_MAKE_NONCOPYABLE(DocumentXSLT); USING_GARBAGE_COLLECTED_MIXIN(DocumentXSLT); public: @@ -29,7 +29,7 @@ m_transformSourceDocument = document; } - static DocumentXSLT& from(HeapSupplementable<Document>&); + static DocumentXSLT& from(Supplementable<Document>&); static const char* supplementName(); // The following static methods don't use any instance of DocumentXSLT.
diff --git a/third_party/WebKit/Source/devtools/front_end/common/TextRange.js b/third_party/WebKit/Source/devtools/front_end/common/TextRange.js index e478d29..8728e05 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/TextRange.js +++ b/third_party/WebKit/Source/devtools/front_end/common/TextRange.js
@@ -187,6 +187,20 @@ }, /** + * @param {number} lineNumber + * @param {number} columnNumber + * @return {number} + */ + compareToPosition: function(lineNumber, columnNumber) + { + if (lineNumber < this.startLine || (lineNumber === this.startLine && columnNumber < this.startColumn)) + return -1; + if (lineNumber > this.endLine || (lineNumber === this.endLine && columnNumber > this.endColumn)) + return 1; + return 0; + }, + + /** * @param {!WebInspector.TextRange} other * @return {boolean} */
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js index 4b7c2d7..0bae0c8 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
@@ -961,7 +961,10 @@ var dataGrid = this._dataGrid; var rootNode = dataGrid.rootNode(); + /** @type {!Array<!WebInspector.NetworkDataGridNode> } */ var nodesToInsert = []; + /** @type {!Array<!WebInspector.NetworkDataGridNode> } */ + var nodesToRefresh = []; for (var requestId in this._staleRequestIds) { var node = this._nodesByRequestId.get(requestId); if (!node) @@ -976,6 +979,8 @@ if (!node[WebInspector.NetworkLogView._isFilteredOutSymbol]) nodesToInsert.push(node); } + if (!isFilteredOut) + nodesToRefresh.push(node); var request = node.request(); this._timeCalculator.updateBoundaries(request); this._durationCalculator.updateBoundaries(request); @@ -985,10 +990,12 @@ var node = nodesToInsert[i]; var request = node.request(); dataGrid.insertChild(node); - node.refresh(); node[WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = this._matchRequest(request); } + for (var node of nodesToRefresh) + node.refresh(); + this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindMatchIndex(this._currentMatchedRequestNode), false); if (!this.calculator().boundary().equals(oldBoundary)) {
diff --git a/third_party/WebKit/Source/devtools/front_end/sass/SASSSourceMapFactory.js b/third_party/WebKit/Source/devtools/front_end/sass/SASSSourceMapFactory.js index 32f7476..5b204f5 100644 --- a/third_party/WebKit/Source/devtools/front_end/sass/SASSSourceMapFactory.js +++ b/third_party/WebKit/Source/devtools/front_end/sass/SASSSourceMapFactory.js
@@ -59,7 +59,6 @@ { var editCallback = WebInspector.SASSProcessor.processCSSEdits.bind(WebInspector.SASSProcessor, this._astService); var map = new WebInspector.ASTSourceMap(sourceMap.compiledURL(), sourceMap.url(), models, editCallback); - //FIXME: this works O(N^2). var valid = true; map.compiledModel().visit(onNode); return valid ? map : null;
diff --git a/third_party/WebKit/Source/devtools/front_end/sass/SASSSupport.js b/third_party/WebKit/Source/devtools/front_end/sass/SASSSupport.js index 78e67d2..0f5edbf11 100644 --- a/third_party/WebKit/Source/devtools/front_end/sass/SASSSupport.js +++ b/third_party/WebKit/Source/devtools/front_end/sass/SASSSupport.js
@@ -662,19 +662,51 @@ */ findNodeForPosition: function(lineNumber, columnNumber) { - var result = null; - this.visit(onNode); - return result; + this._ensureNodePositionsIndex(); + var index = this._sortedTextNodes.lowerBound({lineNumber: lineNumber, columnNumber: columnNumber}, nodeComparator); + var node = this._sortedTextNodes[index]; + if (!node) + return null; + return node.range.containsLocation(lineNumber, columnNumber) ? node : null; + + /** + * @param {!{lineNumber: number, columnNumber: number}} position + * @param {!WebInspector.SASSSupport.TextNode} textNode + * @return {number} + */ + function nodeComparator(position, textNode) + { + return textNode.range.compareToPosition(position.lineNumber, position.columnNumber); + } + }, + + _ensureNodePositionsIndex: function() + { + if (this._sortedTextNodes) + return; + this._sortedTextNodes = []; + this.visit(onNode.bind(this)); + this._sortedTextNodes.sort(nodeComparator); /** * @param {!WebInspector.SASSSupport.Node} node + * @this {WebInspector.SASSSupport.AST} */ function onNode(node) { if (!(node instanceof WebInspector.SASSSupport.TextNode)) return; - if (node.range.containsLocation(lineNumber, columnNumber)) - result = node; + this._sortedTextNodes.push(node); + } + + /** + * @param {!WebInspector.SASSSupport.TextNode} text1 + * @param {!WebInspector.SASSSupport.TextNode} text2 + * @return {number} + */ + function nodeComparator(text1, text2) + { + return WebInspector.TextRange.comparator(text1.range, text2.range); } },
diff --git a/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js b/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js index c45158b..bc236cff 100644 --- a/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js +++ b/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js
@@ -187,7 +187,7 @@ var descriptor = extension.descriptor(); if (!("title" in descriptor)) return false; - if (!(("category" in descriptor) || ("parentSettingName" in descriptor))) + if (!("category" in descriptor)) return false; return true; } @@ -207,18 +207,6 @@ var uiTitle = WebInspector.UIString(extension.title(WebInspector.platform())); var sectionElement = this._sectionElement(sectionName); - var parentSettingName = descriptor["parentSettingName"]; - var parentSettingElement = parentSettingName ? this._nameToSettingElement.get(descriptor["parentSettingName"]) : null; - var parentFieldset = null; - if (parentSettingElement) { - parentFieldset = parentSettingElement.__fieldset; - if (!parentFieldset) { - parentFieldset = WebInspector.SettingsUI.createSettingFieldset(WebInspector.moduleSetting(parentSettingName)); - parentSettingElement.appendChild(parentFieldset); - parentSettingElement.__fieldset = parentFieldset; - } - } - var settingControl; switch (descriptor["settingType"]) { @@ -240,7 +228,7 @@ return; } this._nameToSettingElement.set(settingName, settingControl); - (parentFieldset || sectionElement).appendChild(/** @type {!Element} */ (settingControl)); + sectionElement.appendChild(/** @type {!Element} */ (settingControl)); }, /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js b/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js index 50d4c8b..78ad36d 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js
@@ -122,7 +122,7 @@ var fileNameIndex = fullDisplayName.lastIndexOf("/"); titleElement.textContent = uiSourceCode.displayName() + (this._queryLineNumberAndColumnNumber || ""); - subtitleElement.textContent = fullDisplayName.trimEnd(100); + this._renderSubtitleElement(subtitleElement, fullDisplayName); subtitleElement.title = fullDisplayName; var ranges = []; for (var i = 0; i < indexes.length; ++i) @@ -138,6 +138,23 @@ }, /** + * @param {!Element} element + * @param {string} text + */ + _renderSubtitleElement: function(element, text) + { + element.removeChildren(); + var splitPosition = text.lastIndexOf("/"); + if (text.length > 55) + splitPosition = text.length - 55; + var first = element.createChild("div", "first-part"); + first.textContent = text.substring(0, splitPosition); + var second = element.createChild("div", "second-part"); + second.textContent = text.substring(splitPosition); + element.title = text; + }, + + /** * @override * @param {?number} itemIndex * @param {string} promptValue
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/module.json b/third_party/WebKit/Source/devtools/front_end/sources/module.json index 2db6ec1..62d6f41 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/module.json +++ b/third_party/WebKit/Source/devtools/front_end/sources/module.json
@@ -319,14 +319,6 @@ "defaultValue": true }, { - "type": "setting", - "title": "Auto-reload generated CSS", - "parentSettingName": "cssSourceMapsEnabled", - "settingName": "cssReloadEnabled", - "settingType": "boolean", - "defaultValue": false - }, - { "type": "drawer-view", "name": "sources.search", "title": "Search",
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/filteredListWidget.css b/third_party/WebKit/Source/devtools/front_end/ui_lazy/filteredListWidget.css index dc8f7e4..7ed987b 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/filteredListWidget.css +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/filteredListWidget.css
@@ -61,6 +61,13 @@ overflow: hidden; text-overflow: ellipsis; color: rgb(155, 155, 155); + display: flex; +} + +.filtered-list-widget-item .filtered-list-widget-subtitle .first-part { + flex-shrink: 1000; + overflow: hidden; + text-overflow: ellipsis; } .filtered-list-widget-item.one-row {
diff --git a/third_party/WebKit/Source/modules/EventModulesFactory.h b/third_party/WebKit/Source/modules/EventModulesFactory.h index 07da64a..416e2aa5 100644 --- a/third_party/WebKit/Source/modules/EventModulesFactory.h +++ b/third_party/WebKit/Source/modules/EventModulesFactory.h
@@ -21,7 +21,7 @@ return adoptPtr(new EventModulesFactory()); } - PassRefPtrWillBeRawPtr<Event> create(ExecutionContext*, const String& eventType) override; + RawPtr<Event> create(ExecutionContext*, const String& eventType) override; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/EventTargetModulesFactory.in b/third_party/WebKit/Source/modules/EventTargetModulesFactory.in index ccc182f2..7f7a3a8 100644 --- a/third_party/WebKit/Source/modules/EventTargetModulesFactory.in +++ b/third_party/WebKit/Source/modules/EventTargetModulesFactory.in
@@ -21,7 +21,6 @@ modules/mediastream/RTCDTMFSender modules/mediastream/RTCDataChannel modules/mediastream/RTCPeerConnection -modules/navigatorconnect/ServicePortCollection modules/netinfo/NetworkInformation modules/notifications/Notification modules/payments/PaymentRequest
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp index 73652d72..d94649c4 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -1096,7 +1096,7 @@ // This has to be overridden in the case where the selected item has an ARIA label. HTMLSelectElement* selectElement = toHTMLSelectElement(m_layoutObject->node()); int selectedIndex = selectElement->selectedIndex(); - const WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>& listItems = selectElement->listItems(); + const HeapVector<Member<HTMLElement>>& listItems = selectElement->listItems(); if (selectedIndex >= 0 && static_cast<size_t>(selectedIndex) < listItems.size()) { const AtomicString& overriddenDescription = listItems[selectedIndex]->fastGetAttribute(aria_labelAttr); if (!overriddenDescription.isNull()) @@ -1851,7 +1851,7 @@ return AXRange(); VisibleSelection selection = getLayoutObject()->frame()->selection().selection(); - RefPtrWillBeRawPtr<Range> selectionRange = firstRangeOf(selection); + RawPtr<Range> selectionRange = firstRangeOf(selection); ContainerNode* parentNode = getNode()->parentNode(); int nodeIndex = getNode()->nodeIndex(); if (!selectionRange @@ -1915,7 +1915,7 @@ if (indexPosition.isNull()) return 0; - RefPtrWillBeRawPtr<Range> range = Range::create(*getDocument()); + RawPtr<Range> range = Range::create(*getDocument()); range->setStart(getNode(), 0, IGNORE_EXCEPTION); range->setEnd(indexPosition, IGNORE_EXCEPTION); @@ -2221,7 +2221,7 @@ if (!focusedElement) return false; - WillBeHeapVector<RawPtrWillBeMember<Element>> elements; + HeapVector<Member<Element>> elements; elementsFromAttribute(elements, aria_controlsAttr); for (const auto& element : elements) {
diff --git a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp index 58b655b0..2831cfc1 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp
@@ -198,7 +198,7 @@ if (!selectElement) return -1; - const WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>& listItems = selectElement->listItems(); + const HeapVector<Member<HTMLElement>>& listItems = selectElement->listItems(); unsigned length = listItems.size(); for (unsigned i = 0; i < length; i++) { if (listItems[i] == getNode())
diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h index 466cfff..e40dc1ef 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h
@@ -61,7 +61,7 @@ String textAlternative(bool recursive, bool inAriaLabelledByTraversal, AXObjectSet& visited, AXNameFrom&, AXRelatedObjectVector*, NameSources*) const override; bool computeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override; - RawPtrWillBeMember<HTMLOptionElement> m_element; + Member<HTMLOptionElement> m_element; }; DEFINE_AX_OBJECT_TYPE_CASTS(AXMenuListOption, isMenuListOption());
diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp index 5ba4242..70be3a8 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp
@@ -115,7 +115,7 @@ if (m_activeIndex == -1) m_activeIndex = getSelectedIndex(); - const WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>& listItems = htmlSelectElement->listItems(); + const HeapVector<Member<HTMLElement>>& listItems = htmlSelectElement->listItems(); unsigned length = listItems.size(); for (unsigned i = 0; i < length; i++) { AXMenuListOption* option = menuListOptionAXObject(listItems[i]);
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp index e8c8ac3..36a4afc 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -112,7 +112,7 @@ return String(); } -String AXNodeObject::accessibilityDescriptionForElements(WillBeHeapVector<RawPtrWillBeMember<Element>> &elements) const +String AXNodeObject::accessibilityDescriptionForElements(HeapVector<Member<Element>> &elements) const { StringBuilder builder; unsigned size = elements.size(); @@ -552,7 +552,7 @@ void AXNodeObject::accessibilityChildrenFromAttribute(QualifiedName attr, AXObject::AXObjectVector& children) const { - WillBeHeapVector<RawPtrWillBeMember<Element>> elements; + HeapVector<Member<Element>> elements; elementsFromAttribute(elements, attr); AXObjectCacheImpl& cache = axObjectCache(); @@ -1300,7 +1300,7 @@ if (getNode() && getNode()->isElementNode() && toElement(getNode())->isFormControlElement()) { HTMLFormControlElement* element = toHTMLFormControlElement(getNode()); - WillBeHeapVector<RefPtrWillBeMember<HTMLFormControlElement>> + HeapVector<Member<HTMLFormControlElement>> invalidControls; bool isInvalid = !element->checkValidity( &invalidControls, CheckValidityDispatchNoEvent); @@ -1412,7 +1412,7 @@ if (isHTMLSelectElement(*node)) { HTMLSelectElement& selectElement = toHTMLSelectElement(*node); int selectedIndex = selectElement.selectedIndex(); - const WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>& listItems = selectElement.listItems(); + const HeapVector<Member<HTMLElement>>& listItems = selectElement.listItems(); if (selectedIndex >= 0 && static_cast<size_t>(selectedIndex) < listItems.size()) { const AtomicString& overriddenDescription = listItems[selectedIndex]->fastGetAttribute(aria_labelAttr); if (!overriddenDescription.isNull()) @@ -1440,7 +1440,7 @@ String AXNodeObject::ariaDescribedByAttribute() const { - WillBeHeapVector<RawPtrWillBeMember<Element>> elements; + HeapVector<Member<Element>> elements; elementsFromAttribute(elements, aria_describedbyAttr); return accessibilityDescriptionForElements(elements); @@ -1448,7 +1448,7 @@ String AXNodeObject::ariaLabelledbyAttribute() const { - WillBeHeapVector<RawPtrWillBeMember<Element>> elements; + HeapVector<Member<Element>> elements; ariaLabelledbyElementVector(elements); return accessibilityDescriptionForElements(elements); @@ -1660,7 +1660,7 @@ return false; // Step 2B from: http://www.w3.org/TR/accname-aam-1.1 - WillBeHeapVector<RawPtrWillBeMember<Element>> elements; + HeapVector<Member<Element>> elements; ariaLabelledbyElementVector(elements); if (elements.size() > 0) return false;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h index 40a4d970..f64862d 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h
@@ -62,7 +62,7 @@ const AXObject* inheritsPresentationalRoleFrom() const override; virtual AccessibilityRole determineAccessibilityRole(); virtual AccessibilityRole nativeAccessibilityRoleIgnoringAria() const; - String accessibilityDescriptionForElements(WillBeHeapVector<RawPtrWillBeMember<Element>> &elements) const; + String accessibilityDescriptionForElements(HeapVector<Member<Element>> &elements) const; void alterSliderValue(bool increase); String ariaAccessibilityDescription() const; String ariaAutoComplete() const; @@ -202,7 +202,7 @@ void computeAriaOwnsChildren(HeapVector<Member<AXObject>>& ownedChildren) const; private: - RawPtrWillBeMember<Node> m_node; + Member<Node> m_node; bool isNativeCheckboxInMixedState() const; String textFromDescendants(AXObjectSet& visited, bool recursive) const override;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp index 4e1e14b..8f6582be 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
@@ -825,7 +825,7 @@ return textAlternative; } -String AXObject::textFromElements(bool inAriaLabelledbyTraversal, AXObjectSet& visited, WillBeHeapVector<RawPtrWillBeMember<Element>>& elements, AXRelatedObjectVector* relatedObjects) const +String AXObject::textFromElements(bool inAriaLabelledbyTraversal, AXObjectSet& visited, HeapVector<Member<Element>>& elements, AXRelatedObjectVector* relatedObjects) const { StringBuilder accumulatedText; bool foundValidElement = false; @@ -866,7 +866,7 @@ attributeValue.split(' ', tokens); } -void AXObject::elementsFromAttribute(WillBeHeapVector<RawPtrWillBeMember<Element>>& elements, const QualifiedName& attribute) const +void AXObject::elementsFromAttribute(HeapVector<Member<Element>>& elements, const QualifiedName& attribute) const { Vector<String> ids; tokenVectorFromAttribute(ids, attribute); @@ -880,7 +880,7 @@ } } -void AXObject::ariaLabelledbyElementVector(WillBeHeapVector<RawPtrWillBeMember<Element>>& elements) const +void AXObject::ariaLabelledbyElementVector(HeapVector<Member<Element>>& elements) const { // Try both spellings, but prefer aria-labelledby, which is the official spec. elementsFromAttribute(elements, aria_labelledbyAttr); @@ -890,7 +890,7 @@ String AXObject::textFromAriaLabelledby(AXObjectSet& visited, AXRelatedObjectVector* relatedObjects) const { - WillBeHeapVector<RawPtrWillBeMember<Element>> elements; + HeapVector<Member<Element>> elements; ariaLabelledbyElementVector(elements); return textFromElements(true, visited, elements, relatedObjects); } @@ -898,7 +898,7 @@ String AXObject::textFromAriaDescribedby(AXRelatedObjectVector* relatedObjects) const { AXObjectSet visited; - WillBeHeapVector<RawPtrWillBeMember<Element>> elements; + HeapVector<Member<Element>> elements; elementsFromAttribute(elements, aria_describedbyAttr); return textFromElements(true, visited, elements, relatedObjects); }
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.h b/third_party/WebKit/Source/modules/accessibility/AXObject.h index 3cd59b2..6b72a41 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.h
@@ -913,10 +913,10 @@ static String recursiveTextAlternative(const AXObject&, bool inAriaLabelledByTraversal, AXObjectSet& visited); bool isHiddenForTextAlternativeCalculation() const; String ariaTextAlternative(bool recursive, bool inAriaLabelledByTraversal, AXObjectSet& visited, AXNameFrom&, AXRelatedObjectVector*, NameSources*, bool* foundTextAlternative) const; - String textFromElements(bool inAriaLabelledByTraversal, AXObjectSet& visited, WillBeHeapVector<RawPtrWillBeMember<Element>>& elements, AXRelatedObjectVector* relatedObjects) const; + String textFromElements(bool inAriaLabelledByTraversal, AXObjectSet& visited, HeapVector<Member<Element>>& elements, AXRelatedObjectVector* relatedObjects) const; void tokenVectorFromAttribute(Vector<String>&, const QualifiedName&) const; - void elementsFromAttribute(WillBeHeapVector<RawPtrWillBeMember<Element>>& elements, const QualifiedName&) const; - void ariaLabelledbyElementVector(WillBeHeapVector<RawPtrWillBeMember<Element>>& elements) const; + void elementsFromAttribute(HeapVector<Member<Element>>& elements, const QualifiedName&) const; + void ariaLabelledbyElementVector(HeapVector<Member<Element>>& elements) const; String textFromAriaLabelledby(AXObjectSet& visited, AXRelatedObjectVector* relatedObjects) const; String textFromAriaDescribedby(AXRelatedObjectVector* relatedObjects) const;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp index 6b21c0c82..ef5256c5 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
@@ -653,7 +653,7 @@ void AXObjectCacheImpl::notificationPostTimerFired(Timer<AXObjectCacheImpl>*) { - RefPtrWillBeRawPtr<Document> protectorForCacheOwner(m_document.get()); + RawPtr<Document> protectorForCacheOwner(m_document.get()); m_notificationPostTimer.stop();
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h index 95a0233b..f5fb820 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h +++ b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h
@@ -187,12 +187,12 @@ private: - RawPtrWillBeMember<Document> m_document; + Member<Document> m_document; HeapHashMap<AXID, Member<AXObject>> m_objects; // LayoutObject and AbstractInlineTextBox are not on the Oilpan heap so we // do not use HeapHashMap for those mappings. HashMap<LayoutObject*, AXID> m_layoutObjectMapping; - WillBeHeapHashMap<RawPtrWillBeMember<Node>, AXID> m_nodeObjectMapping; + HeapHashMap<Member<Node>, AXID> m_nodeObjectMapping; HashMap<AbstractInlineTextBox*, AXID> m_inlineTextBoxObjectMapping; int m_modificationCount;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXSpinButton.h b/third_party/WebKit/Source/modules/accessibility/AXSpinButton.h index 04185cf..f3068cb9 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXSpinButton.h +++ b/third_party/WebKit/Source/modules/accessibility/AXSpinButton.h
@@ -54,7 +54,7 @@ void detach() override; void detachFromParent() override; - RawPtrWillBeMember<SpinButtonElement> m_spinButtonElement; + Member<SpinButtonElement> m_spinButtonElement; }; class AXSpinButtonPart final : public AXMockObject {
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp index 79b6ea7a3..fb107b8 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp
@@ -130,20 +130,20 @@ if (elementHasAriaRole(tableElement->tFoot())) return false; - RefPtrWillBeRawPtr<HTMLCollection> bodies = tableElement->tBodies(); + RawPtr<HTMLCollection> bodies = tableElement->tBodies(); for (unsigned bodyIndex = 0; bodyIndex < bodies->length(); ++bodyIndex) { Element* bodyElement = bodies->item(bodyIndex); if (elementHasAriaRole(bodyElement)) return false; } - RefPtrWillBeRawPtr<HTMLTableRowsCollection> rows = tableElement->rows(); + RawPtr<HTMLTableRowsCollection> rows = tableElement->rows(); unsigned rowCount = rows->length(); for (unsigned rowIndex = 0; rowIndex < rowCount; ++rowIndex) { HTMLTableRowElement* rowElement = rows->item(rowIndex); if (elementHasAriaRole(rowElement)) return false; - RefPtrWillBeRawPtr<HTMLCollection> cells = rowElement->cells(); + RawPtr<HTMLCollection> cells = rowElement->cells(); for (unsigned cellIndex = 0; cellIndex < cells->length(); ++cellIndex) { if (elementHasAriaRole(cells->item(cellIndex))) return false;
diff --git a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.h b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.h index 27974443..f322bc6 100644 --- a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.h +++ b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.h
@@ -16,9 +16,9 @@ class MODULES_EXPORT InspectorAccessibilityAgent : public InspectorBaseAgent<InspectorAccessibilityAgent, protocol::Frontend::Accessibility>, public protocol::Backend::Accessibility { WTF_MAKE_NONCOPYABLE(InspectorAccessibilityAgent); public: - static PassOwnPtrWillBeRawPtr<InspectorAccessibilityAgent> create(Page* page) + static RawPtr<InspectorAccessibilityAgent> create(Page* page) { - return adoptPtrWillBeNoop(new InspectorAccessibilityAgent(page)); + return new InspectorAccessibilityAgent(page); } // Base agent methods. @@ -30,7 +30,7 @@ private: explicit InspectorAccessibilityAgent(Page*); - RawPtrWillBeMember<Page> m_page; + Member<Page> m_page; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.h b/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.h index 9da892f..755b92ed 100644 --- a/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.h +++ b/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.h
@@ -17,7 +17,7 @@ class BeforeInstallPromptEventInit; class WebAppBannerClient; -using UserChoiceProperty = ScriptPromiseProperty<RawPtrWillBeMember<BeforeInstallPromptEvent>, Member<AppBannerPromptResult>, ToV8UndefinedGenerator>; +using UserChoiceProperty = ScriptPromiseProperty<Member<BeforeInstallPromptEvent>, Member<AppBannerPromptResult>, ToV8UndefinedGenerator>; class BeforeInstallPromptEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); @@ -25,19 +25,19 @@ ~BeforeInstallPromptEvent() override; // For EventModules.cpp - static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create() + static RawPtr<BeforeInstallPromptEvent> create() { - return adoptRefWillBeNoop(new BeforeInstallPromptEvent()); + return new BeforeInstallPromptEvent(); } - static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create(const AtomicString& name, ExecutionContext* executionContext, const Vector<String>& platforms, int requestId, WebAppBannerClient* client) + static RawPtr<BeforeInstallPromptEvent> create(const AtomicString& name, ExecutionContext* executionContext, const Vector<String>& platforms, int requestId, WebAppBannerClient* client) { - return adoptRefWillBeNoop(new BeforeInstallPromptEvent(name, executionContext, platforms, requestId, client)); + return new BeforeInstallPromptEvent(name, executionContext, platforms, requestId, client); } - static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create(const AtomicString& name, const BeforeInstallPromptEventInit& init) + static RawPtr<BeforeInstallPromptEvent> create(const AtomicString& name, const BeforeInstallPromptEventInit& init) { - return adoptRefWillBeNoop(new BeforeInstallPromptEvent(name, init)); + return new BeforeInstallPromptEvent(name, init); } Vector<String> platforms() const; @@ -57,7 +57,7 @@ int m_requestId; WebAppBannerClient* m_client; - PersistentWillBeMember<UserChoiceProperty> m_userChoice; + Member<UserChoiceProperty> m_userChoice; bool m_registered; };
diff --git a/third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.cpp b/third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.cpp index b8acbabad..4120e62 100644 --- a/third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.cpp +++ b/third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.cpp
@@ -24,10 +24,10 @@ if (!document->frame() || !document->frame()->isLocalFrame()) return nullptr; - return static_cast<AudioOutputDeviceClient*>(WillBeHeapSupplement<LocalFrame>::from(document->frame(), supplementName())); + return static_cast<AudioOutputDeviceClient*>(HeapSupplement<LocalFrame>::from(document->frame(), supplementName())); } -void provideAudioOutputDeviceClientTo(LocalFrame& frame, PassOwnPtrWillBeRawPtr<AudioOutputDeviceClient> client) +void provideAudioOutputDeviceClientTo(LocalFrame& frame, RawPtr<AudioOutputDeviceClient> client) { frame.provideSupplement(AudioOutputDeviceClient::supplementName(), client); }
diff --git a/third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.h b/third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.h index 1aee70d..c7a5db3 100644 --- a/third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.h +++ b/third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.h
@@ -17,19 +17,19 @@ class WebString; class ScriptState; -class AudioOutputDeviceClient : public WillBeHeapSupplement<LocalFrame> { +class AudioOutputDeviceClient : public HeapSupplement<LocalFrame> { public: virtual ~AudioOutputDeviceClient() {} // Checks that a given sink exists and has permissions to be used from the origin of the current frame. virtual void checkIfAudioSinkExistsAndIsAuthorized(ExecutionContext*, const WebString& sinkId, PassOwnPtr<WebSetSinkIdCallbacks>) = 0; - // WillBeHeapSupplement requirements. + // HeapSupplement requirements. static AudioOutputDeviceClient* from(ExecutionContext*); static const char* supplementName(); }; -MODULES_EXPORT void provideAudioOutputDeviceClientTo(LocalFrame&, PassOwnPtrWillBeRawPtr<AudioOutputDeviceClient>); +MODULES_EXPORT void provideAudioOutputDeviceClientTo(LocalFrame&, RawPtr<AudioOutputDeviceClient>); } // namespace blink
diff --git a/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp b/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp index d09afbb..78f0bdb4 100644 --- a/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp +++ b/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp
@@ -28,7 +28,7 @@ SetSinkIdResolver(ScriptState*, HTMLMediaElement&, const String& sinkId); void timerFired(Timer<SetSinkIdResolver>*); - RefPtrWillBeMember<HTMLMediaElement> m_element; + Member<HTMLMediaElement> m_element; String m_sinkId; Timer<SetSinkIdResolver> m_timer; }; @@ -117,7 +117,7 @@ HTMLMediaElementAudioOutputDevice& HTMLMediaElementAudioOutputDevice::from(HTMLMediaElement& element) { - HTMLMediaElementAudioOutputDevice* supplement = static_cast<HTMLMediaElementAudioOutputDevice*>(WillBeHeapSupplement<HTMLMediaElement>::from(element, supplementName())); + HTMLMediaElementAudioOutputDevice* supplement = static_cast<HTMLMediaElementAudioOutputDevice*>(HeapSupplement<HTMLMediaElement>::from(element, supplementName())); if (!supplement) { supplement = new HTMLMediaElementAudioOutputDevice(); provideTo(element, supplementName(), adoptPtrWillBeNoop(supplement)); @@ -127,7 +127,7 @@ DEFINE_TRACE(HTMLMediaElementAudioOutputDevice) { - WillBeHeapSupplement<HTMLMediaElement>::trace(visitor); + HeapSupplement<HTMLMediaElement>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h b/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h index 5158acc..8c61d71 100644 --- a/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h +++ b/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h
@@ -18,9 +18,8 @@ class HTMLMediaElement; class ScriptState; -class MODULES_EXPORT HTMLMediaElementAudioOutputDevice final : public NoBaseWillBeGarbageCollectedFinalized<HTMLMediaElementAudioOutputDevice>, public WillBeHeapSupplement<HTMLMediaElement> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementAudioOutputDevice); - USING_FAST_MALLOC_WILL_BE_REMOVED(HTMLMediaElementAudioOutputDevice); +class MODULES_EXPORT HTMLMediaElementAudioOutputDevice final : public GarbageCollectedFinalized<HTMLMediaElementAudioOutputDevice>, public HeapSupplement<HTMLMediaElement> { + USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementAudioOutputDevice); public: DECLARE_VIRTUAL_TRACE(); static String sinkId(HTMLMediaElement&);
diff --git a/third_party/WebKit/Source/modules/audio_output_devices/SetSinkIdCallbacks.h b/third_party/WebKit/Source/modules/audio_output_devices/SetSinkIdCallbacks.h index fd25ea0b..60c58e9c 100644 --- a/third_party/WebKit/Source/modules/audio_output_devices/SetSinkIdCallbacks.h +++ b/third_party/WebKit/Source/modules/audio_output_devices/SetSinkIdCallbacks.h
@@ -31,7 +31,7 @@ private: Persistent<ScriptPromiseResolver> m_resolver; - RefPtrWillBePersistent<HTMLMediaElement> m_element; + Persistent<HTMLMediaElement> m_element; String m_sinkId; };
diff --git a/third_party/WebKit/Source/modules/background_sync/SyncEvent.h b/third_party/WebKit/Source/modules/background_sync/SyncEvent.h index c88e384..590637b 100644 --- a/third_party/WebKit/Source/modules/background_sync/SyncEvent.h +++ b/third_party/WebKit/Source/modules/background_sync/SyncEvent.h
@@ -17,17 +17,17 @@ class MODULES_EXPORT SyncEvent final : public ExtendableEvent { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<SyncEvent> create() + static RawPtr<SyncEvent> create() { return adoptRefWillBeNoop(new SyncEvent); } - static PassRefPtrWillBeRawPtr<SyncEvent> create(const AtomicString& type, const String& tag, bool lastChance, WaitUntilObserver* observer) + static RawPtr<SyncEvent> create(const AtomicString& type, const String& tag, bool lastChance, WaitUntilObserver* observer) { - return adoptRefWillBeNoop(new SyncEvent(type, tag, lastChance, observer)); + return new SyncEvent(type, tag, lastChance, observer); } - static PassRefPtrWillBeRawPtr<SyncEvent> create(const AtomicString& type, const SyncEventInit& init) + static RawPtr<SyncEvent> create(const AtomicString& type, const SyncEventInit& init) { - return adoptRefWillBeNoop(new SyncEvent(type, init)); + return new SyncEvent(type, init); } ~SyncEvent() override;
diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.h b/third_party/WebKit/Source/modules/battery/BatteryManager.h index b81c0c7e..da27543 100644 --- a/third_party/WebKit/Source/modules/battery/BatteryManager.h +++ b/third_party/WebKit/Source/modules/battery/BatteryManager.h
@@ -20,7 +20,7 @@ class BatteryManager final : public RefCountedGarbageCollectedEventTargetWithInlineData<BatteryManager>, public ActiveScriptWrappable, public ActiveDOMObject, public PlatformEventController { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BatteryManager); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BatteryManager); + USING_GARBAGE_COLLECTED_MIXIN(BatteryManager); public: static BatteryManager* create(ExecutionContext*); ~BatteryManager() override;
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h index f4a8072b..1eb90a3 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h
@@ -37,7 +37,7 @@ USING_PRE_FINALIZER(BluetoothDevice, dispose); DEFINE_WRAPPERTYPEINFO(); REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BluetoothDevice); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothDevice); + USING_GARBAGE_COLLECTED_MIXIN(BluetoothDevice); public: BluetoothDevice(ExecutionContext*, PassOwnPtr<WebBluetoothDevice>);
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp index 0214f948..944d96b 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
@@ -95,7 +95,7 @@ return ActiveDOMObject::getExecutionContext(); } -bool BluetoothRemoteGATTCharacteristic::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) +bool BluetoothRemoteGATTCharacteristic::addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener> listener, const EventListenerOptions& options) { // We will also need to unregister a characteristic once all the event // listeners have been removed. See http://crbug.com/541390
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h index b48d85f45..04d58cb9e 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h
@@ -40,7 +40,7 @@ USING_PRE_FINALIZER(BluetoothRemoteGATTCharacteristic, dispose); DEFINE_WRAPPERTYPEINFO(); REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BluetoothRemoteGATTCharacteristic); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothRemoteGATTCharacteristic); + USING_GARBAGE_COLLECTED_MIXIN(BluetoothRemoteGATTCharacteristic); public: explicit BluetoothRemoteGATTCharacteristic(ExecutionContext*, PassOwnPtr<WebBluetoothRemoteGATTCharacteristicInit>); @@ -86,7 +86,7 @@ protected: // EventTarget overrides. - bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener>, const EventListenerOptions&) override; + bool addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener>, const EventListenerOptions&) override; private: OwnPtr<WebBluetoothRemoteGATTCharacteristicInit> m_webCharacteristic;
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp index 14169ac79..e0493ae 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp
@@ -20,13 +20,13 @@ void BluetoothSupplement::provideTo(LocalFrame& frame, WebBluetooth* bluetooth) { - OwnPtrWillBeRawPtr<BluetoothSupplement> bluetoothSupplement = adoptPtrWillBeNoop(new BluetoothSupplement(bluetooth)); - WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), bluetoothSupplement.release()); + RawPtr<BluetoothSupplement> bluetoothSupplement = new BluetoothSupplement(bluetooth); + HeapSupplement<LocalFrame>::provideTo(frame, supplementName(), bluetoothSupplement.release()); }; WebBluetooth* BluetoothSupplement::from(LocalFrame* frame) { - BluetoothSupplement* supplement = static_cast<BluetoothSupplement*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); + BluetoothSupplement* supplement = static_cast<BluetoothSupplement*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); ASSERT(supplement); ASSERT(supplement->m_bluetooth); @@ -49,7 +49,7 @@ DEFINE_TRACE(BluetoothSupplement) { - WillBeHeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.h index 8bee565a..d23c3c2 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.h
@@ -14,10 +14,9 @@ // This class is attached to a LocalFrame in WebLocalFrameImpl::setCoreFrame, to // pass WebFrameClient::bluetooth() (accessible by web/ only) to the Bluetooth // code in modules/. -class BLINK_EXPORT BluetoothSupplement : public NoBaseWillBeGarbageCollected<BluetoothSupplement>, public WillBeHeapSupplement<LocalFrame> { +class BLINK_EXPORT BluetoothSupplement : public GarbageCollected<BluetoothSupplement>, public HeapSupplement<LocalFrame> { WTF_MAKE_NONCOPYABLE(BluetoothSupplement); - USING_FAST_MALLOC_WILL_BE_REMOVED(BluetoothSupplement); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothSupplement); + USING_GARBAGE_COLLECTED_MIXIN(BluetoothSupplement); public: static const char* supplementName();
diff --git a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp index a268a4b..6d9385e 100644 --- a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
@@ -360,7 +360,7 @@ WebServiceWorkerResponse m_webResponse; }; -Cache* Cache::create(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCache> webCache) +Cache* Cache::create(RawPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCache> webCache) { return new Cache(fetcher, webCache); } @@ -472,7 +472,7 @@ return webQueryParams; } -Cache::Cache(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCache> webCache) +Cache::Cache(RawPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCache> webCache) : m_scopedFetcher(fetcher) , m_webCache(webCache) {
diff --git a/third_party/WebKit/Source/modules/cachestorage/Cache.h b/third_party/WebKit/Source/modules/cachestorage/Cache.h index 305de33..e92ab22 100644 --- a/third_party/WebKit/Source/modules/cachestorage/Cache.h +++ b/third_party/WebKit/Source/modules/cachestorage/Cache.h
@@ -32,7 +32,7 @@ DEFINE_WRAPPERTYPEINFO(); WTF_MAKE_NONCOPYABLE(Cache); public: - static Cache* create(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCache>); + static Cache* create(RawPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCache>); // From Cache.idl: ScriptPromise match(ScriptState*, const RequestInfo&, const CacheQueryOptions&, ExceptionState&); @@ -54,7 +54,7 @@ class BlobHandleCallbackForPut; class FetchResolvedForAdd; friend class FetchResolvedForAdd; - Cache(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCache>); + Cache(RawPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCache>); ScriptPromise matchImpl(ScriptState*, const Request*, const CacheQueryOptions&); ScriptPromise matchAllImpl(ScriptState*); @@ -67,7 +67,7 @@ WebServiceWorkerCache* webCache() const; - WeakPtrWillBeMember<GlobalFetch::ScopedFetcher> m_scopedFetcher; + Member<GlobalFetch::ScopedFetcher> m_scopedFetcher; OwnPtr<WebServiceWorkerCache> m_webCache; };
diff --git a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp index c339ad16e..f0fed5d 100644 --- a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
@@ -214,7 +214,7 @@ Persistent<ScriptPromiseResolver> m_resolver; }; -CacheStorage* CacheStorage::create(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> fetcher, WebServiceWorkerCacheStorage* webCacheStorage) +CacheStorage* CacheStorage::create(RawPtr<GlobalFetch::ScopedFetcher> fetcher, WebServiceWorkerCacheStorage* webCacheStorage) { return new CacheStorage(fetcher, adoptPtr(webCacheStorage)); } @@ -325,7 +325,7 @@ return promise; } -CacheStorage::CacheStorage(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCacheStorage> webCacheStorage) +CacheStorage::CacheStorage(RawPtr<GlobalFetch::ScopedFetcher> fetcher, PassOwnPtr<WebServiceWorkerCacheStorage> webCacheStorage) : m_scopedFetcher(fetcher) , m_webCacheStorage(webCacheStorage) {
diff --git a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.h b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.h index baa06c16..aa3622bf 100644 --- a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.h +++ b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.h
@@ -25,7 +25,7 @@ DEFINE_WRAPPERTYPEINFO(); WTF_MAKE_NONCOPYABLE(CacheStorage); public: - static CacheStorage* create(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher>, WebServiceWorkerCacheStorage*); + static CacheStorage* create(RawPtr<GlobalFetch::ScopedFetcher>, WebServiceWorkerCacheStorage*); ~CacheStorage(); void dispose(); @@ -47,10 +47,10 @@ friend class WithCacheCallbacks; friend class DeleteCallbacks; - CacheStorage(WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCacheStorage>); + CacheStorage(RawPtr<GlobalFetch::ScopedFetcher>, PassOwnPtr<WebServiceWorkerCacheStorage>); ScriptPromise matchImpl(ScriptState*, const Request*, const CacheQueryOptions&); - WeakPtrWillBeMember<GlobalFetch::ScopedFetcher> m_scopedFetcher; + Member<GlobalFetch::ScopedFetcher> m_scopedFetcher; OwnPtr<WebServiceWorkerCacheStorage> m_webCacheStorage; HeapHashMap<String, Member<Cache>> m_nameToCacheMap; };
diff --git a/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp b/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp index fcd57501..7bc1990d 100644 --- a/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp
@@ -34,10 +34,10 @@ const char kNotImplementedString[] = "NotSupportedError: Method is not implemented."; -class ScopedFetcherForTests final : public NoBaseWillBeGarbageCollectedFinalized<ScopedFetcherForTests>, public GlobalFetch::ScopedFetcher { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScopedFetcherForTests); +class ScopedFetcherForTests final : public GarbageCollectedFinalized<ScopedFetcherForTests>, public GlobalFetch::ScopedFetcher { + USING_GARBAGE_COLLECTED_MIXIN(ScopedFetcherForTests); public: - static PassOwnPtrWillBeRawPtr<ScopedFetcherForTests> create() + static RawPtr<ScopedFetcherForTests> create() { return adoptPtrWillBeNoop(new ScopedFetcherForTests); } @@ -63,7 +63,7 @@ return ScriptPromise::reject(scriptState, V8ThrowException::createTypeError(scriptState->isolate(), "Unexpected call to fetch, no response available.")); } - WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> weakPtr() + RawPtr<GlobalFetch::ScopedFetcher> weakPtr() { #if ENABLE(OILPAN) return this; @@ -96,7 +96,7 @@ int m_fetchCount; const String* m_expectedUrl; - PersistentWillBeMember<Response> m_response; + Member<Response> m_response; #if !ENABLE(OILPAN) WeakPtrFactory<GlobalFetch::ScopedFetcher> m_weakFactory; @@ -343,7 +343,7 @@ TEST_F(CacheStorageTest, Basics) { ScriptState::Scope scope(getScriptState()); - OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); + RawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); ErrorWebCacheForTests* testCache; Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache()); ASSERT(cache); @@ -369,7 +369,7 @@ TEST_F(CacheStorageTest, BasicArguments) { ScriptState::Scope scope(getScriptState()); - OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); + RawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); ErrorWebCacheForTests* testCache; Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache()); ASSERT(cache); @@ -425,7 +425,7 @@ TEST_F(CacheStorageTest, BatchOperationArguments) { ScriptState::Scope scope(getScriptState()); - OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); + RawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); ErrorWebCacheForTests* testCache; Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache()); ASSERT(cache); @@ -505,7 +505,7 @@ TEST_F(CacheStorageTest, MatchResponseTest) { ScriptState::Scope scope(getScriptState()); - OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); + RawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); const String requestUrl = "http://request.url/"; const String responseUrl = "http://match.response.test/"; @@ -541,7 +541,7 @@ TEST_F(CacheStorageTest, KeysResponseTest) { ScriptState::Scope scope(getScriptState()); - OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); + RawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); const String url1 = "http://first.request/"; const String url2 = "http://second.request/"; @@ -592,7 +592,7 @@ TEST_F(CacheStorageTest, MatchAllAndBatchResponseTest) { ScriptState::Scope scope(getScriptState()); - OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); + RawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); const String url1 = "http://first.response/"; const String url2 = "http://second.response/"; @@ -630,7 +630,7 @@ TEST_F(CacheStorageTest, Add) { ScriptState::Scope scope(getScriptState()); - OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); + RawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); const String url = "http://www.cacheadd.test/"; const String contentType = "text/plain"; const String content = "hello cache";
diff --git a/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp b/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp index 91b1779b..bd9eaac 100644 --- a/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp
@@ -19,15 +19,15 @@ namespace { template <typename T> -class GlobalCacheStorageImpl final : public NoBaseWillBeGarbageCollectedFinalized<GlobalCacheStorageImpl<T>>, public WillBeHeapSupplement<T> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(GlobalCacheStorageImpl); +class GlobalCacheStorageImpl final : public GarbageCollectedFinalized<GlobalCacheStorageImpl<T>>, public HeapSupplement<T> { + USING_GARBAGE_COLLECTED_MIXIN(GlobalCacheStorageImpl); public: static GlobalCacheStorageImpl& from(T& supplementable, ExecutionContext* executionContext) { - GlobalCacheStorageImpl* supplement = static_cast<GlobalCacheStorageImpl*>(WillBeHeapSupplement<T>::from(supplementable, name())); + GlobalCacheStorageImpl* supplement = static_cast<GlobalCacheStorageImpl*>(HeapSupplement<T>::from(supplementable, name())); if (!supplement) { supplement = new GlobalCacheStorageImpl(); - WillBeHeapSupplement<T>::provideTo(supplementable, name(), adoptPtrWillBeNoop(supplement)); + HeapSupplement<T>::provideTo(supplementable, name(), adoptPtrWillBeNoop(supplement)); } return *supplement; } @@ -62,7 +62,7 @@ DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_caches); - WillBeHeapSupplement<T>::trace(visitor); + HeapSupplement<T>::trace(visitor); } private: @@ -72,7 +72,7 @@ static const char* name() { return "CacheStorage"; } - PersistentWillBeMember<CacheStorage> m_caches; + Member<CacheStorage> m_caches; }; } // namespace
diff --git a/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.h b/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.h index 8a7afc0..a062f49d 100644 --- a/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.h +++ b/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.h
@@ -17,9 +17,9 @@ WTF_MAKE_NONCOPYABLE(InspectorCacheStorageAgent); public: - static PassOwnPtrWillBeRawPtr<InspectorCacheStorageAgent> create() + static RawPtr<InspectorCacheStorageAgent> create() { - return adoptPtrWillBeNoop(new InspectorCacheStorageAgent()); + return new InspectorCacheStorageAgent(); } ~InspectorCacheStorageAgent() override;
diff --git a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp index 09f992f2..7988132 100644 --- a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp +++ b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp
@@ -17,4 +17,15 @@ } } +OffscreenCanvas* HTMLCanvasElementModule::transferControlToOffscreen(HTMLCanvasElement& canvas, ExceptionState& exceptionState) +{ + if (canvas.renderingContext()) { + exceptionState.throwDOMException(InvalidStateError, "Cannot transfer control from a canvas that has a rendering context."); + return nullptr; + } + OffscreenCanvas* offscreenCanvas = OffscreenCanvas::create(canvas.width(), canvas.height()); + offscreenCanvas->setAssociatedCanvas(&canvas); + return offscreenCanvas; +} + }
diff --git a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.h b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.h index bacb33cc..0364503 100644 --- a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.h +++ b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.h
@@ -6,6 +6,8 @@ #define HTMLCanvasElementModule_h #include "core/html/HTMLCanvasElement.h" +#include "modules/ModulesExport.h" +#include "modules/offscreencanvas/OffscreenCanvas.h" #include "wtf/text/WTFString.h" namespace blink { @@ -14,10 +16,11 @@ class HTMLCanvasElement; class ScriptState; -class HTMLCanvasElementModule { +class MODULES_EXPORT HTMLCanvasElementModule { STATIC_ONLY(HTMLCanvasElementModule); public: static void getContext(HTMLCanvasElement&, const String&, const CanvasContextCreationAttributes&, RenderingContext&); + static OffscreenCanvas* transferControlToOffscreen(HTMLCanvasElement&, ExceptionState&); }; }
diff --git a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.idl b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.idl index 3b0219fc..8ae7d90e 100644 --- a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.idl +++ b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.idl
@@ -17,4 +17,5 @@ // (and is not undefined or null). The binding must ignore this. // Related spec issue: https://github.com/whatwg/html/issues/595 RenderingContext? getContext(DOMString contextId, [PermissiveDictionaryConversion] optional CanvasContextCreationAttributes attributes); + [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] OffscreenCanvas transferControlToOffscreen(); };
diff --git a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModuleTest.cpp b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModuleTest.cpp new file mode 100644 index 0000000..4e3566f --- /dev/null +++ b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModuleTest.cpp
@@ -0,0 +1,43 @@ +// 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. + +#include "modules/canvas/HTMLCanvasElementModule.h" + +#include "core/frame/FrameView.h" +#include "core/html/HTMLCanvasElement.h" +#include "core/html/HTMLDocument.h" +#include "core/loader/EmptyClients.h" +#include "core/testing/DummyPageHolder.h" +#include "modules/offscreencanvas/OffscreenCanvas.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace blink { + +class HTMLCanvasElementModuleTest : public ::testing::Test { +protected: + virtual void SetUp() + { + Page::PageClients pageClients; + fillWithEmptyClients(pageClients); + OwnPtr<DummyPageHolder> m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients); + RefPtrWillBePersistent<HTMLDocument> m_document = toHTMLDocument(&m_dummyPageHolder->document()); + m_document->documentElement()->setInnerHTML("<body><canvas id='c'></canvas></body>", ASSERT_NO_EXCEPTION); + m_document->view()->updateAllLifecyclePhases(); + m_canvasElement = toHTMLCanvasElement(m_document->getElementById("c")); + } + + HTMLCanvasElement& canvasElement() const { return *m_canvasElement; } +private: + RefPtrWillBePersistent<HTMLCanvasElement> m_canvasElement; +}; + +TEST_F(HTMLCanvasElementModuleTest, TransferControlToOffscreen) +{ + NonThrowableExceptionState exceptionState; + OffscreenCanvas* offscreenCanvas = HTMLCanvasElementModule::transferControlToOffscreen(canvasElement(), exceptionState); + HTMLCanvasElement* canvas = offscreenCanvas->getAssociatedCanvas(); + EXPECT_EQ(canvas, canvasElement()); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp index 1dfaa25..16607f6 100644 --- a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
@@ -376,7 +376,7 @@ if (filterString == state().unparsedFilter()) return; - RefPtrWillBeRawPtr<CSSValue> filterValue = CSSParser::parseSingleValue(CSSPropertyWebkitFilter, filterString, CSSParserContext(HTMLStandardMode, 0)); + RawPtr<CSSValue> filterValue = CSSParser::parseSingleValue(CSSPropertyWebkitFilter, filterString, CSSParserContext(HTMLStandardMode, 0)); if (!filterValue || filterValue->isInitialValue() || filterValue->isInheritedValue()) return; @@ -385,14 +385,14 @@ modifiableState().setFilter(filterValue.release()); } -PassRefPtrWillBeRawPtr<SVGMatrixTearOff> BaseRenderingContext2D::currentTransform() const +RawPtr<SVGMatrixTearOff> BaseRenderingContext2D::currentTransform() const { return SVGMatrixTearOff::create(state().transform()); } -void BaseRenderingContext2D::setCurrentTransform(PassRefPtrWillBeRawPtr<SVGMatrixTearOff> passMatrixTearOff) +void BaseRenderingContext2D::setCurrentTransform(RawPtr<SVGMatrixTearOff> passMatrixTearOff) { - RefPtrWillBeRawPtr<SVGMatrixTearOff> matrixTearOff = passMatrixTearOff; + RawPtr<SVGMatrixTearOff> matrixTearOff = passMatrixTearOff; const AffineTransform& transform = matrixTearOff->value(); setTransform(transform.a(), transform.b(), transform.c(), transform.d(), transform.e(), transform.f()); } @@ -922,9 +922,8 @@ } SkRect bounds = dstRect; SkPaint layerPaint; - layerPaint.setXfermode(paint->getXfermode()); - SkAutoTUnref<SkImageFilter> localFilter(paint->getImageFilter()->newWithLocalMatrix(invCtm)); - layerPaint.setImageFilter(localFilter); + layerPaint.setXfermode(sk_ref_sp(paint->getXfermode())); + layerPaint.setImageFilter(paint->getImageFilter()->makeWithLocalMatrix(invCtm)); c->saveLayer(&bounds, &layerPaint); imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); imagePaint.setImageFilter(nullptr);
diff --git a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h index bca2270..f13f116 100644 --- a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h +++ b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h
@@ -25,7 +25,7 @@ typedef HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmap CanvasImageSourceUnion; -class MODULES_EXPORT BaseRenderingContext2D : public WillBeGarbageCollectedMixin, public CanvasPathMethods { +class MODULES_EXPORT BaseRenderingContext2D : public GarbageCollectedMixin, public CanvasPathMethods { WTF_MAKE_NONCOPYABLE(BaseRenderingContext2D); public: ~BaseRenderingContext2D() override; @@ -78,8 +78,8 @@ void save(); void restore(); - PassRefPtrWillBeRawPtr<SVGMatrixTearOff> currentTransform() const; - void setCurrentTransform(PassRefPtrWillBeRawPtr<SVGMatrixTearOff>); + RawPtr<SVGMatrixTearOff> currentTransform() const; + void setCurrentTransform(RawPtr<SVGMatrixTearOff>); void scale(double sx, double sy); void rotate(double angleInRadians); @@ -178,7 +178,7 @@ void checkOverdraw(const SkRect&, const SkPaint*, CanvasRenderingContext2DState::ImageType, DrawType); - WillBeHeapVector<OwnPtrWillBeMember<CanvasRenderingContext2DState>> m_stateStack; + HeapVector<Member<CanvasRenderingContext2DState>> m_stateStack; AntiAliasingMode m_clipAntialiasing; private:
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp index 221bfab5..e8f6371 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -105,7 +105,7 @@ m_context->validateStateStack(); } private: - RawPtrWillBeMember<CanvasRenderingContext2D> m_context; + Member<CanvasRenderingContext2D> m_context; int m_saveCount; }; @@ -130,7 +130,7 @@ void CanvasRenderingContext2D::setCanvasGetContextResult(RenderingContext& result) { - result.setCanvasRenderingContext2D(PassRefPtrWillBeRawPtr<CanvasRenderingContext2D>(this)); + result.setCanvasRenderingContext2D(RawPtr<CanvasRenderingContext2D>(this)); } void CanvasRenderingContext2D::unwindStateStack() @@ -228,7 +228,7 @@ void CanvasRenderingContext2D::dispatchContextLostEvent(Timer<CanvasRenderingContext2D>*) { if (contextLostRestoredEventsEnabled()) { - RefPtrWillBeRawPtr<Event> event = Event::createCancelable(EventTypeNames::contextlost); + RawPtr<Event> event = Event::createCancelable(EventTypeNames::contextlost); canvas()->dispatchEvent(event); if (event->defaultPrevented()) { m_contextRestorable = false; @@ -273,7 +273,7 @@ reset(); m_contextLostMode = NotLostContext; if (contextLostRestoredEventsEnabled()) { - RefPtrWillBeRawPtr<Event> event(Event::create(EventTypeNames::contextrestored)); + RawPtr<Event> event(Event::create(EventTypeNames::contextrestored)); canvas()->dispatchEvent(event); } } @@ -297,7 +297,7 @@ { if (!c) return; - WillBeHeapVector<OwnPtrWillBeMember<CanvasRenderingContext2DState>>::const_iterator currState; + HeapVector<Member<CanvasRenderingContext2DState>>::const_iterator currState; ASSERT(m_stateStack.begin() < m_stateStack.end()); for (currState = m_stateStack.begin(); currState < m_stateStack.end(); currState++) { c->setMatrix(SkMatrix::I()); @@ -1013,7 +1013,7 @@ m_hitRegionManager->removeHitRegionById(options.id()); m_hitRegionManager->removeHitRegionByControl(options.control()); - RefPtrWillBeRawPtr<HitRegion> hitRegion = HitRegion::create(hitRegionPath, options); + RawPtr<HitRegion> hitRegion = HitRegion::create(hitRegionPath, options); Element* element = hitRegion->control(); if (element && element->isDescendantOf(canvas())) updateElementAccessibility(hitRegion->path(), hitRegion->control());
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h index 5381db0..54accd5 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h
@@ -64,8 +64,8 @@ class MODULES_EXPORT CanvasRenderingContext2D final : public CanvasRenderingContext, public BaseRenderingContext2D, public WebThread::TaskObserver, public SVGResourceClient { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CanvasRenderingContext2D); - WILL_BE_USING_PRE_FINALIZER(CanvasRenderingContext2D, dispose); + USING_GARBAGE_COLLECTED_MIXIN(CanvasRenderingContext2D); + USING_PRE_FINALIZER(CanvasRenderingContext2D, dispose); public: class Factory : public CanvasRenderingContextFactory { WTF_MAKE_NONCOPYABLE(Factory); @@ -73,9 +73,9 @@ Factory() {} ~Factory() override {} - PassOwnPtrWillBeRawPtr<CanvasRenderingContext> create(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document& document) override + RawPtr<CanvasRenderingContext> create(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document& document) override { - return adoptPtrWillBeNoop(new CanvasRenderingContext2D(canvas, attrs, document)); + return new CanvasRenderingContext2D(canvas, attrs, document); } CanvasRenderingContext::ContextType getContextType() const override { return CanvasRenderingContext::Context2d; } void onError(HTMLCanvasElement*, const String& error) override { } @@ -205,7 +205,7 @@ WebLayer* platformLayer() const override; - PersistentWillBeMember<HitRegionManager> m_hitRegionManager; + Member<HitRegionManager> m_hitRegionManager; bool m_hasAlpha; LostContextMode m_contextLostMode; bool m_contextRestorable;
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.idl b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.idl index 997969a..c9d6b88 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.idl +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.idl
@@ -36,7 +36,7 @@ [ SetWrapperReferenceFrom=canvas, - WillBeGarbageCollected, + GarbageCollected, ] interface CanvasRenderingContext2D { // back-reference to the canvas readonly attribute HTMLCanvasElement canvas;
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DAPITest.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DAPITest.cpp index 905931f..dd76e79 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DAPITest.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DAPITest.cpp
@@ -39,8 +39,8 @@ private: OwnPtr<DummyPageHolder> m_dummyPageHolder; - RefPtrWillBePersistent<HTMLDocument> m_document; - RefPtrWillBePersistent<HTMLCanvasElement> m_canvasElement; + Persistent<HTMLDocument> m_document; + Persistent<HTMLCanvasElement> m_canvasElement; };
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp index efa4091..3bc0a98 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
@@ -313,7 +313,7 @@ StyleBuilder::applyProperty(CSSPropertyWebkitFilter, resolverState, m_filterValue.get()); resolverState.loadPendingResources(); - RefPtrWillBeRawPtr<FilterEffectBuilder> filterEffectBuilder = FilterEffectBuilder::create(); + RawPtr<FilterEffectBuilder> filterEffectBuilder = FilterEffectBuilder::create(); // We can't reuse m_fillPaint and m_strokePaint for the filter, since these incorporate // the global alpha, which isn't applicable here. @@ -328,7 +328,7 @@ filterEffectBuilder->build(styleResolutionHost, filterStyle->filter(), effectiveZoom, &floatCanvasSize, &fillPaintForFilter, &strokePaintForFilter); SkiaImageFilterBuilder imageFilterBuilder; - RefPtrWillBeRawPtr<FilterEffect> lastEffect = filterEffectBuilder->lastEffect(); + RawPtr<FilterEffect> lastEffect = filterEffectBuilder->lastEffect(); m_resolvedFilter = imageFilterBuilder.build(lastEffect.get(), ColorSpaceDeviceRGB); if (m_resolvedFilter) { updateFilterReferences(toHTMLCanvasElement(styleResolutionHost), context, filterStyle->filter()); @@ -432,7 +432,7 @@ shadowParameterChanged(); } -void CanvasRenderingContext2DState::setFilter(PassRefPtrWillBeRawPtr<CSSValue> filterValue) +void CanvasRenderingContext2DState::setFilter(RawPtr<CSSValue> filterValue) { m_filterValue = filterValue; m_resolvedFilter.clear();
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.h b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.h index 138df2f..3dd9caf6 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.h +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.h
@@ -18,12 +18,11 @@ class CSSValue; class Element; -class CanvasRenderingContext2DState final : public NoBaseWillBeGarbageCollectedFinalized<CanvasRenderingContext2DState>, public CSSFontSelectorClient { +class CanvasRenderingContext2DState final : public GarbageCollectedFinalized<CanvasRenderingContext2DState>, public CSSFontSelectorClient { WTF_MAKE_NONCOPYABLE(CanvasRenderingContext2DState); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CanvasRenderingContext2DState); - USING_FAST_MALLOC_WILL_BE_REMOVED(CanvasRenderingContext2DState); + USING_GARBAGE_COLLECTED_MIXIN(CanvasRenderingContext2DState); public: - static PassOwnPtrWillBeRawPtr<CanvasRenderingContext2DState> create() + static RawPtr<CanvasRenderingContext2DState> create() { return adoptPtrWillBeNoop(new CanvasRenderingContext2DState); } @@ -43,9 +42,9 @@ ImagePaintType, }; - static PassOwnPtrWillBeRawPtr<CanvasRenderingContext2DState> create(const CanvasRenderingContext2DState& other, ClipListCopyMode mode) + static RawPtr<CanvasRenderingContext2DState> create(const CanvasRenderingContext2DState& other, ClipListCopyMode mode) { - return adoptPtrWillBeNoop(new CanvasRenderingContext2DState(other, mode)); + return new CanvasRenderingContext2DState(other, mode); } // CSSFontSelectorClient implementation @@ -83,7 +82,7 @@ void setUnparsedFont(const String& font) { m_unparsedFont = font; } const String& unparsedFont() const { return m_unparsedFont; } - void setFilter(PassRefPtrWillBeRawPtr<CSSValue>); + void setFilter(RawPtr<CSSValue>); void setUnparsedFilter(const String& filterString) { m_unparsedFilter = filterString; } const String& unparsedFilter() const { return m_unparsedFilter; } SkImageFilter* getFilter(Element*, const Font&, IntSize canvasSize, CanvasRenderingContext2D*) const; @@ -183,8 +182,8 @@ String m_unparsedStrokeColor; String m_unparsedFillColor; - PersistentWillBeMember<CanvasStyle> m_strokeStyle; - PersistentWillBeMember<CanvasStyle> m_fillStyle; + Member<CanvasStyle> m_strokeStyle; + Member<CanvasStyle> m_fillStyle; mutable SkPaint m_strokePaint; mutable SkPaint m_fillPaint; @@ -208,7 +207,7 @@ Font m_font; String m_unparsedFilter; - RefPtrWillBeMember<CSSValue> m_filterValue; + Member<CSSValue> m_filterValue; mutable RefPtr<SkImageFilter> m_resolvedFilter; // Text state.
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp index 3ab020a9..af0af594 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
@@ -87,13 +87,13 @@ private: OwnPtr<DummyPageHolder> m_dummyPageHolder; - RefPtrWillBePersistent<HTMLDocument> m_document; - RefPtrWillBePersistent<HTMLCanvasElement> m_canvasElement; + Persistent<HTMLDocument> m_document; + Persistent<HTMLCanvasElement> m_canvasElement; Persistent<MemoryCache> m_globalMemoryCache; - class WrapGradients final : public NoBaseWillBeGarbageCollectedFinalized<WrapGradients> { + class WrapGradients final : public GarbageCollectedFinalized<WrapGradients> { public: - static PassOwnPtrWillBeRawPtr<WrapGradients> create() + static RawPtr<WrapGradients> create() { return adoptPtrWillBeNoop(new WrapGradients); } @@ -109,7 +109,7 @@ }; // TODO(Oilpan): avoid tedious part-object wrapper by supporting on-heap ::testing::Tests. - OwnPtrWillBePersistent<WrapGradients> m_wrapGradients; + Persistent<WrapGradients> m_wrapGradients; protected: // Pre-canned objects for testing @@ -446,7 +446,7 @@ canvasElement().createImageBufferUsingSurfaceForTesting(surface.release()); NonThrowableExceptionState exceptionState; - RefPtrWillBeRawPtr<Element> sourceCanvasElement = document().createElement("canvas", exceptionState); + RawPtr<Element> sourceCanvasElement = document().createElement("canvas", exceptionState); EXPECT_FALSE(exceptionState.hadException()); HTMLCanvasElement* sourceCanvas = static_cast<HTMLCanvasElement*>(sourceCanvasElement.get()); IntSize sourceSize(10, 10 * ExpensiveCanvasHeuristicParameters::ExpensiveImageSizeRatio); @@ -455,7 +455,7 @@ const ImageBitmapOptions defaultOptions; // Go through an ImageBitmap to avoid triggering a display list fallback - RefPtrWillBeRawPtr<ImageBitmap> sourceImageBitmap = ImageBitmap::create(sourceCanvas, IntRect(IntPoint(0, 0), sourceSize), defaultOptions); + RawPtr<ImageBitmap> sourceImageBitmap = ImageBitmap::create(sourceCanvas, IntRect(IntPoint(0, 0), sourceSize), defaultOptions); context2d()->drawImage(sourceImageBitmap.get(), 0, 0, 1, 1, 0, 0, 1, 1, exceptionState); EXPECT_FALSE(exceptionState.hadException()); @@ -470,7 +470,7 @@ canvasElement().createImageBufferUsingSurfaceForTesting(surface.release()); NonThrowableExceptionState exceptionState; - RefPtrWillBeRawPtr<Element> sourceCanvasElement = document().createElement("canvas", exceptionState); + RawPtr<Element> sourceCanvasElement = document().createElement("canvas", exceptionState); EXPECT_FALSE(exceptionState.hadException()); HTMLCanvasElement* sourceCanvas = static_cast<HTMLCanvasElement*>(sourceCanvasElement.get()); IntSize sourceSize(10, 10 * ExpensiveCanvasHeuristicParameters::ExpensiveImageSizeRatio + 1); @@ -479,7 +479,7 @@ const ImageBitmapOptions defaultOptions; // Go through an ImageBitmap to avoid triggering a display list fallback - RefPtrWillBeRawPtr<ImageBitmap> sourceImageBitmap = ImageBitmap::create(sourceCanvas, IntRect(IntPoint(0, 0), sourceSize), defaultOptions); + RawPtr<ImageBitmap> sourceImageBitmap = ImageBitmap::create(sourceCanvas, IntRect(IntPoint(0, 0), sourceSize), defaultOptions); context2d()->drawImage(sourceImageBitmap.get(), 0, 0, 1, 1, 0, 0, 1, 1, exceptionState); EXPECT_FALSE(exceptionState.hadException()); @@ -660,15 +660,15 @@ TEST_F(CanvasRenderingContext2DTest, ImageResourceLifetime) { NonThrowableExceptionState nonThrowableExceptionState; - RefPtrWillBeRawPtr<Element> canvasElement = document().createElement("canvas", nonThrowableExceptionState); + RawPtr<Element> canvasElement = document().createElement("canvas", nonThrowableExceptionState); EXPECT_FALSE(nonThrowableExceptionState.hadException()); HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(canvasElement.get()); canvas->setHeight(40); canvas->setWidth(40); - RefPtrWillBeRawPtr<ImageBitmap> imageBitmapDerived = nullptr; + RawPtr<ImageBitmap> imageBitmapDerived = nullptr; { const ImageBitmapOptions defaultOptions; - RefPtrWillBeRawPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::create(canvas, IntRect(0, 0, canvas->width(), canvas->height()), defaultOptions); + RawPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::create(canvas, IntRect(0, 0, canvas->width(), canvas->height()), defaultOptions); imageBitmapDerived = ImageBitmap::create(imageBitmapFromCanvas.get(), IntRect(0, 0, 20, 20), defaultOptions); } CanvasContextCreationAttributes attributes;
diff --git a/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp b/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp index 4423f63..f7cb323 100644 --- a/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp
@@ -35,9 +35,9 @@ visitor->trace(m_control); } -void HitRegionManager::addHitRegion(PassRefPtrWillBeRawPtr<HitRegion> passHitRegion) +void HitRegionManager::addHitRegion(RawPtr<HitRegion> passHitRegion) { - RefPtrWillBeRawPtr<HitRegion> hitRegion = passHitRegion; + RawPtr<HitRegion> hitRegion = passHitRegion; m_hitRegionList.add(hitRegion); @@ -83,7 +83,7 @@ HitRegionList toBeRemoved; for (HitRegionIterator it = m_hitRegionList.rbegin(); it != itEnd; ++it) { - RefPtrWillBeRawPtr<HitRegion> hitRegion = *it; + RawPtr<HitRegion> hitRegion = *it; hitRegion->removePixels(clearArea); if (hitRegion->path().isEmpty()) toBeRemoved.add(hitRegion); @@ -119,7 +119,7 @@ HitRegionIterator itEnd = m_hitRegionList.rend(); for (HitRegionIterator it = m_hitRegionList.rbegin(); it != itEnd; ++it) { - RefPtrWillBeRawPtr<HitRegion> hitRegion = *it; + RawPtr<HitRegion> hitRegion = *it; if (hitRegion->contains(point)) return hitRegion.get(); }
diff --git a/third_party/WebKit/Source/modules/canvas2d/HitRegion.h b/third_party/WebKit/Source/modules/canvas2d/HitRegion.h index 48cae8a8..a032e1b 100644 --- a/third_party/WebKit/Source/modules/canvas2d/HitRegion.h +++ b/third_party/WebKit/Source/modules/canvas2d/HitRegion.h
@@ -17,11 +17,11 @@ namespace blink { -class HitRegion final : public RefCountedWillBeGarbageCollectedFinalized<HitRegion> { +class HitRegion final : public GarbageCollectedFinalized<HitRegion> { public: - static PassRefPtrWillBeRawPtr<HitRegion> create(const Path& path, const HitRegionOptions& options) + static RawPtr<HitRegion> create(const Path& path, const HitRegionOptions& options) { - return adoptRefWillBeNoop(new HitRegion(path, options)); + return new HitRegion(path, options); } virtual ~HitRegion() { } @@ -40,7 +40,7 @@ HitRegion(const Path&, const HitRegionOptions&); String m_id; - RefPtrWillBeMember<Element> m_control; + Member<Element> m_control; Path m_path; WindRule m_fillRule; }; @@ -51,7 +51,7 @@ static HitRegionManager* create() { return new HitRegionManager; } ~HitRegionManager() { } - void addHitRegion(PassRefPtrWillBeRawPtr<HitRegion>); + void addHitRegion(RawPtr<HitRegion>); void removeHitRegion(HitRegion*); void removeHitRegionById(const String& id); @@ -70,10 +70,10 @@ private: HitRegionManager() { } - typedef WillBeHeapListHashSet<RefPtrWillBeMember<HitRegion>> HitRegionList; + typedef HeapListHashSet<Member<HitRegion>> HitRegionList; typedef HitRegionList::const_reverse_iterator HitRegionIterator; - typedef WillBeHeapHashMap<String, RefPtrWillBeMember<HitRegion>> HitRegionIdMap; - typedef WillBeHeapHashMap<RefPtrWillBeMember<Element>, RefPtrWillBeMember<HitRegion>> HitRegionControlMap; + typedef HeapHashMap<String, Member<HitRegion>> HitRegionIdMap; + typedef HeapHashMap<Member<Element>, Member<HitRegion>> HitRegionControlMap; HitRegionList m_hitRegionList; HitRegionIdMap m_hitRegionIdMap;
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp index dd66695..fc126a0 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp
@@ -12,17 +12,17 @@ namespace blink { -PassRefPtrWillBeRawPtr<CompositorWorkerGlobalScope> CompositorWorkerGlobalScope::create(CompositorWorkerThread* thread, PassOwnPtr<WorkerThreadStartupData> startupData, double timeOrigin) +RawPtr<CompositorWorkerGlobalScope> CompositorWorkerGlobalScope::create(CompositorWorkerThread* thread, PassOwnPtr<WorkerThreadStartupData> startupData, double timeOrigin) { // Note: startupData is finalized on return. After the relevant parts has been // passed along to the created 'context'. - RefPtrWillBeRawPtr<CompositorWorkerGlobalScope> context = adoptRefWillBeNoop(new CompositorWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAgent, thread, timeOrigin, startupData->m_starterOriginPrivilegeData.release(), startupData->m_workerClients.release())); + RawPtr<CompositorWorkerGlobalScope> context = new CompositorWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAgent, thread, timeOrigin, startupData->m_starterOriginPrivilegeData.release(), startupData->m_workerClients.release()); context->applyContentSecurityPolicyFromVector(*startupData->m_contentSecurityPolicyHeaders); context->setAddressSpace(startupData->m_addressSpace); return context.release(); } -CompositorWorkerGlobalScope::CompositorWorkerGlobalScope(const KURL& url, const String& userAgent, CompositorWorkerThread* thread, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData> starterOriginPrivilegeData, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) +CompositorWorkerGlobalScope::CompositorWorkerGlobalScope(const KURL& url, const String& userAgent, CompositorWorkerThread* thread, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData> starterOriginPrivilegeData, RawPtr<WorkerClients> workerClients) : WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOriginPrivilegeData, workerClients) , m_callbackCollection(this) {
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.h b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.h index fb702fb5..8f40e97 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.h +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.h
@@ -17,7 +17,7 @@ class CompositorWorkerGlobalScope final : public WorkerGlobalScope { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CompositorWorkerGlobalScope> create(CompositorWorkerThread*, PassOwnPtr<WorkerThreadStartupData>, double timeOrigin); + static RawPtr<CompositorWorkerGlobalScope> create(CompositorWorkerThread*, PassOwnPtr<WorkerThreadStartupData>, double timeOrigin); ~CompositorWorkerGlobalScope() override; // EventTarget @@ -36,7 +36,7 @@ DECLARE_VIRTUAL_TRACE(); private: - CompositorWorkerGlobalScope(const KURL&, const String& userAgent, CompositorWorkerThread*, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData>, PassOwnPtrWillBeRawPtr<WorkerClients>); + CompositorWorkerGlobalScope(const KURL&, const String& userAgent, CompositorWorkerThread*, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData>, RawPtr<WorkerClients>); CompositorWorkerThread* thread() const; FrameRequestCallbackCollection m_callbackCollection;
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp index 0a20181..89a44f1 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp
@@ -160,7 +160,7 @@ return CompositorWorkerSharedState::instance().compositorWorkerThread(); } -PassRefPtrWillBeRawPtr<WorkerGlobalScope> CompositorWorkerThread::createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupData> startupData) +RawPtr<WorkerGlobalScope> CompositorWorkerThread::createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupData> startupData) { TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "CompositorWorkerThread::createWorkerGlobalScope"); return CompositorWorkerGlobalScope::create(this, startupData, m_timeOrigin);
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.h b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.h index 56cdba9..4e96a6b 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.h +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.h
@@ -30,7 +30,7 @@ CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerObjectProxy&, double timeOrigin); // WorkerThread: - PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupData>) override; + RawPtr<WorkerGlobalScope> createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupData>) override; WebThreadSupportingGC& backingThread() override; void didStartWorkerThread() override { } void willStopWorkerThread() override { }
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp index 8b02c5dc..5a771e5 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
@@ -75,7 +75,7 @@ // (Empty) WorkerReportingProxy implementation: virtual void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int exceptionId) {} - void reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) override {} + void reportConsoleMessage(RawPtr<ConsoleMessage>) override {} void postMessageToPageInspector(const String&) override {} void postWorkerConsoleAgentEnabled() override {} @@ -94,7 +94,7 @@ { } - RefPtrWillBePersistent<ExecutionContext> m_executionContext; + Persistent<ExecutionContext> m_executionContext; }; class CompositorWorkerTestPlatform : public TestingPlatformSupport { @@ -137,7 +137,7 @@ PassOwnPtr<TestCompositorWorkerThread> createCompositorWorker(WaitableEvent* startEvent) { TestCompositorWorkerThread* workerThread = new TestCompositorWorkerThread(nullptr, *m_objectProxy, 0, startEvent); - OwnPtrWillBeRawPtr<WorkerClients> clients = nullptr; + RawPtr<WorkerClients> clients = nullptr; workerThread->start(WorkerThreadStartupData::create( KURL(ParsedURLString, "http://fake.url/"), "fake user agent",
diff --git a/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.cpp b/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.cpp index 0983d5d..73913e8 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.cpp +++ b/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.cpp
@@ -22,7 +22,7 @@ DEFINE_TRACE(CredentialManagerClient) { - WillBeHeapSupplement<Page>::trace(visitor); + HeapSupplement<Page>::trace(visitor); } // static @@ -42,7 +42,7 @@ // static CredentialManagerClient* CredentialManagerClient::from(Page* page) { - return static_cast<CredentialManagerClient*>(WillBeHeapSupplement<Page>::from(page, supplementName())); + return static_cast<CredentialManagerClient*>(HeapSupplement<Page>::from(page, supplementName())); } void provideCredentialManagerClientTo(Page& page, CredentialManagerClient* client)
diff --git a/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.h b/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.h index 17f3b61..ae612d2 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.h +++ b/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.h
@@ -20,9 +20,8 @@ // CredentialManagerClient lives as a supplement to Page, and wraps the embedder-provided // WebCredentialManagerClient's methods to make them visible to the bindings code. -class MODULES_EXPORT CredentialManagerClient final : public NoBaseWillBeGarbageCollectedFinalized<CredentialManagerClient>, public WillBeHeapSupplement<Page> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CredentialManagerClient); - USING_FAST_MALLOC_WILL_BE_REMOVED(CredentialManagerClient); +class MODULES_EXPORT CredentialManagerClient final : public GarbageCollectedFinalized<CredentialManagerClient>, public HeapSupplement<Page> { + USING_GARBAGE_COLLECTED_MIXIN(CredentialManagerClient); public: explicit CredentialManagerClient(WebCredentialManagerClient*); virtual ~CredentialManagerClient();
diff --git a/third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp b/third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp index d9792053..1eeb0c9 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp +++ b/third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp
@@ -46,7 +46,7 @@ private: OwnPtr<DummyPageHolder> m_dummyPageHolder; - RefPtrWillBePersistent<HTMLDocument> m_document; + Persistent<HTMLDocument> m_document; }; TEST_F(PasswordCredentialTest, CreateFromMultipartForm)
diff --git a/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.cpp b/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.cpp index 36233c5..f8c5489d8 100644 --- a/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.cpp +++ b/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.cpp
@@ -40,8 +40,6 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowCrypto); - const char* DOMWindowCrypto::supplementName() { return "DOMWindowCrypto"; @@ -49,7 +47,7 @@ DOMWindowCrypto& DOMWindowCrypto::from(LocalDOMWindow& window) { - DOMWindowCrypto* supplement = static_cast<DOMWindowCrypto*>(WillBeHeapSupplement<LocalDOMWindow>::from(window, supplementName())); + DOMWindowCrypto* supplement = static_cast<DOMWindowCrypto*>(HeapSupplement<LocalDOMWindow>::from(window, supplementName())); if (!supplement) { supplement = new DOMWindowCrypto(window); provideTo(window, supplementName(), adoptPtrWillBeNoop(supplement)); @@ -72,7 +70,7 @@ DEFINE_TRACE(DOMWindowCrypto) { visitor->trace(m_crypto); - WillBeHeapSupplement<LocalDOMWindow>::trace(visitor); + HeapSupplement<LocalDOMWindow>::trace(visitor); DOMWindowProperty::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.h b/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.h index 9515d02..9d5f361 100644 --- a/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.h +++ b/third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.h
@@ -40,10 +40,8 @@ class Crypto; class DOMWindow; -class DOMWindowCrypto final : public NoBaseWillBeGarbageCollected<DOMWindowCrypto>, public WillBeHeapSupplement<LocalDOMWindow>, public DOMWindowProperty { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMWindowCrypto); - DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowCrypto); - USING_FAST_MALLOC_WILL_BE_REMOVED(DOMWindowCrypto); +class DOMWindowCrypto final : public GarbageCollected<DOMWindowCrypto>, public HeapSupplement<LocalDOMWindow>, public DOMWindowProperty { + USING_GARBAGE_COLLECTED_MIXIN(DOMWindowCrypto); public: static DOMWindowCrypto& from(LocalDOMWindow&); static Crypto* crypto(DOMWindow&); @@ -55,7 +53,7 @@ explicit DOMWindowCrypto(LocalDOMWindow&); static const char* supplementName(); - mutable PersistentWillBeMember<Crypto> m_crypto; + mutable Member<Crypto> m_crypto; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.cpp b/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.cpp index 12ba53f..92d1528 100644 --- a/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.cpp +++ b/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.cpp
@@ -44,17 +44,17 @@ return "WorkerGlobalScopeCrypto"; } -WorkerGlobalScopeCrypto& WorkerGlobalScopeCrypto::from(WillBeHeapSupplementable<WorkerGlobalScope>& context) +WorkerGlobalScopeCrypto& WorkerGlobalScopeCrypto::from(Supplementable<WorkerGlobalScope>& context) { - WorkerGlobalScopeCrypto* supplement = static_cast<WorkerGlobalScopeCrypto*>(WillBeHeapSupplement<WorkerGlobalScope>::from(context, supplementName())); + WorkerGlobalScopeCrypto* supplement = static_cast<WorkerGlobalScopeCrypto*>(Supplement<WorkerGlobalScope>::from(context, supplementName())); if (!supplement) { - supplement = new WorkerGlobalScopeCrypto(); - provideTo(context, supplementName(), adoptPtrWillBeNoop(supplement)); + supplement = new WorkerGlobalScopeCrypto; + provideTo(context, supplementName(), supplement); } return *supplement; } -Crypto* WorkerGlobalScopeCrypto::crypto(WillBeHeapSupplementable<WorkerGlobalScope>& context) +Crypto* WorkerGlobalScopeCrypto::crypto(Supplementable<WorkerGlobalScope>& context) { return WorkerGlobalScopeCrypto::from(context).crypto(); } @@ -69,7 +69,7 @@ DEFINE_TRACE(WorkerGlobalScopeCrypto) { visitor->trace(m_crypto); - WillBeHeapSupplement<WorkerGlobalScope>::trace(visitor); + Supplement<WorkerGlobalScope>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.h b/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.h index 6c64e13..4e5d8506 100644 --- a/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.h +++ b/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.h
@@ -40,12 +40,11 @@ class Crypto; class WorkerGlobalScope; -class WorkerGlobalScopeCrypto final : public NoBaseWillBeGarbageCollected<WorkerGlobalScopeCrypto>, public WillBeHeapSupplement<WorkerGlobalScope> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WorkerGlobalScopeCrypto); - USING_FAST_MALLOC_WILL_BE_REMOVED(WorkerGlobalScopeCrypto); +class WorkerGlobalScopeCrypto final : public GarbageCollected<WorkerGlobalScopeCrypto>, public Supplement<WorkerGlobalScope> { + USING_GARBAGE_COLLECTED_MIXIN(WorkerGlobalScopeCrypto); public: - static WorkerGlobalScopeCrypto& from(WillBeHeapSupplementable<WorkerGlobalScope>&); - static Crypto* crypto(WillBeHeapSupplementable<WorkerGlobalScope>&); + static WorkerGlobalScopeCrypto& from(Supplementable<WorkerGlobalScope>&); + static Crypto* crypto(Supplementable<WorkerGlobalScope>&); Crypto* crypto() const; DECLARE_VIRTUAL_TRACE(); @@ -54,7 +53,7 @@ WorkerGlobalScopeCrypto(); static const char* supplementName(); - mutable PersistentWillBeMember<Crypto> m_crypto; + mutable Member<Crypto> m_crypto; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp new file mode 100644 index 0000000..29507cd --- /dev/null +++ b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
@@ -0,0 +1,27 @@ +// 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. + +#include "modules/csspaint/CSSPaintDefinition.h" + +#include "bindings/core/v8/ScriptState.h" + +namespace blink { + +RawPtr<CSSPaintDefinition> CSSPaintDefinition::create(ScriptState* scriptState, v8::Local<v8::Function> constructor, v8::Local<v8::Function> paint) +{ + return new CSSPaintDefinition(scriptState, constructor, paint); +} + +CSSPaintDefinition::CSSPaintDefinition(ScriptState* scriptState, v8::Local<v8::Function> constructor, v8::Local<v8::Function> paint) + : m_scriptState(scriptState) + , m_constructor(scriptState->isolate(), constructor) + , m_paint(scriptState->isolate(), paint) +{ +} + +CSSPaintDefinition::~CSSPaintDefinition() +{ +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h new file mode 100644 index 0000000..9c768b73 --- /dev/null +++ b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h
@@ -0,0 +1,40 @@ +// 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. + +#ifndef CSSPaintDefinition_h +#define CSSPaintDefinition_h + +#include "bindings/core/v8/ScopedPersistent.h" +#include "platform/geometry/IntSize.h" +#include "platform/heap/Handle.h" +#include <v8.h> + +namespace blink { + +class ScriptState; + +class CSSPaintDefinition final : public GarbageCollectedFinalized<CSSPaintDefinition> { +public: + static RawPtr<CSSPaintDefinition> create(ScriptState*, v8::Local<v8::Function> constructor, v8::Local<v8::Function> paint); + virtual ~CSSPaintDefinition(); + + v8::Local<v8::Function> paintFunctionForTesting(v8::Isolate* isolate) { return m_paint.newLocal(isolate); } + + DEFINE_INLINE_TRACE() { }; + +private: + CSSPaintDefinition(ScriptState*, v8::Local<v8::Function> constructor, v8::Local<v8::Function> paint); + + RefPtr<ScriptState> m_scriptState; + + // This object keeps the constructor and paint functions alive. This object + // needs to be destroyed to break a reference cycle between it and the + // PaintWorkletGlobalScope. + ScopedPersistent<v8::Function> m_constructor; + ScopedPersistent<v8::Function> m_paint; +}; + +} // namespace blink + +#endif // CSSPaintDefinition_h
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h index 5b31a58..dc57016 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h +++ b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h
@@ -16,15 +16,14 @@ class CanvasImageSource; class Color; -class MODULES_EXPORT PaintRenderingContext2D : public BaseRenderingContext2D, public RefCountedWillBeGarbageCollectedFinalized<PaintRenderingContext2D>, public ScriptWrappable { +class MODULES_EXPORT PaintRenderingContext2D : public BaseRenderingContext2D, public GarbageCollectedFinalized<PaintRenderingContext2D>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PaintRenderingContext2D); + USING_GARBAGE_COLLECTED_MIXIN(PaintRenderingContext2D); WTF_MAKE_NONCOPYABLE(PaintRenderingContext2D); - USING_FAST_MALLOC_WILL_BE_REMOVED(PaintRenderingContext2D); public: - static PassRefPtrWillBeRawPtr<PaintRenderingContext2D> create(PassOwnPtr<ImageBuffer> imageBuffer) + static RawPtr<PaintRenderingContext2D> create(PassOwnPtr<ImageBuffer> imageBuffer) { - return adoptRefWillBeNoop(new PaintRenderingContext2D(imageBuffer)); + return new PaintRenderingContext2D(imageBuffer); } // BaseRenderingContext2D
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.idl b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.idl index 57aa95e1..535af8ab 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.idl +++ b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.idl
@@ -6,7 +6,7 @@ [ Exposed=PaintWorklet, - WillBeGarbageCollected, + GarbageCollected, RuntimeEnabled=CSSPaintAPI, ] interface PaintRenderingContext2D { // state
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2DTest.cpp b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2DTest.cpp index 708e0654..c13e19c 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2DTest.cpp +++ b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2DTest.cpp
@@ -17,7 +17,7 @@ protected: void SetUp() override; - RefPtrWillBePersistent<PaintRenderingContext2D> m_ctx; + Persistent<PaintRenderingContext2D> m_ctx; }; void PaintRenderingContext2DTest::SetUp()
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h b/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h index 1bf6a69..ce46711 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h
@@ -23,7 +23,7 @@ private: PaintWorklet(LocalFrame*, ExecutionContext*); - RefPtrWillBeMember<WorkletGlobalScope> m_paintWorkletGlobalScope; + Member<WorkletGlobalScope> m_paintWorkletGlobalScope; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp index ec5f583..0350334 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
@@ -4,15 +4,19 @@ #include "modules/csspaint/PaintWorkletGlobalScope.h" +#include "bindings/core/v8/ScopedPersistent.h" +#include "bindings/core/v8/V8BindingMacros.h" #include "bindings/core/v8/WorkerOrWorkletScriptController.h" +#include "core/dom/ExceptionCode.h" #include "core/inspector/MainThreadDebugger.h" +#include "modules/csspaint/CSSPaintDefinition.h" namespace blink { // static -PassRefPtrWillBeRawPtr<PaintWorkletGlobalScope> PaintWorkletGlobalScope::create(LocalFrame* frame, const KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> securityOrigin, v8::Isolate* isolate) +RawPtr<PaintWorkletGlobalScope> PaintWorkletGlobalScope::create(LocalFrame* frame, const KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> securityOrigin, v8::Isolate* isolate) { - RefPtrWillBeRawPtr<PaintWorkletGlobalScope> paintWorkletGlobalScope = adoptRefWillBeNoop(new PaintWorkletGlobalScope(frame, url, userAgent, securityOrigin, isolate)); + RawPtr<PaintWorkletGlobalScope> paintWorkletGlobalScope = new PaintWorkletGlobalScope(frame, url, userAgent, securityOrigin, isolate); paintWorkletGlobalScope->scriptController()->initializeContextIfNeeded(); MainThreadDebugger::instance()->contextCreated(paintWorkletGlobalScope->scriptController()->getScriptState(), paintWorkletGlobalScope->frame(), paintWorkletGlobalScope->getSecurityOrigin()); return paintWorkletGlobalScope.release(); @@ -27,4 +31,91 @@ { } +void PaintWorkletGlobalScope::dispose() +{ + // Explicitly clear the paint defininitions to break a reference cycle + // between them and this global scope. + m_paintDefinitions.clear(); + + WorkletGlobalScope::dispose(); +} + +void PaintWorkletGlobalScope::registerPaint(const String& name, const ScriptValue& ctorValue, ExceptionState& exceptionState) +{ + if (m_paintDefinitions.contains(name)) { + exceptionState.throwDOMException(NotSupportedError, "A class with name:'" + name + "' is already registered."); + return; + } + + if (name.isEmpty()) { + exceptionState.throwTypeError("The empty string is not a valid name."); + return; + } + + v8::Isolate* isolate = scriptController()->getScriptState()->isolate(); + v8::Local<v8::Context> context = scriptController()->context(); + + ASSERT(ctorValue.v8Value()->IsFunction()); + v8::Local<v8::Function> constructor = v8::Local<v8::Function>::Cast(ctorValue.v8Value()); + + v8::Local<v8::Value> inputPropertiesValue; + if (!v8Call(constructor->Get(context, v8String(isolate, "inputProperties")), inputPropertiesValue)) + return; + + if (!isUndefinedOrNull(inputPropertiesValue)) { + toImplArray<Vector<String>>(inputPropertiesValue, 0, isolate, exceptionState); + + if (exceptionState.hadException()) + return; + + // TODO(ikilpatrick): Hook up invalidation based on these inputProperties. + } + + v8::Local<v8::Value> prototypeValue; + if (!v8Call(constructor->Get(context, v8String(isolate, "prototype")), prototypeValue)) + return; + + if (isUndefinedOrNull(prototypeValue)) { + exceptionState.throwTypeError("The 'prototype' object on the class does not exist."); + return; + } + + if (!prototypeValue->IsObject()) { + exceptionState.throwTypeError("The 'prototype' property on the class is not an object."); + return; + } + + v8::Local<v8::Object> prototype = v8::Local<v8::Object>::Cast(prototypeValue); + + v8::Local<v8::Value> paintValue; + if (!v8Call(prototype->Get(context, v8String(isolate, "paint")), paintValue)) + return; + + if (isUndefinedOrNull(paintValue)) { + exceptionState.throwTypeError("The 'paint' function on the prototype does not exist."); + return; + } + + if (!paintValue->IsFunction()) { + exceptionState.throwTypeError("The 'paint' property on the prototype is not a function."); + return; + } + + v8::Local<v8::Function> paint = v8::Local<v8::Function>::Cast(paintValue); + + RawPtr<CSSPaintDefinition> definition = CSSPaintDefinition::create(scriptController()->getScriptState(), constructor, paint); + m_paintDefinitions.set(name, definition); +} + +CSSPaintDefinition* PaintWorkletGlobalScope::findDefinition(const String& name) +{ + return m_paintDefinitions.get(name); +} + +DEFINE_TRACE(PaintWorkletGlobalScope) +{ + visitor->trace(m_paintDefinitions); + WorkletGlobalScope::trace(visitor); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h index fb48bccd..4c87e491 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
@@ -7,21 +7,33 @@ #include "bindings/core/v8/ScriptValue.h" #include "core/dom/ExecutionContext.h" +#include "modules/ModulesExport.h" #include "modules/worklet/WorkletGlobalScope.h" namespace blink { -class PaintWorkletGlobalScope : public WorkletGlobalScope { +class CSSPaintDefinition; +class ExceptionState; + +class MODULES_EXPORT PaintWorkletGlobalScope : public WorkletGlobalScope { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<PaintWorkletGlobalScope> create(LocalFrame*, const KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*); + static RawPtr<PaintWorkletGlobalScope> create(LocalFrame*, const KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*); ~PaintWorkletGlobalScope() override; + void dispose() override; bool isPaintWorkletGlobalScope() const final { return true; } - void registerPaint(const String&, ScriptValue) { } + void registerPaint(const String& name, const ScriptValue& ctor, ExceptionState&); + + CSSPaintDefinition* findDefinition(const String& name); + + DECLARE_VIRTUAL_TRACE(); private: PaintWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*); + + typedef HeapHashMap<String, Member<CSSPaintDefinition>> DefinitionMap; + DefinitionMap m_paintDefinitions; }; DEFINE_TYPE_CASTS(PaintWorkletGlobalScope, ExecutionContext, context, context->isPaintWorkletGlobalScope(), context.isPaintWorkletGlobalScope());
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.idl b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.idl index ee716fa..b83498b 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.idl +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.idl
@@ -8,7 +8,7 @@ Exposed=PaintWorklet, Global=(Worklet,PaintWorklet), RuntimeEnabled=CSSPaintAPI, - WillBeGarbageCollected, + GarbageCollected, ] interface PaintWorkletGlobalScope : WorkletGlobalScope { - void registerPaint(DOMString name, Function paintCtor); + [RaisesException] void registerPaint(DOMString name, Function paintCtor); };
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp new file mode 100644 index 0000000..8a23cae2 --- /dev/null +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp
@@ -0,0 +1,80 @@ +// 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. + +#include "modules/csspaint/PaintWorklet.h" + +#include "bindings/core/v8/ScriptSourceCode.h" +#include "bindings/core/v8/V8GCController.h" +#include "bindings/core/v8/WorkerOrWorkletScriptController.h" +#include "core/frame/LocalFrame.h" +#include "core/testing/DummyPageHolder.h" +#include "modules/csspaint/CSSPaintDefinition.h" +#include "modules/csspaint/PaintWorkletGlobalScope.h" +#include "modules/csspaint/WindowPaintWorklet.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "wtf/OwnPtr.h" + +namespace blink { + +namespace { + +static void clearHandle(const v8::WeakCallbackInfo<ScopedPersistent<v8::Function>>& data) +{ + data.GetParameter()->clear(); +} + +} // namespace + +class PaintWorkletTest : public testing::Test { +public: + PaintWorkletTest() + : m_page(DummyPageHolder::create()) + { + } + + PaintWorklet* paintWorklet() + { + return WindowPaintWorklet::from(*m_page->frame().localDOMWindow()).paintWorklet(&m_page->document()); + } + +protected: + OwnPtr<DummyPageHolder> m_page; +}; + +TEST_F(PaintWorkletTest, GarbageCollectionOfCSSPaintDefinition) +{ + PaintWorkletGlobalScope* globalScope = toPaintWorkletGlobalScope(paintWorklet()->workletGlobalScope()); + globalScope->scriptController()->evaluate(ScriptSourceCode("registerPaint('foo', class { paint() { } });")); + + CSSPaintDefinition* definition = globalScope->findDefinition("foo"); + ASSERT(definition); + + v8::Isolate* isolate = globalScope->scriptController()->getScriptState()->isolate(); + ASSERT(isolate); + + // Set our ScopedPersistent to the paint function, and make weak. + ScopedPersistent<v8::Function> handle; + { + v8::HandleScope handleScope(isolate); + handle.set(isolate, definition->paintFunctionForTesting(isolate)); + handle.setWeak(&handle, clearHandle); + } + ASSERT(!handle.isEmpty()); + ASSERT(handle.isWeak()); + + // Run a GC, persistent shouldn't have been collected yet. + Heap::collectAllGarbage(); + V8GCController::collectAllGarbageForTesting(isolate); + ASSERT(!handle.isEmpty()); + + // Delete the page & associated objects. + m_page.clear(); + + // Run a GC, the persistent should have been collected. + Heap::collectAllGarbage(); + V8GCController::collectAllGarbageForTesting(isolate); + ASSERT(handle.isEmpty()); +} + +} // naespace blink
diff --git a/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.cpp b/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.cpp index 3e11656..0db67ca 100644 --- a/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.cpp +++ b/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.cpp
@@ -15,8 +15,6 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(WindowPaintWorklet); - const char* WindowPaintWorklet::supplementName() { return "WindowPaintWorklet"; @@ -25,10 +23,10 @@ // static WindowPaintWorklet& WindowPaintWorklet::from(LocalDOMWindow& window) { - WindowPaintWorklet* supplement = static_cast<WindowPaintWorklet*>(WillBeHeapSupplement<LocalDOMWindow>::from(window, supplementName())); + WindowPaintWorklet* supplement = static_cast<WindowPaintWorklet*>(HeapSupplement<LocalDOMWindow>::from(window, supplementName())); if (!supplement) { supplement = new WindowPaintWorklet(window); - provideTo(window, supplementName(), adoptPtrWillBeNoop(supplement)); + provideTo(window, supplementName(), supplement); } return *supplement; } @@ -49,7 +47,7 @@ DEFINE_TRACE(WindowPaintWorklet) { visitor->trace(m_paintWorklet); - WillBeHeapSupplement<LocalDOMWindow>::trace(visitor); + HeapSupplement<LocalDOMWindow>::trace(visitor); DOMWindowProperty::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.h b/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.h index c69127a2..7d663893d 100644 --- a/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.h +++ b/third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.h
@@ -6,6 +6,7 @@ #define WindowPaintWorklet_h #include "core/frame/DOMWindowProperty.h" +#include "modules/ModulesExport.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h" @@ -16,10 +17,8 @@ class PaintWorklet; class Worklet; -class WindowPaintWorklet final : public NoBaseWillBeGarbageCollected<WindowPaintWorklet>, public WillBeHeapSupplement<LocalDOMWindow>, public DOMWindowProperty { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WindowPaintWorklet); - DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(WindowPaintWorklet); - USING_FAST_MALLOC_WILL_BE_REMOVED(WindowPaintWorklet); +class MODULES_EXPORT WindowPaintWorklet final : public GarbageCollected<WindowPaintWorklet>, public HeapSupplement<LocalDOMWindow>, public DOMWindowProperty { + USING_GARBAGE_COLLECTED_MIXIN(WindowPaintWorklet); public: static WindowPaintWorklet& from(LocalDOMWindow&); static Worklet* paintWorklet(ExecutionContext*, DOMWindow&); @@ -31,7 +30,7 @@ explicit WindowPaintWorklet(LocalDOMWindow&); static const char* supplementName(); - mutable PersistentWillBeMember<PaintWorklet> m_paintWorklet; + mutable Member<PaintWorklet> m_paintWorklet; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/device_light/DeviceLightController.cpp b/third_party/WebKit/Source/modules/device_light/DeviceLightController.cpp index 200af36..1fed15f5 100644 --- a/third_party/WebKit/Source/modules/device_light/DeviceLightController.cpp +++ b/third_party/WebKit/Source/modules/device_light/DeviceLightController.cpp
@@ -31,10 +31,10 @@ DeviceLightController& DeviceLightController::from(Document& document) { - DeviceLightController* controller = static_cast<DeviceLightController*>(WillBeHeapSupplement<Document>::from(document, supplementName())); + DeviceLightController* controller = static_cast<DeviceLightController*>(HeapSupplement<Document>::from(document, supplementName())); if (!controller) { controller = new DeviceLightController(document); - WillBeHeapSupplement<Document>::provideTo(document, supplementName(), adoptPtrWillBeNoop(controller)); + HeapSupplement<Document>::provideTo(document, supplementName(), adoptPtrWillBeNoop(controller)); } return *controller; } @@ -54,7 +54,7 @@ DeviceLightDispatcher::instance().removeController(this); } -PassRefPtrWillBeRawPtr<Event> DeviceLightController::lastEvent() const +RawPtr<Event> DeviceLightController::lastEvent() const { return DeviceLightEvent::create(EventTypeNames::devicelight, DeviceLightDispatcher::instance().latestDeviceLightData()); @@ -74,7 +74,7 @@ DEFINE_TRACE(DeviceLightController) { DeviceSingleWindowEventController::trace(visitor); - WillBeHeapSupplement<Document>::trace(visitor); + HeapSupplement<Document>::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/device_light/DeviceLightController.h b/third_party/WebKit/Source/modules/device_light/DeviceLightController.h index 91f2ab0..b4fe665 100644 --- a/third_party/WebKit/Source/modules/device_light/DeviceLightController.h +++ b/third_party/WebKit/Source/modules/device_light/DeviceLightController.h
@@ -13,8 +13,8 @@ class Event; -class MODULES_EXPORT DeviceLightController final : public DeviceSingleWindowEventController, public WillBeHeapSupplement<Document> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeviceLightController); +class MODULES_EXPORT DeviceLightController final : public DeviceSingleWindowEventController, public HeapSupplement<Document> { + USING_GARBAGE_COLLECTED_MIXIN(DeviceLightController); public: ~DeviceLightController() override; @@ -32,7 +32,7 @@ bool hasLastData() override; // Inherited from DeviceSingleWindowEventController. - PassRefPtrWillBeRawPtr<Event> lastEvent() const override; + RawPtr<Event> lastEvent() const override; const AtomicString& eventTypeName() const override; bool isNullEvent(Event*) const override; };
diff --git a/third_party/WebKit/Source/modules/device_light/DeviceLightEvent.h b/third_party/WebKit/Source/modules/device_light/DeviceLightEvent.h index 87f85542..5ce9a066 100644 --- a/third_party/WebKit/Source/modules/device_light/DeviceLightEvent.h +++ b/third_party/WebKit/Source/modules/device_light/DeviceLightEvent.h
@@ -16,17 +16,17 @@ public: ~DeviceLightEvent() override; - static PassRefPtrWillBeRawPtr<DeviceLightEvent> create() + static RawPtr<DeviceLightEvent> create() { return adoptRefWillBeNoop(new DeviceLightEvent); } - static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& eventType, double value) + static RawPtr<DeviceLightEvent> create(const AtomicString& eventType, double value) { - return adoptRefWillBeNoop(new DeviceLightEvent(eventType, value)); + return new DeviceLightEvent(eventType, value); } - static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& eventType, const DeviceLightEventInit& initializer) + static RawPtr<DeviceLightEvent> create(const AtomicString& eventType, const DeviceLightEventInit& initializer) { - return adoptRefWillBeNoop(new DeviceLightEvent(eventType, initializer)); + return new DeviceLightEvent(eventType, initializer); } double value() const { return m_value; }
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp index ae0b3ae..06100c5 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp
@@ -36,10 +36,10 @@ DeviceMotionController& DeviceMotionController::from(Document& document) { - DeviceMotionController* controller = static_cast<DeviceMotionController*>(WillBeHeapSupplement<Document>::from(document, supplementName())); + DeviceMotionController* controller = static_cast<DeviceMotionController*>(HeapSupplement<Document>::from(document, supplementName())); if (!controller) { controller = new DeviceMotionController(document); - WillBeHeapSupplement<Document>::provideTo(document, supplementName(), adoptPtrWillBeNoop(controller)); + HeapSupplement<Document>::provideTo(document, supplementName(), adoptPtrWillBeNoop(controller)); } return *controller; } @@ -82,7 +82,7 @@ DeviceMotionDispatcher::instance().removeController(this); } -PassRefPtrWillBeRawPtr<Event> DeviceMotionController::lastEvent() const +RawPtr<Event> DeviceMotionController::lastEvent() const { return DeviceMotionEvent::create(EventTypeNames::devicemotion, DeviceMotionDispatcher::instance().latestDeviceMotionData()); } @@ -101,7 +101,7 @@ DEFINE_TRACE(DeviceMotionController) { DeviceSingleWindowEventController::trace(visitor); - WillBeHeapSupplement<Document>::trace(visitor); + HeapSupplement<Document>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.h b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.h index 5a45d76..a12bbec9 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.h +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.h
@@ -13,8 +13,8 @@ class Event; -class MODULES_EXPORT DeviceMotionController final : public DeviceSingleWindowEventController, public WillBeHeapSupplement<Document> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeviceMotionController); +class MODULES_EXPORT DeviceMotionController final : public DeviceSingleWindowEventController, public HeapSupplement<Document> { + USING_GARBAGE_COLLECTED_MIXIN(DeviceMotionController); public: ~DeviceMotionController() override; @@ -35,7 +35,7 @@ bool hasLastData() override; // Inherited from DeviceSingleWindowEventController. - PassRefPtrWillBeRawPtr<Event> lastEvent() const override; + RawPtr<Event> lastEvent() const override; const AtomicString& eventTypeName() const override; bool isNullEvent(Event*) const override; };
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.h b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.h index a613c60..f7cfe99 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.h +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.h
@@ -39,13 +39,13 @@ DEFINE_WRAPPERTYPEINFO(); public: ~DeviceMotionEvent() override; - static PassRefPtrWillBeRawPtr<DeviceMotionEvent> create() + static RawPtr<DeviceMotionEvent> create() { return adoptRefWillBeNoop(new DeviceMotionEvent); } - static PassRefPtrWillBeRawPtr<DeviceMotionEvent> create(const AtomicString& eventType, DeviceMotionData* deviceMotionData) + static RawPtr<DeviceMotionEvent> create(const AtomicString& eventType, DeviceMotionData* deviceMotionData) { - return adoptRefWillBeNoop(new DeviceMotionEvent(eventType, deviceMotionData)); + return new DeviceMotionEvent(eventType, deviceMotionData); } void initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceMotionData*); @@ -65,10 +65,10 @@ DeviceMotionEvent(); DeviceMotionEvent(const AtomicString& eventType, DeviceMotionData*); - PersistentWillBeMember<DeviceMotionData> m_deviceMotionData; - PersistentWillBeMember<DeviceAcceleration> m_acceleration; - PersistentWillBeMember<DeviceAcceleration> m_accelerationIncludingGravity; - PersistentWillBeMember<DeviceRotationRate> m_rotationRate; + Member<DeviceMotionData> m_deviceMotionData; + Member<DeviceAcceleration> m_acceleration; + Member<DeviceAcceleration> m_accelerationIncludingGravity; + Member<DeviceRotationRate> m_rotationRate; }; DEFINE_TYPE_CASTS(DeviceMotionEvent, Event, event, event->interfaceName() == EventNames::DeviceMotionEvent, event.interfaceName() == EventNames::DeviceMotionEvent);
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteController.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteController.cpp index cda7a481..f48a90f 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteController.cpp +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteController.cpp
@@ -29,10 +29,10 @@ DeviceOrientationAbsoluteController& DeviceOrientationAbsoluteController::from(Document& document) { - DeviceOrientationAbsoluteController* controller = static_cast<DeviceOrientationAbsoluteController*>(WillBeHeapSupplement<Document>::from(document, DeviceOrientationAbsoluteController::supplementName())); + DeviceOrientationAbsoluteController* controller = static_cast<DeviceOrientationAbsoluteController*>(HeapSupplement<Document>::from(document, DeviceOrientationAbsoluteController::supplementName())); if (!controller) { controller = new DeviceOrientationAbsoluteController(document); - WillBeHeapSupplement<Document>::provideTo(document, DeviceOrientationAbsoluteController::supplementName(), adoptPtrWillBeNoop(controller)); + HeapSupplement<Document>::provideTo(document, DeviceOrientationAbsoluteController::supplementName(), adoptPtrWillBeNoop(controller)); } return *controller; }
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp index 5a27c1f..f539c32 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp
@@ -43,10 +43,10 @@ DeviceOrientationController& DeviceOrientationController::from(Document& document) { - DeviceOrientationController* controller = static_cast<DeviceOrientationController*>(WillBeHeapSupplement<Document>::from(document, supplementName())); + DeviceOrientationController* controller = static_cast<DeviceOrientationController*>(HeapSupplement<Document>::from(document, supplementName())); if (!controller) { controller = new DeviceOrientationController(document); - WillBeHeapSupplement<Document>::provideTo(document, supplementName(), adoptPtrWillBeNoop(controller)); + HeapSupplement<Document>::provideTo(document, supplementName(), adoptPtrWillBeNoop(controller)); } return *controller; } @@ -94,7 +94,7 @@ dispatcherInstance().removeController(this); } -PassRefPtrWillBeRawPtr<Event> DeviceOrientationController::lastEvent() const +RawPtr<Event> DeviceOrientationController::lastEvent() const { return DeviceOrientationEvent::create(eventTypeName(), lastData()); } @@ -135,7 +135,7 @@ { visitor->trace(m_overrideOrientationData); DeviceSingleWindowEventController::trace(visitor); - WillBeHeapSupplement<Document>::trace(visitor); + HeapSupplement<Document>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.h b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.h index b033d79..006f328 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.h +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.h
@@ -15,8 +15,8 @@ class DeviceOrientationDispatcher; class Event; -class MODULES_EXPORT DeviceOrientationController : public DeviceSingleWindowEventController, public WillBeHeapSupplement<Document> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeviceOrientationController); +class MODULES_EXPORT DeviceOrientationController : public DeviceSingleWindowEventController, public HeapSupplement<Document> { + USING_GARBAGE_COLLECTED_MIXIN(DeviceOrientationController); public: ~DeviceOrientationController() override; @@ -44,13 +44,13 @@ bool hasLastData() override; // Inherited from DeviceSingleWindowEventController. - PassRefPtrWillBeRawPtr<Event> lastEvent() const override; + RawPtr<Event> lastEvent() const override; const AtomicString& eventTypeName() const override; bool isNullEvent(Event*) const override; DeviceOrientationData* lastData() const; - PersistentWillBeMember<DeviceOrientationData> m_overrideOrientationData; + Member<DeviceOrientationData> m_overrideOrientationData; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.h b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.h index 545c2fbd..0592459 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.h +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.h
@@ -38,13 +38,13 @@ DEFINE_WRAPPERTYPEINFO(); public: ~DeviceOrientationEvent() override; - static PassRefPtrWillBeRawPtr<DeviceOrientationEvent> create() + static RawPtr<DeviceOrientationEvent> create() { return adoptRefWillBeNoop(new DeviceOrientationEvent); } - static PassRefPtrWillBeRawPtr<DeviceOrientationEvent> create(const AtomicString& eventType, DeviceOrientationData* orientation) + static RawPtr<DeviceOrientationEvent> create(const AtomicString& eventType, DeviceOrientationData* orientation) { - return adoptRefWillBeNoop(new DeviceOrientationEvent(eventType, orientation)); + return new DeviceOrientationEvent(eventType, orientation); } void initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, const Nullable<double>& alpha, const Nullable<double>& beta, const Nullable<double>& gamma, bool absolute); @@ -64,7 +64,7 @@ DeviceOrientationEvent(); DeviceOrientationEvent(const AtomicString& eventType, DeviceOrientationData*); - PersistentWillBeMember<DeviceOrientationData> m_orientation; + Member<DeviceOrientationData> m_orientation; }; DEFINE_TYPE_CASTS(DeviceOrientationEvent, Event, event, event->interfaceName() == EventNames::DeviceOrientationEvent, event.interfaceName() == EventNames::DeviceOrientationEvent);
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationInspectorAgent.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationInspectorAgent.cpp index da93116..c78a865 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationInspectorAgent.cpp +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationInspectorAgent.cpp
@@ -20,9 +20,9 @@ } // static -PassOwnPtrWillBeRawPtr<DeviceOrientationInspectorAgent> DeviceOrientationInspectorAgent::create(Page* page) +RawPtr<DeviceOrientationInspectorAgent> DeviceOrientationInspectorAgent::create(Page* page) { - return adoptPtrWillBeNoop(new DeviceOrientationInspectorAgent(*page)); + return new DeviceOrientationInspectorAgent(*page); } DeviceOrientationInspectorAgent::~DeviceOrientationInspectorAgent()
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationInspectorAgent.h b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationInspectorAgent.h index 4c8a301..f550a84 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationInspectorAgent.h +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationInspectorAgent.h
@@ -18,7 +18,7 @@ class MODULES_EXPORT DeviceOrientationInspectorAgent final : public InspectorBaseAgent<DeviceOrientationInspectorAgent, protocol::Frontend::DeviceOrientation>, public protocol::Backend::DeviceOrientation { WTF_MAKE_NONCOPYABLE(DeviceOrientationInspectorAgent); public: - static PassOwnPtrWillBeRawPtr<DeviceOrientationInspectorAgent> create(Page*); + static RawPtr<DeviceOrientationInspectorAgent> create(Page*); ~DeviceOrientationInspectorAgent() override; DECLARE_VIRTUAL_TRACE(); @@ -35,7 +35,7 @@ private: explicit DeviceOrientationInspectorAgent(Page&); DeviceOrientationController& controller(); - RawPtrWillBeMember<Page> m_page; + Member<Page> m_page; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp index 0d72eb6..07da456 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
@@ -46,7 +46,7 @@ void setFailed(ExceptionCode, const String& errorMessage); // Keep media element alive until promise is fulfilled - RefPtrWillBeMember<HTMLMediaElement> m_element; + Member<HTMLMediaElement> m_element; Member<MediaKeys> m_newMediaKeys; bool m_madeReservation; Timer<SetMediaKeysHandler> m_timer; @@ -300,7 +300,7 @@ HTMLMediaElementEncryptedMedia& HTMLMediaElementEncryptedMedia::from(HTMLMediaElement& element) { - HTMLMediaElementEncryptedMedia* supplement = static_cast<HTMLMediaElementEncryptedMedia*>(WillBeHeapSupplement<HTMLMediaElement>::from(element, supplementName())); + HTMLMediaElementEncryptedMedia* supplement = static_cast<HTMLMediaElementEncryptedMedia*>(HeapSupplement<HTMLMediaElement>::from(element, supplementName())); if (!supplement) { supplement = new HTMLMediaElementEncryptedMedia(element); provideTo(element, supplementName(), adoptPtrWillBeNoop(supplement)); @@ -341,7 +341,7 @@ } // Create a MediaEncryptedEvent for WD EME. -static PassRefPtrWillBeRawPtr<Event> createEncryptedEvent(WebEncryptedMediaInitDataType initDataType, const unsigned char* initData, unsigned initDataLength) +static RawPtr<Event> createEncryptedEvent(WebEncryptedMediaInitDataType initDataType, const unsigned char* initData, unsigned initDataLength) { MediaEncryptedEventInit initializer; initializer.setInitDataType(EncryptedMediaUtils::convertFromInitDataType(initDataType)); @@ -356,7 +356,7 @@ { WTF_LOG(Media, "HTMLMediaElementEncryptedMedia::encrypted"); - RefPtrWillBeRawPtr<Event> event; + RawPtr<Event> event; if (m_mediaElement->isMediaDataCORSSameOrigin(m_mediaElement->getExecutionContext()->getSecurityOrigin())) { event = createEncryptedEvent(initDataType, initData, initDataLength); } else { @@ -382,7 +382,7 @@ // 2. If the media element's waiting for key value is false, queue a task // to fire a simple event named waitingforkey at the media element. if (!m_isWaitingForKey) { - RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::waitingforkey); + RawPtr<Event> event = Event::create(EventTypeNames::waitingforkey); event->setTarget(m_mediaElement); m_mediaElement->scheduleEvent(event.release()); } @@ -413,7 +413,7 @@ { visitor->trace(m_mediaElement); visitor->trace(m_mediaKeys); - WillBeHeapSupplement<HTMLMediaElement>::trace(visitor); + HeapSupplement<HTMLMediaElement>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h index 7d4682a..6cf20eb 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h
@@ -24,9 +24,8 @@ class WebContentDecryptionModule; class WebMediaPlayer; -class MODULES_EXPORT HTMLMediaElementEncryptedMedia final : public NoBaseWillBeGarbageCollectedFinalized<HTMLMediaElementEncryptedMedia>, public WillBeHeapSupplement<HTMLMediaElement>, public WebMediaPlayerEncryptedMediaClient { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementEncryptedMedia); - USING_FAST_MALLOC_WILL_BE_REMOVED(HTMLMediaElementEncryptedMedia); +class MODULES_EXPORT HTMLMediaElementEncryptedMedia final : public GarbageCollectedFinalized<HTMLMediaElementEncryptedMedia>, public HeapSupplement<HTMLMediaElement>, public WebMediaPlayerEncryptedMediaClient { + USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementEncryptedMedia); public: static MediaKeys* mediaKeys(HTMLMediaElement&); static ScriptPromise setMediaKeys(ScriptState*, HTMLMediaElement&, MediaKeys*); @@ -51,10 +50,10 @@ HTMLMediaElementEncryptedMedia(HTMLMediaElement&); // EventTarget - bool setAttributeEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener>); + bool setAttributeEventListener(const AtomicString& eventType, RawPtr<EventListener>); EventListener* getAttributeEventListener(const AtomicString& eventType); - RawPtrWillBeMember<HTMLMediaElement> m_mediaElement; + Member<HTMLMediaElement> m_mediaElement; // Internal values specified by the EME spec: // http://w3c.github.io/encrypted-media/#idl-def-HTMLMediaElement @@ -64,7 +63,7 @@ bool m_isWaitingForKey; bool m_isAttachingMediaKeys; - PersistentWillBeMember<MediaKeys> m_mediaKeys; + Member<MediaKeys> m_mediaKeys; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaEncryptedEvent.h b/third_party/WebKit/Source/modules/encryptedmedia/MediaEncryptedEvent.h index 30bbb24..fa1557b6 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaEncryptedEvent.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaEncryptedEvent.h
@@ -36,14 +36,14 @@ public: ~MediaEncryptedEvent() override; - static PassRefPtrWillBeRawPtr<MediaEncryptedEvent> create() + static RawPtr<MediaEncryptedEvent> create() { return adoptRefWillBeNoop(new MediaEncryptedEvent); } - static PassRefPtrWillBeRawPtr<MediaEncryptedEvent> create(const AtomicString& type, const MediaEncryptedEventInit& initializer) + static RawPtr<MediaEncryptedEvent> create(const AtomicString& type, const MediaEncryptedEventInit& initializer) { - return adoptRefWillBeNoop(new MediaEncryptedEvent(type, initializer)); + return new MediaEncryptedEvent(type, initializer); } const AtomicString& interfaceName() const override;
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.h b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.h index 29666c0c..2986057 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.h
@@ -39,14 +39,14 @@ public: ~MediaKeyMessageEvent() override; - static PassRefPtrWillBeRawPtr<MediaKeyMessageEvent> create() + static RawPtr<MediaKeyMessageEvent> create() { return adoptRefWillBeNoop(new MediaKeyMessageEvent); } - static PassRefPtrWillBeRawPtr<MediaKeyMessageEvent> create(const AtomicString& type, const MediaKeyMessageEventInit& initializer) + static RawPtr<MediaKeyMessageEvent> create(const AtomicString& type, const MediaKeyMessageEventInit& initializer) { - return adoptRefWillBeNoop(new MediaKeyMessageEvent(type, initializer)); + return new MediaKeyMessageEvent(type, initializer); } const AtomicString& interfaceName() const override;
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp index 560a1dbf..cebd227 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp
@@ -302,7 +302,7 @@ MediaKeySession* MediaKeySession::create(ScriptState* scriptState, MediaKeys* mediaKeys, WebEncryptedMediaSessionType sessionType) { - RefPtrWillBeRawPtr<MediaKeySession> session = new MediaKeySession(scriptState, mediaKeys, sessionType); + RawPtr<MediaKeySession> session = new MediaKeySession(scriptState, mediaKeys, sessionType); session->suspendIfNeeded(); return session.get(); } @@ -801,7 +801,7 @@ } init.setMessage(DOMArrayBuffer::create(static_cast<const void*>(message), messageLength)); - RefPtrWillBeRawPtr<MediaKeyMessageEvent> event = MediaKeyMessageEvent::create(EventTypeNames::message, init); + RawPtr<MediaKeyMessageEvent> event = MediaKeyMessageEvent::create(EventTypeNames::message, init); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release()); } @@ -869,7 +869,7 @@ // 5. Queue a task to fire a simple event named keystatuseschange // at the session. - RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::keystatuseschange); + RawPtr<Event> event = Event::create(EventTypeNames::keystatuseschange); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release());
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h index 77786c64..674729d 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h
@@ -66,7 +66,7 @@ , private WebContentDecryptionModuleSession::Client { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaKeySession); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession); + USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession); public: static MediaKeySession* create(ScriptState*, MediaKeys*, WebEncryptedMediaSessionType); ~MediaKeySession() override; @@ -119,7 +119,7 @@ // Called by LoadSessionResult when the session has been loaded. void finishLoad(); - OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; + Member<GenericEventQueue> m_asyncEventQueue; OwnPtr<WebContentDecryptionModuleSession> m_session; // Used to determine if MediaKeys is still active.
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.h b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.h index 6237c7b0..8541355 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.h
@@ -51,7 +51,7 @@ // References are held by JS and HTMLMediaElement. // The WebContentDecryptionModule has the same lifetime as this object. class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ActiveScriptWrappable, public ActiveDOMObject, public ScriptWrappable { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeys); + USING_GARBAGE_COLLECTED_MIXIN(MediaKeys); DEFINE_WRAPPERTYPEINFO(); public: static MediaKeys* create(ExecutionContext*, const WebVector<WebEncryptedMediaSessionType>& supportedSessionTypes, PassOwnPtr<WebContentDecryptionModule>); @@ -107,7 +107,7 @@ // before this object. This is due to WebMediaPlayerImpl (owned by // HTMLMediaElement) possibly having a pointer to Decryptor created // by WebContentDecryptionModuleImpl (owned by this object). - RawPtrWillBeWeakMember<HTMLMediaElement> m_mediaElement; + WeakMember<HTMLMediaElement> m_mediaElement; // Keep track of whether this object has been reserved by HTMLMediaElement // (i.e. a setMediaKeys operation is in progress). Destruction of this
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeysController.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeysController.cpp index e152f37..11531b9 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeysController.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeysController.cpp
@@ -26,7 +26,7 @@ void MediaKeysController::provideMediaKeysTo(Page& page, MediaKeysClient* client) { - MediaKeysController::provideTo(page, supplementName(), adoptPtrWillBeNoop(new MediaKeysController(client))); + MediaKeysController::provideTo(page, supplementName(), new MediaKeysController(client)); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeysController.h b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeysController.h index 08aa35da1..eebb3832f 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeysController.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeysController.h
@@ -14,16 +14,15 @@ class MediaKeysClient; class WebEncryptedMediaClient; -class MODULES_EXPORT MediaKeysController final : public NoBaseWillBeGarbageCollected<MediaKeysController>, public WillBeHeapSupplement<Page> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeysController); - USING_FAST_MALLOC_WILL_BE_REMOVED(MediaKeysController); +class MODULES_EXPORT MediaKeysController final : public GarbageCollected<MediaKeysController>, public HeapSupplement<Page> { + USING_GARBAGE_COLLECTED_MIXIN(MediaKeysController); public: WebEncryptedMediaClient* encryptedMediaClient(ExecutionContext*); static void provideMediaKeysTo(Page&, MediaKeysClient*); - static MediaKeysController* from(Page* page) { return static_cast<MediaKeysController*>(WillBeHeapSupplement<Page>::from(page, supplementName())); } + static MediaKeysController* from(Page* page) { return static_cast<MediaKeysController*>(HeapSupplement<Page>::from(page, supplementName())); } - DEFINE_INLINE_VIRTUAL_TRACE() { WillBeHeapSupplement<Page>::trace(visitor); } + DEFINE_INLINE_VIRTUAL_TRACE() { HeapSupplement<Page>::trace(visitor); } private: explicit MediaKeysController(MediaKeysClient*);
diff --git a/third_party/WebKit/Source/modules/fetch/Body.h b/third_party/WebKit/Source/modules/fetch/Body.h index 01dfe881..79064d06 100644 --- a/third_party/WebKit/Source/modules/fetch/Body.h +++ b/third_party/WebKit/Source/modules/fetch/Body.h
@@ -34,7 +34,7 @@ , public ActiveDOMObject { WTF_MAKE_NONCOPYABLE(Body); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Body); + USING_GARBAGE_COLLECTED_MIXIN(Body); public: explicit Body(ExecutionContext*); ~Body() override { }
diff --git a/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h b/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h index ef7fe14..20ad171 100644 --- a/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h +++ b/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h
@@ -91,7 +91,7 @@ class Bridge : public GarbageCollectedFinalized<Bridge> , public ActiveDOMObject { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Bridge); + USING_GARBAGE_COLLECTED_MIXIN(Bridge); public: Bridge(ExecutionContext* executionContext, PassOwnPtr<T> obj, PassRefPtr<MutexWrapper> mutex, CrossThreadHolder* holder) : ActiveDOMObject(executionContext)
diff --git a/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.cpp b/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.cpp index dc34185..9ad9ba5 100644 --- a/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.cpp +++ b/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.cpp
@@ -35,7 +35,7 @@ m_scriptState = ScriptState::create(v8::Context::New(isolate()), DOMWrapperWorld::create(isolate())); } if (m_initializationPolicy >= WithExecutionContext) { - m_executionContext = adoptRefWillBeNoop(new NullExecutionContext()); + m_executionContext = new NullExecutionContext(); } m_waitableEvent->signal(); }
diff --git a/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h b/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h index 745fba0..40e0567 100644 --- a/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h +++ b/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h
@@ -72,7 +72,7 @@ OwnPtr<WebThreadSupportingGC> m_thread; const InitializationPolicy m_initializationPolicy; OwnPtr<WaitableEvent> m_waitableEvent; - RefPtrWillBePersistent<NullExecutionContext> m_executionContext; + Persistent<NullExecutionContext> m_executionContext; OwnPtr<gin::IsolateHolder> m_isolateHolder; RefPtr<ScriptState> m_scriptState; };
diff --git a/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp b/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp index 7eb155d3..b72c4a6 100644 --- a/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp +++ b/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp
@@ -325,7 +325,7 @@ // Bound to the created thread. class SourceContext final : public GarbageCollectedFinalized<SourceContext>, public ActiveDOMObject, public WebDataConsumerHandle::Client { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceContext); + USING_GARBAGE_COLLECTED_MIXIN(SourceContext); public: SourceContext( PassRefPtr<TeeRootObject> root,
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp index e402fe9..5c6a490 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -175,7 +175,7 @@ Member<SRIVerifier> m_integrityVerifier; bool m_didFinishLoading; bool m_isIsolatedWorld; - RawPtrWillBeMember<ExecutionContext> m_executionContext; + Member<ExecutionContext> m_executionContext; }; FetchManager::Loader::Loader(ExecutionContext* executionContext, FetchManager* fetchManager, ScriptPromiseResolver* resolver, FetchRequestData* request, bool isIsolatedWorld)
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.h b/third_party/WebKit/Source/modules/fetch/FetchManager.h index dde767d..ec6ad5d 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchManager.h +++ b/third_party/WebKit/Source/modules/fetch/FetchManager.h
@@ -16,7 +16,7 @@ class ScriptState; class FetchManager final : public GarbageCollectedFinalized<FetchManager>, public ContextLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FetchManager); + USING_GARBAGE_COLLECTED_MIXIN(FetchManager); public: static FetchManager* create(ExecutionContext*); explicit FetchManager(ExecutionContext*);
diff --git a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp index 323b05d..46dda65 100644 --- a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp +++ b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp
@@ -18,15 +18,15 @@ namespace { template <typename T> -class GlobalFetchImpl final : public NoBaseWillBeGarbageCollectedFinalized<GlobalFetchImpl<T>>, public GlobalFetch::ScopedFetcher, public WillBeHeapSupplement<T> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(GlobalFetchImpl); +class GlobalFetchImpl final : public GarbageCollectedFinalized<GlobalFetchImpl<T>>, public GlobalFetch::ScopedFetcher, public HeapSupplement<T> { + USING_GARBAGE_COLLECTED_MIXIN(GlobalFetchImpl); public: - static WeakPtrWillBeRawPtr<ScopedFetcher> from(T& supplementable, ExecutionContext* executionContext) + static RawPtr<ScopedFetcher> from(T& supplementable, ExecutionContext* executionContext) { - GlobalFetchImpl* supplement = static_cast<GlobalFetchImpl*>(WillBeHeapSupplement<T>::from(supplementable, supplementName())); + GlobalFetchImpl* supplement = static_cast<GlobalFetchImpl*>(HeapSupplement<T>::from(supplementable, supplementName())); if (!supplement) { supplement = new GlobalFetchImpl(executionContext); - WillBeHeapSupplement<T>::provideTo(supplementable, supplementName(), adoptPtrWillBeNoop(supplement)); + HeapSupplement<T>::provideTo(supplementable, supplementName(), adoptPtrWillBeNoop(supplement)); } #if ENABLE(OILPAN) return supplement; @@ -55,7 +55,7 @@ { visitor->trace(m_fetchManager); ScopedFetcher::trace(visitor); - WillBeHeapSupplement<T>::trace(visitor); + HeapSupplement<T>::trace(visitor); } private: @@ -68,7 +68,7 @@ } static const char* supplementName() { return "GlobalFetch"; } - PersistentWillBeMember<FetchManager> m_fetchManager; + Member<FetchManager> m_fetchManager; #if !ENABLE(OILPAN) WeakPtrFactory<ScopedFetcher> m_weakFactory; #endif @@ -80,12 +80,12 @@ { } -WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from(DOMWindow& window) +RawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from(DOMWindow& window) { return GlobalFetchImpl<LocalDOMWindow>::from(toLocalDOMWindow(window), window.getExecutionContext()); } -WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from(WorkerGlobalScope& worker) +RawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from(WorkerGlobalScope& worker) { return GlobalFetchImpl<WorkerGlobalScope>::from(worker, worker.getExecutionContext()); }
diff --git a/third_party/WebKit/Source/modules/fetch/GlobalFetch.h b/third_party/WebKit/Source/modules/fetch/GlobalFetch.h index 7b0f51b..0f88cfe 100644 --- a/third_party/WebKit/Source/modules/fetch/GlobalFetch.h +++ b/third_party/WebKit/Source/modules/fetch/GlobalFetch.h
@@ -21,14 +21,14 @@ class GlobalFetch { STATIC_ONLY(GlobalFetch); public: - class MODULES_EXPORT ScopedFetcher : public WillBeGarbageCollectedMixin { + class MODULES_EXPORT ScopedFetcher : public GarbageCollectedMixin { public: virtual ~ScopedFetcher(); virtual ScriptPromise fetch(ScriptState*, const RequestInfo&, const Dictionary&, ExceptionState&) = 0; - static WeakPtrWillBeRawPtr<ScopedFetcher> from(DOMWindow&); - static WeakPtrWillBeRawPtr<ScopedFetcher> from(WorkerGlobalScope&); + static RawPtr<ScopedFetcher> from(DOMWindow&); + static RawPtr<ScopedFetcher> from(WorkerGlobalScope&); DECLARE_VIRTUAL_TRACE(); };
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h index 3eaecd9..0c83795a 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h +++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h
@@ -51,7 +51,7 @@ class MODULES_EXPORT DOMFileSystem final : public DOMFileSystemBase, public ScriptWrappable, public ActiveScriptWrappable, public ActiveDOMObject { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMFileSystem); + USING_GARBAGE_COLLECTED_MIXIN(DOMFileSystem); public: static DOMFileSystem* create(ExecutionContext*, const String& name, FileSystemType, const KURL& rootURL);
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.h b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.h index 5fa5680..5473f5d2 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.h +++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.h
@@ -125,7 +125,7 @@ friend class DOMFileSystemBaseTest; friend class DOMFileSystemSync; - RawPtrWillBeMember<ExecutionContext> m_context; + Member<ExecutionContext> m_context; String m_name; FileSystemType m_type; KURL m_filesystemRootURL;
diff --git a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h index c38196c5..a65a8c5 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h +++ b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h
@@ -75,7 +75,7 @@ Persistent<ErrorCallback> m_errorCallback; Persistent<DOMFileSystemBase> m_fileSystem; - RefPtrWillBePersistent<ExecutionContext> m_executionContext; + Persistent<ExecutionContext> m_executionContext; int m_asyncOperationId; };
diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriter.h b/third_party/WebKit/Source/modules/filesystem/FileWriter.h index 3747cc2..e92f98a 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileWriter.h +++ b/third_party/WebKit/Source/modules/filesystem/FileWriter.h
@@ -59,7 +59,7 @@ , public WebFileWriterClient { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(FileWriterBase); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FileWriter); + USING_GARBAGE_COLLECTED_MIXIN(FileWriter); public: static FileWriter* create(ExecutionContext*); ~FileWriter() override;
diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriterBase.h b/third_party/WebKit/Source/modules/filesystem/FileWriterBase.h index ecf5ef1..89d97d9 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileWriterBase.h +++ b/third_party/WebKit/Source/modules/filesystem/FileWriterBase.h
@@ -39,7 +39,7 @@ class WebFileWriter; -class FileWriterBase : public RefCountedGarbageCollectedWillBeNoBase<FileWriterBase>, public WillBeGarbageCollectedMixin { +class FileWriterBase : public GarbageCollectedMixin { public: virtual ~FileWriterBase(); void initialize(PassOwnPtr<WebFileWriter>, long long length);
diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriterSync.h b/third_party/WebKit/Source/modules/filesystem/FileWriterSync.h index d88a15ec..ccb41acf 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileWriterSync.h +++ b/third_party/WebKit/Source/modules/filesystem/FileWriterSync.h
@@ -52,7 +52,7 @@ , public ScriptWrappable , public WebFileWriterClient { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FileWriterSync); + USING_GARBAGE_COLLECTED_MIXIN(FileWriterSync); public: static FileWriterSync* create() {
diff --git a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp index 3a5a7b73..b34bd45 100644 --- a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp +++ b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp
@@ -74,9 +74,9 @@ OwnPtr<AsyncFileSystemCallbacks> m_callbacks; }; -PassOwnPtrWillBeRawPtr<LocalFileSystem> LocalFileSystem::create(PassOwnPtr<FileSystemClient> client) +RawPtr<LocalFileSystem> LocalFileSystem::create(PassOwnPtr<FileSystemClient> client) { - return adoptPtrWillBeNoop(new LocalFileSystem(client)); + return new LocalFileSystem(client); } LocalFileSystem::~LocalFileSystem() @@ -85,7 +85,7 @@ void LocalFileSystem::resolveURL(ExecutionContext* context, const KURL& fileSystemURL, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - RefPtrWillBeRawPtr<ExecutionContext> contextPtr(context); + RawPtr<ExecutionContext> contextPtr(context); CallbackWrapper* wrapper = new CallbackWrapper(callbacks); requestFileSystemAccessInternal(context, bind(&LocalFileSystem::resolveURLInternal, this, contextPtr, fileSystemURL, wrapper), @@ -94,7 +94,7 @@ void LocalFileSystem::requestFileSystem(ExecutionContext* context, FileSystemType type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - RefPtrWillBeRawPtr<ExecutionContext> contextPtr(context); + RawPtr<ExecutionContext> contextPtr(context); CallbackWrapper* wrapper = new CallbackWrapper(callbacks); requestFileSystemAccessInternal(context, bind(&LocalFileSystem::fileSystemAllowedInternal, this, contextPtr, type, wrapper), @@ -103,7 +103,7 @@ void LocalFileSystem::deleteFileSystem(ExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - RefPtrWillBeRawPtr<ExecutionContext> contextPtr(context); + RawPtr<ExecutionContext> contextPtr(context); ASSERT(context); ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument()); @@ -139,21 +139,21 @@ } void LocalFileSystem::fileSystemNotAvailable( - PassRefPtrWillBeRawPtr<ExecutionContext> context, + RawPtr<ExecutionContext> context, CallbackWrapper* callbacks) { context->postTask(BLINK_FROM_HERE, createSameThreadTask(&reportFailure, callbacks->release(), FileError::ABORT_ERR)); } void LocalFileSystem::fileSystemNotAllowedInternal( - PassRefPtrWillBeRawPtr<ExecutionContext> context, + RawPtr<ExecutionContext> context, CallbackWrapper* callbacks) { context->postTask(BLINK_FROM_HERE, createSameThreadTask(&reportFailure, callbacks->release(), FileError::ABORT_ERR)); } void LocalFileSystem::fileSystemAllowedInternal( - PassRefPtrWillBeRawPtr<ExecutionContext> context, + RawPtr<ExecutionContext> context, FileSystemType type, CallbackWrapper* callbacks) { @@ -167,7 +167,7 @@ } void LocalFileSystem::resolveURLInternal( - PassRefPtrWillBeRawPtr<ExecutionContext> context, + RawPtr<ExecutionContext> context, const KURL& fileSystemURL, CallbackWrapper* callbacks) { @@ -179,7 +179,7 @@ } void LocalFileSystem::deleteFileSystemInternal( - PassRefPtrWillBeRawPtr<ExecutionContext> context, + RawPtr<ExecutionContext> context, FileSystemType type, CallbackWrapper* callbacks) { @@ -204,11 +204,11 @@ LocalFileSystem* LocalFileSystem::from(ExecutionContext& context) { if (context.isDocument()) - return static_cast<LocalFileSystem*>(WillBeHeapSupplement<LocalFrame>::from(toDocument(context).frame(), supplementName())); + return static_cast<LocalFileSystem*>(HeapSupplement<LocalFrame>::from(toDocument(context).frame(), supplementName())); WorkerClients* clients = toWorkerGlobalScope(context).clients(); ASSERT(clients); - return static_cast<LocalFileSystem*>(WillBeHeapSupplement<WorkerClients>::from(clients, supplementName())); + return static_cast<LocalFileSystem*>(HeapSupplement<WorkerClients>::from(clients, supplementName())); } void provideLocalFileSystemTo(LocalFrame& frame, PassOwnPtr<FileSystemClient> client)
diff --git a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.h b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.h index a5a8e0c..e4ac00e 100644 --- a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.h +++ b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.h
@@ -47,12 +47,11 @@ class LocalFrame; class WebFileSystem; -class LocalFileSystem final : public NoBaseWillBeGarbageCollectedFinalized<LocalFileSystem>, public WillBeHeapSupplement<LocalFrame>, public WillBeHeapSupplement<WorkerClients> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LocalFileSystem); +class LocalFileSystem final : public GarbageCollectedFinalized<LocalFileSystem>, public HeapSupplement<LocalFrame>, public HeapSupplement<WorkerClients> { + USING_GARBAGE_COLLECTED_MIXIN(LocalFileSystem); WTF_MAKE_NONCOPYABLE(LocalFileSystem); - USING_FAST_MALLOC_WILL_BE_REMOVED(LocalFileSystem); public: - static PassOwnPtrWillBeRawPtr<LocalFileSystem> create(PassOwnPtr<FileSystemClient>); + static RawPtr<LocalFileSystem> create(PassOwnPtr<FileSystemClient>); virtual ~LocalFileSystem(); void resolveURL(ExecutionContext*, const KURL&, PassOwnPtr<AsyncFileSystemCallbacks>); @@ -66,8 +65,8 @@ DEFINE_INLINE_VIRTUAL_TRACE() { - WillBeHeapSupplement<LocalFrame>::trace(visitor); - WillBeHeapSupplement<WorkerClients>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<WorkerClients>::trace(visitor); } protected: @@ -76,11 +75,11 @@ private: WebFileSystem* fileSystem() const; void requestFileSystemAccessInternal(ExecutionContext*, PassOwnPtr<SameThreadClosure> allowed, PassOwnPtr<SameThreadClosure> denied); - void fileSystemNotAvailable(PassRefPtrWillBeRawPtr<ExecutionContext>, CallbackWrapper*); - void fileSystemNotAllowedInternal(PassRefPtrWillBeRawPtr<ExecutionContext>, CallbackWrapper*); - void fileSystemAllowedInternal(PassRefPtrWillBeRawPtr<ExecutionContext>, FileSystemType, CallbackWrapper*); - void resolveURLInternal(PassRefPtrWillBeRawPtr<ExecutionContext>, const KURL&, CallbackWrapper*); - void deleteFileSystemInternal(PassRefPtrWillBeRawPtr<ExecutionContext>, FileSystemType, CallbackWrapper*); + void fileSystemNotAvailable(RawPtr<ExecutionContext>, CallbackWrapper*); + void fileSystemNotAllowedInternal(RawPtr<ExecutionContext>, CallbackWrapper*); + void fileSystemAllowedInternal(RawPtr<ExecutionContext>, FileSystemType, CallbackWrapper*); + void resolveURLInternal(RawPtr<ExecutionContext>, const KURL&, CallbackWrapper*); + void deleteFileSystemInternal(RawPtr<ExecutionContext>, FileSystemType, CallbackWrapper*); OwnPtr<FileSystemClient> m_client; };
diff --git a/third_party/WebKit/Source/modules/gamepad/GamepadEvent.h b/third_party/WebKit/Source/modules/gamepad/GamepadEvent.h index b12e555..cb062f2 100644 --- a/third_party/WebKit/Source/modules/gamepad/GamepadEvent.h +++ b/third_party/WebKit/Source/modules/gamepad/GamepadEvent.h
@@ -14,17 +14,17 @@ class GamepadEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<GamepadEvent> create() + static RawPtr<GamepadEvent> create() { return adoptRefWillBeNoop(new GamepadEvent); } - static PassRefPtrWillBeRawPtr<GamepadEvent> create(const AtomicString& type, bool canBubble, bool cancelable, Gamepad* gamepad) + static RawPtr<GamepadEvent> create(const AtomicString& type, bool canBubble, bool cancelable, Gamepad* gamepad) { - return adoptRefWillBeNoop(new GamepadEvent(type, canBubble, cancelable, gamepad)); + return new GamepadEvent(type, canBubble, cancelable, gamepad); } - static PassRefPtrWillBeRawPtr<GamepadEvent> create(const AtomicString& type, const GamepadEventInit& initializer) + static RawPtr<GamepadEvent> create(const AtomicString& type, const GamepadEventInit& initializer) { - return adoptRefWillBeNoop(new GamepadEvent(type, initializer)); + return new GamepadEvent(type, initializer); } ~GamepadEvent() override; @@ -39,7 +39,7 @@ GamepadEvent(const AtomicString& type, bool canBubble, bool cancelable, Gamepad*); GamepadEvent(const AtomicString&, const GamepadEventInit&); - PersistentWillBeMember<Gamepad> m_gamepad; + Member<Gamepad> m_gamepad; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/geofencing/GeofencingEvent.h b/third_party/WebKit/Source/modules/geofencing/GeofencingEvent.h index 01c152e..2f4cfc7e 100644 --- a/third_party/WebKit/Source/modules/geofencing/GeofencingEvent.h +++ b/third_party/WebKit/Source/modules/geofencing/GeofencingEvent.h
@@ -20,14 +20,14 @@ class MODULES_EXPORT GeofencingEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<GeofencingEvent> create() + static RawPtr<GeofencingEvent> create() { return adoptRefWillBeNoop(new GeofencingEvent); } - static PassRefPtrWillBeRawPtr<GeofencingEvent> create(const AtomicString& type, const String& id, GeofencingRegion* region) + static RawPtr<GeofencingEvent> create(const AtomicString& type, const String& id, GeofencingRegion* region) { - return adoptRefWillBeNoop(new GeofencingEvent(type, id, region)); + return new GeofencingEvent(type, id, region); } ~GeofencingEvent() override; @@ -43,7 +43,7 @@ GeofencingEvent(); GeofencingEvent(const AtomicString& type, const String& id, GeofencingRegion*); String m_id; - PersistentWillBeMember<GeofencingRegion> m_region; + Member<GeofencingRegion> m_region; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/geolocation/Geolocation.h b/third_party/WebKit/Source/modules/geolocation/Geolocation.h index e4aed04..6518b95 100644 --- a/third_party/WebKit/Source/modules/geolocation/Geolocation.h +++ b/third_party/WebKit/Source/modules/geolocation/Geolocation.h
@@ -52,7 +52,7 @@ , public ScriptWrappable , public ActiveDOMObject { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Geolocation); + USING_GARBAGE_COLLECTED_MIXIN(Geolocation); public: static Geolocation* create(ExecutionContext*); ~Geolocation() override;
diff --git a/third_party/WebKit/Source/modules/geolocation/GeolocationClient.h b/third_party/WebKit/Source/modules/geolocation/GeolocationClient.h index 4c90d56..f0314e0 100644 --- a/third_party/WebKit/Source/modules/geolocation/GeolocationClient.h +++ b/third_party/WebKit/Source/modules/geolocation/GeolocationClient.h
@@ -36,8 +36,7 @@ class GeolocationPosition; class LocalFrame; -class GeolocationClient : public NoBaseWillBeGarbageCollectedFinalized<GeolocationClient> { - USING_FAST_MALLOC_WILL_BE_REMOVED(GeolocationClient); +class GeolocationClient : public GarbageCollectedFinalized<GeolocationClient> { public: virtual ~GeolocationClient() { }
diff --git a/third_party/WebKit/Source/modules/geolocation/GeolocationController.cpp b/third_party/WebKit/Source/modules/geolocation/GeolocationController.cpp index 88a65026..b399325b 100644 --- a/third_party/WebKit/Source/modules/geolocation/GeolocationController.cpp +++ b/third_party/WebKit/Source/modules/geolocation/GeolocationController.cpp
@@ -73,9 +73,9 @@ #endif } -PassOwnPtrWillBeRawPtr<GeolocationController> GeolocationController::create(LocalFrame& frame, GeolocationClient* client) +RawPtr<GeolocationController> GeolocationController::create(LocalFrame& frame, GeolocationClient* client) { - return adoptPtrWillBeNoop(new GeolocationController(frame, client)); + return new GeolocationController(frame, client); } void GeolocationController::addObserver(Geolocation* observer, bool enableHighAccuracy) @@ -187,13 +187,13 @@ visitor->trace(m_lastPosition); visitor->trace(m_observers); visitor->trace(m_highAccuracyObservers); - WillBeHeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); PageLifecycleObserver::trace(visitor); } void provideGeolocationTo(LocalFrame& frame, GeolocationClient* client) { - WillBeHeapSupplement<LocalFrame>::provideTo(frame, GeolocationController::supplementName(), GeolocationController::create(frame, client)); + HeapSupplement<LocalFrame>::provideTo(frame, GeolocationController::supplementName(), GeolocationController::create(frame, client)); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/geolocation/GeolocationController.h b/third_party/WebKit/Source/modules/geolocation/GeolocationController.h index 6b6f2a0..dac3c16 100644 --- a/third_party/WebKit/Source/modules/geolocation/GeolocationController.h +++ b/third_party/WebKit/Source/modules/geolocation/GeolocationController.h
@@ -40,14 +40,13 @@ class GeolocationError; class GeolocationPosition; -class MODULES_EXPORT GeolocationController : public NoBaseWillBeGarbageCollectedFinalized<GeolocationController>, public WillBeHeapSupplement<LocalFrame>, public PageLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(GeolocationController); +class MODULES_EXPORT GeolocationController : public GarbageCollectedFinalized<GeolocationController>, public HeapSupplement<LocalFrame>, public PageLifecycleObserver { + USING_GARBAGE_COLLECTED_MIXIN(GeolocationController); WTF_MAKE_NONCOPYABLE(GeolocationController); - USING_FAST_MALLOC_WILL_BE_REMOVED(GeolocationController); public: virtual ~GeolocationController(); - static PassOwnPtrWillBeRawPtr<GeolocationController> create(LocalFrame&, GeolocationClient*); + static RawPtr<GeolocationController> create(LocalFrame&, GeolocationClient*); void addObserver(Geolocation*, bool enableHighAccuracy); void removeObserver(Geolocation*); @@ -68,7 +67,7 @@ void pageVisibilityChanged() override; static const char* supplementName(); - static GeolocationController* from(LocalFrame* frame) { return static_cast<GeolocationController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); } + static GeolocationController* from(LocalFrame* frame) { return static_cast<GeolocationController*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); } // Inherited from Supplement. DECLARE_VIRTUAL_TRACE(); @@ -79,11 +78,11 @@ void startUpdatingIfNeeded(); void stopUpdatingIfNeeded(); - RawPtrWillBeMember<GeolocationClient> m_client; + Member<GeolocationClient> m_client; bool m_hasClientForTest; - PersistentWillBeMember<GeolocationPosition> m_lastPosition; - typedef PersistentHeapHashSetWillBeHeapHashSet<Member<Geolocation>> ObserversSet; + Member<GeolocationPosition> m_lastPosition; + typedef HeapHashSet<Member<Geolocation>> ObserversSet; // All observers; both those requesting high accuracy and those not. ObserversSet m_observers; ObserversSet m_highAccuracyObservers;
diff --git a/third_party/WebKit/Source/modules/geolocation/testing/GeolocationClientMock.h b/third_party/WebKit/Source/modules/geolocation/testing/GeolocationClientMock.h index f82dd8b..044acb3 100644 --- a/third_party/WebKit/Source/modules/geolocation/testing/GeolocationClientMock.h +++ b/third_party/WebKit/Source/modules/geolocation/testing/GeolocationClientMock.h
@@ -75,10 +75,10 @@ void clearError(); - typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<GeolocationController>> GeolocationControllers; + typedef HeapHashSet<WeakMember<GeolocationController>> GeolocationControllers; GeolocationControllers m_controllers; - PersistentWillBeMember<GeolocationPosition> m_lastPosition; + Member<GeolocationPosition> m_lastPosition; bool m_hasError; String m_errorMessage; Timer<GeolocationClientMock> m_controllerTimer; @@ -93,7 +93,7 @@ PermissionState m_permissionState; - typedef PersistentHeapHashSetWillBeHeapHashSet<Member<Geolocation>> GeolocationSet; + typedef HeapHashSet<Member<Geolocation>> GeolocationSet; GeolocationSet m_pendingPermissions; };
diff --git a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp index 7acc629..2943811 100644 --- a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp +++ b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
@@ -22,7 +22,7 @@ void ImageBitmapRenderingContext::setCanvasGetContextResult(RenderingContext& result) { - result.setImageBitmapRenderingContext(PassRefPtrWillBeRawPtr<ImageBitmapRenderingContext>(this)); + result.setImageBitmapRenderingContext(RawPtr<ImageBitmapRenderingContext>(this)); } void ImageBitmapRenderingContext::transferImageBitmap(ImageBitmap* imageBitmap) @@ -58,11 +58,11 @@ return true; } -PassOwnPtrWillBeRawPtr<CanvasRenderingContext> ImageBitmapRenderingContext::Factory::create(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document& document) +RawPtr<CanvasRenderingContext> ImageBitmapRenderingContext::Factory::create(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document& document) { if (!RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled()) return nullptr; - return adoptPtrWillBeNoop(new ImageBitmapRenderingContext(canvas, attrs, document)); + return new ImageBitmapRenderingContext(canvas, attrs, document); } void ImageBitmapRenderingContext::stop()
diff --git a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.h b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.h index 897ab83..d096fd8 100644 --- a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.h +++ b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.h
@@ -23,7 +23,7 @@ Factory() {} ~Factory() override {} - PassOwnPtrWillBeRawPtr<CanvasRenderingContext> create(HTMLCanvasElement*, const CanvasContextCreationAttributes&, Document&) override; + RawPtr<CanvasRenderingContext> create(HTMLCanvasElement*, const CanvasContextCreationAttributes&, Document&) override; CanvasRenderingContext::ContextType getContextType() const override { return CanvasRenderingContext::ContextImageBitmap; } void onError(HTMLCanvasElement*, const String& error) override { } };
diff --git a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.idl b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.idl index ac6f794a3..de9c5aa1 100644 --- a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.idl +++ b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.idl
@@ -5,7 +5,7 @@ [ RuntimeEnabled=ExperimentalCanvasFeatures, SetWrapperReferenceFrom=canvas, - WillBeGarbageCollected, + GarbageCollected, ] interface ImageBitmapRenderingContext { // back-reference to the canvas readonly attribute HTMLCanvasElement canvas;
diff --git a/third_party/WebKit/Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp b/third_party/WebKit/Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp index 99f26384..b474ba8 100644 --- a/third_party/WebKit/Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/DOMWindowIndexedDatabase.cpp
@@ -38,13 +38,11 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowIndexedDatabase); - DEFINE_TRACE(DOMWindowIndexedDatabase) { visitor->trace(m_window); visitor->trace(m_idbFactory); - WillBeHeapSupplement<LocalDOMWindow>::trace(visitor); + HeapSupplement<LocalDOMWindow>::trace(visitor); DOMWindowProperty::trace(visitor); } @@ -55,7 +53,7 @@ DOMWindowIndexedDatabase& DOMWindowIndexedDatabase::from(LocalDOMWindow& window) { - DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*>(WillBeHeapSupplement<LocalDOMWindow>::from(window, supplementName())); + DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*>(HeapSupplement<LocalDOMWindow>::from(window, supplementName())); if (!supplement) { supplement = new DOMWindowIndexedDatabase(window); provideTo(window, supplementName(), adoptPtrWillBeNoop(supplement));
diff --git a/third_party/WebKit/Source/modules/indexeddb/DOMWindowIndexedDatabase.h b/third_party/WebKit/Source/modules/indexeddb/DOMWindowIndexedDatabase.h index 5979256..f773b1ca 100644 --- a/third_party/WebKit/Source/modules/indexeddb/DOMWindowIndexedDatabase.h +++ b/third_party/WebKit/Source/modules/indexeddb/DOMWindowIndexedDatabase.h
@@ -35,10 +35,8 @@ class IDBFactory; class DOMWindow; -class DOMWindowIndexedDatabase final : public NoBaseWillBeGarbageCollected<DOMWindowIndexedDatabase>, public WillBeHeapSupplement<LocalDOMWindow>, public DOMWindowProperty { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMWindowIndexedDatabase); - DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowIndexedDatabase); - USING_FAST_MALLOC_WILL_BE_REMOVED(DOMWindowIndexedDatabase); +class DOMWindowIndexedDatabase final : public GarbageCollected<DOMWindowIndexedDatabase>, public HeapSupplement<LocalDOMWindow>, public DOMWindowProperty { + USING_GARBAGE_COLLECTED_MIXIN(DOMWindowIndexedDatabase); public: static DOMWindowIndexedDatabase& from(LocalDOMWindow&); @@ -55,8 +53,8 @@ IDBFactory* indexedDB(); static const char* supplementName(); - RawPtrWillBeMember<LocalDOMWindow> m_window; - PersistentWillBeMember<IDBFactory> m_idbFactory; + Member<LocalDOMWindow> m_window; + Member<IDBFactory> m_idbFactory; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBAny.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBAny.cpp index ef227b7..a842d040 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBAny.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBAny.cpp
@@ -122,7 +122,7 @@ return m_integer; } -IDBAny::IDBAny(PassRefPtrWillBeRawPtr<DOMStringList> value) +IDBAny::IDBAny(RawPtr<DOMStringList> value) : m_type(DOMStringListType) , m_domStringList(value) {
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBAny.h b/third_party/WebKit/Source/modules/indexeddb/IDBAny.h index 9ed6f6b..39c30dc 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBAny.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBAny.h
@@ -60,7 +60,7 @@ { return new IDBAny(idbObject); } - static IDBAny* create(PassRefPtrWillBeRawPtr<DOMStringList> domStringList) + static IDBAny* create(RawPtr<DOMStringList> domStringList) { return new IDBAny(domStringList); } @@ -110,7 +110,7 @@ private: explicit IDBAny(Type); - explicit IDBAny(PassRefPtrWillBeRawPtr<DOMStringList>); + explicit IDBAny(RawPtr<DOMStringList>); explicit IDBAny(IDBCursor*); explicit IDBAny(IDBDatabase*); explicit IDBAny(IDBIndex*); @@ -123,7 +123,7 @@ const Type m_type; // Only one of the following should ever be in use at any given time. - const RefPtrWillBeMember<DOMStringList> m_domStringList; + const Member<DOMStringList> m_domStringList; const Member<IDBCursor> m_idbCursor; const Member<IDBDatabase> m_idbDatabase; const Member<IDBIndex> m_idbIndex;
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp index d7f260a2..7d8dda6 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp
@@ -160,9 +160,9 @@ m_transactions.get(transactionId)->onComplete(); } -PassRefPtrWillBeRawPtr<DOMStringList> IDBDatabase::objectStoreNames() const +RawPtr<DOMStringList> IDBDatabase::objectStoreNames() const { - RefPtrWillBeRawPtr<DOMStringList> objectStoreNames = DOMStringList::create(DOMStringList::IndexedDB); + RawPtr<DOMStringList> objectStoreNames = DOMStringList::create(DOMStringList::IndexedDB); for (const auto& it : m_metadata.objectStores) objectStoreNames->append(it.value.name); objectStoreNames->sort(); @@ -378,7 +378,7 @@ enqueueEvent(IDBVersionChangeEvent::create(EventTypeNames::versionchange, oldVersion, newVersionNullable)); } -void IDBDatabase::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) +void IDBDatabase::enqueueEvent(RawPtr<Event> event) { ASSERT(!m_contextStopped); ASSERT(getExecutionContext()); @@ -388,7 +388,7 @@ m_enqueuedEvents.append(event); } -DispatchEventResult IDBDatabase::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) +DispatchEventResult IDBDatabase::dispatchEventInternal(RawPtr<Event> event) { IDB_TRACE("IDBDatabase::dispatchEvent"); if (m_contextStopped || !getExecutionContext())
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h index 7c75a91..d589d36 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h
@@ -59,7 +59,7 @@ , public ActiveScriptWrappable , public ActiveDOMObject { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(IDBDatabase); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBDatabase); + USING_GARBAGE_COLLECTED_MIXIN(IDBDatabase); DEFINE_WRAPPERTYPEINFO(); public: static IDBDatabase* create(ExecutionContext*, PassOwnPtr<WebIDBDatabase>, IDBDatabaseCallbacks*); @@ -75,7 +75,7 @@ // Implement the IDL const String& name() const { return m_metadata.name; } unsigned long long version() const { return m_metadata.version; } - PassRefPtrWillBeRawPtr<DOMStringList> objectStoreNames() const; + RawPtr<DOMStringList> objectStoreNames() const; IDBObjectStore* createObjectStore(const String& name, const IDBObjectStoreParameters& options, ExceptionState& exceptionState) { return createObjectStore(name, IDBKeyPath(options.keyPath()), options.autoIncrement(), exceptionState); } IDBTransaction* transaction(ScriptState*, const StringOrStringSequenceOrDOMStringList&, const String& mode, ExceptionState&); @@ -105,7 +105,7 @@ bool isClosePending() const { return m_closePending; } void forceClose(); const IDBDatabaseMetadata& metadata() const { return m_metadata; } - void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); + void enqueueEvent(RawPtr<Event>); int64_t findObjectStoreId(const String& name) const; bool containsObjectStore(const String& name) const @@ -138,7 +138,7 @@ protected: // EventTarget - DispatchEventResult dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) override; + DispatchEventResult dispatchEventInternal(RawPtr<Event>) override; private: IDBDatabase(ExecutionContext*, PassOwnPtr<WebIDBDatabase>, IDBDatabaseCallbacks*); @@ -156,7 +156,7 @@ // Keep track of the versionchange events waiting to be fired on this // database so that we can cancel them if the database closes. - WillBeHeapVector<RefPtrWillBeMember<Event>> m_enqueuedEvents; + HeapVector<Member<Event>> m_enqueuedEvents; Member<IDBDatabaseCallbacks> m_databaseCallbacks; };
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBEventDispatcher.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBEventDispatcher.cpp index 76d59497..76ca8bc0d5 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBEventDispatcher.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBEventDispatcher.cpp
@@ -33,7 +33,7 @@ namespace blink { -DispatchEventResult IDBEventDispatcher::dispatch(Event* event, WillBeHeapVector<RefPtrWillBeMember<EventTarget>>& eventTargets) +DispatchEventResult IDBEventDispatcher::dispatch(Event* event, HeapVector<Member<EventTarget>>& eventTargets) { size_t size = eventTargets.size(); ASSERT(size);
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBEventDispatcher.h b/third_party/WebKit/Source/modules/indexeddb/IDBEventDispatcher.h index 74abe65..cf49953 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBEventDispatcher.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBEventDispatcher.h
@@ -42,7 +42,7 @@ class IDBEventDispatcher { STATIC_ONLY(IDBEventDispatcher); public: - static DispatchEventResult dispatch(Event*, WillBeHeapVector<RefPtrWillBeMember<EventTarget>>&); // The target first and then its ancestors in order of how the event bubbles. + static DispatchEventResult dispatch(Event*, HeapVector<Member<EventTarget>>&); // The target first and then its ancestors in order of how the event bubbles. }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp index a0d8742..f5b9949 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp
@@ -75,10 +75,10 @@ return ScriptValue::from(scriptState, m_metadata.keyPath); } -PassRefPtrWillBeRawPtr<DOMStringList> IDBObjectStore::indexNames() const +RawPtr<DOMStringList> IDBObjectStore::indexNames() const { IDB_TRACE("IDBObjectStore::indexNames"); - RefPtrWillBeRawPtr<DOMStringList> indexNames = DOMStringList::create(DOMStringList::IndexedDB); + RawPtr<DOMStringList> indexNames = DOMStringList::create(DOMStringList::IndexedDB); for (const auto& it : m_metadata.indexes) indexNames->append(it.value.name); indexNames->sort(); @@ -416,9 +416,9 @@ // cursor success handlers are kept alive. class IndexPopulator final : public EventListener { public: - static PassRefPtrWillBeRawPtr<IndexPopulator> create(ScriptState* scriptState, IDBDatabase* database, int64_t transactionId, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata) + static RawPtr<IndexPopulator> create(ScriptState* scriptState, IDBDatabase* database, int64_t transactionId, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata) { - return adoptRefWillBeNoop(new IndexPopulator(scriptState, database, transactionId, objectStoreId, indexMetadata)); + return new IndexPopulator(scriptState, database, transactionId, objectStoreId, indexMetadata); } bool operator==(const EventListener& other) const override @@ -483,7 +483,7 @@ } RefPtr<ScriptState> m_scriptState; - PersistentWillBeMember<IDBDatabase> m_database; + Member<IDBDatabase> m_database; const int64_t m_transactionId; const int64_t m_objectStoreId; const IDBIndexMetadata m_indexMetadata; @@ -547,7 +547,7 @@ indexRequest->preventPropagation(); // This is kept alive by being the success handler of the request, which is in turn kept alive by the owning transaction. - RefPtrWillBeRawPtr<IndexPopulator> indexPopulator = IndexPopulator::create(scriptState, transaction()->db(), m_transaction->id(), id(), metadata); + RawPtr<IndexPopulator> indexPopulator = IndexPopulator::create(scriptState, transaction()->db(), m_transaction->id(), id(), metadata); indexRequest->setOnsuccess(indexPopulator); return index; }
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.h b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.h index abb60f2..3e114f1a 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.h
@@ -64,7 +64,7 @@ int64_t id() const { return m_metadata.id; } const String& name() const { return m_metadata.name; } ScriptValue keyPath(ScriptState*) const; - PassRefPtrWillBeRawPtr<DOMStringList> indexNames() const; + RawPtr<DOMStringList> indexNames() const; IDBTransaction* transaction() const { return m_transaction.get(); } bool autoIncrement() const { return m_metadata.autoIncrement; }
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp index d7569ae0..322d973 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp
@@ -162,7 +162,7 @@ return true; } -DispatchEventResult IDBOpenDBRequest::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) +DispatchEventResult IDBOpenDBRequest::dispatchEventInternal(RawPtr<Event> event) { // If the connection closed between onUpgradeNeeded and the delivery of the "success" event, // an "error" event should be fired instead.
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h index d752abd0..510f960 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h
@@ -58,7 +58,7 @@ bool shouldEnqueueEvent() const override; // EventTarget - DispatchEventResult dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) override; + DispatchEventResult dispatchEventInternal(RawPtr<Event>) override; private: IDBOpenDBRequest(ScriptState*, IDBDatabaseCallbacks*, int64_t transactionId, int64_t version);
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp index 0c88bf3a..37011949 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
@@ -240,7 +240,7 @@ if (!shouldEnqueueEvent()) return; - RefPtrWillBeRawPtr<DOMStringList> domStringList = DOMStringList::create(DOMStringList::IndexedDB); + RawPtr<DOMStringList> domStringList = DOMStringList::create(DOMStringList::IndexedDB); for (size_t i = 0; i < stringList.size(); ++i) domStringList->append(stringList[i]); onSuccessInternal(IDBAny::create(domStringList.release())); @@ -411,7 +411,7 @@ return ActiveDOMObject::getExecutionContext(); } -DispatchEventResult IDBRequest::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) +DispatchEventResult IDBRequest::dispatchEventInternal(RawPtr<Event> event) { IDB_TRACE("IDBRequest::dispatchEvent"); if (m_contextStopped || !getExecutionContext()) @@ -427,7 +427,7 @@ m_readyState = DONE; dequeueEvent(event.get()); - WillBeHeapVector<RefPtrWillBeMember<EventTarget>> targets; + HeapVector<Member<EventTarget>> targets; targets.append(this); if (m_transaction && !m_preventPropagation) { targets.append(m_transaction); @@ -510,7 +510,7 @@ m_readyState = PENDING; } -void IDBRequest::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) +void IDBRequest::enqueueEvent(RawPtr<Event> event) { ASSERT(m_readyState == PENDING || m_readyState == DONE);
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h index a99e4675..225122a 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h
@@ -61,7 +61,7 @@ , public ActiveDOMObject { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(IDBRequest); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBRequest); + USING_GARBAGE_COLLECTED_MIXIN(IDBRequest); public: static IDBRequest* create(ScriptState*, IDBAny* source, IDBTransaction*); ~IDBRequest() override; @@ -131,14 +131,14 @@ protected: IDBRequest(ScriptState*, IDBAny* source, IDBTransaction*); - void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); + void enqueueEvent(RawPtr<Event>); void dequeueEvent(Event*); virtual bool shouldEnqueueEvent() const; void onSuccessInternal(IDBAny*); void setResult(IDBAny*); // EventTarget - DispatchEventResult dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) override; + DispatchEventResult dispatchEventInternal(RawPtr<Event>) override; bool m_contextStopped = false; Member<IDBTransaction> m_transaction; @@ -156,7 +156,7 @@ Member<DOMException> m_error; bool m_hasPendingActivity = true; - WillBeHeapVector<RefPtrWillBeMember<Event>> m_enqueuedEvents; + HeapVector<Member<Event>> m_enqueuedEvents; // Only used if the result type will be a cursor. IndexedDB::CursorType m_cursorType = IndexedDB::CursorKeyAndValue;
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp index 97f8da18..3958588d 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp
@@ -58,7 +58,7 @@ void SetUp() override { - m_executionContext = adoptRefWillBeNoop(new NullExecutionContext()); + m_executionContext = new NullExecutionContext(); m_scope.getScriptState()->setExecutionContext(m_executionContext.get()); } @@ -74,7 +74,7 @@ private: V8TestingScope m_scope; - RefPtrWillBePersistent<ExecutionContext> m_executionContext; + Persistent<ExecutionContext> m_executionContext; }; TEST_F(IDBRequestTest, EventsAfterStopping)
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp index 508312da..0add9ce 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
@@ -339,12 +339,12 @@ return IndexedDBNames::readonly; } -PassRefPtrWillBeRawPtr<DOMStringList> IDBTransaction::objectStoreNames() const +RawPtr<DOMStringList> IDBTransaction::objectStoreNames() const { if (m_mode == WebIDBTransactionModeVersionChange) return m_database->objectStoreNames(); - RefPtrWillBeRawPtr<DOMStringList> objectStoreNames = DOMStringList::create(DOMStringList::IndexedDB); + RawPtr<DOMStringList> objectStoreNames = DOMStringList::create(DOMStringList::IndexedDB); for (const String& name : m_objectStoreNames) objectStoreNames->append(name); objectStoreNames->sort(); @@ -361,7 +361,7 @@ return ActiveDOMObject::getExecutionContext(); } -DispatchEventResult IDBTransaction::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) +DispatchEventResult IDBTransaction::dispatchEventInternal(RawPtr<Event> event) { IDB_TRACE("IDBTransaction::dispatchEvent"); if (m_contextStopped || !getExecutionContext()) { @@ -384,7 +384,7 @@ m_createdObjectStores.clear(); m_deletedObjectStores.clear(); - WillBeHeapVector<RefPtrWillBeMember<EventTarget>> targets; + HeapVector<Member<EventTarget>> targets; targets.append(this); targets.append(db()); @@ -411,7 +411,7 @@ abort(IGNORE_EXCEPTION); } -void IDBTransaction::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) +void IDBTransaction::enqueueEvent(RawPtr<Event> event) { DCHECK_NE(m_state, Finished) << "A finished transaction tried to enqueue an event of type " << event->type() << "."; if (m_contextStopped || !getExecutionContext())
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h index 01dcff4..b0f77bc 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h
@@ -54,7 +54,7 @@ , public ActiveScriptWrappable , public ActiveDOMObject { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(IDBTransaction); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBTransaction); + USING_GARBAGE_COLLECTED_MIXIN(IDBTransaction); DEFINE_WRAPPERTYPEINFO(); public: static IDBTransaction* create(ScriptState*, int64_t, const HashSet<String>& objectStoreNames, WebIDBTransactionMode, IDBDatabase*); @@ -76,7 +76,7 @@ // Implement the IDBTransaction IDL const String& mode() const; - PassRefPtrWillBeRawPtr<DOMStringList> objectStoreNames() const; + RawPtr<DOMStringList> objectStoreNames() const; IDBDatabase* db() const { return m_database.get(); } DOMException* error() const { return m_error; } IDBObjectStore* objectStore(const String& name, ExceptionState&); @@ -108,12 +108,12 @@ protected: // EventTarget - DispatchEventResult dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) override; + DispatchEventResult dispatchEventInternal(RawPtr<Event>) override; private: IDBTransaction(ScriptState*, int64_t, const HashSet<String>&, WebIDBTransactionMode, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata&); - void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); + void enqueueEvent(RawPtr<Event>); enum State { Inactive, // Created or started, but not in an event callback
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp index 4bafd6a..8fb436a6 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp
@@ -74,7 +74,7 @@ private: V8TestingScope m_scope; - RefPtrWillBePersistent<ExecutionContext> m_executionContext; + Persistent<ExecutionContext> m_executionContext; }; class FakeIDBDatabaseCallbacks final : public IDBDatabaseCallbacks {
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.h b/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.h index 3ac78ca1..e8156ab 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.h
@@ -42,17 +42,17 @@ class IDBVersionChangeEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create() + static RawPtr<IDBVersionChangeEvent> create() { - return adoptRefWillBeNoop(new IDBVersionChangeEvent()); + return new IDBVersionChangeEvent(); } - static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicString& eventType, unsigned long long oldVersion, const Nullable<unsigned long long>& newVersion, WebIDBDataLoss dataLoss = WebIDBDataLossNone, const String& dataLossMessage = String()) + static RawPtr<IDBVersionChangeEvent> create(const AtomicString& eventType, unsigned long long oldVersion, const Nullable<unsigned long long>& newVersion, WebIDBDataLoss dataLoss = WebIDBDataLossNone, const String& dataLossMessage = String()) { - return adoptRefWillBeNoop(new IDBVersionChangeEvent(eventType, oldVersion, newVersion, dataLoss, dataLossMessage)); + return new IDBVersionChangeEvent(eventType, oldVersion, newVersion, dataLoss, dataLossMessage); } - static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicString& eventType, const IDBVersionChangeEventInit& initializer) + static RawPtr<IDBVersionChangeEvent> create(const AtomicString& eventType, const IDBVersionChangeEventInit& initializer) { - return adoptRefWillBeNoop(new IDBVersionChangeEvent(eventType, initializer)); + return new IDBVersionChangeEvent(eventType, initializer); } unsigned long long oldVersion() const { return m_oldVersion; }
diff --git a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp index 3562723..db3bfde 100644 --- a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
@@ -88,9 +88,9 @@ class GetDatabaseNamesCallback final : public EventListener { WTF_MAKE_NONCOPYABLE(GetDatabaseNamesCallback); public: - static PassRefPtrWillBeRawPtr<GetDatabaseNamesCallback> create(PassOwnPtr<RequestDatabaseNamesCallback> requestCallback, const String& securityOrigin) + static RawPtr<GetDatabaseNamesCallback> create(PassOwnPtr<RequestDatabaseNamesCallback> requestCallback, const String& securityOrigin) { - return adoptRefWillBeNoop(new GetDatabaseNamesCallback(requestCallback, securityOrigin)); + return new GetDatabaseNamesCallback(requestCallback, securityOrigin); } ~GetDatabaseNamesCallback() override { } @@ -114,7 +114,7 @@ return; } - RefPtrWillBeRawPtr<DOMStringList> databaseNamesList = requestResult->domStringList(); + RawPtr<DOMStringList> databaseNamesList = requestResult->domStringList(); OwnPtr<protocol::Array<String>> databaseNames = protocol::Array<String>::create(); for (size_t i = 0; i < databaseNamesList->length(); ++i) databaseNames->addItem(databaseNamesList->anonymousIndexedGetter(i)); @@ -151,9 +151,9 @@ class OpenDatabaseCallback final : public EventListener { public: - static PassRefPtrWillBeRawPtr<OpenDatabaseCallback> create(ExecutableWithDatabase* executableWithDatabase) + static RawPtr<OpenDatabaseCallback> create(ExecutableWithDatabase* executableWithDatabase) { - return adoptRefWillBeNoop(new OpenDatabaseCallback(executableWithDatabase)); + return new OpenDatabaseCallback(executableWithDatabase); } ~OpenDatabaseCallback() override { } @@ -192,9 +192,9 @@ class UpgradeDatabaseCallback final : public EventListener { public: - static PassRefPtrWillBeRawPtr<UpgradeDatabaseCallback> create(ExecutableWithDatabase* executableWithDatabase) + static RawPtr<UpgradeDatabaseCallback> create(ExecutableWithDatabase* executableWithDatabase) { - return adoptRefWillBeNoop(new UpgradeDatabaseCallback(executableWithDatabase)); + return new UpgradeDatabaseCallback(executableWithDatabase); } ~UpgradeDatabaseCallback() override { } @@ -229,8 +229,8 @@ void ExecutableWithDatabase::start(IDBFactory* idbFactory, SecurityOrigin*, const String& databaseName) { - RefPtrWillBeRawPtr<OpenDatabaseCallback> openCallback = OpenDatabaseCallback::create(this); - RefPtrWillBeRawPtr<UpgradeDatabaseCallback> upgradeCallback = UpgradeDatabaseCallback::create(this); + RawPtr<OpenDatabaseCallback> openCallback = OpenDatabaseCallback::create(this); + RawPtr<UpgradeDatabaseCallback> upgradeCallback = UpgradeDatabaseCallback::create(this); TrackExceptionState exceptionState; IDBOpenDBRequest* idbOpenDBRequest = idbFactory->open(getScriptState(), databaseName, exceptionState); if (exceptionState.hadException()) { @@ -407,9 +407,9 @@ class OpenCursorCallback final : public EventListener { public: - static PassRefPtrWillBeRawPtr<OpenCursorCallback> create(ScriptState* scriptState, PassOwnPtr<RequestDataCallback> requestCallback, int skipCount, unsigned pageSize) + static RawPtr<OpenCursorCallback> create(ScriptState* scriptState, PassOwnPtr<RequestDataCallback> requestCallback, int skipCount, unsigned pageSize) { - return adoptRefWillBeNoop(new OpenCursorCallback(scriptState, requestCallback, skipCount, pageSize)); + return new OpenCursorCallback(scriptState, requestCallback, skipCount, pageSize); } ~OpenCursorCallback() override { } @@ -544,7 +544,7 @@ } else { idbRequest = idbObjectStore->openCursor(getScriptState(), m_idbKeyRange.get(), WebIDBCursorDirectionNext); } - RefPtrWillBeRawPtr<OpenCursorCallback> openCursorCallback = OpenCursorCallback::create(getScriptState(), m_requestCallback.release(), m_skipCount, m_pageSize); + RawPtr<OpenCursorCallback> openCursorCallback = OpenCursorCallback::create(getScriptState(), m_requestCallback.release(), m_skipCount, m_pageSize); idbRequest->addEventListener(EventTypeNames::success, openCursorCallback, false); } @@ -571,9 +571,9 @@ } // namespace // static -PassOwnPtrWillBeRawPtr<InspectorIndexedDBAgent> InspectorIndexedDBAgent::create(InspectedFrames* inspectedFrames) +RawPtr<InspectorIndexedDBAgent> InspectorIndexedDBAgent::create(InspectedFrames* inspectedFrames) { - return adoptPtrWillBeNoop(new InspectorIndexedDBAgent(inspectedFrames)); + return new InspectorIndexedDBAgent(inspectedFrames); } InspectorIndexedDBAgent::InspectorIndexedDBAgent(InspectedFrames* inspectedFrames) @@ -705,9 +705,9 @@ class ClearObjectStoreListener final : public EventListener { WTF_MAKE_NONCOPYABLE(ClearObjectStoreListener); public: - static PassRefPtrWillBeRawPtr<ClearObjectStoreListener> create(PassOwnPtr<ClearObjectStoreCallback> requestCallback) + static RawPtr<ClearObjectStoreListener> create(PassOwnPtr<ClearObjectStoreCallback> requestCallback) { - return adoptRefWillBeNoop(new ClearObjectStoreListener(requestCallback)); + return new ClearObjectStoreListener(requestCallback); } ~ClearObjectStoreListener() override { }
diff --git a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.h b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.h index b03d9a2..56685eb 100644 --- a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.h +++ b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.h
@@ -43,7 +43,7 @@ class MODULES_EXPORT InspectorIndexedDBAgent final : public InspectorBaseAgent<InspectorIndexedDBAgent, protocol::Frontend::IndexedDB>, public protocol::Backend::IndexedDB { public: - static PassOwnPtrWillBeRawPtr<InspectorIndexedDBAgent> create(InspectedFrames*); + static RawPtr<InspectorIndexedDBAgent> create(InspectedFrames*); ~InspectorIndexedDBAgent() override; DECLARE_VIRTUAL_TRACE(); @@ -61,7 +61,7 @@ private: explicit InspectorIndexedDBAgent(InspectedFrames*); - RawPtrWillBeMember<InspectedFrames> m_inspectedFrames; + Member<InspectedFrames> m_inspectedFrames; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp b/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp index 374ef9a..3052050 100644 --- a/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp
@@ -46,17 +46,17 @@ return "WorkerGlobalScopeIndexedDatabase"; } -WorkerGlobalScopeIndexedDatabase& WorkerGlobalScopeIndexedDatabase::from(WillBeHeapSupplementable<WorkerGlobalScope>& context) +WorkerGlobalScopeIndexedDatabase& WorkerGlobalScopeIndexedDatabase::from(Supplementable<WorkerGlobalScope>& context) { - WorkerGlobalScopeIndexedDatabase* supplement = static_cast<WorkerGlobalScopeIndexedDatabase*>(WillBeHeapSupplement<WorkerGlobalScope>::from(context, supplementName())); + WorkerGlobalScopeIndexedDatabase* supplement = static_cast<WorkerGlobalScopeIndexedDatabase*>(Supplement<WorkerGlobalScope>::from(context, supplementName())); if (!supplement) { - supplement = new WorkerGlobalScopeIndexedDatabase(); - provideTo(context, supplementName(), adoptPtrWillBeNoop(supplement)); + supplement = new WorkerGlobalScopeIndexedDatabase; + provideTo(context, supplementName(), supplement); } return *supplement; } -IDBFactory* WorkerGlobalScopeIndexedDatabase::indexedDB(WillBeHeapSupplementable<WorkerGlobalScope>& context) +IDBFactory* WorkerGlobalScopeIndexedDatabase::indexedDB(Supplementable<WorkerGlobalScope>& context) { return from(context).indexedDB(); } @@ -71,7 +71,7 @@ DEFINE_TRACE(WorkerGlobalScopeIndexedDatabase) { visitor->trace(m_idbFactory); - WillBeHeapSupplement<WorkerGlobalScope>::trace(visitor); + Supplement<WorkerGlobalScope>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h b/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h index e065b0e..8e300c2 100644 --- a/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h +++ b/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h
@@ -36,14 +36,13 @@ class IDBFactory; class WorkerGlobalScope; -class WorkerGlobalScopeIndexedDatabase final : public NoBaseWillBeGarbageCollectedFinalized<WorkerGlobalScopeIndexedDatabase>, public WillBeHeapSupplement<WorkerGlobalScope> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WorkerGlobalScopeIndexedDatabase); - USING_FAST_MALLOC_WILL_BE_REMOVED(WorkerGlobalScopeIndexedDatabase); +class WorkerGlobalScopeIndexedDatabase final : public GarbageCollectedFinalized<WorkerGlobalScopeIndexedDatabase>, public Supplement<WorkerGlobalScope> { + USING_GARBAGE_COLLECTED_MIXIN(WorkerGlobalScopeIndexedDatabase); public: virtual ~WorkerGlobalScopeIndexedDatabase(); - static WorkerGlobalScopeIndexedDatabase& from(WillBeHeapSupplementable<WorkerGlobalScope>&); + static WorkerGlobalScopeIndexedDatabase& from(Supplementable<WorkerGlobalScope>&); - static IDBFactory* indexedDB(WillBeHeapSupplementable<WorkerGlobalScope>&); + static IDBFactory* indexedDB(Supplementable<WorkerGlobalScope>&); DECLARE_VIRTUAL_TRACE(); @@ -53,7 +52,7 @@ IDBFactory* indexedDB(); static const char* supplementName(); - PersistentWillBeMember<IDBFactory> m_idbFactory; + Member<IDBFactory> m_idbFactory; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/installedapp/InstalledAppController.cpp b/third_party/WebKit/Source/modules/installedapp/InstalledAppController.cpp index 71170d0d..c282647c 100644 --- a/third_party/WebKit/Source/modules/installedapp/InstalledAppController.cpp +++ b/third_party/WebKit/Source/modules/installedapp/InstalledAppController.cpp
@@ -18,13 +18,13 @@ { ASSERT(RuntimeEnabledFeatures::installedAppEnabled()); - OwnPtrWillBeRawPtr<InstalledAppController> controller = adoptPtrWillBeNoop(new InstalledAppController(frame, client)); - WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), controller.release()); + RawPtr<InstalledAppController> controller = new InstalledAppController(frame, client); + HeapSupplement<LocalFrame>::provideTo(frame, supplementName(), controller.release()); } InstalledAppController* InstalledAppController::from(LocalFrame& frame) { - InstalledAppController* controller = static_cast<InstalledAppController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); + InstalledAppController* controller = static_cast<InstalledAppController*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); ASSERT(controller); return controller; } @@ -59,7 +59,7 @@ DEFINE_TRACE(InstalledAppController) { - WillBeHeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); LocalFrameLifecycleObserver::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/installedapp/InstalledAppController.h b/third_party/WebKit/Source/modules/installedapp/InstalledAppController.h index b9164e4..3a03e8f 100644 --- a/third_party/WebKit/Source/modules/installedapp/InstalledAppController.h +++ b/third_party/WebKit/Source/modules/installedapp/InstalledAppController.h
@@ -15,8 +15,8 @@ class WebSecurityOrigin; class MODULES_EXPORT InstalledAppController final - : public NoBaseWillBeGarbageCollectedFinalized<InstalledAppController>, public WillBeHeapSupplement<LocalFrame>, public LocalFrameLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InstalledAppController); + : public GarbageCollectedFinalized<InstalledAppController>, public HeapSupplement<LocalFrame>, public LocalFrameLifecycleObserver { + USING_GARBAGE_COLLECTED_MIXIN(InstalledAppController); WTF_MAKE_NONCOPYABLE(InstalledAppController); public: virtual ~InstalledAppController();
diff --git a/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.cpp b/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.cpp index 00f5229..26b627fa 100644 --- a/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.cpp +++ b/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.cpp
@@ -12,12 +12,12 @@ namespace blink { -CanvasCaptureMediaStreamTrack* CanvasCaptureMediaStreamTrack::create(MediaStreamComponent* component, PassRefPtrWillBeRawPtr<HTMLCanvasElement> element, const PassOwnPtr<WebCanvasCaptureHandler> handler) +CanvasCaptureMediaStreamTrack* CanvasCaptureMediaStreamTrack::create(MediaStreamComponent* component, RawPtr<HTMLCanvasElement> element, const PassOwnPtr<WebCanvasCaptureHandler> handler) { return new CanvasCaptureMediaStreamTrack(component, element, handler); } -CanvasCaptureMediaStreamTrack* CanvasCaptureMediaStreamTrack::create(MediaStreamComponent* component, PassRefPtrWillBeRawPtr<HTMLCanvasElement> element, const PassOwnPtr<WebCanvasCaptureHandler> handler, double frameRate) +CanvasCaptureMediaStreamTrack* CanvasCaptureMediaStreamTrack::create(MediaStreamComponent* component, RawPtr<HTMLCanvasElement> element, const PassOwnPtr<WebCanvasCaptureHandler> handler, double frameRate) { return new CanvasCaptureMediaStreamTrack(component, element, handler, frameRate); } @@ -56,7 +56,7 @@ m_canvasElement->addListener(m_drawListener.get()); } -CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack(MediaStreamComponent* component, PassRefPtrWillBeRawPtr<HTMLCanvasElement> element, const PassOwnPtr<WebCanvasCaptureHandler> handler) +CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack(MediaStreamComponent* component, RawPtr<HTMLCanvasElement> element, const PassOwnPtr<WebCanvasCaptureHandler> handler) : MediaStreamTrack(element->getExecutionContext(), component) , m_canvasElement(element) { @@ -65,7 +65,7 @@ m_canvasElement->addListener(m_drawListener.get()); } -CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack(MediaStreamComponent* component, PassRefPtrWillBeRawPtr<HTMLCanvasElement> element, const PassOwnPtr<WebCanvasCaptureHandler> handler, double frameRate) +CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack(MediaStreamComponent* component, RawPtr<HTMLCanvasElement> element, const PassOwnPtr<WebCanvasCaptureHandler> handler, double frameRate) : MediaStreamTrack(element->getExecutionContext(), component) , m_canvasElement(element) {
diff --git a/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.h b/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.h index 2828827..7c8a41a9 100644 --- a/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.h +++ b/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.h
@@ -17,8 +17,8 @@ class CanvasCaptureMediaStreamTrack final : public MediaStreamTrack { DEFINE_WRAPPERTYPEINFO(); public: - static CanvasCaptureMediaStreamTrack* create(MediaStreamComponent*, PassRefPtrWillBeRawPtr<HTMLCanvasElement>, const PassOwnPtr<WebCanvasCaptureHandler>); - static CanvasCaptureMediaStreamTrack* create(MediaStreamComponent*, PassRefPtrWillBeRawPtr<HTMLCanvasElement>, const PassOwnPtr<WebCanvasCaptureHandler>, double frameRate); + static CanvasCaptureMediaStreamTrack* create(MediaStreamComponent*, RawPtr<HTMLCanvasElement>, const PassOwnPtr<WebCanvasCaptureHandler>); + static CanvasCaptureMediaStreamTrack* create(MediaStreamComponent*, RawPtr<HTMLCanvasElement>, const PassOwnPtr<WebCanvasCaptureHandler>, double frameRate); HTMLCanvasElement* canvas() const; void requestFrame(); @@ -29,10 +29,10 @@ private: CanvasCaptureMediaStreamTrack(const CanvasCaptureMediaStreamTrack&, MediaStreamComponent*); - CanvasCaptureMediaStreamTrack(MediaStreamComponent*, PassRefPtrWillBeRawPtr<HTMLCanvasElement>, const PassOwnPtr<WebCanvasCaptureHandler>); - CanvasCaptureMediaStreamTrack(MediaStreamComponent*, PassRefPtrWillBeRawPtr<HTMLCanvasElement>, const PassOwnPtr<WebCanvasCaptureHandler>, double frameRate); + CanvasCaptureMediaStreamTrack(MediaStreamComponent*, RawPtr<HTMLCanvasElement>, const PassOwnPtr<WebCanvasCaptureHandler>); + CanvasCaptureMediaStreamTrack(MediaStreamComponent*, RawPtr<HTMLCanvasElement>, const PassOwnPtr<WebCanvasCaptureHandler>, double frameRate); - RefPtrWillBeMember<HTMLCanvasElement> m_canvasElement; + Member<HTMLCanvasElement> m_canvasElement; Member<CanvasDrawListener> m_drawListener; };
diff --git a/third_party/WebKit/Source/modules/mediarecorder/BlobEvent.cpp b/third_party/WebKit/Source/modules/mediarecorder/BlobEvent.cpp index 2b27e53..fc8df4e 100644 --- a/third_party/WebKit/Source/modules/mediarecorder/BlobEvent.cpp +++ b/third_party/WebKit/Source/modules/mediarecorder/BlobEvent.cpp
@@ -10,21 +10,21 @@ namespace blink { // static -PassRefPtrWillBeRawPtr<BlobEvent> BlobEvent::create() +RawPtr<BlobEvent> BlobEvent::create() { return adoptRefWillBeNoop(new BlobEvent); } // static -PassRefPtrWillBeRawPtr<BlobEvent> BlobEvent::create(const AtomicString& type, const BlobEventInit& initializer) +RawPtr<BlobEvent> BlobEvent::create(const AtomicString& type, const BlobEventInit& initializer) { - return adoptRefWillBeNoop(new BlobEvent(type, initializer)); + return new BlobEvent(type, initializer); } // static -PassRefPtrWillBeRawPtr<BlobEvent> BlobEvent::create(const AtomicString& type, Blob* blob) +RawPtr<BlobEvent> BlobEvent::create(const AtomicString& type, Blob* blob) { - return adoptRefWillBeNoop(new BlobEvent(type, blob)); + return new BlobEvent(type, blob); } const AtomicString& BlobEvent::interfaceName() const
diff --git a/third_party/WebKit/Source/modules/mediarecorder/BlobEvent.h b/third_party/WebKit/Source/modules/mediarecorder/BlobEvent.h index a28fec4..a436fbfa9 100644 --- a/third_party/WebKit/Source/modules/mediarecorder/BlobEvent.h +++ b/third_party/WebKit/Source/modules/mediarecorder/BlobEvent.h
@@ -20,9 +20,9 @@ public: ~BlobEvent() override {} - static PassRefPtrWillBeRawPtr<BlobEvent> create(); - static PassRefPtrWillBeRawPtr<BlobEvent> create(const AtomicString& type, const BlobEventInit& initializer); - static PassRefPtrWillBeRawPtr<BlobEvent> create(const AtomicString& type, Blob*); + static RawPtr<BlobEvent> create(); + static RawPtr<BlobEvent> create(const AtomicString& type, const BlobEventInit& initializer); + static RawPtr<BlobEvent> create(const AtomicString& type, Blob*); Blob* data() const { return m_blob.get(); } @@ -36,7 +36,7 @@ BlobEvent(const AtomicString& type, const BlobEventInit& initializer); BlobEvent(const AtomicString& type, Blob*); - PersistentWillBeMember<Blob> m_blob; + Member<Blob> m_blob; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp index 15bd864..80f1a9d 100644 --- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp +++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
@@ -332,7 +332,7 @@ scheduleDispatchEvent(Event::create(EventTypeNames::stop)); } -void MediaRecorder::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> event) +void MediaRecorder::scheduleDispatchEvent(RawPtr<Event> event) { m_scheduledEvents.append(event); @@ -341,7 +341,7 @@ void MediaRecorder::dispatchScheduledEvent() { - WillBeHeapVector<RefPtrWillBeMember<Event>> events; + HeapVector<Member<Event>> events; events.swap(m_scheduledEvents); for (const auto& event : events)
diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h index f4b2c86..77db8c92 100644 --- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h +++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h
@@ -28,7 +28,7 @@ , public ActiveScriptWrappable , public ActiveDOMObject { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaRecorder); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaRecorder); + USING_GARBAGE_COLLECTED_MIXIN(MediaRecorder); DEFINE_WRAPPERTYPEINFO(); public: enum class State { @@ -90,7 +90,7 @@ void createBlobEvent(Blob*); void stopRecording(); - void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); + void scheduleDispatchEvent(RawPtr<Event>); void dispatchScheduledEvent(); Member<MediaStream> m_stream; @@ -108,7 +108,7 @@ OwnPtr<WebMediaRecorderHandler> m_recorderHandler; Member<AsyncMethodRunner<MediaRecorder>> m_dispatchScheduledEventRunner; - WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; + HeapVector<Member<Event>> m_scheduledEvents; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediasession/HTMLMediaElementMediaSession.cpp b/third_party/WebKit/Source/modules/mediasession/HTMLMediaElementMediaSession.cpp index e54b2011..6b9cfdb 100644 --- a/third_party/WebKit/Source/modules/mediasession/HTMLMediaElementMediaSession.cpp +++ b/third_party/WebKit/Source/modules/mediasession/HTMLMediaElementMediaSession.cpp
@@ -43,13 +43,13 @@ HTMLMediaElementMediaSession* HTMLMediaElementMediaSession::fromIfExists(HTMLMediaElement& element) { - return static_cast<HTMLMediaElementMediaSession*>(WillBeHeapSupplement<HTMLMediaElement>::from(element, supplementName())); + return static_cast<HTMLMediaElementMediaSession*>(HeapSupplement<HTMLMediaElement>::from(element, supplementName())); } DEFINE_TRACE(HTMLMediaElementMediaSession) { visitor->trace(m_session); - WillBeHeapSupplement<HTMLMediaElement>::trace(visitor); + HeapSupplement<HTMLMediaElement>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediasession/HTMLMediaElementMediaSession.h b/third_party/WebKit/Source/modules/mediasession/HTMLMediaElementMediaSession.h index b4cd9e4..35c7ed2 100644 --- a/third_party/WebKit/Source/modules/mediasession/HTMLMediaElementMediaSession.h +++ b/third_party/WebKit/Source/modules/mediasession/HTMLMediaElementMediaSession.h
@@ -15,9 +15,8 @@ // A supplement to HTMLMediaElement responsible for the integration of // MediaSession with HTMLMediaElement. -class MODULES_EXPORT HTMLMediaElementMediaSession final : public NoBaseWillBeGarbageCollected<HTMLMediaElementMediaSession>, public WillBeHeapSupplement<HTMLMediaElement> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementMediaSession); - USING_FAST_MALLOC_WILL_BE_REMOVED(HTMLMediaElementMediaSession); +class MODULES_EXPORT HTMLMediaElementMediaSession final : public GarbageCollected<HTMLMediaElementMediaSession>, public HeapSupplement<HTMLMediaElement> { + USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementMediaSession); public: static MediaSession* session(HTMLMediaElement&); static void setSession(HTMLMediaElement&, MediaSession*, ExceptionState&); @@ -29,7 +28,7 @@ static HTMLMediaElementMediaSession* fromIfExists(HTMLMediaElement&); static const char* supplementName(); - PersistentWillBeMember<MediaSession> m_session; + Member<MediaSession> m_session; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp index e64ab87..b440b95 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp +++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
@@ -611,7 +611,7 @@ { ASSERT(m_asyncEventQueue); - RefPtrWillBeRawPtr<Event> event = Event::create(eventName); + RawPtr<Event> event = Event::create(eventName); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release());
diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.h b/third_party/WebKit/Source/modules/mediasource/MediaSource.h index d6cc9972..de6cfff 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSource.h +++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.h
@@ -55,7 +55,7 @@ , public ActiveDOMObject { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaSource); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaSource); + USING_GARBAGE_COLLECTED_MIXIN(MediaSource); public: static const AtomicString& openKeyword(); static const AtomicString& closedKeyword(); @@ -133,8 +133,8 @@ OwnPtr<WebMediaSource> m_webMediaSource; AtomicString m_readyState; - OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; - RawPtrWillBeWeakMember<HTMLMediaElement> m_attachedElement; + Member<GenericEventQueue> m_asyncEventQueue; + WeakMember<HTMLMediaElement> m_attachedElement; Member<SourceBufferList> m_sourceBuffers; Member<SourceBufferList> m_activeSourceBuffers;
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp index 0a84c21..10285d6b 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
@@ -622,7 +622,7 @@ { ASSERT(m_asyncEventQueue); - RefPtrWillBeRawPtr<Event> event = Event::create(eventName); + RawPtr<Event> event = Event::create(eventName); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release());
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h index baa22e3..e2603ea 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h
@@ -63,7 +63,7 @@ , public FileReaderLoaderClient , public WebSourceBufferClient { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SourceBuffer); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); + USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); DEFINE_WRAPPERTYPEINFO(); public: static SourceBuffer* create(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*); @@ -145,7 +145,7 @@ OwnPtr<WebSourceBuffer> m_webSourceBuffer; Member<MediaSource> m_source; Member<TrackDefaultList> m_trackDefaults; - RawPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; + Member<GenericEventQueue> m_asyncEventQueue; AtomicString m_mode; bool m_updating;
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp index 345f043..c355f75 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp
@@ -81,7 +81,7 @@ { ASSERT(m_asyncEventQueue); - RefPtrWillBeRawPtr<Event> event = Event::create(eventName); + RawPtr<Event> event = Event::create(eventName); event->setTarget(this); m_asyncEventQueue->enqueueEvent(event.release());
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBufferList.h b/third_party/WebKit/Source/modules/mediasource/SourceBufferList.h index a761ae6..dc44f9e 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBufferList.h +++ b/third_party/WebKit/Source/modules/mediasource/SourceBufferList.h
@@ -70,8 +70,8 @@ void scheduleEvent(const AtomicString&); - RawPtrWillBeMember<ExecutionContext> m_executionContext; - RawPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; + Member<ExecutionContext> m_executionContext; + Member<GenericEventQueue> m_asyncEventQueue; HeapVector<Member<SourceBuffer>> m_list; };
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.h b/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.h index 8f4354ad..39c35ca2 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.h +++ b/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.h
@@ -42,7 +42,7 @@ class ScriptPromiseResolver; class MODULES_EXPORT MediaDevicesRequest final : public GarbageCollectedFinalized<MediaDevicesRequest>, public ActiveDOMObject { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaDevicesRequest); + USING_GARBAGE_COLLECTED_MIXIN(MediaDevicesRequest); public: static MediaDevicesRequest* create(ScriptState*, UserMediaController*); ~MediaDevicesRequest() override; @@ -61,7 +61,7 @@ private: MediaDevicesRequest(ScriptState*, UserMediaController*); - RawPtrWillBeMember<UserMediaController> m_controller; + Member<UserMediaController> m_controller; Member<ScriptPromiseResolver> m_resolver; };
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp index 4ba6007..8fa874c 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp
@@ -382,7 +382,7 @@ } } -void MediaStream::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> event) +void MediaStream::scheduleDispatchEvent(RawPtr<Event> event) { m_scheduledEvents.append(event); @@ -395,10 +395,10 @@ if (m_stopped) return; - WillBeHeapVector<RefPtrWillBeMember<Event>> events; + HeapVector<Member<Event>> events; events.swap(m_scheduledEvents); - WillBeHeapVector<RefPtrWillBeMember<Event>>::iterator it = events.begin(); + HeapVector<Member<Event>>::iterator it = events.begin(); for (; it != events.end(); ++it) dispatchEvent((*it).release());
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStream.h b/third_party/WebKit/Source/modules/mediastream/MediaStream.h index 8891156..d0a5e28e 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStream.h +++ b/third_party/WebKit/Source/modules/mediastream/MediaStream.h
@@ -101,7 +101,7 @@ bool emptyOrOnlyEndedTracks(); - void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); + void scheduleDispatchEvent(RawPtr<Event>); void scheduledEventTimerFired(Timer<MediaStream>*); bool m_stopped; @@ -111,7 +111,7 @@ Member<MediaStreamDescriptor> m_descriptor; Timer<MediaStream> m_scheduledEventTimer; - WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; + HeapVector<Member<Event>> m_scheduledEvents; }; typedef HeapVector<Member<MediaStream>> MediaStreamVector;
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.cpp index 944f417..851547a 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.cpp
@@ -26,19 +26,19 @@ namespace blink { -PassRefPtrWillBeRawPtr<MediaStreamEvent> MediaStreamEvent::create() +RawPtr<MediaStreamEvent> MediaStreamEvent::create() { return adoptRefWillBeNoop(new MediaStreamEvent); } -PassRefPtrWillBeRawPtr<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, bool canBubble, bool cancelable, MediaStream* stream) +RawPtr<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, bool canBubble, bool cancelable, MediaStream* stream) { - return adoptRefWillBeNoop(new MediaStreamEvent(type, canBubble, cancelable, stream)); + return new MediaStreamEvent(type, canBubble, cancelable, stream); } -PassRefPtrWillBeRawPtr<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, const MediaStreamEventInit& initializer) +RawPtr<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, const MediaStreamEventInit& initializer) { - return adoptRefWillBeNoop(new MediaStreamEvent(type, initializer)); + return new MediaStreamEvent(type, initializer); } MediaStreamEvent::MediaStreamEvent()
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.h b/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.h index 62ac07c..9ed8793 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.h +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.h
@@ -37,9 +37,9 @@ public: ~MediaStreamEvent() override; - static PassRefPtrWillBeRawPtr<MediaStreamEvent> create(); - static PassRefPtrWillBeRawPtr<MediaStreamEvent> create(const AtomicString& type, bool canBubble, bool cancelable, MediaStream*); - static PassRefPtrWillBeRawPtr<MediaStreamEvent> create(const AtomicString& type, const MediaStreamEventInit& initializer); + static RawPtr<MediaStreamEvent> create(); + static RawPtr<MediaStreamEvent> create(const AtomicString& type, bool canBubble, bool cancelable, MediaStream*); + static RawPtr<MediaStreamEvent> create(const AtomicString& type, const MediaStreamEventInit& initializer); MediaStream* stream() const; MediaStream* stream(bool&) const; @@ -53,7 +53,7 @@ MediaStreamEvent(const AtomicString& type, bool canBubble, bool cancelable, MediaStream*); MediaStreamEvent(const AtomicString& type, const MediaStreamEventInit&); - PersistentWillBeMember<MediaStream> m_stream; + Member<MediaStream> m_stream; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.cpp index ede2cb1..73cc65e 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.cpp
@@ -28,14 +28,14 @@ namespace blink { -PassRefPtrWillBeRawPtr<MediaStreamTrackEvent> MediaStreamTrackEvent::create() +RawPtr<MediaStreamTrackEvent> MediaStreamTrackEvent::create() { return adoptRefWillBeNoop(new MediaStreamTrackEvent); } -PassRefPtrWillBeRawPtr<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, MediaStreamTrack* track) +RawPtr<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, MediaStreamTrack* track) { - return adoptRefWillBeNoop(new MediaStreamTrackEvent(type, canBubble, cancelable, track)); + return new MediaStreamTrackEvent(type, canBubble, cancelable, track); }
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.h b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.h index ffc35d65..e064cd75 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.h +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.h
@@ -37,8 +37,8 @@ public: ~MediaStreamTrackEvent() override; - static PassRefPtrWillBeRawPtr<MediaStreamTrackEvent> create(); - static PassRefPtrWillBeRawPtr<MediaStreamTrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, MediaStreamTrack*); + static RawPtr<MediaStreamTrackEvent> create(); + static RawPtr<MediaStreamTrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, MediaStreamTrack*); MediaStreamTrack* track() const; @@ -51,7 +51,7 @@ MediaStreamTrackEvent(); MediaStreamTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, MediaStreamTrack*); - PersistentWillBeMember<MediaStreamTrack> m_track; + Member<MediaStreamTrack> m_track; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.h b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.h index 2e4a0703..80651ff 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.h +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.h
@@ -52,7 +52,7 @@ void performCallback(); Member<MediaStreamTrackSourcesCallback> m_callback; - RefPtrWillBeMember<ExecutionContext> m_executionContext; + Member<ExecutionContext> m_executionContext; SourceInfoVector m_sourceInfos; };
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp index 62375b7..b370276 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp
@@ -142,7 +142,7 @@ m_handler->setClient(0); } -void RTCDTMFSender::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> event) +void RTCDTMFSender::scheduleDispatchEvent(RawPtr<Event> event) { m_scheduledEvents.append(event); @@ -155,10 +155,10 @@ if (m_stopped) return; - WillBeHeapVector<RefPtrWillBeMember<Event>> events; + HeapVector<Member<Event>> events; events.swap(m_scheduledEvents); - WillBeHeapVector<RefPtrWillBeMember<Event>>::iterator it = events.begin(); + HeapVector<Member<Event>>::iterator it = events.begin(); for (; it != events.end(); ++it) dispatchEvent((*it).release()); }
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h index 9e5f5b9..70ea964 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h
@@ -43,7 +43,7 @@ , public WebRTCDTMFSenderHandlerClient , public ActiveDOMObject { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCDTMFSender); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCDTMFSender); + USING_GARBAGE_COLLECTED_MIXIN(RTCDTMFSender); DEFINE_WRAPPERTYPEINFO(); public: static RTCDTMFSender* create(ExecutionContext*, WebRTCPeerConnectionHandler*, MediaStreamTrack*, ExceptionState&); @@ -75,7 +75,7 @@ private: RTCDTMFSender(ExecutionContext*, MediaStreamTrack*, PassOwnPtr<WebRTCDTMFSenderHandler>); - void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); + void scheduleDispatchEvent(RawPtr<Event>); void scheduledEventTimerFired(Timer<RTCDTMFSender>*); // WebRTCDTMFSenderHandlerClient @@ -90,7 +90,7 @@ bool m_stopped; Timer<RTCDTMFSender> m_scheduledEventTimer; - WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; + HeapVector<Member<Event>> m_scheduledEvents; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.cpp index 8c8c8f9..96e2e69d 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.cpp
@@ -27,20 +27,20 @@ namespace blink { -PassRefPtrWillBeRawPtr<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create() +RawPtr<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create() { return adoptRefWillBeNoop(new RTCDTMFToneChangeEvent); } -PassRefPtrWillBeRawPtr<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const String& tone) +RawPtr<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const String& tone) { - return adoptRefWillBeNoop(new RTCDTMFToneChangeEvent(tone)); + return new RTCDTMFToneChangeEvent(tone); } -PassRefPtrWillBeRawPtr<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer) +RawPtr<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer) { ASSERT(type == EventTypeNames::tonechange); - return adoptRefWillBeNoop(new RTCDTMFToneChangeEvent(initializer)); + return new RTCDTMFToneChangeEvent(initializer); } RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent()
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.h b/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.h index c93cb18..1766189 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.h
@@ -37,9 +37,9 @@ public: ~RTCDTMFToneChangeEvent() override; - static PassRefPtrWillBeRawPtr<RTCDTMFToneChangeEvent> create(); - static PassRefPtrWillBeRawPtr<RTCDTMFToneChangeEvent> create(const String& tone); - static PassRefPtrWillBeRawPtr<RTCDTMFToneChangeEvent> create(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer); + static RawPtr<RTCDTMFToneChangeEvent> create(); + static RawPtr<RTCDTMFToneChangeEvent> create(const String& tone); + static RawPtr<RTCDTMFToneChangeEvent> create(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer); const String& tone() const;
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp index 59bf416..009342e 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
@@ -294,7 +294,7 @@ return m_executionContext; } -void RTCDataChannel::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> event) +void RTCDataChannel::scheduleDispatchEvent(RawPtr<Event> event) { m_scheduledEvents.append(event); @@ -304,10 +304,10 @@ void RTCDataChannel::scheduledEventTimerFired(Timer<RTCDataChannel>*) { - WillBeHeapVector<RefPtrWillBeMember<Event>> events; + HeapVector<Member<Event>> events; events.swap(m_scheduledEvents); - WillBeHeapVector<RefPtrWillBeMember<Event>>::iterator it = events.begin(); + HeapVector<Member<Event>>::iterator it = events.begin(); for (; it != events.end(); ++it) dispatchEvent((*it).release());
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h index dcc9f04..192fdccac 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h
@@ -107,10 +107,10 @@ private: RTCDataChannel(ExecutionContext*, PassOwnPtr<WebRTCDataChannelHandler>); - void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); + void scheduleDispatchEvent(RawPtr<Event>); void scheduledEventTimerFired(Timer<RTCDataChannel>*); - RawPtrWillBeMember<ExecutionContext> m_executionContext; + Member<ExecutionContext> m_executionContext; OwnPtr<WebRTCDataChannelHandler> m_handler; @@ -123,7 +123,7 @@ BinaryType m_binaryType; Timer<RTCDataChannel> m_scheduledEventTimer; - WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; + HeapVector<Member<Event>> m_scheduledEvents; unsigned m_bufferedAmountLowThreshold;
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.cpp index d4f7464..7d2b0c4 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.cpp
@@ -26,14 +26,14 @@ namespace blink { -PassRefPtrWillBeRawPtr<RTCDataChannelEvent> RTCDataChannelEvent::create() +RawPtr<RTCDataChannelEvent> RTCDataChannelEvent::create() { return adoptRefWillBeNoop(new RTCDataChannelEvent); } -PassRefPtrWillBeRawPtr<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, bool canBubble, bool cancelable, RTCDataChannel* channel) +RawPtr<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, bool canBubble, bool cancelable, RTCDataChannel* channel) { - return adoptRefWillBeNoop(new RTCDataChannelEvent(type, canBubble, cancelable, channel)); + return new RTCDataChannelEvent(type, canBubble, cancelable, channel); }
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.h b/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.h index 85dfd854..3f6f8a1f 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.h
@@ -36,8 +36,8 @@ public: ~RTCDataChannelEvent() override; - static PassRefPtrWillBeRawPtr<RTCDataChannelEvent> create(); - static PassRefPtrWillBeRawPtr<RTCDataChannelEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RTCDataChannel*); + static RawPtr<RTCDataChannelEvent> create(); + static RawPtr<RTCDataChannelEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RTCDataChannel*); RTCDataChannel* channel() const; @@ -49,7 +49,7 @@ RTCDataChannelEvent(); RTCDataChannelEvent(const AtomicString& type, bool canBubble, bool cancelable, RTCDataChannel*); - PersistentWillBeMember<RTCDataChannel> m_channel; + Member<RTCDataChannel> m_channel; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.cpp b/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.cpp index fa782a1..69cbbbea 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.cpp
@@ -28,14 +28,14 @@ namespace blink { -PassRefPtrWillBeRawPtr<RTCIceCandidateEvent> RTCIceCandidateEvent::create() +RawPtr<RTCIceCandidateEvent> RTCIceCandidateEvent::create() { return adoptRefWillBeNoop(new RTCIceCandidateEvent); } -PassRefPtrWillBeRawPtr<RTCIceCandidateEvent> RTCIceCandidateEvent::create(bool canBubble, bool cancelable, RTCIceCandidate* candidate) +RawPtr<RTCIceCandidateEvent> RTCIceCandidateEvent::create(bool canBubble, bool cancelable, RTCIceCandidate* candidate) { - return adoptRefWillBeNoop(new RTCIceCandidateEvent(canBubble, cancelable, candidate)); + return new RTCIceCandidateEvent(canBubble, cancelable, candidate); } RTCIceCandidateEvent::RTCIceCandidateEvent()
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.h b/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.h index fa456a3..fc82b39 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.h
@@ -36,8 +36,8 @@ public: ~RTCIceCandidateEvent() override; - static PassRefPtrWillBeRawPtr<RTCIceCandidateEvent> create(); - static PassRefPtrWillBeRawPtr<RTCIceCandidateEvent> create(bool canBubble, bool cancelable, RTCIceCandidate*); + static RawPtr<RTCIceCandidateEvent> create(); + static RawPtr<RTCIceCandidateEvent> create(bool canBubble, bool cancelable, RTCIceCandidate*); RTCIceCandidate* candidate() const; @@ -49,7 +49,7 @@ RTCIceCandidateEvent(); RTCIceCandidateEvent(bool canBubble, bool cancelable, RTCIceCandidate*); - PersistentWillBeMember<RTCIceCandidate> m_candidate; + Member<RTCIceCandidate> m_candidate; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp index 3bcbd9f..0f0fa01 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -356,7 +356,7 @@ } // namespace RTCPeerConnection::EventWrapper::EventWrapper( - PassRefPtrWillBeRawPtr<Event> event, + RawPtr<Event> event, PassOwnPtr<BoolFunction> function) : m_event(event) , m_setupFunction(function) @@ -1131,12 +1131,12 @@ changeSignalingState(SignalingStateClosed); } -void RTCPeerConnection::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> event) +void RTCPeerConnection::scheduleDispatchEvent(RawPtr<Event> event) { scheduleDispatchEvent(event, nullptr); } -void RTCPeerConnection::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> event, +void RTCPeerConnection::scheduleDispatchEvent(RawPtr<Event> event, PassOwnPtr<BoolFunction> setupFunction) { m_scheduledEvents.append(new EventWrapper(event, setupFunction));
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h index 66120bf..82394b10 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h
@@ -68,7 +68,7 @@ , public ActiveDOMObject { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCPeerConnection); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); + USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); public: // TODO(hbos): Create with expired RTCCertificate should fail, see crbug.com/565278. static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const Dictionary&, ExceptionState&); @@ -169,14 +169,14 @@ typedef Function<bool()> BoolFunction; class EventWrapper : public GarbageCollectedFinalized<EventWrapper> { public: - EventWrapper(PassRefPtrWillBeRawPtr<Event>, PassOwnPtr<BoolFunction>); + EventWrapper(RawPtr<Event>, PassOwnPtr<BoolFunction>); // Returns true if |m_setupFunction| returns true or it is null. // |m_event| will only be fired if setup() returns true; bool setup(); DECLARE_TRACE(); - RefPtrWillBeMember<Event> m_event; + Member<Event> m_event; private: OwnPtr<BoolFunction> m_setupFunction; @@ -184,8 +184,8 @@ RTCPeerConnection(ExecutionContext*, RTCConfiguration*, WebMediaConstraints, ExceptionState&); - void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); - void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>, PassOwnPtr<BoolFunction>); + void scheduleDispatchEvent(RawPtr<Event>); + void scheduleDispatchEvent(RawPtr<Event>, PassOwnPtr<BoolFunction>); void dispatchScheduledEvent(); bool hasLocalStreamWithTrackId(const String& trackId);
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.h b/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.h index 86d534e..a8a7f183 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.h
@@ -45,7 +45,7 @@ class WebRTCSessionDescription; class RTCSessionDescriptionRequestImpl final : public RTCSessionDescriptionRequest, public ActiveDOMObject { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCSessionDescriptionRequestImpl); + USING_GARBAGE_COLLECTED_MIXIN(RTCSessionDescriptionRequestImpl); public: static RTCSessionDescriptionRequestImpl* create(ExecutionContext*, RTCPeerConnection*, RTCSessionDescriptionCallback*, RTCPeerConnectionErrorCallback*); ~RTCSessionDescriptionRequestImpl() override;
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCStatsRequestImpl.h b/third_party/WebKit/Source/modules/mediastream/RTCStatsRequestImpl.h index 96007f7..9c19ca84 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCStatsRequestImpl.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCStatsRequestImpl.h
@@ -39,7 +39,7 @@ class RTCStatsCallback; class RTCStatsRequestImpl final : public RTCStatsRequest, public ActiveDOMObject { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCStatsRequestImpl); + USING_GARBAGE_COLLECTED_MIXIN(RTCStatsRequestImpl); public: static RTCStatsRequestImpl* create(ExecutionContext*, RTCPeerConnection*, RTCStatsCallback*, MediaStreamTrack*); ~RTCStatsRequestImpl() override;
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCVoidRequestImpl.h b/third_party/WebKit/Source/modules/mediastream/RTCVoidRequestImpl.h index 22e56e2..01d50ce 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCVoidRequestImpl.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCVoidRequestImpl.h
@@ -43,7 +43,7 @@ class VoidCallback; class RTCVoidRequestImpl final : public RTCVoidRequest, public ActiveDOMObject { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCVoidRequestImpl); + USING_GARBAGE_COLLECTED_MIXIN(RTCVoidRequestImpl); public: static RTCVoidRequestImpl* create(ExecutionContext*, RTCPeerConnection*, VoidCallback*, RTCPeerConnectionErrorCallback*); ~RTCVoidRequestImpl() override;
diff --git a/third_party/WebKit/Source/modules/mediastream/UserMediaController.cpp b/third_party/WebKit/Source/modules/mediastream/UserMediaController.cpp index 685afce..2010ef9 100644 --- a/third_party/WebKit/Source/modules/mediastream/UserMediaController.cpp +++ b/third_party/WebKit/Source/modules/mediastream/UserMediaController.cpp
@@ -36,16 +36,14 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(UserMediaController) - DEFINE_TRACE(UserMediaController) { - WillBeHeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); } -PassOwnPtrWillBeRawPtr<UserMediaController> UserMediaController::create(UserMediaClient* client) +RawPtr<UserMediaController> UserMediaController::create(UserMediaClient* client) { - return adoptPtrWillBeNoop(new UserMediaController(client)); + return new UserMediaController(client); } void provideUserMediaTo(LocalFrame& frame, UserMediaClient* client)
diff --git a/third_party/WebKit/Source/modules/mediastream/UserMediaController.h b/third_party/WebKit/Source/modules/mediastream/UserMediaController.h index ce61b6e..e39c6b8 100644 --- a/third_party/WebKit/Source/modules/mediastream/UserMediaController.h +++ b/third_party/WebKit/Source/modules/mediastream/UserMediaController.h
@@ -34,12 +34,10 @@ class MediaDevicesRequest; class UserMediaRequest; -class UserMediaController final : public NoBaseWillBeGarbageCollected<UserMediaController>, public WillBeHeapSupplement<LocalFrame> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(UserMediaController); - DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(UserMediaController); - USING_FAST_MALLOC_WILL_BE_REMOVED(UserMediaController); +class UserMediaController final : public GarbageCollected<UserMediaController>, public HeapSupplement<LocalFrame> { + USING_GARBAGE_COLLECTED_MIXIN(UserMediaController); public: - static PassOwnPtrWillBeRawPtr<UserMediaController> create(UserMediaClient*); + static RawPtr<UserMediaController> create(UserMediaClient*); DECLARE_VIRTUAL_TRACE(); @@ -54,7 +52,7 @@ void requestSources(MediaStreamTrackSourcesRequest*); static const char* supplementName(); - static UserMediaController* from(LocalFrame* frame) { return static_cast<UserMediaController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); } + static UserMediaController* from(LocalFrame* frame) { return static_cast<UserMediaController*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); } private: explicit UserMediaController(UserMediaClient*);
diff --git a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp index e5d4cac9..fdf866c 100644 --- a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp +++ b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp
@@ -163,7 +163,7 @@ if (!getExecutionContext()) return; - RefPtrWillBeRawPtr<MediaStream> stream = MediaStream::create(getExecutionContext(), streamDescriptor); + RawPtr<MediaStream> stream = MediaStream::create(getExecutionContext(), streamDescriptor); MediaStreamTrackVector audioTracks = stream->getAudioTracks(); for (MediaStreamTrackVector::iterator iter = audioTracks.begin(); iter != audioTracks.end(); ++iter) {
diff --git a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.h b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.h index a50dc32..a058cd3 100644 --- a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.h +++ b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.h
@@ -50,7 +50,7 @@ class UserMediaController; class MODULES_EXPORT UserMediaRequest final : public GarbageCollectedFinalized<UserMediaRequest>, public ContextLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(UserMediaRequest); + USING_GARBAGE_COLLECTED_MIXIN(UserMediaRequest); public: static UserMediaRequest* create(ExecutionContext*, UserMediaController*, const MediaStreamConstraints& options, NavigatorUserMediaSuccessCallback*, NavigatorUserMediaErrorCallback*, MediaErrorState&); static UserMediaRequest* createForTesting(const WebMediaConstraints& audio, const WebMediaConstraints& video); @@ -87,7 +87,7 @@ WebMediaConstraints m_audio; WebMediaConstraints m_video; - RawPtrWillBeMember<UserMediaController> m_controller; + Member<UserMediaController> m_controller; Member<NavigatorUserMediaSuccessCallback> m_successCallback; Member<NavigatorUserMediaErrorCallback> m_errorCallback;
diff --git a/third_party/WebKit/Source/modules/modules.gypi b/third_party/WebKit/Source/modules/modules.gypi index e5040ad7..257865b 100644 --- a/third_party/WebKit/Source/modules/modules.gypi +++ b/third_party/WebKit/Source/modules/modules.gypi
@@ -143,10 +143,6 @@ 'mediastream/RTCStatsReport.idl', 'mediastream/RTCStatsResponse.idl', 'mediastream/SourceInfo.idl', - 'navigatorconnect/CrossOriginServiceWorkerClient.idl', - 'navigatorconnect/ServicePort.idl', - 'navigatorconnect/ServicePortConnectEvent.idl', - 'navigatorconnect/ServicePortCollection.idl', 'netinfo/NetworkInformation.idl', 'nfc/MessageCallback.idl', 'nfc/NFC.idl', @@ -378,9 +374,6 @@ 'mediastream/NavigatorUserMedia.idl', 'mediastream/URLMediaStream.idl', 'mediastream/WindowMediaStream.idl', - 'navigatorconnect/NavigatorServices.idl', - 'navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.idl', - 'navigatorconnect/WorkerNavigatorServices.idl', 'navigatorcontentutils/NavigatorContentUtils.idl', 'nfc/NavigatorNFC.idl', 'netinfo/NavigatorNetworkInformation.idl', @@ -430,7 +423,6 @@ 'mediastream/RTCDTMFToneChangeEvent.idl', 'mediastream/RTCDataChannelEvent.idl', 'mediastream/RTCIceCandidateEvent.idl', - 'navigatorconnect/ServicePortConnectEvent.idl', 'notifications/NotificationEvent.idl', 'presentation/PresentationConnectionAvailableEvent.idl', 'presentation/PresentationConnectionCloseEvent.idl', @@ -498,10 +490,6 @@ 'mediastream/RTCOfferAnswerOptions.idl', 'mediastream/RTCOfferOptions.idl', 'mediastream/RTCSessionDescriptionInit.idl', - 'navigatorconnect/ServicePortConnectEventInit.idl', - 'navigatorconnect/ServicePortConnectOptions.idl', - 'navigatorconnect/ServicePortConnectResponse.idl', - 'navigatorconnect/ServicePortMatchOptions.idl', 'nfc/NFCMessage.idl', 'nfc/NFCPushOptions.idl', 'nfc/NFCRecord.idl', @@ -648,14 +636,6 @@ '<(blink_modules_output_dir)/mediastream/RTCOfferOptions.h', '<(blink_modules_output_dir)/mediastream/RTCSessionDescriptionInit.cpp', '<(blink_modules_output_dir)/mediastream/RTCSessionDescriptionInit.h', - '<(blink_modules_output_dir)/navigatorconnect/ServicePortConnectEventInit.cpp', - '<(blink_modules_output_dir)/navigatorconnect/ServicePortConnectEventInit.h', - '<(blink_modules_output_dir)/navigatorconnect/ServicePortConnectOptions.cpp', - '<(blink_modules_output_dir)/navigatorconnect/ServicePortConnectOptions.h', - '<(blink_modules_output_dir)/navigatorconnect/ServicePortConnectResponse.cpp', - '<(blink_modules_output_dir)/navigatorconnect/ServicePortConnectResponse.h', - '<(blink_modules_output_dir)/navigatorconnect/ServicePortMatchOptions.cpp', - '<(blink_modules_output_dir)/navigatorconnect/ServicePortMatchOptions.h', '<(blink_modules_output_dir)/nfc/NFCMessage.cpp', '<(blink_modules_output_dir)/nfc/NFCMessage.h', '<(blink_modules_output_dir)/nfc/NFCPushOptions.cpp', @@ -928,6 +908,8 @@ 'crypto/SubtleCrypto.h', 'crypto/WorkerGlobalScopeCrypto.cpp', 'crypto/WorkerGlobalScopeCrypto.h', + 'csspaint/CSSPaintDefinition.cpp', + 'csspaint/CSSPaintDefinition.h', 'csspaint/PaintRenderingContext2D.cpp', 'csspaint/PaintRenderingContext2D.h', 'csspaint/PaintWorklet.cpp', @@ -1306,21 +1288,6 @@ 'mediastream/UserMediaController.h', 'mediastream/UserMediaRequest.cpp', 'mediastream/UserMediaRequest.h', - 'navigatorconnect/AcceptConnectionObserver.cpp', - 'navigatorconnect/AcceptConnectionObserver.h', - 'navigatorconnect/CrossOriginServiceWorkerClient.cpp', - 'navigatorconnect/CrossOriginServiceWorkerClient.h', - 'navigatorconnect/NavigatorServices.cpp', - 'navigatorconnect/NavigatorServices.h', - 'navigatorconnect/ServicePort.cpp', - 'navigatorconnect/ServicePort.h', - 'navigatorconnect/ServicePortCollection.cpp', - 'navigatorconnect/ServicePortCollection.h', - 'navigatorconnect/ServicePortConnectEvent.cpp', - 'navigatorconnect/ServicePortConnectEvent.h', - 'navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.h', - 'navigatorconnect/WorkerNavigatorServices.cpp', - 'navigatorconnect/WorkerNavigatorServices.h', 'navigatorcontentutils/NavigatorContentUtils.cpp', 'navigatorcontentutils/NavigatorContentUtils.h', 'navigatorcontentutils/NavigatorContentUtilsClient.h', @@ -1971,11 +1938,13 @@ 'modules_unittest_files': [ 'accessibility/AXObjectTest.cpp', 'cachestorage/CacheTest.cpp', + 'canvas/HTMLCanvasElementModuleTest.cpp', 'canvas2d/CanvasRenderingContext2DAPITest.cpp', 'canvas2d/CanvasRenderingContext2DTest.cpp', 'compositorworker/CompositorWorkerThreadTest.cpp', 'credentialmanager/PasswordCredentialTest.cpp', 'csspaint/PaintRenderingContext2DTest.cpp', + 'csspaint/PaintWorkletTest.cpp', 'fetch/BodyStreamBufferTest.cpp', 'fetch/CompositeDataConsumerHandleTest.cpp', 'fetch/DataConsumerHandleTestUtil.cpp',
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/AcceptConnectionObserver.cpp b/third_party/WebKit/Source/modules/navigatorconnect/AcceptConnectionObserver.cpp deleted file mode 100644 index f0b4d01..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/AcceptConnectionObserver.cpp +++ /dev/null
@@ -1,164 +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. - -#include "modules/navigatorconnect/AcceptConnectionObserver.h" - -#include "bindings/core/v8/ExceptionState.h" -#include "bindings/core/v8/ScriptFunction.h" -#include "bindings/core/v8/ScriptPromise.h" -#include "bindings/core/v8/ScriptValue.h" -#include "bindings/core/v8/SerializedScriptValueFactory.h" -#include "core/dom/DOMException.h" -#include "core/dom/ExceptionCode.h" -#include "modules/navigatorconnect/ServicePort.h" -#include "modules/navigatorconnect/ServicePortConnectResponse.h" -#include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" - -namespace blink { - -// Function that is called when the promise passed to acceptConnection is either -// rejected or fulfilled. Calls the corresponding method on -// AcceptConnectionObserver. -class AcceptConnectionObserver::ThenFunction final : public ScriptFunction { -public: - enum ResolveType { - Fulfilled, - Rejected, - }; - - static v8::Local<v8::Function> createFunction(ScriptState* scriptState, AcceptConnectionObserver* observer, ResolveType type) - { - ThenFunction* self = new ThenFunction(scriptState, observer, type); - return self->bindToV8Function(); - } - - DEFINE_INLINE_VIRTUAL_TRACE() - { - visitor->trace(m_observer); - ScriptFunction::trace(visitor); - } - -private: - ThenFunction(ScriptState* scriptState, AcceptConnectionObserver* observer, ResolveType type) - : ScriptFunction(scriptState) - , m_observer(observer) - , m_resolveType(type) - { - } - - ScriptValue call(ScriptValue value) override - { - ASSERT(m_observer); - ASSERT(m_resolveType == Fulfilled || m_resolveType == Rejected); - if (m_resolveType == Rejected) - m_observer->responseWasRejected(); - else - m_observer->responseWasResolved(value); - m_observer = nullptr; - return value; - } - - Member<AcceptConnectionObserver> m_observer; - ResolveType m_resolveType; -}; - -AcceptConnectionObserver* AcceptConnectionObserver::create(ServicePortCollection* collection, PassOwnPtr<WebServicePortConnectEventCallbacks> callbacks, WebServicePortID portID, const KURL& targetURL) -{ - return new AcceptConnectionObserver(collection, callbacks, portID, targetURL); -} - -void AcceptConnectionObserver::contextDestroyed() -{ - ContextLifecycleObserver::contextDestroyed(); - m_state = Done; -} - -void AcceptConnectionObserver::didDispatchEvent() -{ - ASSERT(getExecutionContext()); - if (m_state != Initial) - return; - responseWasRejected(); -} - -ScriptPromise AcceptConnectionObserver::respondWith(ScriptState* scriptState, ScriptPromise value, ExceptionState& exceptionState) -{ - if (m_state != Initial) { - return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(InvalidStateError, "respondWith was already called.")); - } - - m_state = Pending; - m_resolver = ScriptPromiseResolver::create(scriptState); - ScriptPromise promise = m_resolver->promise(); - value.then( - ThenFunction::createFunction(scriptState, this, ThenFunction::Fulfilled), - ThenFunction::createFunction(scriptState, this, ThenFunction::Rejected)); - return promise; -} - -void AcceptConnectionObserver::responseWasRejected() -{ - ASSERT(getExecutionContext()); - if (m_resolver) - m_resolver->reject(DOMException::create(AbortError)); - m_callbacks->onError(); - m_state = Done; -} - -void AcceptConnectionObserver::responseWasResolved(const ScriptValue& value) -{ - ASSERT(getExecutionContext()); - - ScriptState* scriptState = m_resolver->getScriptState(); - ExceptionState exceptionState(ExceptionState::UnknownContext, nullptr, nullptr, scriptState->context()->Global(), scriptState->isolate()); - ServicePortConnectResponse response = ScriptValue::to<ServicePortConnectResponse>(scriptState->isolate(), value, exceptionState); - if (exceptionState.hadException()) { - exceptionState.reject(m_resolver.get()); - m_resolver = nullptr; - responseWasRejected(); - return; - } - if (!response.hasAccept() || !response.accept()) { - responseWasRejected(); - return; - } - WebServicePort webPort; - webPort.targetUrl = m_targetURL; - if (response.hasName()) - webPort.name = response.name(); - if (response.hasData()) { - webPort.data = SerializedScriptValueFactory::instance().create(scriptState->isolate(), response.data(), nullptr, exceptionState)->toWireString(); - if (exceptionState.hadException()) { - exceptionState.reject(m_resolver.get()); - m_resolver = nullptr; - responseWasRejected(); - return; - } - } - webPort.id = m_portID; - ServicePort* port = ServicePort::create(m_collection, webPort); - m_collection->addPort(port); - m_resolver->resolve(port); - m_callbacks->onSuccess(webPort); - m_state = Done; -} - -AcceptConnectionObserver::AcceptConnectionObserver(ServicePortCollection* collection, PassOwnPtr<WebServicePortConnectEventCallbacks> callbacks, WebServicePortID portID, const KURL& targetURL) - : ContextLifecycleObserver(collection->getExecutionContext()) - , m_callbacks(callbacks) - , m_collection(collection) - , m_portID(portID) - , m_targetURL(targetURL) - , m_state(Initial) -{ -} - -DEFINE_TRACE(AcceptConnectionObserver) -{ - visitor->trace(m_collection); - visitor->trace(m_resolver); - ContextLifecycleObserver::trace(visitor); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/AcceptConnectionObserver.h b/third_party/WebKit/Source/modules/navigatorconnect/AcceptConnectionObserver.h deleted file mode 100644 index e122108e..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/AcceptConnectionObserver.h +++ /dev/null
@@ -1,64 +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. - -#ifndef AcceptConnectionObserver_h -#define AcceptConnectionObserver_h - -#include "bindings/core/v8/ScriptPromiseResolver.h" -#include "core/dom/ContextLifecycleObserver.h" -#include "modules/ModulesExport.h" -#include "modules/navigatorconnect/ServicePortCollection.h" -#include "platform/heap/Handle.h" -#include "public/platform/modules/navigator_services/WebServicePort.h" - -namespace blink { - -class ExceptionState; -class ExecutionContext; -class ScriptPromise; -class ScriptState; -class ScriptValue; - -// This class observes the service worker's handling of a ServicePortConnectEvent -// and notifies the client of the result. Created for each instance of -// ServicePortConnectEvent. -class MODULES_EXPORT AcceptConnectionObserver final : public GarbageCollectedFinalized<AcceptConnectionObserver>, public ContextLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AcceptConnectionObserver); -public: - static AcceptConnectionObserver* create(ServicePortCollection*, PassOwnPtr<WebServicePortConnectEventCallbacks>, WebServicePortID, const KURL& targetURL); - - void contextDestroyed() override; - - // Must be called after dispatching the event. Will cause the connection to - // be rejected if no call to acceptConnection or respondWith was made. - void didDispatchEvent(); - - // Observes the promise and delays calling didHandleServicePortConnectEvent() - // until the given promise is resolved or rejected. Returns a promise that - // resolves to a ServicePort when the connection is accepted. - ScriptPromise respondWith(ScriptState*, ScriptPromise, ExceptionState&); - - void responseWasRejected(); - void responseWasResolved(const ScriptValue&); - - DECLARE_VIRTUAL_TRACE(); - -private: - class ThenFunction; - - AcceptConnectionObserver(ServicePortCollection*, PassOwnPtr<WebServicePortConnectEventCallbacks>, WebServicePortID, const KURL& targetURL); - - OwnPtr<WebServicePortConnectEventCallbacks> m_callbacks; - Member<ServicePortCollection> m_collection; - WebServicePortID m_portID; - KURL m_targetURL; - Member<ScriptPromiseResolver> m_resolver; - - enum State { Initial, Pending, Done }; - State m_state; -}; - -} // namespace blink - -#endif // AcceptConnectionObserver_h
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/CrossOriginServiceWorkerClient.cpp b/third_party/WebKit/Source/modules/navigatorconnect/CrossOriginServiceWorkerClient.cpp deleted file mode 100644 index 5759d4b..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/CrossOriginServiceWorkerClient.cpp +++ /dev/null
@@ -1,53 +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. - -#include "modules/navigatorconnect/CrossOriginServiceWorkerClient.h" - -#include "bindings/core/v8/ExceptionState.h" -#include "core/dom/MessagePort.h" -#include "modules/EventTargetModules.h" -#include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" -#include "public/platform/WebCrossOriginServiceWorkerClient.h" - -namespace blink { - -CrossOriginServiceWorkerClient* CrossOriginServiceWorkerClient::create(const WebCrossOriginServiceWorkerClient& client) -{ - return new CrossOriginServiceWorkerClient(client); -} - -CrossOriginServiceWorkerClient::CrossOriginServiceWorkerClient(const WebCrossOriginServiceWorkerClient& client) - : m_webClient(client) -{ -} - -CrossOriginServiceWorkerClient::~CrossOriginServiceWorkerClient() -{ -} - -String CrossOriginServiceWorkerClient::origin() const -{ - return m_webClient.origin.string(); -} - -String CrossOriginServiceWorkerClient::targetUrl() const -{ - return m_webClient.targetURL.string(); -} - -void CrossOriginServiceWorkerClient::postMessage(ExecutionContext* executionContext, PassRefPtr<SerializedScriptValue> message, const MessagePortArray* ports, ExceptionState& exceptionState) -{ - OwnPtr<MessagePortChannelArray> channels; - if (ports) { - channels = MessagePort::disentanglePorts(executionContext, ports, exceptionState); - if (exceptionState.hadException()) - return; - } - - WebString messageString = message->toWireString(); - OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePortChannelArray(channels.release()); - ServiceWorkerGlobalScopeClient::from(executionContext)->postMessageToCrossOriginClient(m_webClient, messageString, webChannels.release()); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/CrossOriginServiceWorkerClient.h b/third_party/WebKit/Source/modules/navigatorconnect/CrossOriginServiceWorkerClient.h deleted file mode 100644 index 9cf89a2..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/CrossOriginServiceWorkerClient.h +++ /dev/null
@@ -1,39 +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. - -#ifndef CrossOriginServiceWorkerClient_h -#define CrossOriginServiceWorkerClient_h - -#include "bindings/core/v8/ScriptWrappable.h" -#include "bindings/core/v8/SerializedScriptValue.h" -#include "core/events/EventTarget.h" -#include "modules/ModulesExport.h" -#include "platform/heap/Handle.h" -#include "public/platform/WebCrossOriginServiceWorkerClient.h" -#include "wtf/Forward.h" - -namespace blink { - -class MODULES_EXPORT CrossOriginServiceWorkerClient final - : public GarbageCollectedFinalized<CrossOriginServiceWorkerClient>, public ScriptWrappable { - DEFINE_WRAPPERTYPEINFO(); -public: - static CrossOriginServiceWorkerClient* create(const WebCrossOriginServiceWorkerClient&); - virtual ~CrossOriginServiceWorkerClient(); - - String origin() const; - String targetUrl() const; - void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, ExceptionState&); - - DEFINE_INLINE_VIRTUAL_TRACE() { } - -private: - explicit CrossOriginServiceWorkerClient(const WebCrossOriginServiceWorkerClient&); - - WebCrossOriginServiceWorkerClient m_webClient; -}; - -} // namespace blink - -#endif // CrossOriginServiceWorkerClient_h
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/CrossOriginServiceWorkerClient.idl b/third_party/WebKit/Source/modules/navigatorconnect/CrossOriginServiceWorkerClient.idl deleted file mode 100644 index cc868af..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/CrossOriginServiceWorkerClient.idl +++ /dev/null
@@ -1,16 +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. - -// http://mkruisselbrink.github.io/navigator-connect/#idl-def-CrossOriginServiceWorkerClient -[ - RuntimeEnabled=NavigatorConnect, - Exposed=ServiceWorker, - GarbageCollected -] interface CrossOriginServiceWorkerClient : EventTarget { - readonly attribute DOMString origin; - readonly attribute DOMString targetUrl; - - [PostMessage, RaisesException, CallWith=ExecutionContext] - void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer); -};
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/NavigatorServices.cpp b/third_party/WebKit/Source/modules/navigatorconnect/NavigatorServices.cpp deleted file mode 100644 index 6fc5329..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/NavigatorServices.cpp +++ /dev/null
@@ -1,53 +0,0 @@ -// 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. - -#include "modules/navigatorconnect/NavigatorServices.h" - -#include "core/frame/Navigator.h" -#include "modules/navigatorconnect/ServicePortCollection.h" - -namespace blink { - -NavigatorServices::~NavigatorServices() -{ -} - -NavigatorServices& NavigatorServices::from(Navigator& navigator) -{ - NavigatorServices* supplement = static_cast<NavigatorServices*>(HeapSupplement<Navigator>::from(navigator, supplementName())); - if (!supplement) { - supplement = new NavigatorServices(); - provideTo(navigator, supplementName(), supplement); - } - return *supplement; -} - -ServicePortCollection* NavigatorServices::services(ExecutionContext* context, Navigator& navigator) -{ - return NavigatorServices::from(navigator).services(context); -} - -ServicePortCollection* NavigatorServices::services(ExecutionContext* context) -{ - if (!m_services) - m_services = ServicePortCollection::create(context); - return m_services.get(); -} - -DEFINE_TRACE(NavigatorServices) -{ - visitor->trace(m_services); - HeapSupplement<Navigator>::trace(visitor); -} - -NavigatorServices::NavigatorServices() -{ -} - -const char* NavigatorServices::supplementName() -{ - return "NavigatorServices"; -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/NavigatorServices.h b/third_party/WebKit/Source/modules/navigatorconnect/NavigatorServices.h deleted file mode 100644 index 25bd3de..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/NavigatorServices.h +++ /dev/null
@@ -1,38 +0,0 @@ -// 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. - -#ifndef NavigatorServices_h -#define NavigatorServices_h - -#include "platform/Supplementable.h" -#include "platform/heap/Handle.h" - -namespace blink { - -class ExecutionContext; -class ServicePortCollection; -class Navigator; - -class NavigatorServices final : public GarbageCollectedFinalized<NavigatorServices>, public HeapSupplement<Navigator> { - USING_GARBAGE_COLLECTED_MIXIN(NavigatorServices); - WTF_MAKE_NONCOPYABLE(NavigatorServices); -public: - virtual ~NavigatorServices(); - static NavigatorServices& from(Navigator&); - - static ServicePortCollection* services(ExecutionContext*, Navigator&); - ServicePortCollection* services(ExecutionContext*); - - DECLARE_VIRTUAL_TRACE(); - -private: - NavigatorServices(); - static const char* supplementName(); - - Member<ServicePortCollection> m_services; -}; - -} // namespace blink - -#endif // NavigatorServices_h
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/NavigatorServices.idl b/third_party/WebKit/Source/modules/navigatorconnect/NavigatorServices.idl deleted file mode 100644 index 99f52f8..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/NavigatorServices.idl +++ /dev/null
@@ -1,10 +0,0 @@ -// 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. - -// https://mkruisselbrink.github.io/navigator-connect/#idl-def-NavigatorServices -[ - RuntimeEnabled=NavigatorConnect, -] partial interface Navigator { - [CallWith=ExecutionContext] readonly attribute ServicePortCollection services; -};
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/OWNERS b/third_party/WebKit/Source/modules/navigatorconnect/OWNERS deleted file mode 100644 index 1b10b343..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/OWNERS +++ /dev/null
@@ -1 +0,0 @@ -mek@chromium.org
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePort.cpp b/third_party/WebKit/Source/modules/navigatorconnect/ServicePort.cpp deleted file mode 100644 index ae21067..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePort.cpp +++ /dev/null
@@ -1,85 +0,0 @@ -// 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. - -#include "modules/navigatorconnect/ServicePort.h" - -#include "bindings/core/v8/ScriptValue.h" -#include "bindings/core/v8/SerializedScriptValueFactory.h" -#include "core/dom/MessagePort.h" -#include "modules/navigatorconnect/ServicePortCollection.h" -#include "public/platform/Platform.h" -#include "public/platform/modules/navigator_services/WebServicePortProvider.h" - -namespace blink { - -ServicePort* ServicePort::create(ServicePortCollection* collection, const WebServicePort& port) -{ - return new ServicePort(collection, port); -} - -ServicePort::~ServicePort() -{ -} - -String ServicePort::targetURL() const -{ - return m_port.targetUrl.string(); -} - -String ServicePort::name() const -{ - return m_port.name; -} - -ScriptValue ServicePort::data(ScriptState* scriptState) const -{ - if (!m_serializedData) - return ScriptValue::createNull(scriptState); - - return ScriptValue(scriptState, m_serializedData->deserialize(scriptState->isolate())); -} - -void ServicePort::postMessage(ExecutionContext* executionContext, PassRefPtr<SerializedScriptValue> message, const MessagePortArray* ports, ExceptionState& exceptionState) -{ - OwnPtr<MessagePortChannelArray> channels; - if (ports) { - channels = MessagePort::disentanglePorts(executionContext, ports, exceptionState); - if (exceptionState.hadException()) - return; - } - - WebString messageString = message->toWireString(); - OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePortChannelArray(channels.release()); - if (m_collection) { - WebServicePortProvider* provider = m_collection->provider(); - provider->postMessage(m_port.id, messageString, webChannels.leakPtr()); - } -} - -void ServicePort::close() -{ - // TODO(mek): Figure out if this should throw instead of just quietly fail. - if (!m_isOpen) - return; - - m_collection->closePort(this); - m_collection = nullptr; - m_isOpen = false; -} - -DEFINE_TRACE(ServicePort) -{ - visitor->trace(m_collection); -} - -ServicePort::ServicePort(ServicePortCollection* collection, const WebServicePort& port) - : m_isOpen(true), m_port(port), m_collection(collection) -{ - if (!m_port.data.isEmpty()) { - m_serializedData = SerializedScriptValueFactory::instance().createFromWire(m_port.data); - } -} - -} // namespace blink -
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePort.h b/third_party/WebKit/Source/modules/navigatorconnect/ServicePort.h deleted file mode 100644 index efc27dc..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePort.h +++ /dev/null
@@ -1,53 +0,0 @@ -// 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. - -#ifndef ServicePort_h -#define ServicePort_h - -#include "bindings/core/v8/ScriptWrappable.h" -#include "core/dom/MessagePort.h" -#include "modules/ModulesExport.h" -#include "public/platform/modules/navigator_services/WebServicePort.h" - -namespace blink { - -class ExceptionState; -class ExecutionContext; -class MessagePort; -class ScriptState; -class ScriptValue; -class SerializedScriptValue; -class ServicePortCollection; - -class MODULES_EXPORT ServicePort final - : public GarbageCollectedFinalized<ServicePort>, public ScriptWrappable { - DEFINE_WRAPPERTYPEINFO(); - WTF_MAKE_NONCOPYABLE(ServicePort); -public: - static ServicePort* create(ServicePortCollection*, const WebServicePort&); - virtual ~ServicePort(); - - WebServicePortID id() const { return m_port.id; } - - // ServicePort.idl - String targetURL() const; - String name() const; - ScriptValue data(ScriptState*) const; - void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, ExceptionState&); - void close(); - - DECLARE_VIRTUAL_TRACE(); - -private: - ServicePort(ServicePortCollection*, const WebServicePort&); - - bool m_isOpen; - WebServicePort m_port; - RefPtr<SerializedScriptValue> m_serializedData; - Member<ServicePortCollection> m_collection; -}; - -} // namespace blink - -#endif // ServicePort_h
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePort.idl b/third_party/WebKit/Source/modules/navigatorconnect/ServicePort.idl deleted file mode 100644 index 8cbfeee..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePort.idl +++ /dev/null
@@ -1,17 +0,0 @@ -// 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. - -// https://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePort -[ - Exposed=(Window,Worker), - RuntimeEnabled=NavigatorConnect, - GarbageCollected, -] interface ServicePort { - readonly attribute DOMString targetURL; - readonly attribute DOMString name; - [CallWith=ScriptState] readonly attribute any data; - [PostMessage, RaisesException, CallWith=ExecutionContext] - void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer); - void close(); -};
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.cpp b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.cpp deleted file mode 100644 index 6b80be9..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.cpp +++ /dev/null
@@ -1,174 +0,0 @@ -// 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. - -#include "modules/navigatorconnect/ServicePortCollection.h" - -#include "bindings/core/v8/ScriptPromiseResolver.h" -#include "bindings/core/v8/SerializedScriptValueFactory.h" -#include "core/dom/DOMException.h" -#include "core/dom/ExceptionCode.h" -#include "core/dom/MessagePort.h" -#include "core/events/MessageEvent.h" -#include "modules/EventTargetModules.h" -#include "modules/navigatorconnect/AcceptConnectionObserver.h" -#include "modules/navigatorconnect/ServicePort.h" -#include "modules/navigatorconnect/ServicePortConnectEvent.h" -#include "modules/navigatorconnect/ServicePortConnectEventInit.h" -#include "modules/navigatorconnect/ServicePortConnectOptions.h" -#include "public/platform/Platform.h" -#include "public/platform/modules/navigator_services/WebServicePortProvider.h" - -namespace blink { - -namespace { - -class ConnectCallbacks : public WebServicePortConnectCallbacks { -public: - ConnectCallbacks(ScriptPromiseResolver* resolver, ServicePortCollection* collection, const KURL& targetUrl, const String& portName, const String& serializedPortData) - : m_resolver(resolver), m_collection(collection), m_targetUrl(targetUrl), m_portName(portName), m_serializedPortData(serializedPortData) - { - ASSERT(m_resolver); - } - - ~ConnectCallbacks() override { } - - void onSuccess(WebServicePortID portId) override - { - if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) { - return; - } - WebServicePort webPort; - webPort.id = portId; - webPort.targetUrl = m_targetUrl; - webPort.name = m_portName; - webPort.data = m_serializedPortData; - ServicePort* port = ServicePort::create(m_collection, webPort); - m_collection->addPort(port); - m_resolver->resolve(port); - } - - void onError() override - { - // TODO(mek): Pass actual error code back. - if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) { - return; - } - m_resolver->reject(DOMException::create(AbortError)); - } - -private: - Persistent<ScriptPromiseResolver> m_resolver; - Persistent<ServicePortCollection> m_collection; - KURL m_targetUrl; - String m_portName; - String m_serializedPortData; - - WTF_MAKE_NONCOPYABLE(ConnectCallbacks); -}; - -} // namespace - -ServicePortCollection* ServicePortCollection::create(ExecutionContext* context) -{ - return new ServicePortCollection(context); -} - -ServicePortCollection::~ServicePortCollection() -{ -} - -void ServicePortCollection::addPort(ServicePort* port) -{ - m_ports.append(port); -} - -void ServicePortCollection::closePort(ServicePort* port) -{ - m_ports.remove(m_ports.find(port)); - if (m_provider) - m_provider->closePort(port->id()); -} - -ScriptPromise ServicePortCollection::connect(ScriptState* scriptState, const String& url, const ServicePortConnectOptions& options, ExceptionState& exceptionState) -{ - if (!m_provider) - return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError)); - - RefPtr<SerializedScriptValue> portData; - if (options.hasData()) { - portData = SerializedScriptValueFactory::instance().create(options.data().isolate(), options.data(), nullptr, exceptionState); - if (exceptionState.hadException()) - return exceptionState.reject(scriptState); - } - ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); - ScriptPromise promise = resolver->promise(); - KURL targetUrl = scriptState->getExecutionContext()->completeURL(url); - m_provider->connect( - targetUrl, - scriptState->getExecutionContext()->getSecurityOrigin()->toString(), - new ConnectCallbacks(resolver, this, targetUrl, options.name(), portData ? portData->toWireString() : String())); - return promise; -} - -ScriptPromise ServicePortCollection::match(ScriptState* scriptState, const ServicePortMatchOptions& options) -{ - return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError)); -} - -ScriptPromise ServicePortCollection::matchAll(ScriptState* scriptState, const ServicePortMatchOptions& options) -{ - return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError)); -} - -const AtomicString& ServicePortCollection::interfaceName() const -{ - return EventTargetNames::ServicePortCollection; -} - -ExecutionContext* ServicePortCollection::getExecutionContext() const -{ - return ContextLifecycleObserver::getExecutionContext(); -} - -void ServicePortCollection::postMessage(WebServicePortID portId, const WebString& messageString, const WebMessagePortChannelArray& webChannels) -{ - OwnPtr<MessagePortChannelArray> channels; - if (webChannels.size()) { - channels = adoptPtr(new MessagePortChannelArray(webChannels.size())); - for (size_t i = 0; i < webChannels.size(); ++i) - (*channels)[i] = adoptPtr(webChannels[i]); - } - RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instance().createFromWire(messageString); - - MessagePortArray* ports = MessagePort::entanglePorts(*getExecutionContext(), channels.release()); - RefPtrWillBeRawPtr<Event> evt = MessageEvent::create(ports, message.release()); - // TODO(mek): Lookup ServicePort and set events source attribute. - dispatchEvent(evt.release()); -} - -void ServicePortCollection::dispatchConnectEvent(PassOwnPtr<WebServicePortConnectEventCallbacks> callbacks, const WebURL& targetURL, const WebString& origin, WebServicePortID portID) -{ - AcceptConnectionObserver* observer = AcceptConnectionObserver::create(this, callbacks, portID, targetURL); - ServicePortConnectEventInit init; - init.setTargetURL(targetURL.string()); - init.setOrigin(origin); - RefPtrWillBeRawPtr<Event> event = ServicePortConnectEvent::create(EventTypeNames::connect, init, observer); - dispatchEvent(event.release()); - observer->didDispatchEvent(); -} - -DEFINE_TRACE(ServicePortCollection) -{ - visitor->trace(m_ports); - RefCountedGarbageCollectedEventTargetWithInlineData<ServicePortCollection>::trace(visitor); - ContextLifecycleObserver::trace(visitor); -} - -ServicePortCollection::ServicePortCollection(ExecutionContext* context) - : ContextLifecycleObserver(context) - , m_provider(adoptPtr(Platform::current()->createServicePortProvider(this))) -{ -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.h b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.h deleted file mode 100644 index 5107bec55..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.h +++ /dev/null
@@ -1,74 +0,0 @@ -// 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. - -#ifndef ServicePortCollection_h -#define ServicePortCollection_h - -#include "bindings/core/v8/ScriptPromise.h" -#include "core/dom/ContextLifecycleObserver.h" -#include "core/events/EventTarget.h" -#include "modules/ModulesExport.h" -#include "platform/heap/Handle.h" -#include "public/platform/modules/navigator_services/WebServicePortCallbacks.h" -#include "public/platform/modules/navigator_services/WebServicePortProvider.h" -#include "public/platform/modules/navigator_services/WebServicePortProviderClient.h" -#include "wtf/RefCounted.h" - -namespace blink { - -class ServicePort; -class ServicePortConnectOptions; -class ServicePortMatchOptions; - -class MODULES_EXPORT ServicePortCollection final - : public RefCountedGarbageCollectedEventTargetWithInlineData<ServicePortCollection> - , public ContextLifecycleObserver - , public WebServicePortProviderClient { - DEFINE_WRAPPERTYPEINFO(); - REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServicePortCollection); - WTF_MAKE_NONCOPYABLE(ServicePortCollection); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServicePortCollection); -public: - static ServicePortCollection* create(ExecutionContext*); - ~ServicePortCollection() override; - - // Adds a port to this collection to keep track of it and allow delivering - // events related to it. - void addPort(ServicePort*); - - // Called when a port is closed to signal the WebServicePortProvider as well - // as remove the port from this collection. - void closePort(ServicePort*); - - WebServicePortProvider* provider() { return m_provider.get(); } - - // ServicePortCollection.idl - ScriptPromise connect(ScriptState*, const String& url, const ServicePortConnectOptions&, ExceptionState&); - ScriptPromise match(ScriptState*, const ServicePortMatchOptions&); - ScriptPromise matchAll(ScriptState*, const ServicePortMatchOptions&); - DEFINE_ATTRIBUTE_EVENT_LISTENER(connect); - DEFINE_ATTRIBUTE_EVENT_LISTENER(message); - DEFINE_ATTRIBUTE_EVENT_LISTENER(close); - - // EventTarget overrides. - const AtomicString& interfaceName() const override; - ExecutionContext* getExecutionContext() const override; - - // WebServicePortProviderClient overrides. - void postMessage(WebServicePortID, const WebString&, const WebMessagePortChannelArray&) override; - - void dispatchConnectEvent(PassOwnPtr<WebServicePortConnectEventCallbacks>, const WebURL& targetURL, const WebString& origin, WebServicePortID); - - DECLARE_VIRTUAL_TRACE(); - -private: - explicit ServicePortCollection(ExecutionContext*); - - OwnPtr<WebServicePortProvider> m_provider; - HeapVector<Member<ServicePort>> m_ports; -}; - -} // namespace blink - -#endif // ServicePortCollection_h
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.idl b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.idl deleted file mode 100644 index bcdc2b0..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.idl +++ /dev/null
@@ -1,17 +0,0 @@ -// 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. - -// https://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortCollection -[ - Exposed=(Window,Worker), - GarbageCollected, - RuntimeEnabled=NavigatorConnect, -] interface ServicePortCollection : EventTarget { - [CallWith=ScriptState, RaisesException] Promise<ServicePort> connect(DOMString url, optional ServicePortConnectOptions options); - [CallWith=ScriptState] Promise<ServicePort> match(ServicePortMatchOptions options); - [CallWith=ScriptState] Promise<sequence<ServicePort>> matchAll(optional ServicePortMatchOptions options); - [Exposed=ServiceWorker] attribute EventHandler onconnect; - attribute EventHandler onmessage; - attribute EventHandler onclose; -};
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEvent.cpp b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEvent.cpp deleted file mode 100644 index 18817426..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEvent.cpp +++ /dev/null
@@ -1,61 +0,0 @@ -// 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. - -#include "modules/navigatorconnect/ServicePortConnectEvent.h" - -#include "core/dom/DOMException.h" -#include "core/dom/ExceptionCode.h" -#include "modules/navigatorconnect/AcceptConnectionObserver.h" -#include "modules/navigatorconnect/ServicePortConnectEventInit.h" - -namespace blink { - -PassRefPtrWillBeRawPtr<ServicePortConnectEvent> ServicePortConnectEvent::create() -{ - return adoptRefWillBeNoop(new ServicePortConnectEvent()); -} - -PassRefPtrWillBeRawPtr<ServicePortConnectEvent> ServicePortConnectEvent::create(const AtomicString& type, const ServicePortConnectEventInit& initializer) -{ - return adoptRefWillBeNoop(new ServicePortConnectEvent(type, initializer, nullptr)); -} - -PassRefPtrWillBeRawPtr<ServicePortConnectEvent> ServicePortConnectEvent::create(const AtomicString& type, const ServicePortConnectEventInit& initializer, AcceptConnectionObserver* observer) -{ - return adoptRefWillBeNoop(new ServicePortConnectEvent(type, initializer, observer)); -} - -ScriptPromise ServicePortConnectEvent::respondWith(ScriptState* scriptState, const ScriptPromise& response, ExceptionState& exceptionState) -{ - stopImmediatePropagation(); - if (m_observer) - return m_observer->respondWith(scriptState, response, exceptionState); - return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError)); -} - -const AtomicString& ServicePortConnectEvent::interfaceName() const -{ - return EventNames::ServicePortConnectEvent; -} - -DEFINE_TRACE(ServicePortConnectEvent) -{ - visitor->trace(m_observer); - ExtendableEvent::trace(visitor); -} - -ServicePortConnectEvent::ServicePortConnectEvent() -{ -} - -ServicePortConnectEvent::ServicePortConnectEvent(const AtomicString& type, const ServicePortConnectEventInit& initializer, AcceptConnectionObserver* observer) - : ExtendableEvent(type, initializer) - , m_observer(observer) - , m_targetURL(initializer.targetURL()) - , m_origin(initializer.origin()) -{ -} - -} // namespace blink -
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEvent.h b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEvent.h deleted file mode 100644 index a687b67..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEvent.h +++ /dev/null
@@ -1,50 +0,0 @@ -// 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. - -#ifndef ServicePortConnectEvent_h -#define ServicePortConnectEvent_h - -#include "modules/EventModules.h" -#include "modules/ModulesExport.h" -#include "modules/serviceworkers/ExtendableEvent.h" -#include "platform/heap/Handle.h" - -namespace blink { - -class AcceptConnectionObserver; -class ExceptionState; -class ServicePortConnectEventInit; - -// A connect event is dispatched by the client to a service worker's script. -// AcceptConnectionObserver can be used to notify the client about the service -// worker's response. -class MODULES_EXPORT ServicePortConnectEvent final : public ExtendableEvent { - DEFINE_WRAPPERTYPEINFO(); -public: - static PassRefPtrWillBeRawPtr<ServicePortConnectEvent> create(); - static PassRefPtrWillBeRawPtr<ServicePortConnectEvent> create(const AtomicString& type, const ServicePortConnectEventInit&); - static PassRefPtrWillBeRawPtr<ServicePortConnectEvent> create(const AtomicString& type, const ServicePortConnectEventInit&, AcceptConnectionObserver*); - - // ServicePortConnectEvent.idl - String targetURL() const { return m_targetURL; } - String origin() const { return m_origin; } - ScriptPromise respondWith(ScriptState*, const ScriptPromise& response, ExceptionState&); - - const AtomicString& interfaceName() const override; - - DECLARE_VIRTUAL_TRACE(); - -protected: - ServicePortConnectEvent(); - ServicePortConnectEvent(const AtomicString& type, const ServicePortConnectEventInit&, AcceptConnectionObserver*); - -private: - PersistentWillBeMember<AcceptConnectionObserver> m_observer; - String m_targetURL; - String m_origin; -}; - -} // namespace blink - -#endif // ServicePortConnectEvent_h
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEvent.idl b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEvent.idl deleted file mode 100644 index 27fd436b..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEvent.idl +++ /dev/null
@@ -1,14 +0,0 @@ -// 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. - -// https://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortConnectEvent -[ - Exposed=ServiceWorker, - RuntimeEnabled=NavigatorConnect, - Constructor(DOMString type, optional ServicePortConnectEventInit eventInitDict), -] interface ServicePortConnectEvent : ExtendableEvent { - readonly attribute DOMString targetURL; - readonly attribute DOMString origin; - [CallWith=ScriptState, RaisesException] Promise<ServicePort> respondWith(Promise<ServicePortConnectResponse> response); -};
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEventInit.idl b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEventInit.idl deleted file mode 100644 index 1afd760..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectEventInit.idl +++ /dev/null
@@ -1,11 +0,0 @@ -// 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. - -// https://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortConnectEventInit - -dictionary ServicePortConnectEventInit : ExtendableEventInit { - DOMString targetURL; - DOMString origin; -}; -
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectOptions.idl b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectOptions.idl deleted file mode 100644 index 4268cb10..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectOptions.idl +++ /dev/null
@@ -1,10 +0,0 @@ -// 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. - -// https://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortConnectOptions - -dictionary ServicePortConnectOptions { - DOMString name; - any data; -};
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectResponse.idl b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectResponse.idl deleted file mode 100644 index ea7e097..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortConnectResponse.idl +++ /dev/null
@@ -1,12 +0,0 @@ -// 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. - -// https://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortConnectResponse - -dictionary ServicePortConnectResponse { - boolean accept; - DOMString name; - any data; -}; -
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortMatchOptions.idl b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortMatchOptions.idl deleted file mode 100644 index b596995..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortMatchOptions.idl +++ /dev/null
@@ -1,10 +0,0 @@ -// 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. - -// https://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortMatchOptions - -dictionary ServicePortMatchOptions { - DOMString name; - DOMString targetURL; -};
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.h b/third_party/WebKit/Source/modules/navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.h deleted file mode 100644 index 109451a..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.h +++ /dev/null
@@ -1,19 +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. - -#ifndef ServiceWorkerGlobalScopeNavigatorConnect_h -#define ServiceWorkerGlobalScopeNavigatorConnect_h - -#include "core/events/EventTarget.h" - -namespace blink { - -class ServiceWorkerGlobalScopeNavigatorConnect { -public: - DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(crossoriginmessage); -}; - -} // namespace blink - -#endif // ServiceWorkerGlobalScopeNavigatorConnect_h
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.idl b/third_party/WebKit/Source/modules/navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.idl deleted file mode 100644 index fe645ae..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.idl +++ /dev/null
@@ -1,11 +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. - -// http://mkruisselbrink.github.io/navigator-connect/#idl-def-ServiceWorkerGlobalScope - -[ - RuntimeEnabled=NavigatorConnect, -] partial interface ServiceWorkerGlobalScope { - attribute EventHandler oncrossoriginmessage; -};
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/WorkerNavigatorServices.cpp b/third_party/WebKit/Source/modules/navigatorconnect/WorkerNavigatorServices.cpp deleted file mode 100644 index f84f55b..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/WorkerNavigatorServices.cpp +++ /dev/null
@@ -1,53 +0,0 @@ -// 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. - -#include "modules/navigatorconnect/WorkerNavigatorServices.h" - -#include "core/workers/WorkerNavigator.h" -#include "modules/navigatorconnect/ServicePortCollection.h" - -namespace blink { - -WorkerNavigatorServices::~WorkerNavigatorServices() -{ -} - -WorkerNavigatorServices& WorkerNavigatorServices::from(WorkerNavigator& navigator) -{ - WorkerNavigatorServices* supplement = static_cast<WorkerNavigatorServices*>(HeapSupplement<WorkerNavigator>::from(navigator, supplementName())); - if (!supplement) { - supplement = new WorkerNavigatorServices(); - provideTo(navigator, supplementName(), supplement); - } - return *supplement; -} - -ServicePortCollection* WorkerNavigatorServices::services(ExecutionContext* context, WorkerNavigator& navigator) -{ - return WorkerNavigatorServices::from(navigator).services(context); -} - -ServicePortCollection* WorkerNavigatorServices::services(ExecutionContext* context) -{ - if (!m_services) - m_services = ServicePortCollection::create(context); - return m_services.get(); -} - -DEFINE_TRACE(WorkerNavigatorServices) -{ - visitor->trace(m_services); - HeapSupplement<WorkerNavigator>::trace(visitor); -} - -WorkerNavigatorServices::WorkerNavigatorServices() -{ -} - -const char* WorkerNavigatorServices::supplementName() -{ - return "WorkerNavigatorServices"; -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/WorkerNavigatorServices.h b/third_party/WebKit/Source/modules/navigatorconnect/WorkerNavigatorServices.h deleted file mode 100644 index 2fea068..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/WorkerNavigatorServices.h +++ /dev/null
@@ -1,39 +0,0 @@ -// 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. - -#ifndef WorkerNavigatorServices_h -#define WorkerNavigatorServices_h - -#include "modules/ModulesExport.h" -#include "platform/Supplementable.h" -#include "platform/heap/Handle.h" - -namespace blink { - -class ExecutionContext; -class ServicePortCollection; -class WorkerNavigator; - -class MODULES_EXPORT WorkerNavigatorServices final : public GarbageCollectedFinalized<WorkerNavigatorServices>, public HeapSupplement<WorkerNavigator> { - USING_GARBAGE_COLLECTED_MIXIN(WorkerNavigatorServices); - WTF_MAKE_NONCOPYABLE(WorkerNavigatorServices); -public: - virtual ~WorkerNavigatorServices(); - static WorkerNavigatorServices& from(WorkerNavigator&); - - static ServicePortCollection* services(ExecutionContext*, WorkerNavigator&); - ServicePortCollection* services(ExecutionContext*); - - DECLARE_VIRTUAL_TRACE(); - -private: - WorkerNavigatorServices(); - static const char* supplementName(); - - Member<ServicePortCollection> m_services; -}; - -} // namespace blink - -#endif // WorkerNavigatorServices_h
diff --git a/third_party/WebKit/Source/modules/navigatorconnect/WorkerNavigatorServices.idl b/third_party/WebKit/Source/modules/navigatorconnect/WorkerNavigatorServices.idl deleted file mode 100644 index e5e87bd8..0000000 --- a/third_party/WebKit/Source/modules/navigatorconnect/WorkerNavigatorServices.idl +++ /dev/null
@@ -1,10 +0,0 @@ -// 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. - -// https://mkruisselbrink.github.io/navigator-connect/#idl-def-NavigatorServices -[ - RuntimeEnabled=NavigatorConnect, -] partial interface WorkerNavigator { - [CallWith=ExecutionContext] readonly attribute ServicePortCollection services; -};
diff --git a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp index c18aade..40e41be 100644 --- a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp +++ b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
@@ -138,16 +138,16 @@ NavigatorContentUtils* NavigatorContentUtils::from(LocalFrame& frame) { - return static_cast<NavigatorContentUtils*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); + return static_cast<NavigatorContentUtils*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); } NavigatorContentUtils::~NavigatorContentUtils() { } -PassOwnPtrWillBeRawPtr<NavigatorContentUtils> NavigatorContentUtils::create(PassOwnPtrWillBeRawPtr<NavigatorContentUtilsClient> client) +RawPtr<NavigatorContentUtils> NavigatorContentUtils::create(RawPtr<NavigatorContentUtilsClient> client) { - return adoptPtrWillBeNoop(new NavigatorContentUtils(client)); + return new NavigatorContentUtils(client); } void NavigatorContentUtils::registerProtocolHandler(Navigator& navigator, const String& scheme, const String& url, const String& title, ExceptionState& exceptionState) @@ -229,7 +229,7 @@ return "NavigatorContentUtils"; } -void provideNavigatorContentUtilsTo(LocalFrame& frame, PassOwnPtrWillBeRawPtr<NavigatorContentUtilsClient> client) +void provideNavigatorContentUtilsTo(LocalFrame& frame, RawPtr<NavigatorContentUtilsClient> client) { NavigatorContentUtils::provideTo(frame, NavigatorContentUtils::supplementName(), NavigatorContentUtils::create(client)); }
diff --git a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.h b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.h index 96bf9ba..429fdf4 100644 --- a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.h +++ b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.h
@@ -40,9 +40,8 @@ class LocalFrame; class Navigator; -class MODULES_EXPORT NavigatorContentUtils final : public NoBaseWillBeGarbageCollectedFinalized<NavigatorContentUtils>, public WillBeHeapSupplement<LocalFrame> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorContentUtils); - USING_FAST_MALLOC_WILL_BE_REMOVED(NavigatorContentUtils); +class MODULES_EXPORT NavigatorContentUtils final : public GarbageCollectedFinalized<NavigatorContentUtils>, public HeapSupplement<LocalFrame> { + USING_GARBAGE_COLLECTED_MIXIN(NavigatorContentUtils); public: virtual ~NavigatorContentUtils(); @@ -53,25 +52,25 @@ static String isProtocolHandlerRegistered(Navigator&, const String& scheme, const String& url, ExceptionState&); static void unregisterProtocolHandler(Navigator&, const String& scheme, const String& url, ExceptionState&); - static PassOwnPtrWillBeRawPtr<NavigatorContentUtils> create(PassOwnPtrWillBeRawPtr<NavigatorContentUtilsClient>); + static RawPtr<NavigatorContentUtils> create(RawPtr<NavigatorContentUtilsClient>); DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_client); - WillBeHeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); } - void setClientForTest(PassOwnPtrWillBeRawPtr<NavigatorContentUtilsClient> client) { m_client = client; } + void setClientForTest(RawPtr<NavigatorContentUtilsClient> client) { m_client = client; } private: - explicit NavigatorContentUtils(PassOwnPtrWillBeRawPtr<NavigatorContentUtilsClient> client) + explicit NavigatorContentUtils(RawPtr<NavigatorContentUtilsClient> client) : m_client(client) { } NavigatorContentUtilsClient* client() { return m_client.get(); } - OwnPtrWillBeMember<NavigatorContentUtilsClient> m_client; + Member<NavigatorContentUtilsClient> m_client; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtilsClient.h b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtilsClient.h index cd272dd..d0ce0cde 100644 --- a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtilsClient.h +++ b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtilsClient.h
@@ -36,8 +36,7 @@ class LocalFrame; -class NavigatorContentUtilsClient : public NoBaseWillBeGarbageCollectedFinalized<NavigatorContentUtilsClient> { - USING_FAST_MALLOC_WILL_BE_REMOVED(NavigatorContentUtilsClient); +class NavigatorContentUtilsClient : public GarbageCollectedFinalized<NavigatorContentUtilsClient> { public: virtual ~NavigatorContentUtilsClient() { } virtual void registerProtocolHandler(const String& scheme, const KURL&, const String& title) = 0; @@ -54,7 +53,7 @@ DEFINE_INLINE_VIRTUAL_TRACE() { } }; -MODULES_EXPORT void provideNavigatorContentUtilsTo(LocalFrame&, PassOwnPtrWillBeRawPtr<NavigatorContentUtilsClient>); +MODULES_EXPORT void provideNavigatorContentUtilsTo(LocalFrame&, RawPtr<NavigatorContentUtilsClient>); } // namespace blink
diff --git a/third_party/WebKit/Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h b/third_party/WebKit/Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h index e863546..eec618e 100644 --- a/third_party/WebKit/Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h +++ b/third_party/WebKit/Source/modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h
@@ -17,7 +17,7 @@ // Provides a mock object for the navigatorcontentutils client. class NavigatorContentUtilsClientMock final : public NavigatorContentUtilsClient { public: - static PassOwnPtrWillBeRawPtr<NavigatorContentUtilsClientMock> create() + static RawPtr<NavigatorContentUtilsClientMock> create() { return adoptPtrWillBeNoop(new NavigatorContentUtilsClientMock); }
diff --git a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp index 25f4b4e..5e413f2 100644 --- a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp +++ b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp
@@ -103,7 +103,7 @@ return ActiveDOMObject::getExecutionContext(); } -bool NetworkInformation::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) +bool NetworkInformation::addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener> listener, const EventListenerOptions& options) { if (!EventTargetWithInlineData::addEventListenerInternal(eventType, listener, options)) return false; @@ -111,7 +111,7 @@ return true; } -bool NetworkInformation::removeEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) +bool NetworkInformation::removeEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener> listener, const EventListenerOptions& options) { if (!EventTargetWithInlineData::removeEventListenerInternal(eventType, listener, options)) return false;
diff --git a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h index 0776552..7a1055c1 100644 --- a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h +++ b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h
@@ -21,7 +21,7 @@ , public ActiveDOMObject , public NetworkStateNotifier::NetworkStateObserver { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(NetworkInformation); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NetworkInformation); + USING_GARBAGE_COLLECTED_MIXIN(NetworkInformation); DEFINE_WRAPPERTYPEINFO(); public: static NetworkInformation* create(ExecutionContext*); @@ -51,8 +51,8 @@ protected: // EventTarget overrides. - bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener>, const EventListenerOptions&) override; - bool removeEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener>, const EventListenerOptions&) override; + bool addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener>, const EventListenerOptions&) override; + bool removeEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener>, const EventListenerOptions&) override; private: explicit NetworkInformation(ExecutionContext*);
diff --git a/third_party/WebKit/Source/modules/nfc/NFC.h b/third_party/WebKit/Source/modules/nfc/NFC.h index 50b9b47e..f5a8580 100644 --- a/third_party/WebKit/Source/modules/nfc/NFC.h +++ b/third_party/WebKit/Source/modules/nfc/NFC.h
@@ -24,7 +24,7 @@ , public LocalFrameLifecycleObserver , public PageLifecycleObserver { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NFC); + USING_GARBAGE_COLLECTED_MIXIN(NFC); public: static NFC* create(LocalFrame*);
diff --git a/third_party/WebKit/Source/modules/notifications/Notification.cpp b/third_party/WebKit/Source/modules/notifications/Notification.cpp index 2e66d25..b22dbe35 100644 --- a/third_party/WebKit/Source/modules/notifications/Notification.cpp +++ b/third_party/WebKit/Source/modules/notifications/Notification.cpp
@@ -358,7 +358,7 @@ return notificationManager()->maxActions(); } -DispatchEventResult Notification::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) +DispatchEventResult Notification::dispatchEventInternal(RawPtr<Event> event) { ASSERT(getExecutionContext()->isContextThread()); return EventTarget::dispatchEventInternal(event);
diff --git a/third_party/WebKit/Source/modules/notifications/Notification.h b/third_party/WebKit/Source/modules/notifications/Notification.h index 0b9295a0..bb224c2 100644 --- a/third_party/WebKit/Source/modules/notifications/Notification.h +++ b/third_party/WebKit/Source/modules/notifications/Notification.h
@@ -60,7 +60,7 @@ class MODULES_EXPORT Notification final : public RefCountedGarbageCollectedEventTargetWithInlineData<Notification>, public ActiveScriptWrappable, public ActiveDOMObject, public WebNotificationDelegate { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(Notification); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Notification); + USING_GARBAGE_COLLECTED_MIXIN(Notification); DEFINE_WRAPPERTYPEINFO(); public: // Used for JavaScript instantiations of the Notification object. Will automatically schedule for @@ -122,7 +122,7 @@ protected: // EventTarget interface. - DispatchEventResult dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) final; + DispatchEventResult dispatchEventInternal(RawPtr<Event>) final; private: Notification(ExecutionContext*, const WebNotificationData&);
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationDataTest.cpp b/third_party/WebKit/Source/modules/notifications/NotificationDataTest.cpp index afac764..63b4a34 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationDataTest.cpp +++ b/third_party/WebKit/Source/modules/notifications/NotificationDataTest.cpp
@@ -44,13 +44,13 @@ public: void SetUp() override { - m_executionContext = adoptRefWillBeNoop(new NullExecutionContext()); + m_executionContext = new NullExecutionContext(); } ExecutionContext* getExecutionContext() { return m_executionContext.get(); } private: - RefPtrWillBePersistent<ExecutionContext> m_executionContext; + Persistent<ExecutionContext> m_executionContext; }; TEST_F(NotificationDataTest, ReflectProperties)
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationEvent.h b/third_party/WebKit/Source/modules/notifications/NotificationEvent.h index e2cfb7b..716b1b45 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationEvent.h +++ b/third_party/WebKit/Source/modules/notifications/NotificationEvent.h
@@ -18,17 +18,17 @@ class MODULES_EXPORT NotificationEvent final : public ExtendableEvent { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<NotificationEvent> create() + static RawPtr<NotificationEvent> create() { return adoptRefWillBeNoop(new NotificationEvent); } - static PassRefPtrWillBeRawPtr<NotificationEvent> create(const AtomicString& type, const NotificationEventInit& initializer) + static RawPtr<NotificationEvent> create(const AtomicString& type, const NotificationEventInit& initializer) { - return adoptRefWillBeNoop(new NotificationEvent(type, initializer)); + return new NotificationEvent(type, initializer); } - static PassRefPtrWillBeRawPtr<NotificationEvent> create(const AtomicString& type, const NotificationEventInit& initializer, WaitUntilObserver* observer) + static RawPtr<NotificationEvent> create(const AtomicString& type, const NotificationEventInit& initializer, WaitUntilObserver* observer) { - return adoptRefWillBeNoop(new NotificationEvent(type, initializer, observer)); + return new NotificationEvent(type, initializer, observer); } ~NotificationEvent() override; @@ -45,7 +45,7 @@ NotificationEvent(const AtomicString& type, const NotificationEventInit&); NotificationEvent(const AtomicString& type, const NotificationEventInit&, WaitUntilObserver*); - PersistentWillBeMember<Notification> m_notification; + Member<Notification> m_notification; String m_action; };
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationPermissionClient.cpp b/third_party/WebKit/Source/modules/notifications/NotificationPermissionClient.cpp index 74e365e..2c2f80e 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationPermissionClient.cpp +++ b/third_party/WebKit/Source/modules/notifications/NotificationPermissionClient.cpp
@@ -24,10 +24,10 @@ if (!document->frame() || !document->frame()->isLocalFrame()) return nullptr; - return static_cast<NotificationPermissionClient*>(WillBeHeapSupplement<LocalFrame>::from(document->frame(), supplementName())); + return static_cast<NotificationPermissionClient*>(HeapSupplement<LocalFrame>::from(document->frame(), supplementName())); } -void provideNotificationPermissionClientTo(LocalFrame& frame, PassOwnPtrWillBeRawPtr<NotificationPermissionClient> client) +void provideNotificationPermissionClientTo(LocalFrame& frame, RawPtr<NotificationPermissionClient> client) { frame.provideSupplement(NotificationPermissionClient::supplementName(), client); }
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationPermissionClient.h b/third_party/WebKit/Source/modules/notifications/NotificationPermissionClient.h index 403b534d..a05f64c 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationPermissionClient.h +++ b/third_party/WebKit/Source/modules/notifications/NotificationPermissionClient.h
@@ -17,7 +17,7 @@ class NotificationPermissionCallback; class ScriptState; -class NotificationPermissionClient : public WillBeHeapSupplement<LocalFrame> { +class NotificationPermissionClient : public HeapSupplement<LocalFrame> { public: virtual ~NotificationPermissionClient() { } @@ -25,12 +25,12 @@ // current frame. The provided callback will be ran when the user has made a decision. virtual ScriptPromise requestPermission(ScriptState*, NotificationPermissionCallback*) = 0; - // WillBeHeapSupplement requirements. + // HeapSupplement requirements. static const char* supplementName(); static NotificationPermissionClient* from(ExecutionContext*); }; -MODULES_EXPORT void provideNotificationPermissionClientTo(LocalFrame&, PassOwnPtrWillBeRawPtr<NotificationPermissionClient>); +MODULES_EXPORT void provideNotificationPermissionClientTo(LocalFrame&, RawPtr<NotificationPermissionClient>); } // namespace blink
diff --git a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp index d63ae11..71dfbe1 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp +++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp
@@ -65,13 +65,13 @@ return static_cast<OffscreenCanvasRenderingContext2D*>(m_context.get()); } -PassRefPtrWillBeRawPtr<ImageBitmap> OffscreenCanvas::transferToImageBitmap(ExceptionState& exceptionState) +RawPtr<ImageBitmap> OffscreenCanvas::transferToImageBitmap(ExceptionState& exceptionState) { if (!m_context) { exceptionState.throwDOMException(InvalidStateError, "Cannot transfer an ImageBitmap from an OffscreenCanvas with no context"); return nullptr; } - RefPtrWillBeRawPtr<ImageBitmap> image = m_context->transferToImageBitmap(exceptionState); + RawPtr<ImageBitmap> image = m_context->transferToImageBitmap(exceptionState); if (!image) { // Undocumented exception (not in spec) exceptionState.throwDOMException(V8GeneralError, "Out of memory"); @@ -110,6 +110,7 @@ DEFINE_TRACE(OffscreenCanvas) { visitor->trace(m_context); + visitor->trace(m_canvas); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.h b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.h index 0e2e957..a31bcf2a 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.h +++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.h
@@ -8,6 +8,7 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptState.h" #include "bindings/core/v8/ScriptWrappable.h" +#include "core/html/HTMLCanvasElement.h" #include "modules/ModulesExport.h" #include "platform/geometry/IntSize.h" #include "platform/heap/Handle.h" @@ -34,10 +35,12 @@ // API Methods OffscreenCanvasRenderingContext2D* getContext(const String&, const CanvasContextCreationAttributes&); - PassRefPtrWillBeRawPtr<ImageBitmap> transferToImageBitmap(ExceptionState&); + RawPtr<ImageBitmap> transferToImageBitmap(ExceptionState&); IntSize size() const { return m_size; } OffscreenCanvasRenderingContext2D* renderingContext() const; + void setAssociatedCanvas(HTMLCanvasElement* canvas) { m_canvas = canvas; } + HTMLCanvasElement* getAssociatedCanvas() const { return m_canvas; } static void registerRenderingContextFactory(PassOwnPtr<OffscreenCanvasRenderingContextFactory>); @@ -51,6 +54,7 @@ static OffscreenCanvasRenderingContextFactory* getRenderingContextFactory(int); Member<OffscreenCanvasRenderingContext> m_context; + WeakMember<HTMLCanvasElement> m_canvas; IntSize m_size; };
diff --git a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h index ca3f222..6549936f 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h +++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h
@@ -26,7 +26,7 @@ OffscreenCanvas* getOffscreenCanvas() const { return m_offscreenCanvas; } virtual ContextType getContextType() const = 0; - virtual PassRefPtrWillBeRawPtr<ImageBitmap> transferToImageBitmap(ExceptionState&) = 0; + virtual RawPtr<ImageBitmap> transferToImageBitmap(ExceptionState&) = 0; virtual bool is2d() const { return false; }
diff --git a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp index e9ddf97..9edb535 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp +++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
@@ -74,7 +74,7 @@ return m_imageBuffer.get(); } -PassRefPtrWillBeRawPtr<ImageBitmap> OffscreenCanvasRenderingContext2D::transferToImageBitmap(ExceptionState& exceptionState) +RawPtr<ImageBitmap> OffscreenCanvasRenderingContext2D::transferToImageBitmap(ExceptionState& exceptionState) { if (!imageBuffer()) return nullptr;
diff --git a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h index 0eb2cf98..2002850d 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h +++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
@@ -14,7 +14,7 @@ class MODULES_EXPORT OffscreenCanvasRenderingContext2D final : public OffscreenCanvasRenderingContext, public BaseRenderingContext2D { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(OffscreenCanvasRenderingContext2D); + USING_GARBAGE_COLLECTED_MIXIN(OffscreenCanvasRenderingContext2D); public: class Factory : public OffscreenCanvasRenderingContextFactory { public: @@ -67,7 +67,7 @@ bool hasAlpha() const override { return m_hasAlpha; } bool isContextLost() const override; - PassRefPtrWillBeRawPtr<ImageBitmap> transferToImageBitmap(ExceptionState&) final; + RawPtr<ImageBitmap> transferToImageBitmap(ExceptionState&) final; protected: OffscreenCanvasRenderingContext2D(OffscreenCanvas*, const CanvasContextCreationAttributes& attrs);
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp index 1d112fe..83524fb 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
@@ -304,7 +304,7 @@ } m_shippingAddress = new ShippingAddress(std::move(address)); - RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::shippingaddresschange); + RawPtr<Event> event = Event::create(EventTypeNames::shippingaddresschange); event->setTarget(this); getExecutionContext()->getEventQueue()->enqueueEvent(event); } @@ -314,7 +314,7 @@ DCHECK(m_showResolver); DCHECK(!m_completeResolver); m_shippingOption = shippingOptionId; - RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::shippingoptionchange); + RawPtr<Event> event = Event::create(EventTypeNames::shippingoptionchange); event->setTarget(this); getExecutionContext()->getEventQueue()->enqueueEvent(event); }
diff --git a/third_party/WebKit/Source/modules/permissions/PermissionController.cpp b/third_party/WebKit/Source/modules/permissions/PermissionController.cpp index e1999d1..a9800ad 100644 --- a/third_party/WebKit/Source/modules/permissions/PermissionController.cpp +++ b/third_party/WebKit/Source/modules/permissions/PermissionController.cpp
@@ -19,12 +19,12 @@ ASSERT(RuntimeEnabledFeatures::permissionsEnabled()); PermissionController* controller = new PermissionController(frame, client); - WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPtrWillBeNoop(controller)); + HeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPtrWillBeNoop(controller)); } PermissionController* PermissionController::from(LocalFrame& frame) { - return static_cast<PermissionController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); + return static_cast<PermissionController*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); } PermissionController::PermissionController(LocalFrame& frame, WebPermissionClient* client) @@ -51,7 +51,7 @@ DEFINE_TRACE(PermissionController) { LocalFrameLifecycleObserver::trace(visitor); - WillBeHeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/permissions/PermissionController.h b/third_party/WebKit/Source/modules/permissions/PermissionController.h index 5afb935..9d88a4c 100644 --- a/third_party/WebKit/Source/modules/permissions/PermissionController.h +++ b/third_party/WebKit/Source/modules/permissions/PermissionController.h
@@ -14,12 +14,11 @@ class WebPermissionClient; class MODULES_EXPORT PermissionController final - : public NoBaseWillBeGarbageCollectedFinalized<PermissionController> - , public WillBeHeapSupplement<LocalFrame> + : public GarbageCollectedFinalized<PermissionController> + , public HeapSupplement<LocalFrame> , public LocalFrameLifecycleObserver { WTF_MAKE_NONCOPYABLE(PermissionController); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PermissionController); - USING_FAST_MALLOC_WILL_BE_REMOVED(PermissionController); + USING_GARBAGE_COLLECTED_MIXIN(PermissionController); public: virtual ~PermissionController();
diff --git a/third_party/WebKit/Source/modules/permissions/PermissionStatus.h b/third_party/WebKit/Source/modules/permissions/PermissionStatus.h index 5ac62c7..abffcc4b 100644 --- a/third_party/WebKit/Source/modules/permissions/PermissionStatus.h +++ b/third_party/WebKit/Source/modules/permissions/PermissionStatus.h
@@ -28,7 +28,7 @@ , public ActiveDOMObject , public WebPermissionObserver { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PermissionStatus); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PermissionStatus); + USING_GARBAGE_COLLECTED_MIXIN(PermissionStatus); DEFINE_WRAPPERTYPEINFO(); public: static PermissionStatus* take(ScriptPromiseResolver*, WebPermissionStatus, WebPermissionType);
diff --git a/third_party/WebKit/Source/modules/plugins/DOMMimeType.h b/third_party/WebKit/Source/modules/plugins/DOMMimeType.h index 24a3b13..f6e2f61 100644 --- a/third_party/WebKit/Source/modules/plugins/DOMMimeType.h +++ b/third_party/WebKit/Source/modules/plugins/DOMMimeType.h
@@ -33,7 +33,7 @@ class LocalFrame; class DOMMimeType final : public GarbageCollectedFinalized<DOMMimeType>, public ScriptWrappable, public LocalFrameLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMMimeType); + USING_GARBAGE_COLLECTED_MIXIN(DOMMimeType); DEFINE_WRAPPERTYPEINFO(); public: static DOMMimeType* create(PassRefPtr<PluginData> pluginData, LocalFrame* frame, unsigned index)
diff --git a/third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.h b/third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.h index f42415fe..96cbf81 100644 --- a/third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.h +++ b/third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.h
@@ -36,7 +36,7 @@ class DOMMimeTypeArray final : public GarbageCollectedFinalized<DOMMimeTypeArray>, public ScriptWrappable, public DOMWindowProperty { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMMimeTypeArray); + USING_GARBAGE_COLLECTED_MIXIN(DOMMimeTypeArray); public: static DOMMimeTypeArray* create(LocalFrame* frame) {
diff --git a/third_party/WebKit/Source/modules/plugins/DOMPlugin.h b/third_party/WebKit/Source/modules/plugins/DOMPlugin.h index ac15bdb..cc0e492 100644 --- a/third_party/WebKit/Source/modules/plugins/DOMPlugin.h +++ b/third_party/WebKit/Source/modules/plugins/DOMPlugin.h
@@ -32,7 +32,7 @@ class PluginData; class DOMPlugin final : public GarbageCollectedFinalized<DOMPlugin>, public ScriptWrappable, public LocalFrameLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMPlugin); + USING_GARBAGE_COLLECTED_MIXIN(DOMPlugin); DEFINE_WRAPPERTYPEINFO(); public: static DOMPlugin* create(PluginData* pluginData, LocalFrame* frame, unsigned index)
diff --git a/third_party/WebKit/Source/modules/plugins/DOMPluginArray.h b/third_party/WebKit/Source/modules/plugins/DOMPluginArray.h index ee22470..c26ba65 100644 --- a/third_party/WebKit/Source/modules/plugins/DOMPluginArray.h +++ b/third_party/WebKit/Source/modules/plugins/DOMPluginArray.h
@@ -34,7 +34,7 @@ class DOMPluginArray final : public GarbageCollectedFinalized<DOMPluginArray>, public ScriptWrappable, public DOMWindowProperty { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMPluginArray); + USING_GARBAGE_COLLECTED_MIXIN(DOMPluginArray); public: static DOMPluginArray* create(LocalFrame* frame) {
diff --git a/third_party/WebKit/Source/modules/plugins/PluginOcclusionSupport.cpp b/third_party/WebKit/Source/modules/plugins/PluginOcclusionSupport.cpp index 4ea42c8..adf3a3e 100644 --- a/third_party/WebKit/Source/modules/plugins/PluginOcclusionSupport.cpp +++ b/third_party/WebKit/Source/modules/plugins/PluginOcclusionSupport.cpp
@@ -193,7 +193,7 @@ // as being in the top layer. const Element* ancestor = topLayerAncestor(element); Document* document = parentFrameView->frame().document(); - const WillBeHeapVector<RefPtrWillBeMember<Element>>& elements = document->topLayerElements(); + const HeapVector<Member<Element>>& elements = document->topLayerElements(); size_t start = ancestor ? elements.find(ancestor) + 1 : 0; for (size_t i = start; i < elements.size(); ++i) addTreeToOcclusions(elements[i]->layoutObject(), frameRect, occlusions);
diff --git a/third_party/WebKit/Source/modules/presentation/Presentation.h b/third_party/WebKit/Source/modules/presentation/Presentation.h index 8091cd9..141ca92 100644 --- a/third_party/WebKit/Source/modules/presentation/Presentation.h +++ b/third_party/WebKit/Source/modules/presentation/Presentation.h
@@ -24,7 +24,7 @@ : public GarbageCollectedFinalized<Presentation> , public ScriptWrappable , public DOMWindowProperty { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Presentation); + USING_GARBAGE_COLLECTED_MIXIN(Presentation); DEFINE_WRAPPERTYPEINFO(); public: static Presentation* create(LocalFrame*);
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp index 52b010e8..b3e9295 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp
@@ -64,7 +64,7 @@ return ActiveDOMObject::getExecutionContext(); } -bool PresentationAvailability::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) +bool PresentationAvailability::addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener> listener, const EventListenerOptions& options) { if (eventType == EventTypeNames::change) UseCounter::count(getExecutionContext(), UseCounter::PresentationAvailabilityChangeEventListener);
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h index 5c6c1e4..e57c764 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h
@@ -30,7 +30,7 @@ , public PageLifecycleObserver , public WebPresentationAvailabilityObserver { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationAvailability); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationAvailability); + USING_GARBAGE_COLLECTED_MIXIN(PresentationAvailability); DEFINE_WRAPPERTYPEINFO(); public: static PresentationAvailability* take(ScriptPromiseResolver*, const KURL&, bool); @@ -63,7 +63,7 @@ protected: // EventTarget implementation. - bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener>, const EventListenerOptions&) override; + bool addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener>, const EventListenerOptions&) override; private: // Current state of the ActiveDOMObject. It is Active when created. It
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp index 44d0d28..9a3a45b2 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
@@ -183,7 +183,7 @@ return frame()->document(); } -bool PresentationConnection::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) +bool PresentationConnection::addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener> listener, const EventListenerOptions& options) { if (eventType == EventTypeNames::statechange) Deprecation::countDeprecation(getExecutionContext(), UseCounter::PresentationConnectionStateChangeEventListener);
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnection.h b/third_party/WebKit/Source/modules/presentation/PresentationConnection.h index eb0f0c0..1e2ada0 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationConnection.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnection.h
@@ -29,7 +29,7 @@ : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationConnection> , public DOMWindowProperty { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationConnection); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationConnection); + USING_GARBAGE_COLLECTED_MIXIN(PresentationConnection); DEFINE_WRAPPERTYPEINFO(); public: // For CallbackPromiseAdapter. @@ -79,7 +79,7 @@ protected: // EventTarget implementation. - bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener>, const EventListenerOptions&) override; + bool addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener>, const EventListenerOptions&) override; private: class BlobLoader;
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnectionAvailableEvent.h b/third_party/WebKit/Source/modules/presentation/PresentationConnectionAvailableEvent.h index 09038085..cc4c559 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationConnectionAvailableEvent.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnectionAvailableEvent.h
@@ -21,17 +21,17 @@ public: ~PresentationConnectionAvailableEvent() override; - static PassRefPtrWillBeRawPtr<PresentationConnectionAvailableEvent> create() + static RawPtr<PresentationConnectionAvailableEvent> create() { return adoptRefWillBeNoop(new PresentationConnectionAvailableEvent); } - static PassRefPtrWillBeRawPtr<PresentationConnectionAvailableEvent> create(const AtomicString& eventType, PresentationConnection* connection) + static RawPtr<PresentationConnectionAvailableEvent> create(const AtomicString& eventType, PresentationConnection* connection) { - return adoptRefWillBeNoop(new PresentationConnectionAvailableEvent(eventType, connection)); + return new PresentationConnectionAvailableEvent(eventType, connection); } - static PassRefPtrWillBeRawPtr<PresentationConnectionAvailableEvent> create(const AtomicString& eventType, const PresentationConnectionAvailableEventInit& initializer) + static RawPtr<PresentationConnectionAvailableEvent> create(const AtomicString& eventType, const PresentationConnectionAvailableEventInit& initializer) { - return adoptRefWillBeNoop(new PresentationConnectionAvailableEvent(eventType, initializer)); + return new PresentationConnectionAvailableEvent(eventType, initializer); } PresentationConnection* connection() { return m_connection.get(); } @@ -45,7 +45,7 @@ PresentationConnectionAvailableEvent(const AtomicString& eventType, PresentationConnection*); PresentationConnectionAvailableEvent(const AtomicString& eventType, const PresentationConnectionAvailableEventInit& initializer); - PersistentWillBeMember<PresentationConnection> m_connection; + Member<PresentationConnection> m_connection; }; DEFINE_TYPE_CASTS(PresentationConnectionAvailableEvent, Event, event, event->interfaceName() == EventNames::PresentationConnectionAvailableEvent, event.interfaceName() == EventNames::PresentationConnectionAvailableEvent);
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnectionCloseEvent.h b/third_party/WebKit/Source/modules/presentation/PresentationConnectionCloseEvent.h index f7b5ce06..53b59bb 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationConnectionCloseEvent.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnectionCloseEvent.h
@@ -20,19 +20,19 @@ public: ~PresentationConnectionCloseEvent() override = default; - static PassRefPtrWillBeRawPtr<PresentationConnectionCloseEvent> create() + static RawPtr<PresentationConnectionCloseEvent> create() { return adoptRefWillBeNoop(new PresentationConnectionCloseEvent); } - static PassRefPtrWillBeRawPtr<PresentationConnectionCloseEvent> create(const AtomicString& eventType, const String& reason, const String& message) + static RawPtr<PresentationConnectionCloseEvent> create(const AtomicString& eventType, const String& reason, const String& message) { - return adoptRefWillBeNoop(new PresentationConnectionCloseEvent(eventType, reason, message)); + return new PresentationConnectionCloseEvent(eventType, reason, message); } - static PassRefPtrWillBeRawPtr<PresentationConnectionCloseEvent> create(const AtomicString& eventType, const PresentationConnectionCloseEventInit& initializer) + static RawPtr<PresentationConnectionCloseEvent> create(const AtomicString& eventType, const PresentationConnectionCloseEventInit& initializer) { - return adoptRefWillBeNoop(new PresentationConnectionCloseEvent(eventType, initializer)); + return new PresentationConnectionCloseEvent(eventType, initializer); } const String& reason() const { return m_reason; }
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationController.cpp b/third_party/WebKit/Source/modules/presentation/PresentationController.cpp index 2666a78..3dea7e77 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationController.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationController.cpp
@@ -25,9 +25,9 @@ } // static -PassOwnPtrWillBeRawPtr<PresentationController> PresentationController::create(LocalFrame& frame, WebPresentationClient* client) +RawPtr<PresentationController> PresentationController::create(LocalFrame& frame, WebPresentationClient* client) { - return adoptPtrWillBeNoop(new PresentationController(frame, client)); + return new PresentationController(frame, client); } // static @@ -39,13 +39,13 @@ // static PresentationController* PresentationController::from(LocalFrame& frame) { - return static_cast<PresentationController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); + return static_cast<PresentationController*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); } // static void PresentationController::provideTo(LocalFrame& frame, WebPresentationClient* client) { - WillBeHeapSupplement<LocalFrame>::provideTo(frame, PresentationController::supplementName(), PresentationController::create(frame, client)); + HeapSupplement<LocalFrame>::provideTo(frame, PresentationController::supplementName(), PresentationController::create(frame, client)); } WebPresentationClient* PresentationController::client() @@ -57,7 +57,7 @@ { visitor->trace(m_presentation); visitor->trace(m_connections); - WillBeHeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); LocalFrameLifecycleObserver::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationController.h b/third_party/WebKit/Source/modules/presentation/PresentationController.h index 8fab614..4228113 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationController.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationController.h
@@ -26,17 +26,16 @@ // The coordinator between the various page exposed properties and the content // layer represented via |WebPresentationClient|. class MODULES_EXPORT PresentationController final - : public NoBaseWillBeGarbageCollectedFinalized<PresentationController> - , public WillBeHeapSupplement<LocalFrame> + : public GarbageCollectedFinalized<PresentationController> + , public HeapSupplement<LocalFrame> , public LocalFrameLifecycleObserver , public WebPresentationController { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationController); - USING_FAST_MALLOC_WILL_BE_REMOVED(PresentationController); + USING_GARBAGE_COLLECTED_MIXIN(PresentationController); WTF_MAKE_NONCOPYABLE(PresentationController); public: ~PresentationController() override; - static PassOwnPtrWillBeRawPtr<PresentationController> create(LocalFrame&, WebPresentationClient*); + static RawPtr<PresentationController> create(LocalFrame&, WebPresentationClient*); static const char* supplementName(); static PresentationController* from(LocalFrame&); @@ -85,14 +84,14 @@ WebPresentationClient* m_client; // Default PresentationRequest used by the embedder. - // PersistentWillBeMember<PresentationRequest> m_defaultRequest; + // Member<PresentationRequest> m_defaultRequest; WeakMember<Presentation> m_presentation; // The presentation connections associated with that frame. // TODO(mlamouri): the PresentationController will keep any created // connections alive until the frame is detached. These should be weak ptr // so that the connection can be GC'd. - PersistentHeapHashSetWillBeHeapHashSet<Member<PresentationConnection>> m_connections; + HeapHashSet<Member<PresentationConnection>> m_connections; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.h b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.h index 52055f14..f93a5c3 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.h
@@ -19,7 +19,7 @@ : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationReceiver> , DOMWindowProperty { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationReceiver); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationReceiver); + USING_GARBAGE_COLLECTED_MIXIN(PresentationReceiver); DEFINE_WRAPPERTYPEINFO(); public: PresentationReceiver(LocalFrame*);
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp index bebfafd..b62a56c 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp
@@ -71,7 +71,7 @@ return ActiveDOMObject::getExecutionContext(); } -bool PresentationRequest::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) +bool PresentationRequest::addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener> listener, const EventListenerOptions& options) { if (eventType == EventTypeNames::connectionavailable) UseCounter::count(getExecutionContext(), UseCounter::PresentationRequestConnectionAvailableEventListener);
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationRequest.h b/third_party/WebKit/Source/modules/presentation/PresentationRequest.h index 64479b1..b2e80616 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationRequest.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationRequest.h
@@ -22,7 +22,7 @@ , public ActiveScriptWrappable , public ActiveDOMObject { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationRequest); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationRequest); + USING_GARBAGE_COLLECTED_MIXIN(PresentationRequest); DEFINE_WRAPPERTYPEINFO(); public: ~PresentationRequest() = default; @@ -48,7 +48,7 @@ protected: // EventTarget implementation. - bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener>, const EventListenerOptions&) override; + bool addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener>, const EventListenerOptions&) override; private: PresentationRequest(ExecutionContext*, const KURL&);
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushController.cpp b/third_party/WebKit/Source/modules/push_messaging/PushController.cpp index 9d505255..13afc5e 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushController.cpp +++ b/third_party/WebKit/Source/modules/push_messaging/PushController.cpp
@@ -14,9 +14,9 @@ { } -PassOwnPtrWillBeRawPtr<PushController> PushController::create(WebPushClient* client) +RawPtr<PushController> PushController::create(WebPushClient* client) { - return adoptPtrWillBeNoop(new PushController(client)); + return new PushController(client); } WebPushClient& PushController::clientFrom(LocalFrame* frame)
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushController.h b/third_party/WebKit/Source/modules/push_messaging/PushController.h index ee98aa7..9b1e6e6c 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushController.h +++ b/third_party/WebKit/Source/modules/push_messaging/PushController.h
@@ -16,18 +16,16 @@ class WebPushClient; -class PushController final : public NoBaseWillBeGarbageCollected<PushController>, public WillBeHeapSupplement<LocalFrame> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PushController); +class PushController final : public GarbageCollected<PushController>, public HeapSupplement<LocalFrame> { + USING_GARBAGE_COLLECTED_MIXIN(PushController); WTF_MAKE_NONCOPYABLE(PushController); - USING_FAST_MALLOC_WILL_BE_REMOVED(PushController); - public: - static PassOwnPtrWillBeRawPtr<PushController> create(WebPushClient*); + static RawPtr<PushController> create(WebPushClient*); static const char* supplementName(); - static PushController* from(LocalFrame* frame) { return static_cast<PushController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); } + static PushController* from(LocalFrame* frame) { return static_cast<PushController*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); } static WebPushClient& clientFrom(LocalFrame*); - DEFINE_INLINE_VIRTUAL_TRACE() { WillBeHeapSupplement<LocalFrame>::trace(visitor); } + DEFINE_INLINE_VIRTUAL_TRACE() { HeapSupplement<LocalFrame>::trace(visitor); } private: explicit PushController(WebPushClient*);
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushEvent.h b/third_party/WebKit/Source/modules/push_messaging/PushEvent.h index 514e2a61..4fb3754a 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushEvent.h +++ b/third_party/WebKit/Source/modules/push_messaging/PushEvent.h
@@ -20,17 +20,17 @@ class MODULES_EXPORT PushEvent final : public ExtendableEvent { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<PushEvent> create() + static RawPtr<PushEvent> create() { return adoptRefWillBeNoop(new PushEvent); } - static PassRefPtrWillBeRawPtr<PushEvent> create(const AtomicString& type, PushMessageData* data, WaitUntilObserver* observer) + static RawPtr<PushEvent> create(const AtomicString& type, PushMessageData* data, WaitUntilObserver* observer) { - return adoptRefWillBeNoop(new PushEvent(type, data, observer)); + return new PushEvent(type, data, observer); } - static PassRefPtrWillBeRawPtr<PushEvent> create(const AtomicString& type, const PushEventInit& initializer) + static RawPtr<PushEvent> create(const AtomicString& type, const PushEventInit& initializer) { - return adoptRefWillBeNoop(new PushEvent(type, initializer)); + return new PushEvent(type, initializer); } ~PushEvent() override; @@ -46,7 +46,7 @@ PushEvent(const AtomicString& type, PushMessageData*, WaitUntilObserver*); PushEvent(const AtomicString& type, const PushEventInit&); - PersistentWillBeMember<PushMessageData> m_data; + Member<PushMessageData> m_data; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp b/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp index 5f501e5..a40ff6c 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp +++ b/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp
@@ -27,6 +27,8 @@ namespace blink { namespace { +const int kMaxApplicationServerKeyLength = 255; + WebPushProvider* pushProvider() { WebPushProvider* webPushProvider = Platform::current()->pushProvider(); @@ -55,7 +57,7 @@ // If the key is valid, just treat it as a string of bytes and pass it to // the push service. - if (length == 65 && input[0] == 0x04) + if (length <= kMaxApplicationServerKeyLength) return WebString::fromLatin1(input, length); exceptionState.throwDOMException(InvalidAccessError, "The provided applicationServerKey is not valid.");
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushManagerTest.cpp b/third_party/WebKit/Source/modules/push_messaging/PushManagerTest.cpp index 15cca80..03f0128 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushManagerTest.cpp +++ b/third_party/WebKit/Source/modules/push_messaging/PushManagerTest.cpp
@@ -14,12 +14,12 @@ namespace blink { namespace { -const char kValidKeyMarker = 0x04; -const unsigned kValidKeyLength = 65; +const unsigned kMaxKeyLength = 255; // NIST P-256 public key made available to tests. Must be an uncompressed // point in accordance with SEC1 2.3.3. -const uint8_t kApplicationServerKey[65] = { +const unsigned kApplicationServerKeyLength = 65; +const uint8_t kApplicationServerKey[kApplicationServerKeyLength] = { 0x04, 0x55, 0x52, 0x6A, 0xA5, 0x6E, 0x8E, 0xAA, 0x47, 0x97, 0x36, 0x10, 0xC1, 0x66, 0x3C, 0x1E, 0x65, 0xBF, 0xA1, 0x7B, 0xEE, 0x48, 0xC9, 0xC6, 0xBB, 0xBF, 0x02, 0x18, 0x53, 0x72, 0x1D, 0x0C, 0x7B, 0xA9, 0xE3, 0x11, 0xB7, 0x03, 0x52, @@ -32,47 +32,31 @@ PushSubscriptionOptions options; options.setApplicationServerKey( ArrayBufferOrArrayBufferView::fromArrayBuffer( - DOMArrayBuffer::create(kApplicationServerKey, kValidKeyLength))); + DOMArrayBuffer::create(kApplicationServerKey, kApplicationServerKeyLength))); TrackExceptionState exceptionState; WebPushSubscriptionOptions output = PushManager::toWebPushSubscriptionOptions(options, exceptionState); EXPECT_FALSE(exceptionState.hadException()); - EXPECT_EQ(output.applicationServerKey.length(), kValidKeyLength); + EXPECT_EQ(output.applicationServerKey.length(), kApplicationServerKeyLength); // Copy the key into a size+1 buffer so that it can be treated as a null // terminated string for the purposes of EXPECT_EQ. - uint8_t senderKey[kValidKeyLength+1]; - for (unsigned i = 0; i < kValidKeyLength; i++) + uint8_t senderKey[kApplicationServerKeyLength+1]; + for (unsigned i = 0; i < kApplicationServerKeyLength; i++) senderKey[i] = kApplicationServerKey[i]; - senderKey[kValidKeyLength] = 0x0; + senderKey[kApplicationServerKeyLength] = 0x0; EXPECT_EQ(reinterpret_cast<const char*>(senderKey), output.applicationServerKey.latin1()); EXPECT_FALSE(output.applicationServerKey.isEmpty()); } -TEST(PushManagerTest, InvalidSenderKeyMarker) -{ - uint8_t senderKey[kValidKeyLength]; - memset(senderKey, 0, sizeof(senderKey)); - senderKey[0] = 0x05; - PushSubscriptionOptions options; - options.setApplicationServerKey( - ArrayBufferOrArrayBufferView::fromArrayBuffer( - DOMArrayBuffer::create(senderKey, kValidKeyLength))); - - TrackExceptionState exceptionState; - WebPushSubscriptionOptions output = PushManager::toWebPushSubscriptionOptions(options, exceptionState); - EXPECT_TRUE(exceptionState.hadException()); -} - TEST(PushManagerTest, InvalidSenderKeyLength) { - uint8_t senderKey[kValidKeyLength - 1]; + uint8_t senderKey[kMaxKeyLength + 1]; memset(senderKey, 0, sizeof(senderKey)); - senderKey[0] = kValidKeyMarker; PushSubscriptionOptions options; options.setApplicationServerKey( ArrayBufferOrArrayBufferView::fromArrayBuffer( - DOMArrayBuffer::create(senderKey, kValidKeyLength - 1))); + DOMArrayBuffer::create(senderKey, kMaxKeyLength + 1))); TrackExceptionState exceptionState; WebPushSubscriptionOptions output = PushManager::toWebPushSubscriptionOptions(options, exceptionState);
diff --git a/third_party/WebKit/Source/modules/quota/DOMWindowQuota.cpp b/third_party/WebKit/Source/modules/quota/DOMWindowQuota.cpp index 80ccd1d..f7d7720 100644 --- a/third_party/WebKit/Source/modules/quota/DOMWindowQuota.cpp +++ b/third_party/WebKit/Source/modules/quota/DOMWindowQuota.cpp
@@ -42,8 +42,6 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowQuota); - const char* DOMWindowQuota::supplementName() { return "DOMWindowQuota"; @@ -52,7 +50,7 @@ // static DOMWindowQuota& DOMWindowQuota::from(LocalDOMWindow& window) { - DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(WillBeHeapSupplement<LocalDOMWindow>::from(window, supplementName())); + DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(HeapSupplement<LocalDOMWindow>::from(window, supplementName())); if (!supplement) { supplement = new DOMWindowQuota(window); provideTo(window, supplementName(), adoptPtrWillBeNoop(supplement)); @@ -76,7 +74,7 @@ DEFINE_TRACE(DOMWindowQuota) { visitor->trace(m_storageInfo); - WillBeHeapSupplement<LocalDOMWindow>::trace(visitor); + HeapSupplement<LocalDOMWindow>::trace(visitor); DOMWindowProperty::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/quota/DOMWindowQuota.h b/third_party/WebKit/Source/modules/quota/DOMWindowQuota.h index 222c7ff..7c525a9 100644 --- a/third_party/WebKit/Source/modules/quota/DOMWindowQuota.h +++ b/third_party/WebKit/Source/modules/quota/DOMWindowQuota.h
@@ -40,10 +40,8 @@ class DeprecatedStorageInfo; class DOMWindow; -class DOMWindowQuota final : public NoBaseWillBeGarbageCollected<DOMWindowQuota>, public WillBeHeapSupplement<LocalDOMWindow>, public DOMWindowProperty { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMWindowQuota); - DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowQuota); - USING_FAST_MALLOC_WILL_BE_REMOVED(DOMWindowQuota); +class DOMWindowQuota final : public GarbageCollected<DOMWindowQuota>, public HeapSupplement<LocalDOMWindow>, public DOMWindowProperty { + USING_GARBAGE_COLLECTED_MIXIN(DOMWindowQuota); public: static DOMWindowQuota& from(LocalDOMWindow&); static DeprecatedStorageInfo* webkitStorageInfo(DOMWindow&); @@ -55,7 +53,7 @@ explicit DOMWindowQuota(LocalDOMWindow&); static const char* supplementName(); - mutable PersistentWillBeMember<DeprecatedStorageInfo> m_storageInfo; + mutable Member<DeprecatedStorageInfo> m_storageInfo; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/quota/StorageQuotaClient.cpp b/third_party/WebKit/Source/modules/quota/StorageQuotaClient.cpp index b496b6f..43fb8db 100644 --- a/third_party/WebKit/Source/modules/quota/StorageQuotaClient.cpp +++ b/third_party/WebKit/Source/modules/quota/StorageQuotaClient.cpp
@@ -45,10 +45,10 @@ { if (!context->isDocument()) return 0; - return static_cast<StorageQuotaClient*>(WillBeHeapSupplement<Page>::from(toDocument(context)->page(), supplementName())); + return static_cast<StorageQuotaClient*>(HeapSupplement<Page>::from(toDocument(context)->page(), supplementName())); } -void provideStorageQuotaClientTo(Page& page, PassOwnPtrWillBeRawPtr<StorageQuotaClient> client) +void provideStorageQuotaClientTo(Page& page, RawPtr<StorageQuotaClient> client) { page.provideSupplement(StorageQuotaClient::supplementName(), client); }
diff --git a/third_party/WebKit/Source/modules/quota/StorageQuotaClient.h b/third_party/WebKit/Source/modules/quota/StorageQuotaClient.h index a5ac3167..4ea6da6 100644 --- a/third_party/WebKit/Source/modules/quota/StorageQuotaClient.h +++ b/third_party/WebKit/Source/modules/quota/StorageQuotaClient.h
@@ -47,7 +47,7 @@ class StorageErrorCallback; class StorageQuotaCallback; -class StorageQuotaClient : public WillBeHeapSupplement<Page> { +class StorageQuotaClient : public HeapSupplement<Page> { WTF_MAKE_NONCOPYABLE(StorageQuotaClient); public: StorageQuotaClient() { } @@ -60,7 +60,7 @@ static StorageQuotaClient* from(ExecutionContext*); }; -MODULES_EXPORT void provideStorageQuotaClientTo(Page&, PassOwnPtrWillBeRawPtr<StorageQuotaClient>); +MODULES_EXPORT void provideStorageQuotaClientTo(Page&, RawPtr<StorageQuotaClient>); } // namespace blink
diff --git a/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.cpp b/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.cpp index d181b9a7..ffda26518 100644 --- a/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.cpp +++ b/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.cpp
@@ -28,7 +28,7 @@ // static HTMLMediaElementRemotePlayback& HTMLMediaElementRemotePlayback::from(HTMLMediaElement& element) { - HTMLMediaElementRemotePlayback* supplement = static_cast<HTMLMediaElementRemotePlayback*>(WillBeHeapSupplement<HTMLMediaElement>::from(element, supplementName())); + HTMLMediaElementRemotePlayback* supplement = static_cast<HTMLMediaElementRemotePlayback*>(HeapSupplement<HTMLMediaElement>::from(element, supplementName())); if (!supplement) { supplement = new HTMLMediaElementRemotePlayback(); provideTo(element, supplementName(), adoptPtrWillBeNoop(supplement)); @@ -59,7 +59,7 @@ DEFINE_TRACE(HTMLMediaElementRemotePlayback) { visitor->trace(m_remote); - WillBeHeapSupplement<HTMLMediaElement>::trace(visitor); + HeapSupplement<HTMLMediaElement>::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.h b/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.h index 9c657a3..65cf1f8 100644 --- a/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.h +++ b/third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.h
@@ -17,9 +17,8 @@ // Class used to implement the Remote Playback API. It is a supplement to // HTMLMediaElement. -class HTMLMediaElementRemotePlayback final : public NoBaseWillBeGarbageCollected<HTMLMediaElementRemotePlayback>, public WillBeHeapSupplement<HTMLMediaElement> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementRemotePlayback); - USING_FAST_MALLOC_WILL_BE_REMOVED(HTMLMediaElementRemotePlayback); +class HTMLMediaElementRemotePlayback final : public GarbageCollected<HTMLMediaElementRemotePlayback>, public HeapSupplement<HTMLMediaElement> { + USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementRemotePlayback); public: static bool fastHasAttribute(const QualifiedName&, const HTMLMediaElement&); static void setBooleanAttribute(const QualifiedName&, HTMLMediaElement&, bool); @@ -32,7 +31,7 @@ private: static const char* supplementName(); - PersistentWillBeMember<RemotePlayback> m_remote; + Member<RemotePlayback> m_remote; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h index 7354038..d31cabd 100644 --- a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h +++ b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h
@@ -28,7 +28,7 @@ , private WebRemotePlaybackClient { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RemotePlayback); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RemotePlayback); + USING_GARBAGE_COLLECTED_MIXIN(RemotePlayback); public: static RemotePlayback* create(HTMLMediaElement&); @@ -57,7 +57,7 @@ WebRemotePlaybackState m_state; bool m_availability; HeapVector<Member<RemotePlaybackAvailability>> m_availabilityObjects; - WeakPtrWillBeMember<HTMLMediaElement> m_mediaElement; + Member<HTMLMediaElement> m_mediaElement; HeapVector<Member<ScriptPromiseResolver>> m_connectPromiseResolvers; };
diff --git a/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackAvailability.h b/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackAvailability.h index 745aad5..c2269095 100644 --- a/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackAvailability.h +++ b/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackAvailability.h
@@ -19,7 +19,7 @@ class RemotePlaybackAvailability final : public RefCountedGarbageCollectedEventTargetWithInlineData<RemotePlaybackAvailability>, public ContextLifecycleObserver { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RemotePlaybackAvailability); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RemotePlaybackAvailability); + USING_GARBAGE_COLLECTED_MIXIN(RemotePlaybackAvailability); public: static RemotePlaybackAvailability* take(ScriptPromiseResolver*, bool); ~RemotePlaybackAvailability() override;
diff --git a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.h b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.h index fa48114..779fee1 100644 --- a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.h +++ b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.h
@@ -26,7 +26,7 @@ , public DOMWindowProperty { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ScreenOrientation); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientation); + USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientation); public: static ScreenOrientation* create(LocalFrame*);
diff --git a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationController.cpp b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationController.cpp index de25e2c..e46e948 100644 --- a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationController.cpp +++ b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationController.cpp
@@ -27,12 +27,12 @@ ASSERT(RuntimeEnabledFeatures::screenOrientationEnabled()); ScreenOrientationController* controller = new ScreenOrientationController(frame, client); - WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPtrWillBeNoop(controller)); + HeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPtrWillBeNoop(controller)); } ScreenOrientationController* ScreenOrientationController::from(LocalFrame& frame) { - return static_cast<ScreenOrientationController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); + return static_cast<ScreenOrientationController*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); } ScreenOrientationController::ScreenOrientationController(LocalFrame& frame, WebScreenOrientationClient* client) @@ -129,7 +129,7 @@ // Keep track of the frames that need to be notified before notifying the // current frame as it will prevent side effects from the change event // handlers. - WillBeHeapVector<RefPtrWillBeMember<LocalFrame>> childFrames; + HeapVector<Member<LocalFrame>> childFrames; for (Frame* child = frame()->tree().firstChild(); child; child = child->tree().nextSibling()) { if (child->isLocalFrame()) childFrames.append(toLocalFrame(child)); @@ -214,7 +214,7 @@ { visitor->trace(m_orientation); LocalFrameLifecycleObserver::trace(visitor); - WillBeHeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); PlatformEventController::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationController.h b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationController.h index 0a519d32..a728882 100644 --- a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationController.h +++ b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationController.h
@@ -21,13 +21,12 @@ class WebScreenOrientationClient; class MODULES_EXPORT ScreenOrientationController final - : public NoBaseWillBeGarbageCollectedFinalized<ScreenOrientationController> - , public WillBeHeapSupplement<LocalFrame> + : public GarbageCollectedFinalized<ScreenOrientationController> + , public HeapSupplement<LocalFrame> , public LocalFrameLifecycleObserver , public PlatformEventController { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); + USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); WTF_MAKE_NONCOPYABLE(ScreenOrientationController); - USING_FAST_MALLOC_WILL_BE_REMOVED(ScreenOrientationController); public: ~ScreenOrientationController() override; @@ -66,7 +65,7 @@ bool isActiveAndVisible() const; - PersistentWillBeMember<ScreenOrientation> m_orientation; + Member<ScreenOrientation> m_orientation; WebScreenOrientationClient* m_client; Timer<ScreenOrientationController> m_dispatchEventTimer; };
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.cpp b/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.cpp index cde68b8..b578d836 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.cpp
@@ -35,19 +35,19 @@ namespace blink { -PassRefPtrWillBeRawPtr<ExtendableEvent> ExtendableEvent::create() +RawPtr<ExtendableEvent> ExtendableEvent::create() { - return adoptRefWillBeNoop(new ExtendableEvent()); + return new ExtendableEvent(); } -PassRefPtrWillBeRawPtr<ExtendableEvent> ExtendableEvent::create(const AtomicString& type, const ExtendableEventInit& eventInit) +RawPtr<ExtendableEvent> ExtendableEvent::create(const AtomicString& type, const ExtendableEventInit& eventInit) { - return adoptRefWillBeNoop(new ExtendableEvent(type, eventInit)); + return new ExtendableEvent(type, eventInit); } -PassRefPtrWillBeRawPtr<ExtendableEvent> ExtendableEvent::create(const AtomicString& type, const ExtendableEventInit& eventInit, WaitUntilObserver* observer) +RawPtr<ExtendableEvent> ExtendableEvent::create(const AtomicString& type, const ExtendableEventInit& eventInit, WaitUntilObserver* observer) { - return adoptRefWillBeNoop(new ExtendableEvent(type, eventInit, observer)); + return new ExtendableEvent(type, eventInit, observer); } ExtendableEvent::~ExtendableEvent()
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.h b/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.h index 63b0078..45b212f 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.h
@@ -43,9 +43,9 @@ class MODULES_EXPORT ExtendableEvent : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<ExtendableEvent> create(); - static PassRefPtrWillBeRawPtr<ExtendableEvent> create(const AtomicString& type, const ExtendableEventInit&); - static PassRefPtrWillBeRawPtr<ExtendableEvent> create(const AtomicString& type, const ExtendableEventInit&, WaitUntilObserver*); + static RawPtr<ExtendableEvent> create(); + static RawPtr<ExtendableEvent> create(const AtomicString& type, const ExtendableEventInit&); + static RawPtr<ExtendableEvent> create(const AtomicString& type, const ExtendableEventInit&, WaitUntilObserver*); ~ExtendableEvent() override; @@ -59,7 +59,7 @@ ExtendableEvent(const AtomicString& type, const ExtendableEventInit&); ExtendableEvent(const AtomicString& type, const ExtendableEventInit&, WaitUntilObserver*); - PersistentWillBeMember<WaitUntilObserver> m_observer; + Member<WaitUntilObserver> m_observer; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.cpp b/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.cpp index 3837eb0..14a6b23 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.cpp
@@ -6,36 +6,36 @@ namespace blink { -PassRefPtrWillBeRawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create() +RawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create() { return adoptRefWillBeNoop(new ExtendableMessageEvent); } -PassRefPtrWillBeRawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create(const AtomicString& type, const ExtendableMessageEventInit& initializer) +RawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create(const AtomicString& type, const ExtendableMessageEventInit& initializer) { - return adoptRefWillBeNoop(new ExtendableMessageEvent(type, initializer)); + return new ExtendableMessageEvent(type, initializer); } -PassRefPtrWillBeRawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create(const AtomicString& type, const ExtendableMessageEventInit& initializer, WaitUntilObserver* observer) +RawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create(const AtomicString& type, const ExtendableMessageEventInit& initializer, WaitUntilObserver* observer) { - return adoptRefWillBeNoop(new ExtendableMessageEvent(type, initializer, observer)); + return new ExtendableMessageEvent(type, initializer, observer); } -PassRefPtrWillBeRawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, WaitUntilObserver* observer) +RawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, WaitUntilObserver* observer) { - return adoptRefWillBeNoop(new ExtendableMessageEvent(data, origin, ports, observer)); + return new ExtendableMessageEvent(data, origin, ports, observer); } -PassRefPtrWillBeRawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, ServiceWorkerClient* source, WaitUntilObserver* observer) +RawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, ServiceWorkerClient* source, WaitUntilObserver* observer) { - RefPtrWillBeRawPtr<ExtendableMessageEvent> event = adoptRefWillBeNoop(new ExtendableMessageEvent(data, origin, ports, observer)); + RawPtr<ExtendableMessageEvent> event = new ExtendableMessageEvent(data, origin, ports, observer); event->m_sourceAsClient = source; return event.release(); } -PassRefPtrWillBeRawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, ServiceWorker* source, WaitUntilObserver* observer) +RawPtr<ExtendableMessageEvent> ExtendableMessageEvent::create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, ServiceWorker* source, WaitUntilObserver* observer) { - RefPtrWillBeRawPtr<ExtendableMessageEvent> event = adoptRefWillBeNoop(new ExtendableMessageEvent(data, origin, ports, observer)); + RawPtr<ExtendableMessageEvent> event = new ExtendableMessageEvent(data, origin, ports, observer); event->m_sourceAsServiceWorker = source; return event.release(); }
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.h b/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.h index b2b5ad9..dd7824c 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.h
@@ -16,12 +16,12 @@ DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(); - static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(const AtomicString& type, const ExtendableMessageEventInit& initializer); - static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(const AtomicString& type, const ExtendableMessageEventInit& initializer, WaitUntilObserver*); - static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, WaitUntilObserver*); - static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, ServiceWorkerClient* source, WaitUntilObserver*); - static PassRefPtrWillBeRawPtr<ExtendableMessageEvent> create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, ServiceWorker* source, WaitUntilObserver*); + static RawPtr<ExtendableMessageEvent> create(); + static RawPtr<ExtendableMessageEvent> create(const AtomicString& type, const ExtendableMessageEventInit& initializer); + static RawPtr<ExtendableMessageEvent> create(const AtomicString& type, const ExtendableMessageEventInit& initializer, WaitUntilObserver*); + static RawPtr<ExtendableMessageEvent> create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, WaitUntilObserver*); + static RawPtr<ExtendableMessageEvent> create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, ServiceWorkerClient* source, WaitUntilObserver*); + static RawPtr<ExtendableMessageEvent> create(PassRefPtr<SerializedScriptValue> data, const String& origin, MessagePortArray* ports, ServiceWorker* source, WaitUntilObserver*); SerializedScriptValue* serializedData() const { return m_serializedData.get(); } void setSerializedData(PassRefPtr<SerializedScriptValue> serializedData) { m_serializedData = serializedData; } @@ -44,10 +44,10 @@ RefPtr<SerializedScriptValue> m_serializedData; String m_origin; String m_lastEventId; - PersistentWillBeMember<ServiceWorkerClient> m_sourceAsClient; - PersistentWillBeMember<ServiceWorker> m_sourceAsServiceWorker; - PersistentWillBeMember<MessagePort> m_sourceAsMessagePort; - PersistentWillBeMember<MessagePortArray> m_ports; + Member<ServiceWorkerClient> m_sourceAsClient; + Member<ServiceWorker> m_sourceAsServiceWorker; + Member<MessagePort> m_sourceAsMessagePort; + Member<MessagePortArray> m_ports; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.cpp b/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.cpp index 029ee829..8c71242 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.cpp
@@ -10,19 +10,19 @@ namespace blink { -PassRefPtrWillBeRawPtr<FetchEvent> FetchEvent::create() +RawPtr<FetchEvent> FetchEvent::create() { - return adoptRefWillBeNoop(new FetchEvent()); + return new FetchEvent(); } -PassRefPtrWillBeRawPtr<FetchEvent> FetchEvent::create(const AtomicString& type, const FetchEventInit& initializer) +RawPtr<FetchEvent> FetchEvent::create(const AtomicString& type, const FetchEventInit& initializer) { - return adoptRefWillBeNoop(new FetchEvent(type, initializer, nullptr)); + return new FetchEvent(type, initializer, nullptr); } -PassRefPtrWillBeRawPtr<FetchEvent> FetchEvent::create(const AtomicString& type, const FetchEventInit& initializer, RespondWithObserver* observer) +RawPtr<FetchEvent> FetchEvent::create(const AtomicString& type, const FetchEventInit& initializer, RespondWithObserver* observer) { - return adoptRefWillBeNoop(new FetchEvent(type, initializer, observer)); + return new FetchEvent(type, initializer, observer); } Request* FetchEvent::request() const
diff --git a/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h b/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h index 793c5cd..6f24f32 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h +++ b/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.h
@@ -26,9 +26,9 @@ class MODULES_EXPORT FetchEvent final : public ExtendableEvent { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<FetchEvent> create(); - static PassRefPtrWillBeRawPtr<FetchEvent> create(const AtomicString& type, const FetchEventInit&); - static PassRefPtrWillBeRawPtr<FetchEvent> create(const AtomicString& type, const FetchEventInit&, RespondWithObserver*); + static RawPtr<FetchEvent> create(); + static RawPtr<FetchEvent> create(const AtomicString& type, const FetchEventInit&); + static RawPtr<FetchEvent> create(const AtomicString& type, const FetchEventInit&, RespondWithObserver*); Request* request() const; String clientId() const; @@ -45,8 +45,8 @@ FetchEvent(const AtomicString& type, const FetchEventInit&, RespondWithObserver*); private: - PersistentWillBeMember<RespondWithObserver> m_observer; - PersistentWillBeMember<Request> m_request; + Member<RespondWithObserver> m_observer; + Member<Request> m_request; String m_clientId; bool m_isReload; };
diff --git a/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.cpp b/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.cpp index 43feeee..2ade67d 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.cpp
@@ -11,19 +11,19 @@ namespace blink { -PassRefPtrWillBeRawPtr<InstallEvent> InstallEvent::create() +RawPtr<InstallEvent> InstallEvent::create() { - return adoptRefWillBeNoop(new InstallEvent()); + return new InstallEvent(); } -PassRefPtrWillBeRawPtr<InstallEvent> InstallEvent::create(const AtomicString& type, const ExtendableEventInit& eventInit) +RawPtr<InstallEvent> InstallEvent::create(const AtomicString& type, const ExtendableEventInit& eventInit) { - return adoptRefWillBeNoop(new InstallEvent(type, eventInit)); + return new InstallEvent(type, eventInit); } -PassRefPtrWillBeRawPtr<InstallEvent> InstallEvent::create(const AtomicString& type, const ExtendableEventInit& eventInit, WaitUntilObserver* observer) +RawPtr<InstallEvent> InstallEvent::create(const AtomicString& type, const ExtendableEventInit& eventInit, WaitUntilObserver* observer) { - return adoptRefWillBeNoop(new InstallEvent(type, eventInit, observer)); + return new InstallEvent(type, eventInit, observer); } InstallEvent::~InstallEvent()
diff --git a/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.h b/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.h index 345a9c4e..96a508cd 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.h +++ b/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.h
@@ -18,9 +18,9 @@ DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<InstallEvent> create(); - static PassRefPtrWillBeRawPtr<InstallEvent> create(const AtomicString& type, const ExtendableEventInit&); - static PassRefPtrWillBeRawPtr<InstallEvent> create(const AtomicString& type, const ExtendableEventInit&, WaitUntilObserver*); + static RawPtr<InstallEvent> create(); + static RawPtr<InstallEvent> create(const AtomicString& type, const ExtendableEventInit&); + static RawPtr<InstallEvent> create(const AtomicString& type, const ExtendableEventInit&, WaitUntilObserver*); ~InstallEvent() override;
diff --git a/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h b/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h index 7fa8213..7fc8a51 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h +++ b/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h
@@ -23,7 +23,7 @@ // This class observes the service worker's handling of a FetchEvent and // notifies the client. class MODULES_EXPORT RespondWithObserver final : public GarbageCollectedFinalized<RespondWithObserver>, public ContextLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RespondWithObserver); + USING_GARBAGE_COLLECTED_MIXIN(RespondWithObserver); public: static RespondWithObserver* create(ExecutionContext*, int eventID, const KURL& requestURL, WebURLRequest::FetchRequestMode, WebURLRequest::FrameType, WebURLRequest::RequestContext);
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.h index 3085f51..37fb79c8 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.h
@@ -58,7 +58,7 @@ , public WebServiceWorkerProviderClient { DEFINE_WRAPPERTYPEINFO(); REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerContainer); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainer); + USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainer); public: using RegistrationCallbacks = WebServiceWorkerProvider::WebServiceWorkerRegistrationCallbacks;
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp index 094a61ed..2a5cabf 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp
@@ -13,9 +13,9 @@ namespace blink { -PassOwnPtrWillBeRawPtr<ServiceWorkerContainerClient> ServiceWorkerContainerClient::create(PassOwnPtr<WebServiceWorkerProvider> provider) +RawPtr<ServiceWorkerContainerClient> ServiceWorkerContainerClient::create(PassOwnPtr<WebServiceWorkerProvider> provider) { - return adoptPtrWillBeNoop(new ServiceWorkerContainerClient(provider)); + return new ServiceWorkerContainerClient(provider); } ServiceWorkerContainerClient::ServiceWorkerContainerClient(PassOwnPtr<WebServiceWorkerProvider> provider) @@ -37,16 +37,16 @@ if (context->isWorkerGlobalScope()) { WorkerClients* clients = toWorkerGlobalScope(context)->clients(); ASSERT(clients); - return static_cast<ServiceWorkerContainerClient*>(WillBeHeapSupplement<WorkerClients>::from(clients, supplementName())); + return static_cast<ServiceWorkerContainerClient*>(HeapSupplement<WorkerClients>::from(clients, supplementName())); } Document* document = toDocument(context); if (!document->frame()) return nullptr; - ServiceWorkerContainerClient* client = static_cast<ServiceWorkerContainerClient*>(WillBeHeapSupplement<Document>::from(document, supplementName())); + ServiceWorkerContainerClient* client = static_cast<ServiceWorkerContainerClient*>(HeapSupplement<Document>::from(document, supplementName())); if (!client) { client = new ServiceWorkerContainerClient(document->frame()->loader().client()->createServiceWorkerProvider()); - WillBeHeapSupplement<Document>::provideTo(*document, supplementName(), adoptPtrWillBeNoop(client)); + HeapSupplement<Document>::provideTo(*document, supplementName(), adoptPtrWillBeNoop(client)); } return client; }
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.h index c68c61e1..b3d1b99e 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerClient.h
@@ -18,14 +18,13 @@ // This mainly exists to provide access to WebServiceWorkerProvider. // Owned by Document (or WorkerClients). class MODULES_EXPORT ServiceWorkerContainerClient final - : public NoBaseWillBeGarbageCollectedFinalized<ServiceWorkerContainerClient> - , public WillBeHeapSupplement<Document> - , public WillBeHeapSupplement<WorkerClients> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainerClient); + : public GarbageCollectedFinalized<ServiceWorkerContainerClient> + , public HeapSupplement<Document> + , public HeapSupplement<WorkerClients> { + USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainerClient); WTF_MAKE_NONCOPYABLE(ServiceWorkerContainerClient); - USING_FAST_MALLOC_WILL_BE_REMOVED(ServiceWorkerContainerClient); public: - static PassOwnPtrWillBeRawPtr<ServiceWorkerContainerClient> create(PassOwnPtr<WebServiceWorkerProvider>); + static RawPtr<ServiceWorkerContainerClient> create(PassOwnPtr<WebServiceWorkerProvider>); virtual ~ServiceWorkerContainerClient(); WebServiceWorkerProvider* provider() { return m_provider.get(); } @@ -35,8 +34,8 @@ DEFINE_INLINE_VIRTUAL_TRACE() { - WillBeHeapSupplement<Document>::trace(visitor); - WillBeHeapSupplement<WorkerClients>::trace(visitor); + HeapSupplement<Document>::trace(visitor); + HeapSupplement<WorkerClients>::trace(visitor); } protected:
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp index a2409dd2..fa61439 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp
@@ -164,7 +164,7 @@ void provide(PassOwnPtr<WebServiceWorkerProvider> provider) { - WillBeHeapSupplement<Document>::provideTo(m_page->document(), ServiceWorkerContainerClient::supplementName(), ServiceWorkerContainerClient::create(provider)); + HeapSupplement<Document>::provideTo(m_page->document(), ServiceWorkerContainerClient::supplementName(), ServiceWorkerContainerClient::create(provider)); } void setPageURL(const String& url)
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp index 8bb957d8..4d033a14 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
@@ -64,11 +64,11 @@ namespace blink { -PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> ServiceWorkerGlobalScope::create(ServiceWorkerThread* thread, PassOwnPtr<WorkerThreadStartupData> startupData) +RawPtr<ServiceWorkerGlobalScope> ServiceWorkerGlobalScope::create(ServiceWorkerThread* thread, PassOwnPtr<WorkerThreadStartupData> startupData) { // Note: startupData is finalized on return. After the relevant parts has been // passed along to the created 'context'. - RefPtrWillBeRawPtr<ServiceWorkerGlobalScope> context = adoptRefWillBeNoop(new ServiceWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAgent, thread, monotonicallyIncreasingTime(), startupData->m_starterOriginPrivilegeData.release(), startupData->m_workerClients.release())); + RawPtr<ServiceWorkerGlobalScope> context = new ServiceWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAgent, thread, monotonicallyIncreasingTime(), startupData->m_starterOriginPrivilegeData.release(), startupData->m_workerClients.release()); context->setV8CacheOptions(startupData->m_v8CacheOptions); context->applyContentSecurityPolicyFromVector(*startupData->m_contentSecurityPolicyHeaders); @@ -77,7 +77,7 @@ return context.release(); } -ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String& userAgent, ServiceWorkerThread* thread, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData> starterOriginPrivilegeData, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) +ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String& userAgent, ServiceWorkerThread* thread, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData> starterOriginPrivilegeData, RawPtr<WorkerClients> workerClients) : WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOriginPrivilegeData, workerClients) , m_didEvaluateScript(false) , m_hadErrorInTopLevelEventHandler(false) @@ -148,14 +148,14 @@ m_registration = ServiceWorkerRegistration::getOrCreate(getExecutionContext(), handle.release()); } -bool ServiceWorkerGlobalScope::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) +bool ServiceWorkerGlobalScope::addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener> listener, const EventListenerOptions& options) { if (m_didEvaluateScript) { if (eventType == EventTypeNames::install) { - RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "Event handler of 'install' event must be added on the initial evaluation of worker script."); + RawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "Event handler of 'install' event must be added on the initial evaluation of worker script."); addMessageToWorkerConsole(consoleMessage.release()); } else if (eventType == EventTypeNames::activate) { - RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "Event handler of 'activate' event must be added on the initial evaluation of worker script."); + RawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "Event handler of 'activate' event must be added on the initial evaluation of worker script."); addMessageToWorkerConsole(consoleMessage.release()); } } @@ -167,7 +167,7 @@ return EventTargetNames::ServiceWorkerGlobalScope; } -DispatchEventResult ServiceWorkerGlobalScope::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) +DispatchEventResult ServiceWorkerGlobalScope::dispatchEventInternal(RawPtr<Event> event) { m_eventNestingLevel++; DispatchEventResult dispatchResult = WorkerGlobalScope::dispatchEventInternal(event.get()); @@ -177,7 +177,7 @@ return dispatchResult; } -void ServiceWorkerGlobalScope::dispatchExtendableEvent(PassRefPtrWillBeRawPtr<Event> event, WaitUntilObserver* observer) +void ServiceWorkerGlobalScope::dispatchExtendableEvent(RawPtr<Event> event, WaitUntilObserver* observer) { ASSERT(m_eventNestingLevel == 0); m_hadErrorInTopLevelEventHandler = false; @@ -206,7 +206,7 @@ WorkerGlobalScope::importScripts(urls, exceptionState); } -PassOwnPtrWillBeRawPtr<CachedMetadataHandler> ServiceWorkerGlobalScope::createWorkerScriptCachedMetadataHandler(const KURL& scriptURL, const Vector<char>* metaData) +RawPtr<CachedMetadataHandler> ServiceWorkerGlobalScope::createWorkerScriptCachedMetadataHandler(const KURL& scriptURL, const Vector<char>* metaData) { return ServiceWorkerScriptCachedMetadataHandler::create(this, scriptURL, metaData); } @@ -214,7 +214,7 @@ void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack> callStack) { WorkerGlobalScope::logExceptionToConsole(errorMessage, scriptId, sourceURL, lineNumber, columnNumber, callStack); - RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, columnNumber); + RawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, columnNumber); consoleMessage->setScriptId(scriptId); consoleMessage->setCallStack(callStack); addMessageToWorkerConsole(consoleMessage.release());
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.h index a9612bd8d..d3d8263 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.h
@@ -56,7 +56,7 @@ class MODULES_EXPORT ServiceWorkerGlobalScope final : public WorkerGlobalScope { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> create(ServiceWorkerThread*, PassOwnPtr<WorkerThreadStartupData>); + static RawPtr<ServiceWorkerGlobalScope> create(ServiceWorkerThread*, PassOwnPtr<WorkerThreadStartupData>); ~ServiceWorkerGlobalScope() override; bool isServiceWorkerGlobalScope() const override { return true; } @@ -79,7 +79,7 @@ // EventTarget const AtomicString& interfaceName() const override; - void dispatchExtendableEvent(PassRefPtrWillBeRawPtr<Event>, WaitUntilObserver*); + void dispatchExtendableEvent(RawPtr<Event>, WaitUntilObserver*); DEFINE_ATTRIBUTE_EVENT_LISTENER(install); DEFINE_ATTRIBUTE_EVENT_LISTENER(activate); @@ -91,18 +91,18 @@ protected: // EventTarget - DispatchEventResult dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) override; - bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener>, const EventListenerOptions&) override; + DispatchEventResult dispatchEventInternal(RawPtr<Event>) override; + bool addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener>, const EventListenerOptions&) override; private: - ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorkerThread*, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData>, PassOwnPtrWillBeRawPtr<WorkerClients>); + ServiceWorkerGlobalScope(const KURL&, const String& userAgent, ServiceWorkerThread*, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData>, RawPtr<WorkerClients>); void importScripts(const Vector<String>& urls, ExceptionState&) override; - PassOwnPtrWillBeRawPtr<CachedMetadataHandler> createWorkerScriptCachedMetadataHandler(const KURL& scriptURL, const Vector<char>* metaData) override; + RawPtr<CachedMetadataHandler> createWorkerScriptCachedMetadataHandler(const KURL& scriptURL, const Vector<char>* metaData) override; void logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) override; void scriptLoaded(size_t scriptSize, size_t cachedMetadataSize) override; - PersistentWillBeMember<ServiceWorkerClients> m_clients; - PersistentWillBeMember<ServiceWorkerRegistration> m_registration; + Member<ServiceWorkerClients> m_clients; + Member<ServiceWorkerRegistration> m_registration; bool m_didEvaluateScript; bool m_hadErrorInTopLevelEventHandler; unsigned m_eventNestingLevel;
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.cpp index 2e22af1..e1b806c 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.cpp
@@ -44,10 +44,10 @@ { WorkerClients* clients = toWorkerGlobalScope(context)->clients(); ASSERT(clients); - return static_cast<ServiceWorkerGlobalScopeClient*>(WillBeHeapSupplement<WorkerClients>::from(clients, supplementName())); + return static_cast<ServiceWorkerGlobalScopeClient*>(HeapSupplement<WorkerClients>::from(clients, supplementName())); } -void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients* clients, PassOwnPtrWillBeRawPtr<ServiceWorkerGlobalScopeClient> client) +void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients* clients, RawPtr<ServiceWorkerGlobalScopeClient> client) { clients->provideSupplement(ServiceWorkerGlobalScopeClient::supplementName(), client); }
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.h index 44f7c7c7..28fed93 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.h
@@ -53,7 +53,7 @@ class WorkerClients; // See WebServiceWorkerContextClient for documentation for the methods in this class. -class MODULES_EXPORT ServiceWorkerGlobalScopeClient : public WillBeHeapSupplement<WorkerClients> { +class MODULES_EXPORT ServiceWorkerGlobalScopeClient : public HeapSupplement<WorkerClients> { WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeClient); DISALLOW_NEW(); public: @@ -94,7 +94,7 @@ ServiceWorkerGlobalScopeClient() { } }; -MODULES_EXPORT void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*, PassOwnPtrWillBeRawPtr<ServiceWorkerGlobalScopeClient>); +MODULES_EXPORT void provideServiceWorkerGlobalScopeClientToWorker(WorkerClients*, RawPtr<ServiceWorkerGlobalScopeClient>); } // namespace blink
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerLinkResource.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerLinkResource.cpp index 183127b..e7aacb6 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerLinkResource.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerLinkResource.cpp
@@ -35,14 +35,14 @@ private: WTF_MAKE_NONCOPYABLE(RegistrationCallback); - RawPtrWillBePersistent<LinkLoaderClient> m_client; + Persistent<LinkLoaderClient> m_client; }; } -PassOwnPtrWillBeRawPtr<ServiceWorkerLinkResource> ServiceWorkerLinkResource::create(HTMLLinkElement* owner) +RawPtr<ServiceWorkerLinkResource> ServiceWorkerLinkResource::create(HTMLLinkElement* owner) { - return adoptPtrWillBeNoop(new ServiceWorkerLinkResource(owner)); + return new ServiceWorkerLinkResource(owner); } ServiceWorkerLinkResource::~ServiceWorkerLinkResource()
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerLinkResource.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerLinkResource.h index 10a8769f..4e6a4dae 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerLinkResource.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerLinkResource.h
@@ -16,10 +16,9 @@ class HTMLLinkElement; class MODULES_EXPORT ServiceWorkerLinkResource final : public LinkResource { - USING_FAST_MALLOC_WILL_BE_REMOVED(ServiceWorkerLinkResource); public: - static PassOwnPtrWillBeRawPtr<ServiceWorkerLinkResource> create(HTMLLinkElement* owner); + static RawPtr<ServiceWorkerLinkResource> create(HTMLLinkElement* owner); ~ServiceWorkerLinkResource() override;
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerMessageEvent.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerMessageEvent.h index a85d09b9..2242ecb 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerMessageEvent.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerMessageEvent.h
@@ -16,19 +16,19 @@ class MODULES_EXPORT ServiceWorkerMessageEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<ServiceWorkerMessageEvent> create() + static RawPtr<ServiceWorkerMessageEvent> create() { return adoptRefWillBeNoop(new ServiceWorkerMessageEvent); } - static PassRefPtrWillBeRawPtr<ServiceWorkerMessageEvent> create(const AtomicString& type, const ServiceWorkerMessageEventInit& initializer) + static RawPtr<ServiceWorkerMessageEvent> create(const AtomicString& type, const ServiceWorkerMessageEventInit& initializer) { - return adoptRefWillBeNoop(new ServiceWorkerMessageEvent(type, initializer)); + return new ServiceWorkerMessageEvent(type, initializer); } - static PassRefPtrWillBeRawPtr<ServiceWorkerMessageEvent> create(MessagePortArray* ports, PassRefPtr<SerializedScriptValue> data, ServiceWorker* source, const String& origin) + static RawPtr<ServiceWorkerMessageEvent> create(MessagePortArray* ports, PassRefPtr<SerializedScriptValue> data, ServiceWorker* source, const String& origin) { - return adoptRefWillBeNoop(new ServiceWorkerMessageEvent(data, origin, String(), source, ports)); + return new ServiceWorkerMessageEvent(data, origin, String(), source, ports); } ~ServiceWorkerMessageEvent() override; @@ -53,9 +53,9 @@ RefPtr<SerializedScriptValue> m_serializedData; String m_origin; String m_lastEventId; - PersistentWillBeMember<ServiceWorker> m_sourceAsServiceWorker; - PersistentWillBeMember<MessagePort> m_sourceAsMessagePort; - PersistentWillBeMember<MessagePortArray> m_ports; + Member<ServiceWorker> m_sourceAsServiceWorker; + Member<MessagePort> m_sourceAsMessagePort; + Member<MessagePortArray> m_ports; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp index 53aa5c9..9044c03 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -124,8 +124,8 @@ visitor->trace(m_waiting); visitor->trace(m_active); RefCountedGarbageCollectedEventTargetWithInlineData<ServiceWorkerRegistration>::trace(visitor); - HeapSupplementable<ServiceWorkerRegistration>::trace(visitor); ActiveDOMObject::trace(visitor); + Supplementable<ServiceWorkerRegistration>::trace(visitor); } bool ServiceWorkerRegistration::hasPendingActivity() const
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h index be00bd05..196eace 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h
@@ -33,7 +33,7 @@ , public ActiveScriptWrappable , public ActiveDOMObject , public WebServiceWorkerRegistrationProxy - , public HeapSupplementable<ServiceWorkerRegistration> { + , public Supplementable<ServiceWorkerRegistration> { DEFINE_WRAPPERTYPEINFO(); REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerRegistration); USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistration);
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h index e314128..860af08 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h
@@ -18,9 +18,9 @@ class ServiceWorkerScriptCachedMetadataHandler : public CachedMetadataHandler { public: - static PassOwnPtrWillBeRawPtr<ServiceWorkerScriptCachedMetadataHandler> create(WorkerGlobalScope* workerGlobalScope, const KURL& scriptURL, const Vector<char>* metaData) + static RawPtr<ServiceWorkerScriptCachedMetadataHandler> create(WorkerGlobalScope* workerGlobalScope, const KURL& scriptURL, const Vector<char>* metaData) { - return adoptPtrWillBeNoop(new ServiceWorkerScriptCachedMetadataHandler(workerGlobalScope, scriptURL, metaData)); + return new ServiceWorkerScriptCachedMetadataHandler(workerGlobalScope, scriptURL, metaData); } ~ServiceWorkerScriptCachedMetadataHandler() override; DECLARE_VIRTUAL_TRACE(); @@ -32,7 +32,7 @@ private: ServiceWorkerScriptCachedMetadataHandler(WorkerGlobalScope*, const KURL& scriptURL, const Vector<char>* metaData); - RawPtrWillBeMember<WorkerGlobalScope> m_workerGlobalScope; + Member<WorkerGlobalScope> m_workerGlobalScope; KURL m_scriptURL; RefPtr<CachedMetadata> m_cachedMetadata; };
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.cpp index 13df201df..ffd253c 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.cpp
@@ -49,7 +49,7 @@ { } -PassRefPtrWillBeRawPtr<WorkerGlobalScope> ServiceWorkerThread::createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupData> startupData) +RawPtr<WorkerGlobalScope> ServiceWorkerThread::createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupData> startupData) { return ServiceWorkerGlobalScope::create(this, startupData); }
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.h index 37739024..6167e8f 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerThread.h
@@ -44,7 +44,7 @@ ~ServiceWorkerThread() override; protected: - PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupData>) override; + RawPtr<WorkerGlobalScope> createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupData>) override; WebThreadSupportingGC& backingThread() override; private:
diff --git a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h index 0b0287fd..7414f598 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h +++ b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h
@@ -22,7 +22,7 @@ // Created for each ExtendableEvent instance. class MODULES_EXPORT WaitUntilObserver final : public GarbageCollectedFinalized<WaitUntilObserver>, public ContextLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WaitUntilObserver); + USING_GARBAGE_COLLECTED_MIXIN(WaitUntilObserver); public: enum EventType { Activate,
diff --git a/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp b/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp index a3d2118..87e3d79 100644 --- a/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp +++ b/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp
@@ -41,8 +41,6 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowSpeechSynthesis); - const char* DOMWindowSpeechSynthesis::supplementName() { return "DOMWindowSpeechSynthesis"; @@ -51,7 +49,7 @@ // static DOMWindowSpeechSynthesis& DOMWindowSpeechSynthesis::from(LocalDOMWindow& window) { - DOMWindowSpeechSynthesis* supplement = static_cast<DOMWindowSpeechSynthesis*>(WillBeHeapSupplement<LocalDOMWindow>::from(window, supplementName())); + DOMWindowSpeechSynthesis* supplement = static_cast<DOMWindowSpeechSynthesis*>(HeapSupplement<LocalDOMWindow>::from(window, supplementName())); if (!supplement) { supplement = new DOMWindowSpeechSynthesis(window); provideTo(window, supplementName(), adoptPtrWillBeNoop(supplement)); @@ -75,7 +73,7 @@ DEFINE_TRACE(DOMWindowSpeechSynthesis) { visitor->trace(m_speechSynthesis); - WillBeHeapSupplement<LocalDOMWindow>::trace(visitor); + HeapSupplement<LocalDOMWindow>::trace(visitor); DOMWindowProperty::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.h b/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.h index b4227c53..2f0e18f 100644 --- a/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.h +++ b/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.h
@@ -36,10 +36,8 @@ class DOMWindow; -class MODULES_EXPORT DOMWindowSpeechSynthesis final : public NoBaseWillBeGarbageCollected<DOMWindowSpeechSynthesis>, public WillBeHeapSupplement<LocalDOMWindow>, public DOMWindowProperty { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMWindowSpeechSynthesis); - DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowSpeechSynthesis); - USING_FAST_MALLOC_WILL_BE_REMOVED(DOMWindowSpeechSynthesis); +class MODULES_EXPORT DOMWindowSpeechSynthesis final : public GarbageCollected<DOMWindowSpeechSynthesis>, public HeapSupplement<LocalDOMWindow>, public DOMWindowProperty { + USING_GARBAGE_COLLECTED_MIXIN(DOMWindowSpeechSynthesis); public: static SpeechSynthesis* speechSynthesis(DOMWindow&); static DOMWindowSpeechSynthesis& from(LocalDOMWindow&); @@ -52,7 +50,7 @@ SpeechSynthesis* speechSynthesis(); static const char* supplementName(); - PersistentWillBeMember<SpeechSynthesis> m_speechSynthesis; + Member<SpeechSynthesis> m_speechSynthesis; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp b/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp index 6fb212fa..206b7fd 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp
@@ -132,7 +132,7 @@ dispatchEvent(SpeechRecognitionEvent::createNoMatch(result)); } -void SpeechRecognition::didReceiveError(PassRefPtrWillBeRawPtr<SpeechRecognitionError> error) +void SpeechRecognition::didReceiveError(RawPtr<SpeechRecognitionError> error) { dispatchEvent(error); m_started = false;
diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognition.h b/third_party/WebKit/Source/modules/speech/SpeechRecognition.h index 17d8323..76616b4 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognition.h +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognition.h
@@ -48,7 +48,7 @@ class MODULES_EXPORT SpeechRecognition final : public RefCountedGarbageCollectedEventTargetWithInlineData<SpeechRecognition>, public PageLifecycleObserver, public ActiveScriptWrappable, public ActiveDOMObject { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SpeechRecognition); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SpeechRecognition); + USING_GARBAGE_COLLECTED_MIXIN(SpeechRecognition); DEFINE_WRAPPERTYPEINFO(); public: static SpeechRecognition* create(ExecutionContext*); @@ -83,7 +83,7 @@ void didEndAudio(); void didReceiveResults(const HeapVector<Member<SpeechRecognitionResult>>& newFinalResults, const HeapVector<Member<SpeechRecognitionResult>>& currentInterimResults); void didReceiveNoMatch(SpeechRecognitionResult*); - void didReceiveError(PassRefPtrWillBeRawPtr<SpeechRecognitionError>); + void didReceiveError(RawPtr<SpeechRecognitionError>); void didStart(); void didEnd(); @@ -124,7 +124,7 @@ bool m_interimResults; unsigned long m_maxAlternatives; - RawPtrWillBeMember<SpeechRecognitionController> m_controller; + Member<SpeechRecognitionController> m_controller; bool m_stoppedByActiveDOMObject; bool m_started; bool m_stopping;
diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognitionController.cpp b/third_party/WebKit/Source/modules/speech/SpeechRecognitionController.cpp index b6f8e7c..70d7500 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognitionController.cpp +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognitionController.cpp
@@ -42,9 +42,9 @@ // FIXME: Call m_client->pageDestroyed(); once we have implemented a client. } -PassOwnPtrWillBeRawPtr<SpeechRecognitionController> SpeechRecognitionController::create(PassOwnPtr<SpeechRecognitionClient> client) +RawPtr<SpeechRecognitionController> SpeechRecognitionController::create(PassOwnPtr<SpeechRecognitionClient> client) { - return adoptPtrWillBeNoop(new SpeechRecognitionController(client)); + return new SpeechRecognitionController(client); } void provideSpeechRecognitionTo(Page& page, PassOwnPtr<SpeechRecognitionClient> client)
diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognitionController.h b/third_party/WebKit/Source/modules/speech/SpeechRecognitionController.h index a02b4105..54bb532 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognitionController.h +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognitionController.h
@@ -34,9 +34,8 @@ class MediaStreamTrack; -class SpeechRecognitionController final : public NoBaseWillBeGarbageCollectedFinalized<SpeechRecognitionController>, public WillBeHeapSupplement<Page> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SpeechRecognitionController); - USING_FAST_MALLOC_WILL_BE_REMOVED(SpeechRecognitionController); +class SpeechRecognitionController final : public GarbageCollectedFinalized<SpeechRecognitionController>, public HeapSupplement<Page> { + USING_GARBAGE_COLLECTED_MIXIN(SpeechRecognitionController); public: virtual ~SpeechRecognitionController(); @@ -48,11 +47,11 @@ void stop(SpeechRecognition* recognition) { m_client->stop(recognition); } void abort(SpeechRecognition* recognition) { m_client->abort(recognition); } - static PassOwnPtrWillBeRawPtr<SpeechRecognitionController> create(PassOwnPtr<SpeechRecognitionClient>); + static RawPtr<SpeechRecognitionController> create(PassOwnPtr<SpeechRecognitionClient>); static const char* supplementName(); - static SpeechRecognitionController* from(Page* page) { return static_cast<SpeechRecognitionController*>(WillBeHeapSupplement<Page>::from(page, supplementName())); } + static SpeechRecognitionController* from(Page* page) { return static_cast<SpeechRecognitionController*>(HeapSupplement<Page>::from(page, supplementName())); } - DEFINE_INLINE_VIRTUAL_TRACE() { WillBeHeapSupplement<Page>::trace(visitor); } + DEFINE_INLINE_VIRTUAL_TRACE() { HeapSupplement<Page>::trace(visitor); } private: explicit SpeechRecognitionController(PassOwnPtr<SpeechRecognitionClient>);
diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.cpp b/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.cpp index 33b6bc7..7cf44d68 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.cpp +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.cpp
@@ -54,19 +54,19 @@ return String(); } -PassRefPtrWillBeRawPtr<SpeechRecognitionError> SpeechRecognitionError::create(ErrorCode code, const String& message) +RawPtr<SpeechRecognitionError> SpeechRecognitionError::create(ErrorCode code, const String& message) { - return adoptRefWillBeNoop(new SpeechRecognitionError(ErrorCodeToString(code), message)); + return new SpeechRecognitionError(ErrorCodeToString(code), message); } -PassRefPtrWillBeRawPtr<SpeechRecognitionError> SpeechRecognitionError::create() +RawPtr<SpeechRecognitionError> SpeechRecognitionError::create() { - return adoptRefWillBeNoop(new SpeechRecognitionError(emptyString(), emptyString())); + return new SpeechRecognitionError(emptyString(), emptyString()); } -PassRefPtrWillBeRawPtr<SpeechRecognitionError> SpeechRecognitionError::create(const AtomicString& eventName, const SpeechRecognitionErrorInit& initializer) +RawPtr<SpeechRecognitionError> SpeechRecognitionError::create(const AtomicString& eventName, const SpeechRecognitionErrorInit& initializer) { - return adoptRefWillBeNoop(new SpeechRecognitionError(eventName, initializer)); + return new SpeechRecognitionError(eventName, initializer); } SpeechRecognitionError::SpeechRecognitionError(const String& error, const String& message)
diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.h b/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.h index dd8ae01..17d9a00 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.h +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.h
@@ -50,9 +50,9 @@ ErrorCodeLanguageNotSupported = 8 }; - static PassRefPtrWillBeRawPtr<SpeechRecognitionError> create(ErrorCode, const String&); - static PassRefPtrWillBeRawPtr<SpeechRecognitionError> create(); - static PassRefPtrWillBeRawPtr<SpeechRecognitionError> create(const AtomicString&, const SpeechRecognitionErrorInit&); + static RawPtr<SpeechRecognitionError> create(ErrorCode, const String&); + static RawPtr<SpeechRecognitionError> create(); + static RawPtr<SpeechRecognitionError> create(const AtomicString&, const SpeechRecognitionErrorInit&); const String& error() { return m_error; } const String& message() { return m_message; }
diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.cpp b/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.cpp index fdac8f3..b61c201 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.cpp +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.cpp
@@ -27,30 +27,30 @@ namespace blink { -PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::create() +RawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::create() { return adoptRefWillBeNoop(new SpeechRecognitionEvent); } -PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::create(const AtomicString& eventName, const SpeechRecognitionEventInit& initializer) +RawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::create(const AtomicString& eventName, const SpeechRecognitionEventInit& initializer) { - return adoptRefWillBeNoop(new SpeechRecognitionEvent(eventName, initializer)); + return new SpeechRecognitionEvent(eventName, initializer); } -PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::createResult(unsigned long resultIndex, const HeapVector<Member<SpeechRecognitionResult>>& results) +RawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::createResult(unsigned long resultIndex, const HeapVector<Member<SpeechRecognitionResult>>& results) { - return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::result, resultIndex, SpeechRecognitionResultList::create(results))); + return new SpeechRecognitionEvent(EventTypeNames::result, resultIndex, SpeechRecognitionResultList::create(results)); } -PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::createNoMatch(SpeechRecognitionResult* result) +RawPtr<SpeechRecognitionEvent> SpeechRecognitionEvent::createNoMatch(SpeechRecognitionResult* result) { if (result) { HeapVector<Member<SpeechRecognitionResult>> results; results.append(result); - return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::nomatch, 0, SpeechRecognitionResultList::create(results))); + return new SpeechRecognitionEvent(EventTypeNames::nomatch, 0, SpeechRecognitionResultList::create(results)); } - return adoptRefWillBeNoop(new SpeechRecognitionEvent(EventTypeNames::nomatch, 0, nullptr)); + return new SpeechRecognitionEvent(EventTypeNames::nomatch, 0, nullptr); } const AtomicString& SpeechRecognitionEvent::interfaceName() const
diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.h b/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.h index 610c1307..b43a237c 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.h +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.h
@@ -39,12 +39,12 @@ class SpeechRecognitionEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> create(); - static PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> create(const AtomicString&, const SpeechRecognitionEventInit&); + static RawPtr<SpeechRecognitionEvent> create(); + static RawPtr<SpeechRecognitionEvent> create(const AtomicString&, const SpeechRecognitionEventInit&); ~SpeechRecognitionEvent() override; - static PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> createResult(unsigned long resultIndex, const HeapVector<Member<SpeechRecognitionResult>>& results); - static PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> createNoMatch(SpeechRecognitionResult*); + static RawPtr<SpeechRecognitionEvent> createResult(unsigned long resultIndex, const HeapVector<Member<SpeechRecognitionResult>>& results); + static RawPtr<SpeechRecognitionEvent> createNoMatch(SpeechRecognitionResult*); unsigned long resultIndex() const { return m_resultIndex; } SpeechRecognitionResultList* results() const { return m_results; } @@ -64,7 +64,7 @@ SpeechRecognitionEvent(const AtomicString& eventName, unsigned long resultIndex, SpeechRecognitionResultList* results); unsigned long m_resultIndex; - PersistentWillBeMember<SpeechRecognitionResultList> m_results; + Member<SpeechRecognitionResultList> m_results; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.cpp b/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.cpp index 94cdfe37..6a5e94e3 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.cpp +++ b/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.cpp
@@ -27,14 +27,14 @@ namespace blink { -PassRefPtrWillBeRawPtr<SpeechSynthesisEvent> SpeechSynthesisEvent::create() +RawPtr<SpeechSynthesisEvent> SpeechSynthesisEvent::create() { return adoptRefWillBeNoop(new SpeechSynthesisEvent); } -PassRefPtrWillBeRawPtr<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomicString& type, SpeechSynthesisUtterance* utterance, unsigned charIndex, float elapsedTime, const String& name) +RawPtr<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomicString& type, SpeechSynthesisUtterance* utterance, unsigned charIndex, float elapsedTime, const String& name) { - return adoptRefWillBeNoop(new SpeechSynthesisEvent(type, utterance, charIndex, elapsedTime, name)); + return new SpeechSynthesisEvent(type, utterance, charIndex, elapsedTime, name); } SpeechSynthesisEvent::SpeechSynthesisEvent()
diff --git a/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.h b/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.h index 015a14c..c8f7bdb1 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.h +++ b/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.h
@@ -34,8 +34,8 @@ class SpeechSynthesisEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<SpeechSynthesisEvent> create(); - static PassRefPtrWillBeRawPtr<SpeechSynthesisEvent> create(const AtomicString& type, SpeechSynthesisUtterance*, unsigned charIndex, float elapsedTime, const String& name); + static RawPtr<SpeechSynthesisEvent> create(); + static RawPtr<SpeechSynthesisEvent> create(const AtomicString& type, SpeechSynthesisUtterance*, unsigned charIndex, float elapsedTime, const String& name); SpeechSynthesisUtterance* utterance() const { return m_utterance; } unsigned charIndex() const { return m_charIndex; } @@ -50,7 +50,7 @@ SpeechSynthesisEvent(); SpeechSynthesisEvent(const AtomicString& type, SpeechSynthesisUtterance*, unsigned charIndex, float elapsedTime, const String& name); - PersistentWillBeMember<SpeechSynthesisUtterance> m_utterance; + Member<SpeechSynthesisUtterance> m_utterance; unsigned m_charIndex; float m_elapsedTime; String m_name;
diff --git a/third_party/WebKit/Source/modules/storage/DOMWindowStorage.cpp b/third_party/WebKit/Source/modules/storage/DOMWindowStorage.cpp index 878a11e..8de3df5 100644 --- a/third_party/WebKit/Source/modules/storage/DOMWindowStorage.cpp +++ b/third_party/WebKit/Source/modules/storage/DOMWindowStorage.cpp
@@ -23,14 +23,12 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowStorage); - DEFINE_TRACE(DOMWindowStorage) { visitor->trace(m_window); visitor->trace(m_sessionStorage); visitor->trace(m_localStorage); - WillBeHeapSupplement<LocalDOMWindow>::trace(visitor); + HeapSupplement<LocalDOMWindow>::trace(visitor); DOMWindowProperty::trace(visitor); } @@ -43,7 +41,7 @@ // static DOMWindowStorage& DOMWindowStorage::from(LocalDOMWindow& window) { - DOMWindowStorage* supplement = static_cast<DOMWindowStorage*>(WillBeHeapSupplement<LocalDOMWindow>::from(window, supplementName())); + DOMWindowStorage* supplement = static_cast<DOMWindowStorage*>(HeapSupplement<LocalDOMWindow>::from(window, supplementName())); if (!supplement) { supplement = new DOMWindowStorage(window); provideTo(window, supplementName(), adoptPtrWillBeNoop(supplement));
diff --git a/third_party/WebKit/Source/modules/storage/DOMWindowStorage.h b/third_party/WebKit/Source/modules/storage/DOMWindowStorage.h index 92e1cfab..b44d145de8 100644 --- a/third_party/WebKit/Source/modules/storage/DOMWindowStorage.h +++ b/third_party/WebKit/Source/modules/storage/DOMWindowStorage.h
@@ -15,10 +15,8 @@ class ExceptionState; class Storage; -class DOMWindowStorage final : public NoBaseWillBeGarbageCollected<DOMWindowStorage>, public WillBeHeapSupplement<LocalDOMWindow>, public DOMWindowProperty { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMWindowStorage); - DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowStorage); - USING_FAST_MALLOC_WILL_BE_REMOVED(DOMWindowStorage); +class DOMWindowStorage final : public GarbageCollected<DOMWindowStorage>, public HeapSupplement<LocalDOMWindow>, public DOMWindowProperty { + USING_GARBAGE_COLLECTED_MIXIN(DOMWindowStorage); public: static DOMWindowStorage& from(LocalDOMWindow&); static Storage* sessionStorage(DOMWindow&, ExceptionState&); @@ -35,9 +33,9 @@ explicit DOMWindowStorage(LocalDOMWindow&); static const char* supplementName(); - RawPtrWillBeMember<LocalDOMWindow> m_window; - mutable PersistentWillBeMember<Storage> m_sessionStorage; - mutable PersistentWillBeMember<Storage> m_localStorage; + Member<LocalDOMWindow> m_window; + mutable Member<Storage> m_sessionStorage; + mutable Member<Storage> m_localStorage; };
diff --git a/third_party/WebKit/Source/modules/storage/DOMWindowStorageController.cpp b/third_party/WebKit/Source/modules/storage/DOMWindowStorageController.cpp index 61c22ede..0da05ee 100644 --- a/third_party/WebKit/Source/modules/storage/DOMWindowStorageController.cpp +++ b/third_party/WebKit/Source/modules/storage/DOMWindowStorageController.cpp
@@ -18,12 +18,10 @@ { } -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowStorageController); - DEFINE_TRACE(DOMWindowStorageController) { visitor->trace(m_document); - WillBeHeapSupplement<Document>::trace(visitor); + HeapSupplement<Document>::trace(visitor); DOMWindowLifecycleObserver::trace(visitor); } @@ -36,10 +34,10 @@ // static DOMWindowStorageController& DOMWindowStorageController::from(Document& document) { - DOMWindowStorageController* controller = static_cast<DOMWindowStorageController*>(WillBeHeapSupplement<Document>::from(document, supplementName())); + DOMWindowStorageController* controller = static_cast<DOMWindowStorageController*>(HeapSupplement<Document>::from(document, supplementName())); if (!controller) { controller = new DOMWindowStorageController(document); - WillBeHeapSupplement<Document>::provideTo(document, supplementName(), adoptPtrWillBeNoop(controller)); + HeapSupplement<Document>::provideTo(document, supplementName(), adoptPtrWillBeNoop(controller)); } return *controller; }
diff --git a/third_party/WebKit/Source/modules/storage/DOMWindowStorageController.h b/third_party/WebKit/Source/modules/storage/DOMWindowStorageController.h index 5dfadb3..50db24c 100644 --- a/third_party/WebKit/Source/modules/storage/DOMWindowStorageController.h +++ b/third_party/WebKit/Source/modules/storage/DOMWindowStorageController.h
@@ -16,10 +16,8 @@ class Document; class Event; -class MODULES_EXPORT DOMWindowStorageController final : public NoBaseWillBeGarbageCollected<DOMWindowStorageController>, public WillBeHeapSupplement<Document>, public DOMWindowLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMWindowStorageController); - DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowStorageController); - USING_FAST_MALLOC_WILL_BE_REMOVED(DOMWindowStorageController); +class MODULES_EXPORT DOMWindowStorageController final : public GarbageCollected<DOMWindowStorageController>, public HeapSupplement<Document>, public DOMWindowLifecycleObserver { + USING_GARBAGE_COLLECTED_MIXIN(DOMWindowStorageController); public: DECLARE_VIRTUAL_TRACE(); @@ -35,7 +33,7 @@ private: Document& document() const { return *m_document; } - RawPtrWillBeMember<Document> m_document; + Member<Document> m_document; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp b/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp index fb02193..0ad8ef79 100644 --- a/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp +++ b/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp
@@ -199,7 +199,7 @@ if (!m_page->mainFrame()->isLocalFrame()) return nullptr; - OwnPtrWillBeRawPtr<InspectedFrames> inspectedFrames = InspectedFrames::create(m_page->deprecatedLocalMainFrame()); + RawPtr<InspectedFrames> inspectedFrames = InspectedFrames::create(m_page->deprecatedLocalMainFrame()); LocalFrame* frame = inspectedFrames->frameWithSecurityOrigin(securityOrigin); if (!frame) { if (errorString)
diff --git a/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.h b/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.h index 28a2c5a1..f16c95c 100644 --- a/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.h +++ b/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.h
@@ -49,9 +49,9 @@ class MODULES_EXPORT InspectorDOMStorageAgent final : public InspectorBaseAgent<InspectorDOMStorageAgent, protocol::Frontend::DOMStorage>, public protocol::Backend::DOMStorage { public: - static PassOwnPtrWillBeRawPtr<InspectorDOMStorageAgent> create(Page* page) + static RawPtr<InspectorDOMStorageAgent> create(Page* page) { - return adoptPtrWillBeNoop(new InspectorDOMStorageAgent(page)); + return new InspectorDOMStorageAgent(page); } ~InspectorDOMStorageAgent() override; @@ -75,7 +75,7 @@ StorageArea* findStorageArea(ErrorString*, PassOwnPtr<protocol::DOMStorage::StorageId>, LocalFrame*&); PassOwnPtr<protocol::DOMStorage::StorageId> storageId(SecurityOrigin*, bool isLocalStorage); - RawPtrWillBeMember<Page> m_page; + Member<Page> m_page; bool m_isEnabled; };
diff --git a/third_party/WebKit/Source/modules/storage/Storage.h b/third_party/WebKit/Source/modules/storage/Storage.h index dc6d4412..5911fc6d 100644 --- a/third_party/WebKit/Source/modules/storage/Storage.h +++ b/third_party/WebKit/Source/modules/storage/Storage.h
@@ -41,7 +41,7 @@ class Storage final : public GarbageCollectedFinalized<Storage>, public ScriptWrappable, public DOMWindowProperty { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Storage); + USING_GARBAGE_COLLECTED_MIXIN(Storage); public: static Storage* create(LocalFrame*, StorageArea*); virtual ~Storage();
diff --git a/third_party/WebKit/Source/modules/storage/StorageArea.h b/third_party/WebKit/Source/modules/storage/StorageArea.h index 1334840..406012a8 100644 --- a/third_party/WebKit/Source/modules/storage/StorageArea.h +++ b/third_party/WebKit/Source/modules/storage/StorageArea.h
@@ -49,7 +49,7 @@ }; class MODULES_EXPORT StorageArea final : public GarbageCollectedFinalized<StorageArea>, public LocalFrameLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StorageArea); + USING_GARBAGE_COLLECTED_MIXIN(StorageArea); public: static StorageArea* create(PassOwnPtr<WebStorageArea>, StorageType);
diff --git a/third_party/WebKit/Source/modules/storage/StorageEvent.cpp b/third_party/WebKit/Source/modules/storage/StorageEvent.cpp index f94f0c1..59ff58e 100644 --- a/third_party/WebKit/Source/modules/storage/StorageEvent.cpp +++ b/third_party/WebKit/Source/modules/storage/StorageEvent.cpp
@@ -31,7 +31,7 @@ namespace blink { -PassRefPtrWillBeRawPtr<StorageEvent> StorageEvent::create() +RawPtr<StorageEvent> StorageEvent::create() { return adoptRefWillBeNoop(new StorageEvent); } @@ -44,14 +44,14 @@ { } -PassRefPtrWillBeRawPtr<StorageEvent> StorageEvent::create(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea) +RawPtr<StorageEvent> StorageEvent::create(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea) { - return adoptRefWillBeNoop(new StorageEvent(type, key, oldValue, newValue, url, storageArea)); + return new StorageEvent(type, key, oldValue, newValue, url, storageArea); } -PassRefPtrWillBeRawPtr<StorageEvent> StorageEvent::create(const AtomicString& type, const StorageEventInit& initializer) +RawPtr<StorageEvent> StorageEvent::create(const AtomicString& type, const StorageEventInit& initializer) { - return adoptRefWillBeNoop(new StorageEvent(type, initializer)); + return new StorageEvent(type, initializer); } StorageEvent::StorageEvent(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea)
diff --git a/third_party/WebKit/Source/modules/storage/StorageEvent.h b/third_party/WebKit/Source/modules/storage/StorageEvent.h index 8c91631..63e1352 100644 --- a/third_party/WebKit/Source/modules/storage/StorageEvent.h +++ b/third_party/WebKit/Source/modules/storage/StorageEvent.h
@@ -38,9 +38,9 @@ class StorageEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<StorageEvent> create(); - static PassRefPtrWillBeRawPtr<StorageEvent> create(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea); - static PassRefPtrWillBeRawPtr<StorageEvent> create(const AtomicString&, const StorageEventInit&); + static RawPtr<StorageEvent> create(); + static RawPtr<StorageEvent> create(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea); + static RawPtr<StorageEvent> create(const AtomicString&, const StorageEventInit&); ~StorageEvent() override; const String& key() const { return m_key; } @@ -67,7 +67,7 @@ String m_oldValue; String m_newValue; String m_url; - PersistentWillBeMember<Storage> m_storageArea; + Member<Storage> m_storageArea; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/storage/StorageNamespaceController.cpp b/third_party/WebKit/Source/modules/storage/StorageNamespaceController.cpp index 829faec..60f39a5 100644 --- a/third_party/WebKit/Source/modules/storage/StorageNamespaceController.cpp +++ b/third_party/WebKit/Source/modules/storage/StorageNamespaceController.cpp
@@ -27,7 +27,7 @@ DEFINE_TRACE(StorageNamespaceController) { - WillBeHeapSupplement<Page>::trace(visitor); + HeapSupplement<Page>::trace(visitor); visitor->trace(m_inspectorAgent); } @@ -40,7 +40,7 @@ void StorageNamespaceController::provideStorageNamespaceTo(Page& page, StorageClient* client) { - StorageNamespaceController::provideTo(page, supplementName(), adoptPtrWillBeNoop(new StorageNamespaceController(client))); + StorageNamespaceController::provideTo(page, supplementName(), new StorageNamespaceController(client)); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/storage/StorageNamespaceController.h b/third_party/WebKit/Source/modules/storage/StorageNamespaceController.h index 93dd6cb..6c5435d7 100644 --- a/third_party/WebKit/Source/modules/storage/StorageNamespaceController.h +++ b/third_party/WebKit/Source/modules/storage/StorageNamespaceController.h
@@ -16,16 +16,15 @@ class StorageClient; class StorageNamespace; -class MODULES_EXPORT StorageNamespaceController final : public NoBaseWillBeGarbageCollectedFinalized<StorageNamespaceController>, public WillBeHeapSupplement<Page> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StorageNamespaceController); - USING_FAST_MALLOC_WILL_BE_REMOVED(StorageNamespaceController); +class MODULES_EXPORT StorageNamespaceController final : public GarbageCollectedFinalized<StorageNamespaceController>, public HeapSupplement<Page> { + USING_GARBAGE_COLLECTED_MIXIN(StorageNamespaceController); public: StorageNamespace* sessionStorage(bool optionalCreate = true); StorageClient* getStorageClient() { return m_client; } ~StorageNamespaceController(); static void provideStorageNamespaceTo(Page&, StorageClient*); - static StorageNamespaceController* from(Page* page) { return static_cast<StorageNamespaceController*>(WillBeHeapSupplement<Page>::from(page, supplementName())); } + static StorageNamespaceController* from(Page* page) { return static_cast<StorageNamespaceController*>(HeapSupplement<Page>::from(page, supplementName())); } DECLARE_TRACE(); @@ -36,7 +35,7 @@ static const char* supplementName(); OwnPtr<StorageNamespace> m_sessionStorage; StorageClient* m_client; - RawPtrWillBeMember<InspectorDOMStorageAgent> m_inspectorAgent; + Member<InspectorDOMStorageAgent> m_inspectorAgent; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp b/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp index 357b4ed1..8d402ca 100644 --- a/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp +++ b/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp
@@ -184,10 +184,10 @@ NavigatorVibration& NavigatorVibration::from(Page& page) { - NavigatorVibration* navigatorVibration = static_cast<NavigatorVibration*>(WillBeHeapSupplement<Page>::from(page, supplementName())); + NavigatorVibration* navigatorVibration = static_cast<NavigatorVibration*>(HeapSupplement<Page>::from(page, supplementName())); if (!navigatorVibration) { navigatorVibration = new NavigatorVibration(page); - WillBeHeapSupplement<Page>::provideTo(page, supplementName(), adoptPtrWillBeNoop(navigatorVibration)); + HeapSupplement<Page>::provideTo(page, supplementName(), adoptPtrWillBeNoop(navigatorVibration)); } return *navigatorVibration; } @@ -199,7 +199,7 @@ DEFINE_TRACE(NavigatorVibration) { - WillBeHeapSupplement<Page>::trace(visitor); + HeapSupplement<Page>::trace(visitor); PageLifecycleObserver::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/vibration/NavigatorVibration.h b/third_party/WebKit/Source/modules/vibration/NavigatorVibration.h index cf1dbfa..2a7b555f 100644 --- a/third_party/WebKit/Source/modules/vibration/NavigatorVibration.h +++ b/third_party/WebKit/Source/modules/vibration/NavigatorVibration.h
@@ -34,11 +34,10 @@ class UnsignedLongOrUnsignedLongSequence; class MODULES_EXPORT NavigatorVibration final - : public NoBaseWillBeGarbageCollectedFinalized<NavigatorVibration> - , public WillBeHeapSupplement<Page> + : public GarbageCollectedFinalized<NavigatorVibration> + , public HeapSupplement<Page> , public PageLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorVibration); - USING_FAST_MALLOC_WILL_BE_REMOVED(NavigatorVibration); + USING_GARBAGE_COLLECTED_MIXIN(NavigatorVibration); public: typedef Vector<unsigned> VibrationPattern;
diff --git a/third_party/WebKit/Source/modules/vr/VRController.cpp b/third_party/WebKit/Source/modules/vr/VRController.cpp index 543ee140..d0d8bb80 100644 --- a/third_party/WebKit/Source/modules/vr/VRController.cpp +++ b/third_party/WebKit/Source/modules/vr/VRController.cpp
@@ -18,12 +18,12 @@ ASSERT(RuntimeEnabledFeatures::webVREnabled()); VRController* controller = new VRController(frame, client); - WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPtrWillBeNoop(controller)); + HeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPtrWillBeNoop(controller)); } VRController* VRController::from(LocalFrame& frame) { - return static_cast<VRController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); + return static_cast<VRController*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); } VRController::VRController(LocalFrame& frame, WebVRClient* client) @@ -73,7 +73,7 @@ DEFINE_TRACE(VRController) { - WillBeHeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); LocalFrameLifecycleObserver::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/vr/VRController.h b/third_party/WebKit/Source/modules/vr/VRController.h index fed11d5e..9bad95c 100644 --- a/third_party/WebKit/Source/modules/vr/VRController.h +++ b/third_party/WebKit/Source/modules/vr/VRController.h
@@ -14,10 +14,10 @@ namespace blink { class MODULES_EXPORT VRController final - : public NoBaseWillBeGarbageCollectedFinalized<VRController> - , public WillBeHeapSupplement<LocalFrame> + : public GarbageCollectedFinalized<VRController> + , public HeapSupplement<LocalFrame> , public LocalFrameLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(VRController); + USING_GARBAGE_COLLECTED_MIXIN(VRController); WTF_MAKE_NONCOPYABLE(VRController); public: virtual ~VRController();
diff --git a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.cpp b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.cpp index c3fe625ed..8c46f66 100644 --- a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.cpp +++ b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.cpp
@@ -47,17 +47,17 @@ // static ScreenWakeLock* ScreenWakeLock::from(LocalFrame* frame) { - return static_cast<ScreenWakeLock*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); + return static_cast<ScreenWakeLock*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); } // static void ScreenWakeLock::provideTo(LocalFrame& frame, WebWakeLockClient* client) { ASSERT(RuntimeEnabledFeatures::wakeLockEnabled()); - WillBeHeapSupplement<LocalFrame>::provideTo( + HeapSupplement<LocalFrame>::provideTo( frame, ScreenWakeLock::supplementName(), - adoptPtrWillBeNoop(new ScreenWakeLock(frame, client))); + new ScreenWakeLock(frame, client)); } void ScreenWakeLock::pageVisibilityChanged() @@ -80,7 +80,7 @@ DEFINE_TRACE(ScreenWakeLock) { - WillBeHeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); PageLifecycleObserver::trace(visitor); LocalFrameLifecycleObserver::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h index 72c597d..0a98be0 100644 --- a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h +++ b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h
@@ -16,8 +16,8 @@ class Screen; class WebWakeLockClient; -class MODULES_EXPORT ScreenWakeLock final : public NoBaseWillBeGarbageCollected<ScreenWakeLock>, public WillBeHeapSupplement<LocalFrame>, public PageLifecycleObserver, public LocalFrameLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenWakeLock); +class MODULES_EXPORT ScreenWakeLock final : public GarbageCollected<ScreenWakeLock>, public HeapSupplement<LocalFrame>, public PageLifecycleObserver, public LocalFrameLifecycleObserver { + USING_GARBAGE_COLLECTED_MIXIN(ScreenWakeLock); WTF_MAKE_NONCOPYABLE(ScreenWakeLock); public: static bool keepAwake(Screen&);
diff --git a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h index 407c2a92..26f5388 100644 --- a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h +++ b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
@@ -83,7 +83,7 @@ class MODULES_EXPORT AbstractAudioContext : public RefCountedGarbageCollectedEventTargetWithInlineData<AbstractAudioContext>, public ActiveScriptWrappable, public ActiveDOMObject { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(AbstractAudioContext); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AbstractAudioContext); + USING_GARBAGE_COLLECTED_MIXIN(AbstractAudioContext); DEFINE_WRAPPERTYPEINFO(); public: // The state of an audio context. On creation, the state is Suspended. The state is Running if
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp index e666a35..3240f4b 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp
@@ -511,7 +511,7 @@ // This should only be called for ScriptProcessorNodes which are the only nodes where you can // have an output with 0 channels. All other nodes have have at least one output channel, so // there's no reason other nodes should ever call this function. - DCHECK(1) << "numberOfOutputChannels() not valid for node type " << getNodeType(); + DCHECK(0) << "numberOfOutputChannels() not valid for node type " << getNodeType(); return 1; } // ----------------------------------------------------------------
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.cpp b/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.cpp index 0d1c788..0ce631c0 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.cpp
@@ -26,14 +26,14 @@ namespace blink { -PassRefPtrWillBeRawPtr<AudioProcessingEvent> AudioProcessingEvent::create() +RawPtr<AudioProcessingEvent> AudioProcessingEvent::create() { return adoptRefWillBeNoop(new AudioProcessingEvent); } -PassRefPtrWillBeRawPtr<AudioProcessingEvent> AudioProcessingEvent::create(AudioBuffer* inputBuffer, AudioBuffer* outputBuffer, double playbackTime) +RawPtr<AudioProcessingEvent> AudioProcessingEvent::create(AudioBuffer* inputBuffer, AudioBuffer* outputBuffer, double playbackTime) { - return adoptRefWillBeNoop(new AudioProcessingEvent(inputBuffer, outputBuffer, playbackTime)); + return new AudioProcessingEvent(inputBuffer, outputBuffer, playbackTime); } AudioProcessingEvent::AudioProcessingEvent()
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.h b/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.h index e3c35b3..f782ba40 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.h
@@ -37,8 +37,8 @@ class AudioProcessingEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<AudioProcessingEvent> create(); - static PassRefPtrWillBeRawPtr<AudioProcessingEvent> create(AudioBuffer* inputBuffer, AudioBuffer* outputBuffer, double playbackTime); + static RawPtr<AudioProcessingEvent> create(); + static RawPtr<AudioProcessingEvent> create(AudioBuffer* inputBuffer, AudioBuffer* outputBuffer, double playbackTime); ~AudioProcessingEvent() override; @@ -54,8 +54,8 @@ AudioProcessingEvent(); AudioProcessingEvent(AudioBuffer* inputBuffer, AudioBuffer* outputBuffer, double playbackTime); - PersistentWillBeMember<AudioBuffer> m_inputBuffer; - PersistentWillBeMember<AudioBuffer> m_outputBuffer; + Member<AudioBuffer> m_inputBuffer; + Member<AudioBuffer> m_outputBuffer; double m_playbackTime; };
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp index f1280ef..0291b36 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp
@@ -259,7 +259,7 @@ return getAttributeEventListener(EventTypeNames::ended); } -void AudioScheduledSourceNode::setOnended(PassRefPtrWillBeRawPtr<EventListener> listener) +void AudioScheduledSourceNode::setOnended(RawPtr<EventListener> listener) { setAttributeEventListener(EventTypeNames::ended, listener); }
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h index 4be86da9..89b60e69 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h
@@ -129,7 +129,7 @@ void stop(double when, ExceptionState&); EventListener* onended(); - void setOnended(PassRefPtrWillBeRawPtr<EventListener>); + void setOnended(RawPtr<EventListener>); // ActiveScriptWrappable bool hasPendingActivity() const final;
diff --git a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h index c8a460e..63e8a8d 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h +++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h
@@ -72,7 +72,7 @@ // This Persistent doesn't make a reference cycle. The reference from // HTMLMediaElement to AudioSourceProvideClient, which // MediaElementAudioSourceNode implements, is weak. - RefPtrWillBePersistent<HTMLMediaElement> m_mediaElement; + Persistent<HTMLMediaElement> m_mediaElement; Mutex m_processLock; unsigned m_sourceNumberOfChannels;
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.cpp index 1dcea79..fdb2d444 100644 --- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.cpp +++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.cpp
@@ -26,14 +26,14 @@ namespace blink { -PassRefPtrWillBeRawPtr<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create() +RawPtr<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create() { return adoptRefWillBeNoop(new OfflineAudioCompletionEvent); } -PassRefPtrWillBeRawPtr<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create(AudioBuffer* renderedBuffer) +RawPtr<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create(AudioBuffer* renderedBuffer) { - return adoptRefWillBeNoop(new OfflineAudioCompletionEvent(renderedBuffer)); + return new OfflineAudioCompletionEvent(renderedBuffer); } OfflineAudioCompletionEvent::OfflineAudioCompletionEvent()
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.h b/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.h index f1c9864..50fcaf4 100644 --- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.h +++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.h
@@ -37,8 +37,8 @@ class OfflineAudioCompletionEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<OfflineAudioCompletionEvent> create(); - static PassRefPtrWillBeRawPtr<OfflineAudioCompletionEvent> create(AudioBuffer* renderedBuffer); + static RawPtr<OfflineAudioCompletionEvent> create(); + static RawPtr<OfflineAudioCompletionEvent> create(AudioBuffer* renderedBuffer); ~OfflineAudioCompletionEvent() override; @@ -52,7 +52,7 @@ OfflineAudioCompletionEvent(); explicit OfflineAudioCompletionEvent(AudioBuffer* renderedBuffer); - PersistentWillBeMember<AudioBuffer> m_renderedBuffer; + Member<AudioBuffer> m_renderedBuffer; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.cpp index 2aa395a..e43c849c 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.cpp
@@ -48,7 +48,7 @@ DatabaseClient* DatabaseClient::fromPage(Page* page) { - return static_cast<DatabaseClient*>(WillBeHeapSupplement<Page>::from(page, supplementName())); + return static_cast<DatabaseClient*>(HeapSupplement<Page>::from(page, supplementName())); } DatabaseClient* DatabaseClient::from(ExecutionContext* context) @@ -73,7 +73,7 @@ m_inspectorAgent = agent; } -void provideDatabaseClientTo(Page& page, PassOwnPtrWillBeRawPtr<DatabaseClient> client) +void provideDatabaseClientTo(Page& page, RawPtr<DatabaseClient> client) { page.provideSupplement(DatabaseClient::supplementName(), client); }
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.h b/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.h index 248dc9d..5a5d420 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.h +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseClient.h
@@ -44,7 +44,7 @@ class InspectorDatabaseAgent; class Page; -class MODULES_EXPORT DatabaseClient : public WillBeHeapSupplement<Page> { +class MODULES_EXPORT DatabaseClient : public HeapSupplement<Page> { WTF_MAKE_NONCOPYABLE(DatabaseClient); public: DatabaseClient(); @@ -63,10 +63,10 @@ void setInspectorAgent(InspectorDatabaseAgent*); private: - RawPtrWillBeMember<InspectorDatabaseAgent> m_inspectorAgent; + Member<InspectorDatabaseAgent> m_inspectorAgent; }; -MODULES_EXPORT void provideDatabaseClientTo(Page&, PassOwnPtrWillBeRawPtr<DatabaseClient>); +MODULES_EXPORT void provideDatabaseClientTo(Page&, RawPtr<DatabaseClient>); } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h b/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h index c71a676..cb838ec 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h
@@ -41,7 +41,7 @@ class DatabaseContext final : public GarbageCollectedFinalized<DatabaseContext> , public ActiveDOMObject { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DatabaseContext); + USING_GARBAGE_COLLECTED_MIXIN(DatabaseContext); public: friend class DatabaseManager;
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.h b/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.h index 4d3d8e1..147113b 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.h +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.h
@@ -87,7 +87,7 @@ // m_contextMap can have two or more entries even though we don't support // Web SQL on workers because single Blink process can have multiple main // contexts. - typedef PersistentHeapHashMap<RawPtrWillBeMember<ExecutionContext>, Member<DatabaseContext>> ContextMap; + typedef PersistentHeapHashMap<Member<ExecutionContext>, Member<DatabaseContext>> ContextMap; ContextMap m_contextMap; #if ENABLE(ASSERT) int m_databaseContextRegisteredCount;
diff --git a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.h b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.h index 20bb6d2..a84daa8 100644 --- a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.h +++ b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.h
@@ -48,9 +48,9 @@ class MODULES_EXPORT InspectorDatabaseAgent final : public InspectorBaseAgent<InspectorDatabaseAgent, protocol::Frontend::Database>, public protocol::Backend::Database { WTF_MAKE_NONCOPYABLE(InspectorDatabaseAgent); public: - static PassOwnPtrWillBeRawPtr<InspectorDatabaseAgent> create(Page* page) + static RawPtr<InspectorDatabaseAgent> create(Page* page) { - return adoptPtrWillBeNoop(new InspectorDatabaseAgent(page)); + return new InspectorDatabaseAgent(page); } ~InspectorDatabaseAgent() override; DECLARE_VIRTUAL_TRACE(); @@ -71,8 +71,8 @@ blink::Database* databaseForId(const String& databaseId); InspectorDatabaseResource* findByFileName(const String& fileName); - RawPtrWillBeMember<Page> m_page; - typedef PersistentHeapHashMapWillBeHeapHashMap<String, Member<InspectorDatabaseResource>> DatabaseResourcesHeapMap; + Member<Page> m_page; + typedef HeapHashMap<String, Member<InspectorDatabaseResource>> DatabaseResourcesHeapMap; DatabaseResourcesHeapMap m_resources; bool m_enabled; };
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp index c80ee7b..813b2a2 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp
@@ -31,7 +31,7 @@ namespace blink { -PassOwnPtrWillBeRawPtr<CanvasRenderingContext> WebGL2RenderingContext::Factory::create(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document&) +RawPtr<CanvasRenderingContext> WebGL2RenderingContext::Factory::create(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document&) { if (!RuntimeEnabledFeatures::unsafeES3APIsEnabled()) { canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Creation of WebGL2 contexts disabled.")); @@ -51,7 +51,7 @@ gl->PushGroupMarkerEXT(0, contextLabel.ascii().data()); } - OwnPtrWillBeRawPtr<WebGL2RenderingContext> renderingContext = adoptPtrWillBeNoop(new WebGL2RenderingContext(canvas, contextProvider.release(), attributes)); + RawPtr<WebGL2RenderingContext> renderingContext = new WebGL2RenderingContext(canvas, contextProvider.release(), attributes); if (!renderingContext->drawingBuffer()) { canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Could not create a WebGL2 context.")); @@ -81,7 +81,7 @@ void WebGL2RenderingContext::setCanvasGetContextResult(RenderingContext& result) { - result.setWebGL2RenderingContext(PassRefPtrWillBeRawPtr<WebGL2RenderingContext>(this)); + result.setWebGL2RenderingContext(RawPtr<WebGL2RenderingContext>(this)); } void WebGL2RenderingContext::registerContextExtensions()
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.h b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.h index c470846..bd1397a 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.h +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.h
@@ -22,7 +22,7 @@ Factory() {} ~Factory() override {} - PassOwnPtrWillBeRawPtr<CanvasRenderingContext> create(HTMLCanvasElement*, const CanvasContextCreationAttributes&, Document&) override; + RawPtr<CanvasRenderingContext> create(HTMLCanvasElement*, const CanvasContextCreationAttributes&, Document&) override; CanvasRenderingContext::ContextType getContextType() const override { return CanvasRenderingContext::ContextWebgl2; } void onError(HTMLCanvasElement*, const String& error) override; }; @@ -40,19 +40,19 @@ protected: WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, PassOwnPtr<WebGraphicsContext3DProvider>, const WebGLContextAttributes& requestedAttributes); - PersistentWillBeMember<CHROMIUMSubscribeUniform> m_chromiumSubscribeUniform; - PersistentWillBeMember<EXTColorBufferFloat> m_extColorBufferFloat; - PersistentWillBeMember<EXTDisjointTimerQuery> m_extDisjointTimerQuery; - PersistentWillBeMember<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; - PersistentWillBeMember<OESTextureFloatLinear> m_oesTextureFloatLinear; - PersistentWillBeMember<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC; - PersistentWillBeMember<WebGLCompressedTextureATC> m_webglCompressedTextureATC; - PersistentWillBeMember<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1; - PersistentWillBeMember<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC; - PersistentWillBeMember<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC; - PersistentWillBeMember<WebGLDebugRendererInfo> m_webglDebugRendererInfo; - PersistentWillBeMember<WebGLDebugShaders> m_webglDebugShaders; - PersistentWillBeMember<WebGLLoseContext> m_webglLoseContext; + Member<CHROMIUMSubscribeUniform> m_chromiumSubscribeUniform; + Member<EXTColorBufferFloat> m_extColorBufferFloat; + Member<EXTDisjointTimerQuery> m_extDisjointTimerQuery; + Member<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; + Member<OESTextureFloatLinear> m_oesTextureFloatLinear; + Member<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC; + Member<WebGLCompressedTextureATC> m_webglCompressedTextureATC; + Member<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1; + Member<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC; + Member<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC; + Member<WebGLDebugRendererInfo> m_webglDebugRendererInfo; + Member<WebGLDebugShaders> m_webglDebugShaders; + Member<WebGLLoseContext> m_webglLoseContext; }; DEFINE_TYPE_CASTS(WebGL2RenderingContext, CanvasRenderingContext, context,
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.idl b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.idl index a3387bfb..e0b903e 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.idl +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.idl
@@ -6,7 +6,7 @@ RuntimeEnabled=UnsafeES3APIs, DoNotCheckConstants, SetWrapperReferenceFrom=canvas, - WillBeGarbageCollected, + GarbageCollected, ] interface WebGL2RenderingContext { }; WebGL2RenderingContext implements WebGLRenderingContextBase; WebGL2RenderingContext implements WebGL2RenderingContextBase;
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp index af6f9ff..c1718301 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -906,7 +906,7 @@ WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, type, video, exceptionState); } -void WebGL2RenderingContextBase::texImage2D(GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap> imageBitMap, ExceptionState& exceptionState) +void WebGL2RenderingContextBase::texImage2D(GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, RawPtr<ImageBitmap> imageBitMap, ExceptionState& exceptionState) { WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, type, imageBitMap, exceptionState); } @@ -942,7 +942,7 @@ } void WebGL2RenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap> bitmap, ExceptionState& exceptionState) + GLenum format, GLenum type, RawPtr<ImageBitmap> bitmap, ExceptionState& exceptionState) { WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, format, type, bitmap, exceptionState); } @@ -1169,7 +1169,7 @@ texSubImage3DImpl(target, level, xoffset, yoffset, zoffset, format, type, image.get(), WebGLImageConversion::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha); } -void WebGL2RenderingContextBase::texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap> bitmap, ExceptionState& exceptionState) +void WebGL2RenderingContextBase::texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, RawPtr<ImageBitmap> bitmap, ExceptionState& exceptionState) { if (isContextLost()) return;
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h index 7b9630f..3cafe96 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
@@ -23,7 +23,7 @@ class WebGLVertexArrayObject; class WebGL2RenderingContextBase : public WebGLRenderingContextBase { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WebGL2RenderingContextBase); + USING_GARBAGE_COLLECTED_MIXIN(WebGL2RenderingContextBase); public: ~WebGL2RenderingContextBase() override; @@ -60,7 +60,7 @@ void texImage2D(GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, HTMLVideoElement*, ExceptionState&); void texImage2D(GLenum target, GLint level, GLint internalformat, - GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap>, ExceptionState&); + GLenum format, GLenum type, RawPtr<ImageBitmap>, ExceptionState&); void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, DOMArrayBufferView*); @@ -73,7 +73,7 @@ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLVideoElement*, ExceptionState&); void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap>, ExceptionState&); + GLenum format, GLenum type, RawPtr<ImageBitmap>, ExceptionState&); void texStorage2D(GLenum, GLsizei, GLenum, GLsizei, GLsizei); void texStorage3D(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei); @@ -85,7 +85,7 @@ void texSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLenum, GLenum, HTMLImageElement*, ExceptionState&); void texSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLenum, GLenum, HTMLCanvasElement*, ExceptionState&); void texSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLenum, GLenum, HTMLVideoElement*, ExceptionState&); - void texSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLenum, GLenum, PassRefPtrWillBeRawPtr<ImageBitmap>, ExceptionState&); + void texSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLenum, GLenum, RawPtr<ImageBitmap>, ExceptionState&); void copyTexSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); void compressedTexImage3D(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, DOMArrayBufferView*); void compressedTexSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, DOMArrayBufferView*); @@ -282,27 +282,27 @@ void setTransformFeedbackActive(bool); void setTransformFeedbackPaused(bool); - PersistentWillBeMember<WebGLFramebuffer> m_readFramebufferBinding; - PersistentWillBeMember<WebGLTransformFeedback> m_transformFeedbackBinding; + Member<WebGLFramebuffer> m_readFramebufferBinding; + Member<WebGLTransformFeedback> m_transformFeedbackBinding; std::set<GLenum> m_supportedInternalFormatsStorage; std::set<GLenum> m_compressedTextureFormatsETC2EAC; - PersistentWillBeMember<WebGLBuffer> m_boundCopyReadBuffer; - PersistentWillBeMember<WebGLBuffer> m_boundCopyWriteBuffer; - PersistentWillBeMember<WebGLBuffer> m_boundPixelPackBuffer; - PersistentWillBeMember<WebGLBuffer> m_boundPixelUnpackBuffer; - PersistentWillBeMember<WebGLBuffer> m_boundTransformFeedbackBuffer; - PersistentWillBeMember<WebGLBuffer> m_boundUniformBuffer; + Member<WebGLBuffer> m_boundCopyReadBuffer; + Member<WebGLBuffer> m_boundCopyWriteBuffer; + Member<WebGLBuffer> m_boundPixelPackBuffer; + Member<WebGLBuffer> m_boundPixelUnpackBuffer; + Member<WebGLBuffer> m_boundTransformFeedbackBuffer; + Member<WebGLBuffer> m_boundUniformBuffer; - PersistentHeapVectorWillBeHeapVector<Member<WebGLBuffer>> m_boundIndexedTransformFeedbackBuffers; - PersistentHeapVectorWillBeHeapVector<Member<WebGLBuffer>> m_boundIndexedUniformBuffers; + HeapVector<Member<WebGLBuffer>> m_boundIndexedTransformFeedbackBuffers; + HeapVector<Member<WebGLBuffer>> m_boundIndexedUniformBuffers; GLint m_maxTransformFeedbackSeparateAttribs; size_t m_maxBoundUniformBufferIndex; - PersistentWillBeMember<WebGLQuery> m_currentBooleanOcclusionQuery; - PersistentWillBeMember<WebGLQuery> m_currentTransformFeedbackPrimitivesWrittenQuery; - PersistentHeapVectorWillBeHeapVector<Member<WebGLSampler>> m_samplerUnits; + Member<WebGLQuery> m_currentBooleanOcclusionQuery; + Member<WebGLQuery> m_currentTransformFeedbackPrimitivesWrittenQuery; + HeapVector<Member<WebGLSampler>> m_samplerUnits; GLint m_packRowLength; GLint m_packSkipPixels;
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl index d7a3d8d..70277c7 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl
@@ -21,7 +21,7 @@ [ RuntimeEnabled=UnsafeES3APIs, NoInterfaceObject, - WillBeGarbageCollected, + GarbageCollected, ] interface WebGL2RenderingContextBase { const GLenum READ_BUFFER = 0x0C02; const GLenum UNPACK_ROW_LENGTH = 0x0CF2;
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLContextAttributeHelpers.cpp b/third_party/WebKit/Source/modules/webgl/WebGLContextAttributeHelpers.cpp index 41aba4d9..af9f9e7 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLContextAttributeHelpers.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGLContextAttributeHelpers.cpp
@@ -21,24 +21,12 @@ return result; } -WebGraphicsContext3D::Attributes toWebGraphicsContext3DAttributes(const WebGLContextAttributes& attrs, const WebString& topDocumentURL, Settings* settings, unsigned webGLVersion) +Platform::ContextAttributes toPlatformContextAttributes(const WebGLContextAttributes& attrs, unsigned webGLVersion) { - WebGraphicsContext3D::Attributes result; - result.alpha = attrs.alpha(); - result.depth = attrs.depth(); - result.stencil = attrs.stencil(); - result.antialias = attrs.antialias(); - if (attrs.antialias()) { - if (settings && !settings->openGLMultisamplingEnabled()) - result.antialias = false; - } + Platform::ContextAttributes result; result.failIfMajorPerformanceCaveat = attrs.failIfMajorPerformanceCaveat(); - result.shareResources = false; result.preferDiscreteGPU = true; - - result.topDocumentURL = topDocumentURL; - result.webGLVersion = webGLVersion; return result; }
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLContextAttributeHelpers.h b/third_party/WebKit/Source/modules/webgl/WebGLContextAttributeHelpers.h index fe6760b..99aa0c2 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLContextAttributeHelpers.h +++ b/third_party/WebKit/Source/modules/webgl/WebGLContextAttributeHelpers.h
@@ -7,7 +7,7 @@ #include "core/html/canvas/CanvasContextCreationAttributes.h" #include "modules/webgl/WebGLContextAttributes.h" -#include "public/platform/WebGraphicsContext3D.h" +#include "public/platform/Platform.h" namespace blink { @@ -15,10 +15,9 @@ WebGLContextAttributes toWebGLContextAttributes(const CanvasContextCreationAttributes&); -// Set up the attributes that can be used to initialize a WebGraphicsContext3D. -// It's mostly based on WebGLContextAttributes, but may be adjusted based -// on settings. -WebGraphicsContext3D::Attributes toWebGraphicsContext3DAttributes(const WebGLContextAttributes&, const WebString&, Settings*, unsigned webGLVersion); +// Set up the attributes that can be used to create a GL context via the +// Platform API. +Platform::ContextAttributes toPlatformContextAttributes(const WebGLContextAttributes&, unsigned webGLVersion); } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLContextEvent.h b/third_party/WebKit/Source/modules/webgl/WebGLContextEvent.h index 92df191..4115b8b 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLContextEvent.h +++ b/third_party/WebKit/Source/modules/webgl/WebGLContextEvent.h
@@ -35,17 +35,17 @@ DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<WebGLContextEvent> create() + static RawPtr<WebGLContextEvent> create() { return adoptRefWillBeNoop(new WebGLContextEvent); } - static PassRefPtrWillBeRawPtr<WebGLContextEvent> create(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage) + static RawPtr<WebGLContextEvent> create(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage) { - return adoptRefWillBeNoop(new WebGLContextEvent(type, canBubble, cancelable, statusMessage)); + return new WebGLContextEvent(type, canBubble, cancelable, statusMessage); } - static PassRefPtrWillBeRawPtr<WebGLContextEvent> create(const AtomicString& type, const WebGLContextEventInit& initializer) + static RawPtr<WebGLContextEvent> create(const AtomicString& type, const WebGLContextEventInit& initializer) { - return adoptRefWillBeNoop(new WebGLContextEvent(type, initializer)); + return new WebGLContextEvent(type, initializer); } ~WebGLContextEvent() override;
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.h b/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.h index da78009..7867930 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.h +++ b/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.h
@@ -70,7 +70,7 @@ // registration with WebGLContextGroup, and vice versa, the // WebGLContextGroup takes care of detaching the group objects if // the set of WebGLRenderingContextBase contexts becomes empty. - HashSet<RawPtrWillBeUntracedMember<WebGLRenderingContextBase>> m_contexts; + HashSet<UntracedMember<WebGLRenderingContextBase>> m_contexts; HashSet<UntracedMember<WebGLSharedObject>> m_groupObjects; };
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLContextObject.h b/third_party/WebKit/Source/modules/webgl/WebGLContextObject.h index 12c8c1f..842323c 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLContextObject.h +++ b/third_party/WebKit/Source/modules/webgl/WebGLContextObject.h
@@ -64,7 +64,7 @@ gpu::gles2::GLES2Interface* getAGLInterface() const final; private: - RawPtrWillBeMember<WebGLRenderingContextBase> m_context; + Member<WebGLRenderingContextBase> m_context; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLExtension.h b/third_party/WebKit/Source/modules/webgl/WebGLExtension.h index 6715d0f..255b25f 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLExtension.h +++ b/third_party/WebKit/Source/modules/webgl/WebGLExtension.h
@@ -45,7 +45,7 @@ WebGLRenderingContextBase* context() const { return m_context.get(); } private: - RefPtrWillBeMember<WebGLRenderingContextBase> m_context; + Member<WebGLRenderingContextBase> m_context; }; class WebGLExtension : public GarbageCollectedFinalized<WebGLExtension>, public ScriptWrappable { @@ -79,7 +79,7 @@ private: friend WebGLExtensionScopedContext; - RawPtrWillBeWeakMember<WebGLRenderingContextBase> m_context; + WeakMember<WebGLRenderingContextBase> m_context; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp index 458669e..c73f8a6 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp
@@ -66,7 +66,7 @@ namespace blink { -PassOwnPtrWillBeRawPtr<CanvasRenderingContext> WebGLRenderingContext::Factory::create(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document&) +RawPtr<CanvasRenderingContext> WebGLRenderingContext::Factory::create(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document&) { WebGLContextAttributes attributes = toWebGLContextAttributes(attrs); OwnPtr<WebGraphicsContext3DProvider> contextProvider(createWebGraphicsContext3DProvider(canvas, attributes, 1)); @@ -81,7 +81,7 @@ gl->PushGroupMarkerEXT(0, contextLabel.ascii().data()); } - OwnPtrWillBeRawPtr<WebGLRenderingContext> renderingContext = adoptPtrWillBeNoop(new WebGLRenderingContext(canvas, contextProvider.release(), attributes)); + RawPtr<WebGLRenderingContext> renderingContext = new WebGLRenderingContext(canvas, contextProvider.release(), attributes); if (!renderingContext->drawingBuffer()) { canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Could not create a WebGL context.")); @@ -110,7 +110,7 @@ void WebGLRenderingContext::setCanvasGetContextResult(RenderingContext& result) { - result.setWebGLRenderingContext(PassRefPtrWillBeRawPtr<WebGLRenderingContext>(this)); + result.setWebGLRenderingContext(RawPtr<WebGLRenderingContext>(this)); } void WebGLRenderingContext::registerContextExtensions()
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.h index cd41c3b6..bd32faf6 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.h +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.h
@@ -42,7 +42,7 @@ Factory() {} ~Factory() override {} - PassOwnPtrWillBeRawPtr<CanvasRenderingContext> create(HTMLCanvasElement*, const CanvasContextCreationAttributes&, Document&) override; + RawPtr<CanvasRenderingContext> create(HTMLCanvasElement*, const CanvasContextCreationAttributes&, Document&) override; CanvasRenderingContext::ContextType getContextType() const override { return CanvasRenderingContext::ContextWebgl; } void onError(HTMLCanvasElement*, const String& error) override; }; @@ -62,31 +62,31 @@ WebGLRenderingContext(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext3DProvider>, const WebGLContextAttributes&); // Enabled extension objects. - PersistentWillBeMember<ANGLEInstancedArrays> m_angleInstancedArrays; - PersistentWillBeMember<CHROMIUMSubscribeUniform> m_chromiumSubscribeUniform; - PersistentWillBeMember<EXTBlendMinMax> m_extBlendMinMax; - PersistentWillBeMember<EXTDisjointTimerQuery> m_extDisjointTimerQuery; - PersistentWillBeMember<EXTFragDepth> m_extFragDepth; - PersistentWillBeMember<EXTShaderTextureLOD> m_extShaderTextureLOD; - PersistentWillBeMember<EXTsRGB> m_extsRGB; - PersistentWillBeMember<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; - PersistentWillBeMember<OESTextureFloat> m_oesTextureFloat; - PersistentWillBeMember<OESTextureFloatLinear> m_oesTextureFloatLinear; - PersistentWillBeMember<OESTextureHalfFloat> m_oesTextureHalfFloat; - PersistentWillBeMember<OESTextureHalfFloatLinear> m_oesTextureHalfFloatLinear; - PersistentWillBeMember<OESStandardDerivatives> m_oesStandardDerivatives; - PersistentWillBeMember<OESVertexArrayObject> m_oesVertexArrayObject; - PersistentWillBeMember<OESElementIndexUint> m_oesElementIndexUint; - PersistentWillBeMember<WebGLLoseContext> m_webglLoseContext; - PersistentWillBeMember<WebGLDebugRendererInfo> m_webglDebugRendererInfo; - PersistentWillBeMember<WebGLDebugShaders> m_webglDebugShaders; - PersistentWillBeMember<WebGLDrawBuffers> m_webglDrawBuffers; - PersistentWillBeMember<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC; - PersistentWillBeMember<WebGLCompressedTextureATC> m_webglCompressedTextureATC; - PersistentWillBeMember<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1; - PersistentWillBeMember<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC; - PersistentWillBeMember<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC; - PersistentWillBeMember<WebGLDepthTexture> m_webglDepthTexture; + Member<ANGLEInstancedArrays> m_angleInstancedArrays; + Member<CHROMIUMSubscribeUniform> m_chromiumSubscribeUniform; + Member<EXTBlendMinMax> m_extBlendMinMax; + Member<EXTDisjointTimerQuery> m_extDisjointTimerQuery; + Member<EXTFragDepth> m_extFragDepth; + Member<EXTShaderTextureLOD> m_extShaderTextureLOD; + Member<EXTsRGB> m_extsRGB; + Member<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; + Member<OESTextureFloat> m_oesTextureFloat; + Member<OESTextureFloatLinear> m_oesTextureFloatLinear; + Member<OESTextureHalfFloat> m_oesTextureHalfFloat; + Member<OESTextureHalfFloatLinear> m_oesTextureHalfFloatLinear; + Member<OESStandardDerivatives> m_oesStandardDerivatives; + Member<OESVertexArrayObject> m_oesVertexArrayObject; + Member<OESElementIndexUint> m_oesElementIndexUint; + Member<WebGLLoseContext> m_webglLoseContext; + Member<WebGLDebugRendererInfo> m_webglDebugRendererInfo; + Member<WebGLDebugShaders> m_webglDebugShaders; + Member<WebGLDrawBuffers> m_webglDrawBuffers; + Member<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC; + Member<WebGLCompressedTextureATC> m_webglCompressedTextureATC; + Member<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1; + Member<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC; + Member<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC; + Member<WebGLDepthTexture> m_webglDepthTexture; }; DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context,
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.idl b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.idl index 20922a2..fe2f8da9 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.idl +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.idl
@@ -28,6 +28,6 @@ [ DoNotCheckConstants, SetWrapperReferenceFrom=canvas, - WillBeGarbageCollected, + GarbageCollected, ] interface WebGLRenderingContext { }; WebGLRenderingContext implements WebGLRenderingContextBase;
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp index b52c29c8..896cafbe 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -111,14 +111,14 @@ const int maxGLErrorsAllowedToConsole = 256; const unsigned maxGLActiveContexts = 16; -using WebGLRenderingContextBaseSet = WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<WebGLRenderingContextBase>>; +using WebGLRenderingContextBaseSet = PersistentHeapHashSet<WeakMember<WebGLRenderingContextBase>>; WebGLRenderingContextBaseSet& activeContexts() { DEFINE_STATIC_LOCAL(WebGLRenderingContextBaseSet, activeContexts, ()); return activeContexts; } -using WebGLRenderingContextBaseMap = WillBePersistentHeapHashMap<RawPtrWillBeWeakMember<WebGLRenderingContextBase>, int>; +using WebGLRenderingContextBaseMap = PersistentHeapHashMap<WeakMember<WebGLRenderingContextBase>, int>; WebGLRenderingContextBaseMap& forciblyEvictedContexts() { DEFINE_STATIC_LOCAL(WebGLRenderingContextBaseMap, forciblyEvictedContexts, ()); @@ -137,7 +137,7 @@ // been lost. Garbage collection might be triggered in the middle of this function, for // example, printWarningToConsole() causes an upcall to JavaScript. // Must make sure that the context is not deleted until the call stack unwinds. - RefPtrWillBeRawPtr<WebGLRenderingContextBase> protect(candidate); + RawPtr<WebGLRenderingContextBase> protect(candidate); candidate->printWarningToConsole(reason); InspectorInstrumentation::didFireWebGLWarning(candidate->canvas()); @@ -473,7 +473,7 @@ } private: - RawPtrWillBeMember<WebGLRenderingContextBase> m_context; + Member<WebGLRenderingContextBase> m_context; }; class ScopedFramebufferRestorer { @@ -490,7 +490,7 @@ } private: - RawPtrWillBeMember<WebGLRenderingContextBase> m_context; + Member<WebGLRenderingContextBase> m_context; }; class WebGLRenderingContextErrorMessageCallback final : public GarbageCollectedFinalized<WebGLRenderingContextErrorMessageCallback>, public WebGraphicsContext3D::WebGraphicsErrorMessageCallback { @@ -518,7 +518,7 @@ explicit WebGLRenderingContextErrorMessageCallback(WebGLRenderingContextBase* context) : m_context(context) { } - RawPtrWillBeMember<WebGLRenderingContextBase> m_context; + Member<WebGLRenderingContextBase> m_context; }; static void formatWebGLStatusString(const String& glInfo, const String& infostring, String& statusMessage) @@ -562,9 +562,10 @@ return nullptr; } - WebGraphicsContext3D::Attributes wgc3dAttributes = toWebGraphicsContext3DAttributes(attributes, document.topDocument().url().getString(), settings, webGLVersion); + Platform::ContextAttributes contextAttributes = toPlatformContextAttributes(attributes, webGLVersion); Platform::GraphicsInfo glInfo; - OwnPtr<WebGraphicsContext3DProvider> contextProvider = adoptPtr(Platform::current()->createOffscreenGraphicsContext3DProvider(wgc3dAttributes, 0, &glInfo)); + OwnPtr<WebGraphicsContext3DProvider> contextProvider = adoptPtr(Platform::current()->createOffscreenGraphicsContext3DProvider( + contextAttributes, document.topDocument().url(), 0, &glInfo)); if (!contextProvider || shouldFailContextCreationForTesting) { shouldFailContextCreationForTesting = false; canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, extractWebGLContextCreationError(glInfo))); @@ -879,14 +880,21 @@ PassRefPtr<DrawingBuffer> WebGLRenderingContextBase::createDrawingBuffer(PassOwnPtr<WebGraphicsContext3DProvider> contextProvider) { - WebGraphicsContext3D::Attributes attrs; - attrs.alpha = m_requestedAttributes.alpha(); - attrs.depth = m_requestedAttributes.depth(); - attrs.stencil = m_requestedAttributes.stencil(); - attrs.antialias = m_requestedAttributes.antialias(); bool premultipliedAlpha = m_requestedAttributes.premultipliedAlpha(); + bool wantAlphaChannel = m_requestedAttributes.alpha(); + bool wantDepthBuffer = m_requestedAttributes.depth(); + bool wantStencilBuffer = m_requestedAttributes.stencil(); + bool wantAntialiasing = m_requestedAttributes.antialias(); DrawingBuffer::PreserveDrawingBuffer preserve = m_requestedAttributes.preserveDrawingBuffer() ? DrawingBuffer::Preserve : DrawingBuffer::Discard; - return DrawingBuffer::create(contextProvider, clampedCanvasSize(), premultipliedAlpha, preserve, attrs); + return DrawingBuffer::create( + contextProvider, + clampedCanvasSize(), + premultipliedAlpha, + wantAlphaChannel, + wantDepthBuffer, + wantStencilBuffer, + wantAntialiasing, + preserve); } void WebGLRenderingContextBase::initializeNewContext() @@ -1298,7 +1306,8 @@ // We don't have to mark the canvas as dirty, since the newly created image buffer will also start off // clear (and this matches what reshape will do). - drawingBuffer()->reset(IntSize(width, height)); + bool wantDepthOrStencilBuffer = m_requestedAttributes.depth() || m_requestedAttributes.stencil(); + drawingBuffer()->reset(IntSize(width, height), wantDepthOrStencilBuffer); restoreStateAfterClear(); contextGL()->BindTexture(GL_TEXTURE_2D, objectOrZero(m_textureUnits[m_activeTextureUnit].m_texture2DBinding.get())); @@ -2405,10 +2414,9 @@ result.set(m_requestedAttributes); // Some requested attributes may not be honored, so we need to query the underlying // context/drawing buffer and adjust accordingly. - WebGraphicsContext3D::Attributes attrs = drawingBuffer()->getActualAttributes(); - if (m_requestedAttributes.depth() && !attrs.depth) + if (m_requestedAttributes.depth() && !drawingBuffer()->hasDepthBuffer()) result.get().setDepth(false); - if (m_requestedAttributes.stencil() && !attrs.stencil) + if (m_requestedAttributes.stencil() && !drawingBuffer()->hasStencilBuffer()) result.get().setStencil(false); result.get().setAntialias(drawingBuffer()->multisample()); } @@ -4247,7 +4255,7 @@ } void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLint internalformat, - GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap> bitmap, ExceptionState& exceptionState) + GLenum format, GLenum type, RawPtr<ImageBitmap> bitmap, ExceptionState& exceptionState) { if (isContextLost()) return; @@ -4513,7 +4521,7 @@ } void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap> bitmap, ExceptionState& exceptionState) + GLenum format, GLenum type, RawPtr<ImageBitmap> bitmap, ExceptionState& exceptionState) { if (isContextLost()) return; @@ -5962,7 +5970,7 @@ void WebGLRenderingContextBase::dispatchContextLostEvent(Timer<WebGLRenderingContextBase>*) { - RefPtrWillBeRawPtr<WebGLContextEvent> event = WebGLContextEvent::create(EventTypeNames::webglcontextlost, false, true, ""); + RawPtr<WebGLContextEvent> event = WebGLContextEvent::create(EventTypeNames::webglcontextlost, false, true, ""); canvas()->dispatchEvent(event); m_restoreAllowed = event->defaultPrevented(); if (m_restoreAllowed && !m_isHidden) { @@ -5999,9 +6007,10 @@ m_drawingBuffer.clear(); } - WebGraphicsContext3D::Attributes attributes = toWebGraphicsContext3DAttributes(m_requestedAttributes, canvas()->document().topDocument().url().getString(), settings, version()); + Platform::ContextAttributes attributes = toPlatformContextAttributes(m_requestedAttributes, version()); Platform::GraphicsInfo glInfo; - OwnPtr<WebGraphicsContext3DProvider> contextProvider = adoptPtr(Platform::current()->createOffscreenGraphicsContext3DProvider(attributes, 0, &glInfo)); + OwnPtr<WebGraphicsContext3DProvider> contextProvider = adoptPtr(Platform::current()->createOffscreenGraphicsContext3DProvider( + attributes, canvas()->document().topDocument().url(), 0, &glInfo)); RefPtr<DrawingBuffer> buffer; if (contextProvider) { // Construct a new drawing buffer with the new WebGraphicsContext3D.
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h index e1c84d99c..a477c75 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -143,7 +143,7 @@ }; class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext, public Page::MultisamplingChangedObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WebGLRenderingContextBase); + USING_GARBAGE_COLLECTED_MIXIN(WebGLRenderingContextBase); public: ~WebGLRenderingContextBase() override; @@ -294,7 +294,7 @@ void texImage2D(GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, HTMLVideoElement*, ExceptionState&); void texImage2D(GLenum target, GLint level, GLint internalformat, - GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap>, ExceptionState&); + GLenum format, GLenum type, RawPtr<ImageBitmap>, ExceptionState&); void texParameterf(GLenum target, GLenum pname, GLfloat param); void texParameteri(GLenum target, GLenum pname, GLint param); @@ -311,7 +311,7 @@ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLVideoElement*, ExceptionState&); void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap>, ExceptionState&); + GLenum format, GLenum type, RawPtr<ImageBitmap>, ExceptionState&); void uniform1f(const WebGLUniformLocation*, GLfloat x); void uniform1fv(const WebGLUniformLocation*, const FlexibleFloat32ArrayView&); @@ -525,13 +525,13 @@ HashSet<UntracedMember<WebGLContextObject>> m_contextObjects; #endif - PersistentWillBeMember<WebGLRenderingContextErrorMessageCallback> m_errorMessageCallbackAdapter; + Member<WebGLRenderingContextErrorMessageCallback> m_errorMessageCallbackAdapter; // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER and stored values for ELEMENT_ARRAY_BUFFER - PersistentWillBeMember<WebGLBuffer> m_boundArrayBuffer; + Member<WebGLBuffer> m_boundArrayBuffer; - PersistentWillBeMember<WebGLVertexArrayObjectBase> m_defaultVertexArrayObject; - PersistentWillBeMember<WebGLVertexArrayObjectBase> m_boundVertexArrayObject; + Member<WebGLVertexArrayObjectBase> m_defaultVertexArrayObject; + Member<WebGLVertexArrayObjectBase> m_boundVertexArrayObject; bool m_preservedDefaultVAOObjectWrapper; void setBoundVertexArrayObject(ScriptState*, WebGLVertexArrayObjectBase*); @@ -545,12 +545,12 @@ unsigned m_maxVertexAttribs; void setVertexAttribType(GLuint index, VertexAttribValueType); - PersistentWillBeMember<WebGLProgram> m_currentProgram; - PersistentWillBeMember<WebGLFramebuffer> m_framebufferBinding; - PersistentWillBeMember<WebGLRenderbuffer> m_renderbufferBinding; - PersistentWillBeMember<CHROMIUMValuebuffer> m_valuebufferBinding; + Member<WebGLProgram> m_currentProgram; + Member<WebGLFramebuffer> m_framebufferBinding; + Member<WebGLRenderbuffer> m_renderbufferBinding; + Member<CHROMIUMValuebuffer> m_valuebufferBinding; - PersistentHeapVectorWillBeHeapVector<TextureUnitState> m_textureUnits; + HeapVector<TextureUnitState> m_textureUnits; unsigned long m_activeTextureUnit; Vector<GLenum> m_compressedTextureFormats; @@ -654,7 +654,7 @@ template <typename T> class TypedExtensionTracker final : public ExtensionTracker { public: - static TypedExtensionTracker<T>* create(PersistentWillBeMember<T>& extensionField, ExtensionFlags flags, const char* const* prefixes) + static TypedExtensionTracker<T>* create(Member<T>& extensionField, ExtensionFlags flags, const char* const* prefixes) { return new TypedExtensionTracker<T>(extensionField, flags, prefixes); } @@ -695,24 +695,24 @@ } private: - TypedExtensionTracker(PersistentWillBeMember<T>& extensionField, ExtensionFlags flags, const char* const* prefixes) + TypedExtensionTracker(Member<T>& extensionField, ExtensionFlags flags, const char* const* prefixes) : ExtensionTracker(flags, prefixes) , m_extensionField(extensionField) { } GC_PLUGIN_IGNORE("http://crbug.com/519953") - PersistentWillBeMember<T>& m_extensionField; + Member<T>& m_extensionField; // ExtensionTracker holds it's own reference to the extension to ensure // that it is not deleted before this object's destructor is called Member<T> m_extension; }; bool m_extensionEnabled[WebGLExtensionNameCount]; - PersistentHeapVectorWillBeHeapVector<Member<ExtensionTracker>> m_extensions; + HeapVector<Member<ExtensionTracker>> m_extensions; template <typename T> - void registerExtension(PersistentWillBeMember<T>& extensionPtr, ExtensionFlags flags = ApprovedExtension, const char* const* prefixes = nullptr) + void registerExtension(Member<T>& extensionPtr, ExtensionFlags flags = ApprovedExtension, const char* const* prefixes = nullptr) { m_extensions.append(TypedExtensionTracker<T>::create(extensionPtr, flags, prefixes)); }
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl index 2bad45cb..a6d277c 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl
@@ -45,7 +45,7 @@ // be put on implementing interface // DoNotCheckConstants, // need to put on implementing interface NoInterfaceObject, // Always used on target of 'implements' - WillBeGarbageCollected, + GarbageCollected, ] interface WebGLRenderingContextBase { readonly attribute HTMLCanvasElement canvas;
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp index e9cf5e7..c0e197c 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp
@@ -74,7 +74,7 @@ return getAttributeEventListener(EventTypeNames::statechange); } -void MIDIAccess::setOnstatechange(PassRefPtrWillBeRawPtr<EventListener> listener) +void MIDIAccess::setOnstatechange(RawPtr<EventListener> listener) { m_hasPendingActivity = listener; setAttributeEventListener(EventTypeNames::statechange, listener);
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h index d3134d5c..acc04a0f 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h
@@ -52,7 +52,7 @@ class MIDIAccess final : public RefCountedGarbageCollectedEventTargetWithInlineData<MIDIAccess>, public ActiveScriptWrappable, public ActiveDOMObject, public MIDIAccessorClient { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MIDIAccess); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MIDIAccess); + USING_GARBAGE_COLLECTED_MIXIN(MIDIAccess); public: static MIDIAccess* create(PassOwnPtr<MIDIAccessor> accessor, bool sysexEnabled, const Vector<MIDIAccessInitializer::PortDescriptor>& ports, ExecutionContext* executionContext) { @@ -66,7 +66,7 @@ MIDIOutputMap* outputs() const; EventListener* onstatechange(); - void setOnstatechange(PassRefPtrWillBeRawPtr<EventListener>); + void setOnstatechange(RawPtr<EventListener>); bool sysexEnabled() const { return m_sysexEnabled; }
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.h b/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.h index eddccc8..0daa1dc3 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.h
@@ -41,19 +41,19 @@ class MIDIConnectionEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create() + static RawPtr<MIDIConnectionEvent> create() { - return adoptRefWillBeNoop(new MIDIConnectionEvent()); + return new MIDIConnectionEvent(); } - static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(MIDIPort* port) + static RawPtr<MIDIConnectionEvent> create(MIDIPort* port) { - return adoptRefWillBeNoop(new MIDIConnectionEvent(port)); + return new MIDIConnectionEvent(port); } - static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(const AtomicString& type, const MIDIConnectionEventInit& initializer) + static RawPtr<MIDIConnectionEvent> create(const AtomicString& type, const MIDIConnectionEventInit& initializer) { - return adoptRefWillBeNoop(new MIDIConnectionEvent(type, initializer)); + return new MIDIConnectionEvent(type, initializer); } MIDIPort* port() { return m_port; } @@ -72,7 +72,7 @@ MIDIConnectionEvent(const AtomicString&, const MIDIConnectionEventInit&); - PersistentWillBeMember<MIDIPort> m_port; + Member<MIDIPort> m_port; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIController.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIController.cpp index 09b3054..60c17f2 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIController.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIController.cpp
@@ -50,9 +50,9 @@ { } -PassOwnPtrWillBeRawPtr<MIDIController> MIDIController::create(PassOwnPtr<MIDIClient> client) +RawPtr<MIDIController> MIDIController::create(PassOwnPtr<MIDIClient> client) { - return adoptPtrWillBeNoop(new MIDIController(client)); + return new MIDIController(client); } void MIDIController::requestPermission(MIDIAccessInitializer* initializer, const MIDIOptions& options)
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIController.h b/third_party/WebKit/Source/modules/webmidi/MIDIController.h index 14ba3a0..d1980c07 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIController.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIController.h
@@ -40,20 +40,19 @@ class MIDIClient; class MIDIOptions; -class MIDIController final : public NoBaseWillBeGarbageCollectedFinalized<MIDIController>, public WillBeHeapSupplement<LocalFrame> { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MIDIController); - USING_FAST_MALLOC_WILL_BE_REMOVED(MIDIController); +class MIDIController final : public GarbageCollectedFinalized<MIDIController>, public HeapSupplement<LocalFrame> { + USING_GARBAGE_COLLECTED_MIXIN(MIDIController); public: virtual ~MIDIController(); void requestPermission(MIDIAccessInitializer*, const MIDIOptions&); void cancelPermissionRequest(MIDIAccessInitializer*); - static PassOwnPtrWillBeRawPtr<MIDIController> create(PassOwnPtr<MIDIClient>); + static RawPtr<MIDIController> create(PassOwnPtr<MIDIClient>); static const char* supplementName(); - static MIDIController* from(LocalFrame* frame) { return static_cast<MIDIController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); } + static MIDIController* from(LocalFrame* frame) { return static_cast<MIDIController*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); } - DEFINE_INLINE_VIRTUAL_TRACE() { WillBeHeapSupplement<LocalFrame>::trace(visitor); } + DEFINE_INLINE_VIRTUAL_TRACE() { HeapSupplement<LocalFrame>::trace(visitor); } protected: explicit MIDIController(PassOwnPtr<MIDIClient>);
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIInput.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIInput.cpp index d615293..1a51b25 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIInput.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIInput.cpp
@@ -56,7 +56,7 @@ return getAttributeEventListener(EventTypeNames::midimessage); } -void MIDIInput::setOnmidimessage(PassRefPtrWillBeRawPtr<EventListener> listener) +void MIDIInput::setOnmidimessage(RawPtr<EventListener> listener) { // Implicit open. It does nothing if the port is already opened. // See http://www.w3.org/TR/webmidi/#widl-MIDIPort-open-Promise-MIDIPort @@ -65,7 +65,7 @@ setAttributeEventListener(EventTypeNames::midimessage, listener); } -bool MIDIInput::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) +bool MIDIInput::addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener> listener, const EventListenerOptions& options) { if (eventType == EventTypeNames::midimessage) { // Implicit open. See setOnmidimessage().
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIInput.h b/third_party/WebKit/Source/modules/webmidi/MIDIInput.h index 1c780f07..abfdff3 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIInput.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIInput.h
@@ -46,7 +46,7 @@ ~MIDIInput() override { } EventListener* onmidimessage(); - void setOnmidimessage(PassRefPtrWillBeRawPtr<EventListener>); + void setOnmidimessage(RawPtr<EventListener>); // EventTarget const AtomicString& interfaceName() const override { return EventTargetNames::MIDIInput; } @@ -57,7 +57,7 @@ DECLARE_VIRTUAL_TRACE(); protected: - bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener>, const EventListenerOptions&) override; + bool addEventListenerInternal(const AtomicString& eventType, RawPtr<EventListener>, const EventListenerOptions&) override; private: MIDIInput(MIDIAccess*, const String& id, const String& manufacturer, const String& name, const String& version, MIDIAccessor::MIDIPortState);
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.h b/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.h index 871f324..a212ce6 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.h
@@ -41,19 +41,19 @@ class MIDIMessageEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<MIDIMessageEvent> create() + static RawPtr<MIDIMessageEvent> create() { - return adoptRefWillBeNoop(new MIDIMessageEvent()); + return new MIDIMessageEvent(); } - static PassRefPtrWillBeRawPtr<MIDIMessageEvent> create(double receivedTime, PassRefPtr<DOMUint8Array> data) + static RawPtr<MIDIMessageEvent> create(double receivedTime, PassRefPtr<DOMUint8Array> data) { - return adoptRefWillBeNoop(new MIDIMessageEvent(receivedTime, data)); + return new MIDIMessageEvent(receivedTime, data); } - static PassRefPtrWillBeRawPtr<MIDIMessageEvent> create(const AtomicString& type, const MIDIMessageEventInit& initializer) + static RawPtr<MIDIMessageEvent> create(const AtomicString& type, const MIDIMessageEventInit& initializer) { - return adoptRefWillBeNoop(new MIDIMessageEvent(type, initializer)); + return new MIDIMessageEvent(type, initializer); } double receivedTime() { return m_receivedTime; }
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIPort.h b/third_party/WebKit/Source/modules/webmidi/MIDIPort.h index ce18060..9fc51069 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIPort.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIPort.h
@@ -46,7 +46,7 @@ class MIDIPort : public RefCountedGarbageCollectedEventTargetWithInlineData<MIDIPort>, public ActiveScriptWrappable, public ActiveDOMObject { REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MIDIPort); DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MIDIPort); + USING_GARBAGE_COLLECTED_MIXIN(MIDIPort); public: enum ConnectionState { ConnectionStateOpen,
diff --git a/third_party/WebKit/Source/modules/websockets/CloseEvent.h b/third_party/WebKit/Source/modules/websockets/CloseEvent.h index 1a33d741..0c9c621 100644 --- a/third_party/WebKit/Source/modules/websockets/CloseEvent.h +++ b/third_party/WebKit/Source/modules/websockets/CloseEvent.h
@@ -46,19 +46,19 @@ class CloseEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<CloseEvent> create() + static RawPtr<CloseEvent> create() { - return adoptRefWillBeNoop(new CloseEvent()); + return new CloseEvent(); } - static PassRefPtrWillBeRawPtr<CloseEvent> create(bool wasClean, unsigned short code, const String& reason) + static RawPtr<CloseEvent> create(bool wasClean, unsigned short code, const String& reason) { - return adoptRefWillBeNoop(new CloseEvent(wasClean, code, reason)); + return new CloseEvent(wasClean, code, reason); } - static PassRefPtrWillBeRawPtr<CloseEvent> create(const AtomicString& type, const CloseEventInit& initializer) + static RawPtr<CloseEvent> create(const AtomicString& type, const CloseEventInit& initializer) { - return adoptRefWillBeNoop(new CloseEvent(type, initializer)); + return new CloseEvent(type, initializer); } bool wasClean() const { return m_wasClean; }
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp index a202872..71ab2c5 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp
@@ -71,7 +71,7 @@ DOMWebSocket::EventQueue::~EventQueue() { stop(); } -void DOMWebSocket::EventQueue::dispatch(PassRefPtrWillBeRawPtr<Event> event) +void DOMWebSocket::EventQueue::dispatch(RawPtr<Event> event) { switch (m_state) { case Active: @@ -126,7 +126,7 @@ if (m_state != Active) return; - WillBeHeapDeque<RefPtrWillBeMember<Event>> events; + HeapDeque<Member<Event>> events; events.swap(m_events); while (!events.isEmpty()) { if (m_state == Stopped || m_state == Suspended)
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h index 4ae0affc..c8654c0 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h
@@ -154,7 +154,7 @@ // Dispatches the event if this queue is active. // Queues the event if this queue is suspended. // Does nothing otherwise. - void dispatch(PassRefPtrWillBeRawPtr<Event> /* event */); + void dispatch(RawPtr<Event> /* event */); bool isEmpty() const; @@ -179,8 +179,8 @@ void resumeTimerFired(Timer<EventQueue>*); State m_state; - RawPtrWillBeMember<EventTarget> m_target; - WillBeHeapDeque<RefPtrWillBeMember<Event>> m_events; + Member<EventTarget> m_target; + HeapDeque<Member<Event>> m_events; Timer<EventQueue> m_resumeTimer; };
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h index a8df49b..5ba65b67 100644 --- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h +++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
@@ -61,7 +61,7 @@ // This class is a WebSocketChannel subclass that works with a Document in a // DOMWindow (i.e. works in the main thread). class MODULES_EXPORT DocumentWebSocketChannel final : public WebSocketChannel, public WebSocketHandleClient, public ContextLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DocumentWebSocketChannel); + USING_GARBAGE_COLLECTED_MIXIN(DocumentWebSocketChannel); public: // You can specify the source file and the line number information // explicitly by passing the last parameter.
diff --git a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h index a14a36df..5441607b 100644 --- a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h +++ b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
@@ -147,7 +147,7 @@ bool waitForMethodCompletion(PassOwnPtr<ExecutionContextTask>); Member<WebSocketChannelClient> m_client; - RefPtrWillBeMember<WorkerGlobalScope> m_workerGlobalScope; + Member<WorkerGlobalScope> m_workerGlobalScope; RefPtr<WorkerLoaderProxy> m_loaderProxy; Member<WebSocketChannelSyncHelper> m_syncHelper; Member<Peer> m_peer;
diff --git a/third_party/WebKit/Source/modules/webusb/USB.cpp b/third_party/WebKit/Source/modules/webusb/USB.cpp index c35c88c..73ac25da 100644 --- a/third_party/WebKit/Source/modules/webusb/USB.cpp +++ b/third_party/WebKit/Source/modules/webusb/USB.cpp
@@ -49,7 +49,7 @@ void convertDeviceRequestOptions(const USBDeviceRequestOptions& options, WebUSBDeviceRequestOptions* webOptions) { - ASSERT(options.hasFilters()); + DCHECK(options.hasFilters()); webOptions->filters = WebVector<WebUSBDeviceFilter>(options.filters().size()); for (size_t i = 0; i < options.filters().size(); ++i) { convertDeviceFilter(options.filters()[i], &webOptions->filters[i]); @@ -79,13 +79,13 @@ , m_client(USBController::from(frame).client()) { if (m_client) - m_client->setObserver(this); + m_client->addObserver(this); } USB::~USB() { if (m_client) - m_client->setObserver(nullptr); + m_client->removeObserver(this); } ScriptPromise USB::getDevices(ScriptState* scriptState) @@ -139,7 +139,7 @@ void USB::willDetachFrameHost() { if (m_client) - m_client->setObserver(nullptr); + m_client->removeObserver(this); m_client = nullptr; }
diff --git a/third_party/WebKit/Source/modules/webusb/USB.h b/third_party/WebKit/Source/modules/webusb/USB.h index fbad005d..841b0e4 100644 --- a/third_party/WebKit/Source/modules/webusb/USB.h +++ b/third_party/WebKit/Source/modules/webusb/USB.h
@@ -25,7 +25,7 @@ , public WebUSBClient::Observer { DEFINE_WRAPPERTYPEINFO(); REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(USB); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(USB); + USING_GARBAGE_COLLECTED_MIXIN(USB); public: static USB* create(LocalFrame& frame) { @@ -52,6 +52,7 @@ void onDeviceDisconnected(WebPassOwnPtr<WebUSBDevice>) override; DECLARE_VIRTUAL_TRACE(); + EAGERLY_FINALIZE(); private: explicit USB(LocalFrame& frame);
diff --git a/third_party/WebKit/Source/modules/webusb/USBConnectionEvent.cpp b/third_party/WebKit/Source/modules/webusb/USBConnectionEvent.cpp index c5fa4619..3aecfcf 100644 --- a/third_party/WebKit/Source/modules/webusb/USBConnectionEvent.cpp +++ b/third_party/WebKit/Source/modules/webusb/USBConnectionEvent.cpp
@@ -9,14 +9,14 @@ namespace blink { -PassRefPtrWillBeRawPtr<USBConnectionEvent> USBConnectionEvent::create(const AtomicString& type, const USBConnectionEventInit& initializer) +RawPtr<USBConnectionEvent> USBConnectionEvent::create(const AtomicString& type, const USBConnectionEventInit& initializer) { - return adoptRefWillBeNoop(new USBConnectionEvent(type, initializer)); + return new USBConnectionEvent(type, initializer); } -PassRefPtrWillBeRawPtr<USBConnectionEvent> USBConnectionEvent::create(const AtomicString& type, USBDevice* device) +RawPtr<USBConnectionEvent> USBConnectionEvent::create(const AtomicString& type, USBDevice* device) { - return adoptRefWillBeNoop(new USBConnectionEvent(type, device)); + return new USBConnectionEvent(type, device); } USBConnectionEvent::USBConnectionEvent(const AtomicString& type, const USBConnectionEventInit& initializer)
diff --git a/third_party/WebKit/Source/modules/webusb/USBConnectionEvent.h b/third_party/WebKit/Source/modules/webusb/USBConnectionEvent.h index d23f09c..286882b 100644 --- a/third_party/WebKit/Source/modules/webusb/USBConnectionEvent.h +++ b/third_party/WebKit/Source/modules/webusb/USBConnectionEvent.h
@@ -16,8 +16,8 @@ class USBConnectionEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); public: - static PassRefPtrWillBeRawPtr<USBConnectionEvent> create(const AtomicString& type, const USBConnectionEventInit&); - static PassRefPtrWillBeRawPtr<USBConnectionEvent> create(const AtomicString& type, USBDevice*); + static RawPtr<USBConnectionEvent> create(const AtomicString& type, const USBConnectionEventInit&); + static RawPtr<USBConnectionEvent> create(const AtomicString& type, USBDevice*); USBConnectionEvent(const AtomicString& type, const USBConnectionEventInit&); USBConnectionEvent(const AtomicString& type, USBDevice*); @@ -27,7 +27,7 @@ DECLARE_VIRTUAL_TRACE(); private: - PersistentWillBeMember<USBDevice> m_device; + Member<USBDevice> m_device; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webusb/USBController.cpp b/third_party/WebKit/Source/modules/webusb/USBController.cpp index f95fafd..6329e229 100644 --- a/third_party/WebKit/Source/modules/webusb/USBController.cpp +++ b/third_party/WebKit/Source/modules/webusb/USBController.cpp
@@ -17,12 +17,12 @@ { ASSERT(RuntimeEnabledFeatures::webUSBEnabled()); USBController* controller = new USBController(frame, client); - WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPtrWillBeNoop(controller)); + HeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPtrWillBeNoop(controller)); } USBController& USBController::from(LocalFrame& frame) { - USBController* controller = static_cast<USBController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); + USBController* controller = static_cast<USBController*>(HeapSupplement<LocalFrame>::from(frame, supplementName())); ASSERT(controller); return *controller; } @@ -45,7 +45,7 @@ DEFINE_TRACE(USBController) { - WillBeHeapSupplement<LocalFrame>::trace(visitor); + HeapSupplement<LocalFrame>::trace(visitor); LocalFrameLifecycleObserver::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/webusb/USBController.h b/third_party/WebKit/Source/modules/webusb/USBController.h index ab99223..2a5a1d43 100644 --- a/third_party/WebKit/Source/modules/webusb/USBController.h +++ b/third_party/WebKit/Source/modules/webusb/USBController.h
@@ -15,11 +15,11 @@ class WebUSBClient; class MODULES_EXPORT USBController final - : public NoBaseWillBeGarbageCollectedFinalized<USBController> - , public WillBeHeapSupplement<LocalFrame> + : public GarbageCollectedFinalized<USBController> + , public HeapSupplement<LocalFrame> , public LocalFrameLifecycleObserver { WTF_MAKE_NONCOPYABLE(USBController); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(USBController); + USING_GARBAGE_COLLECTED_MIXIN(USBController); public: virtual ~USBController();
diff --git a/third_party/WebKit/Source/modules/webusb/USBDevice.h b/third_party/WebKit/Source/modules/webusb/USBDevice.h index d28121f..1f458b7 100644 --- a/third_party/WebKit/Source/modules/webusb/USBDevice.h +++ b/third_party/WebKit/Source/modules/webusb/USBDevice.h
@@ -29,7 +29,7 @@ , public ContextLifecycleObserver , public ScriptWrappable , public PageLifecycleObserver { - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(USBDevice); + USING_GARBAGE_COLLECTED_MIXIN(USBDevice); DEFINE_WRAPPERTYPEINFO(); public: using WebType = OwnPtr<WebUSBDevice>;
diff --git a/third_party/WebKit/Source/modules/worklet/Worklet.cpp b/third_party/WebKit/Source/modules/worklet/Worklet.cpp index 5c04f405..0c753df2 100644 --- a/third_party/WebKit/Source/modules/worklet/Worklet.cpp +++ b/third_party/WebKit/Source/modules/worklet/Worklet.cpp
@@ -79,7 +79,7 @@ void Worklet::stop() { - workletGlobalScope()->scriptController()->willScheduleExecutionTermination(); + workletGlobalScope()->dispose(); for (auto scriptLoader : m_scriptLoaders) { scriptLoader->cancel();
diff --git a/third_party/WebKit/Source/modules/worklet/Worklet.h b/third_party/WebKit/Source/modules/worklet/Worklet.h index 2523d28d..0d34da7f 100644 --- a/third_party/WebKit/Source/modules/worklet/Worklet.h +++ b/third_party/WebKit/Source/modules/worklet/Worklet.h
@@ -21,7 +21,7 @@ class Worklet : public GarbageCollectedFinalized<Worklet>, public ScriptWrappable, public ActiveDOMObject { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Worklet); + USING_GARBAGE_COLLECTED_MIXIN(Worklet); WTF_MAKE_NONCOPYABLE(Worklet); public: virtual WorkletGlobalScope* workletGlobalScope() const = 0;
diff --git a/third_party/WebKit/Source/modules/worklet/WorkletConsole.cpp b/third_party/WebKit/Source/modules/worklet/WorkletConsole.cpp index 9d9bf7f..e721cf3 100644 --- a/third_party/WebKit/Source/modules/worklet/WorkletConsole.cpp +++ b/third_party/WebKit/Source/modules/worklet/WorkletConsole.cpp
@@ -19,7 +19,7 @@ { } -void WorkletConsole::reportMessageToConsole(PassRefPtrWillBeRawPtr<ConsoleMessage> consoleMessage) +void WorkletConsole::reportMessageToConsole(RawPtr<ConsoleMessage> consoleMessage) { m_scope->addConsoleMessage(consoleMessage); }
diff --git a/third_party/WebKit/Source/modules/worklet/WorkletConsole.h b/third_party/WebKit/Source/modules/worklet/WorkletConsole.h index c79f0cb..91c14a13 100644 --- a/third_party/WebKit/Source/modules/worklet/WorkletConsole.h +++ b/third_party/WebKit/Source/modules/worklet/WorkletConsole.h
@@ -28,12 +28,12 @@ protected: ExecutionContext* context() final; - void reportMessageToConsole(PassRefPtrWillBeRawPtr<ConsoleMessage>) final; + void reportMessageToConsole(RawPtr<ConsoleMessage>) final; private: explicit WorkletConsole(WorkletGlobalScope*); - RawPtrWillBeMember<WorkletGlobalScope> m_scope; + Member<WorkletGlobalScope> m_scope; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.cpp index cc0a4f4..af3f14b3 100644 --- a/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.cpp
@@ -25,6 +25,16 @@ { } +void WorkletGlobalScope::dispose() +{ + stopActiveDOMObjects(); + + ASSERT(m_scriptController); + m_scriptController->willScheduleExecutionTermination(); + m_scriptController->dispose(); + m_scriptController.clear(); +} + WorkletConsole* WorkletGlobalScope::console() { if (!m_console) @@ -67,15 +77,15 @@ InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText); } -void WorkletGlobalScope::addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage> prpConsoleMessage) +void WorkletGlobalScope::addConsoleMessage(RawPtr<ConsoleMessage> prpConsoleMessage) { - RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = prpConsoleMessage; + RawPtr<ConsoleMessage> consoleMessage = prpConsoleMessage; frame()->console().addMessage(consoleMessage.release()); } void WorkletGlobalScope::logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack> callStack) { - RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, columnNumber); + RawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, columnNumber); consoleMessage->setScriptId(scriptId); consoleMessage->setCallStack(callStack); addConsoleMessage(consoleMessage.release());
diff --git a/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.h b/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.h index e8eaa2f6..11a37a4e 100644 --- a/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.h +++ b/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.h
@@ -13,6 +13,7 @@ #include "core/inspector/ConsoleMessage.h" #include "core/workers/MainThreadWorkletGlobalScope.h" #include "core/workers/WorkerOrWorkletGlobalScope.h" +#include "modules/ModulesExport.h" #include "platform/heap/Handle.h" namespace blink { @@ -22,9 +23,9 @@ class WorkerOrWorkletScriptController; class WorkletConsole; -class WorkletGlobalScope : public RefCountedWillBeGarbageCollectedFinalized<WorkletGlobalScope>, public SecurityContext, public MainThreadWorkletGlobalScope, public ScriptWrappable { +class MODULES_EXPORT WorkletGlobalScope : public GarbageCollectedFinalized<WorkletGlobalScope>, public SecurityContext, public MainThreadWorkletGlobalScope, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WorkletGlobalScope); + USING_GARBAGE_COLLECTED_MIXIN(WorkletGlobalScope); public: #if !ENABLE(OILPAN) using RefCounted<WorkletGlobalScope>::ref; @@ -32,6 +33,7 @@ #endif ~WorkletGlobalScope() override; + virtual void dispose(); bool isWorkletGlobalScope() const final { return true; } @@ -64,7 +66,7 @@ } void reportBlockedScriptExecutionToInspector(const String& directiveText) final; - void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) final; + void addConsoleMessage(RawPtr<ConsoleMessage>) final; void logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) final; DECLARE_VIRTUAL_TRACE(); @@ -86,11 +88,11 @@ EventTarget* errorEventTarget() final { return nullptr; } void didUpdateSecurityOrigin() final { } - mutable PersistentWillBeMember<WorkletConsole> m_console; + mutable Member<WorkletConsole> m_console; KURL m_url; String m_userAgent; - OwnPtrWillBeMember<WorkerOrWorkletScriptController> m_scriptController; + Member<WorkerOrWorkletScriptController> m_scriptController; }; DEFINE_TYPE_CASTS(WorkletGlobalScope, ExecutionContext, context, context->isWorkletGlobalScope(), context.isWorkletGlobalScope());
diff --git a/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.idl b/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.idl index 34ae3a3..3a917d7 100644 --- a/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.idl +++ b/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.idl
@@ -7,7 +7,7 @@ [ Exposed=Worklet, RuntimeEnabled=Worklet, - WillBeGarbageCollected, + GarbageCollected, ] interface WorkletGlobalScope { [Replaceable] readonly attribute WorkletConsole console; };
diff --git a/third_party/WebKit/Source/platform/DEPS b/third_party/WebKit/Source/platform/DEPS index 3af517f..bb37e60 100644 --- a/third_party/WebKit/Source/platform/DEPS +++ b/third_party/WebKit/Source/platform/DEPS
@@ -8,6 +8,7 @@ "+base/memory", "+base/metrics/histogram.h", "+base/metrics/histogram_base.h", + "+base/metrics/histogram_samples.h", "+base/metrics/sparse_histogram.h", "+base/strings/stringprintf.h", "+base/synchronization/waitable_event.h",
diff --git a/third_party/WebKit/Source/platform/Histogram.h b/third_party/WebKit/Source/platform/Histogram.h index a889704..73ed721 100644 --- a/third_party/WebKit/Source/platform/Histogram.h +++ b/third_party/WebKit/Source/platform/Histogram.h
@@ -7,6 +7,7 @@ #include "base/metrics/histogram_base.h" #include "platform/PlatformExport.h" +#include "wtf/CurrentTime.h" #include <stdint.h> namespace base { @@ -23,7 +24,6 @@ protected: explicit CustomCountHistogram(base::HistogramBase*); -private: base::HistogramBase* m_histogram; }; @@ -42,6 +42,37 @@ base::HistogramBase* m_histogram; }; + + +class PLATFORM_EXPORT ScopedUsHistogramTimer { +public: + ScopedUsHistogramTimer(CustomCountHistogram& counter) + : m_startTime(WTF::monotonicallyIncreasingTime()), + m_counter(counter) {} + + ~ScopedUsHistogramTimer() + { + m_counter.count((WTF::monotonicallyIncreasingTime() - m_startTime) * base::Time::kMicrosecondsPerSecond); + } + +private: + // In seconds. + double m_startTime; + CustomCountHistogram& m_counter; +}; + +// Use code like this to record time, in microseconds, to execute a block of code: +// +// { +// SCOPED_BLINK_UMA_HISTOGRAM_TIMER(myUmaStatName) +// RunMyCode(); +// } +// This macro records all times between 0us and 10 seconds. +// Do not change this macro without renaming all metrics that use it! +#define SCOPED_BLINK_UMA_HISTOGRAM_TIMER(name) \ +DEFINE_STATIC_LOCAL(CustomCountHistogram, scopedUsCounter, (name, 0, 10000000, 50)); \ +ScopedUsHistogramTimer timer(scopedUsCounter); + } // namespace blink #endif // Histogram_h
diff --git a/third_party/WebKit/Source/platform/HistogramTest.cpp b/third_party/WebKit/Source/platform/HistogramTest.cpp new file mode 100644 index 0000000..8b575b6 --- /dev/null +++ b/third_party/WebKit/Source/platform/HistogramTest.cpp
@@ -0,0 +1,62 @@ +// 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. + +#include "platform/Histogram.h" + +#include "base/metrics/histogram_samples.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace blink { + +class ScopedUsHistogramTimerTest : public ::testing::Test { +public: + static void advanceClock(double microseconds) + { + s_timeElapsed += microseconds; + } + +protected: + static double returnMockTime() + { + return s_timeElapsed; + } + + virtual void SetUp() + { + s_timeElapsed = 0.0; + m_originalTimeFunction = setTimeFunctionsForTesting(returnMockTime); + } + + virtual void TearDown() + { + setTimeFunctionsForTesting(m_originalTimeFunction); + } + +private: + static double s_timeElapsed; + TimeFunction m_originalTimeFunction; +}; + +double ScopedUsHistogramTimerTest::s_timeElapsed; + +class TestCustomCountHistogram : public CustomCountHistogram { +public: + TestCustomCountHistogram(const char* name, base::HistogramBase::Sample min, base::HistogramBase::Sample max, int32_t bucketCount) + : CustomCountHistogram(name, min, max, bucketCount) {} + + base::HistogramBase* histogram() { return m_histogram; } +}; + +TEST_F(ScopedUsHistogramTimerTest, Basic) +{ + TestCustomCountHistogram scopedUsCounter("test", 0, 10000000, 50); + { + ScopedUsHistogramTimer timer(scopedUsCounter); + advanceClock(0.5); + } + // 0.5s == 500000us + EXPECT_EQ(500000, scopedUsCounter.histogram()->SnapshotSamples()->sum()); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/platform/RefCountedSupplement.h b/third_party/WebKit/Source/platform/RefCountedSupplement.h deleted file mode 100644 index 19632e4c..0000000 --- a/third_party/WebKit/Source/platform/RefCountedSupplement.h +++ /dev/null
@@ -1,75 +0,0 @@ -/* - * Copyright (C) 2012 Google, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef RefCountedSupplement_h -#define RefCountedSupplement_h - -#include "platform/Supplementable.h" -#include "wtf/RefCounted.h" -#include "wtf/RefPtr.h" - -namespace blink { - -#if !ENABLE(OILPAN) -template<class T, class S> -class RefCountedSupplement : public RefCounted<S> { -public: - typedef RefCountedSupplement<T, S> ThisType; - - virtual ~RefCountedSupplement() { } - - class Wrapper final : public Supplement<T> { - public: - explicit Wrapper(PassRefPtr<ThisType> wrapped) : m_wrapped(wrapped) { } - virtual ~Wrapper() { } -#if ENABLE(SECURITY_ASSERT) - bool isRefCountedWrapper() const override { return true; } -#endif - ThisType* wrapped() const { return m_wrapped.get(); } - - private: - - RefPtr<ThisType> m_wrapped; - }; - - static void provideTo(Supplementable<T>& host, const char* key, PassRefPtr<ThisType> supplement) - { - host.provideSupplement(key, adoptPtr(new Wrapper(supplement))); - } - - static ThisType* from(Supplementable<T>& host, const char* key) - { - Supplement<T>* found = static_cast<Supplement<T>*>(host.requireSupplement(key)); - if (!found) - return 0; - ASSERT_WITH_SECURITY_IMPLICATION(found->isRefCountedWrapper()); - return static_cast<Wrapper*>(found)->wrapped(); - } -}; -#endif - -} // namespace blink - -#endif // RefCountedSupplement_h
diff --git a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in index c67d888..99c8fbd 100644 --- a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in +++ b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
@@ -125,7 +125,6 @@ MemoryInfoInWorkers status=experimental MobileLayoutTheme ModuleScripts status=test -NavigatorConnect status=experimental NavigatorContentUtils WebNFC status=experimental NetworkInformation status=stable
diff --git a/third_party/WebKit/Source/platform/Supplementable.h b/third_party/WebKit/Source/platform/Supplementable.h index be18a18..88c14ed 100644 --- a/third_party/WebKit/Source/platform/Supplementable.h +++ b/third_party/WebKit/Source/platform/Supplementable.h
@@ -26,13 +26,10 @@ #ifndef Supplementable_h #define Supplementable_h -#include "platform/PlatformExport.h" #include "platform/heap/Handle.h" #include "wtf/Assertions.h" #include "wtf/HashMap.h" #include "wtf/Noncopyable.h" -#include "wtf/OwnPtr.h" -#include "wtf/PassOwnPtr.h" #if ENABLE(ASSERT) #include "wtf/Threading.h" @@ -90,101 +87,35 @@ // Note that reattachThread() does nothing if assertion is not enabled. // -template<typename T, bool isGarbageCollected> -class SupplementBase; - -template<typename T, bool isGarbageCollected> -class SupplementableBase; - -template<typename T, bool isGarbageCollected> -struct SupplementableTraits; +template<typename T> +class Supplementable; template<typename T> -struct SupplementableTraits<T, true> { - typedef RawPtr<SupplementBase<T, true>> SupplementArgumentType; -}; - -template<typename T> -struct SupplementableTraits<T, false> { - typedef PassOwnPtr<SupplementBase<T, false>> SupplementArgumentType; -}; - -template<bool> -class SupplementTracing; - -template<> -class PLATFORM_EXPORT SupplementTracing<true> : public GarbageCollectedMixin { }; - -template<> -class GC_PLUGIN_IGNORE("crbug.com/476419") PLATFORM_EXPORT SupplementTracing<false> { +class Supplement : public GarbageCollectedMixin { public: - virtual ~SupplementTracing() { } - // FIXME: Oilpan: this trace() method is only provided to minimize - // the use of ENABLE(OILPAN) for Supplements deriving from the - // transition type HeapSupplement<>. - // - // When that transition type is removed (or its use is substantially - // reduced), remove this dummy trace method also. - DEFINE_INLINE_VIRTUAL_TRACE() { } -}; - -template<typename T, bool isGarbageCollected = false> -class SupplementBase : public SupplementTracing<isGarbageCollected> { -public: -#if ENABLE(SECURITY_ASSERT) - virtual bool isRefCountedWrapper() const { return false; } -#endif - - static void provideTo(SupplementableBase<T, isGarbageCollected>& host, const char* key, typename SupplementableTraits<T, isGarbageCollected>::SupplementArgumentType supplement) + static void provideTo(Supplementable<T>& host, const char* key, Supplement<T>* supplement) { host.provideSupplement(key, supplement); } - static SupplementBase<T, isGarbageCollected>* from(SupplementableBase<T, isGarbageCollected>& host, const char* key) + static Supplement<T>* from(Supplementable<T>& host, const char* key) { return host.requireSupplement(key); } - static SupplementBase<T, isGarbageCollected>* from(SupplementableBase<T, isGarbageCollected>* host, const char* key) + static Supplement<T>* from(Supplementable<T>* host, const char* key) { return host ? host->requireSupplement(key) : 0; } }; -template<typename T, bool isGarbageCollected> -class SupplementableTracing; - -// SupplementableTracing<T,true> inherits GarbageCollectedMixin virtually +// Supplementable<T> inherits from GarbageCollectedMixin virtually // to allow ExecutionContext to derive from two GC mixin classes. template<typename T> -class SupplementableTracing<T, true> : public virtual GarbageCollectedMixin { - WTF_MAKE_NONCOPYABLE(SupplementableTracing); +class Supplementable : public virtual GarbageCollectedMixin { + WTF_MAKE_NONCOPYABLE(Supplementable); public: - DEFINE_INLINE_VIRTUAL_TRACE() - { - visitor->trace(m_supplements); - } - -protected: - SupplementableTracing() { } - typedef HeapHashMap<const char*, Member<SupplementBase<T, true>>, PtrHash<const char>> SupplementMap; - SupplementMap m_supplements; -}; - -template<typename T> -class SupplementableTracing<T, false> { - WTF_MAKE_NONCOPYABLE(SupplementableTracing); -protected: - SupplementableTracing() { } - typedef HashMap<const char*, OwnPtr<SupplementBase<T, false>>, PtrHash<const char>> SupplementMap; - SupplementMap m_supplements; -}; - -// Helper class for implementing Supplementable and HeapSupplementable. -template<typename T, bool isGarbageCollected = false> -class SupplementableBase : public SupplementableTracing<T, isGarbageCollected> { -public: - void provideSupplement(const char* key, typename SupplementableTraits<T, isGarbageCollected>::SupplementArgumentType supplement) + void provideSupplement(const char* key, Supplement<T>* supplement) { ASSERT(m_threadId == currentThread()); ASSERT(!this->m_supplements.get(key)); @@ -197,7 +128,7 @@ this->m_supplements.remove(key); } - SupplementBase<T, isGarbageCollected>* requireSupplement(const char* key) + Supplement<T>* requireSupplement(const char* key) { ASSERT(m_threadId == currentThread()); return this->m_supplements.get(key); @@ -210,34 +141,38 @@ #endif } -#if ENABLE(ASSERT) -protected: - SupplementableBase() : m_threadId(currentThread()) { } + DEFINE_INLINE_VIRTUAL_TRACE() + { + visitor->trace(m_supplements); + } +protected: + using SupplementMap = HeapHashMap<const char*, Member<Supplement<T>>, PtrHash<const char>>; + SupplementMap m_supplements; + + Supplementable() +#if ENABLE(ASSERT) + : m_threadId(currentThread()) +#endif + { + } + +#if ENABLE(ASSERT) private: ThreadIdentifier m_threadId; #endif }; -template<typename T> -class HeapSupplement : public SupplementBase<T, true> { }; +// TODO(sof): replace all HeapSupplement<T> uses with Supplement<T>. +#define HeapSupplement Supplement template<typename T> -class HeapSupplementable : public SupplementableBase<T, true> { }; - -template<typename T> -class Supplement : public SupplementBase<T, false> { }; - -template<typename T> -class Supplementable : public SupplementableBase<T, false> { }; - -template<typename T> -struct ThreadingTrait<SupplementBase<T, true>> { +struct ThreadingTrait<Supplement<T>> { static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; }; template<typename T> -struct ThreadingTrait<SupplementableBase<T, true>> { +struct ThreadingTrait<Supplementable<T>> { static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; };
diff --git a/third_party/WebKit/Source/platform/blink_platform.gyp b/third_party/WebKit/Source/platform/blink_platform.gyp index f0b89d5..fa9afc3 100644 --- a/third_party/WebKit/Source/platform/blink_platform.gyp +++ b/third_party/WebKit/Source/platform/blink_platform.gyp
@@ -137,6 +137,7 @@ '<(DEPTH)/mojo/mojo_public.gyp:mojo_cpp_bindings', '<(DEPTH)/mojo/mojo_public.gyp:mojo_cpp_bindings_wtf_support', '<(DEPTH)/skia/skia.gyp:skia', + '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng', '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg', '<(DEPTH)/third_party/icu/icu.gyp:icui18n', '<(DEPTH)/third_party/icu/icu.gyp:icuuc', @@ -202,7 +203,7 @@ 'sources/': [ # Exclude all platform specific things, reinclude them below on a per-platform basis # FIXME: Figure out how to store these patterns in a variable. - ['exclude', '(cf|cg|mac|opentype|win)/'], + ['exclude', '(cf|cg|mac|win)/'], ['exclude', '(?<!Chromium)(CF|CG|Mac|Win)\\.(cpp|mm?)$'], # *NEON.cpp files need special compile options. @@ -220,17 +221,6 @@ ['include', 'graphics/cpu/x86/WebGLImageConversionSSE\\.h$'], ], }], - ['OS=="linux" or OS=="android" or OS=="win"', { - 'sources/': [ - # Cherry-pick files excluded by the broader regular expressions above. - ['include', 'fonts/opentype/OpenTypeTypes\\.h$'], - ['include', 'fonts/opentype/OpenTypeVerticalData\\.(cpp|h)$'], - ], - 'dependencies': [ - '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng', - ], - }, - ], ['OS=="linux" or OS=="android"', { 'sources/': [ ['include', 'fonts/linux/FontPlatformDataLinux\\.cpp$'], @@ -241,9 +231,6 @@ ] }], ['OS=="mac"', { - 'dependencies': [ - '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng', - ], 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework', @@ -266,10 +253,6 @@ # Use native Mac font code from core. ['include', '(fonts/)?mac/[^/]*Font[^/]*\\.(cpp|mm?)$'], - # TODO(dro): Merge the opentype vertical data files inclusion across all platforms. - ['include', 'fonts/opentype/OpenTypeTypes\\.h$'], - ['include', 'fonts/opentype/OpenTypeVerticalData\\.(cpp|h)$'], - # Cherry-pick some files that can't be included by broader regexps. # Some of these are used instead of Chromium platform files, see # the specific exclusions in the "exclude" list below. @@ -330,7 +313,6 @@ ['include', 'clipboard/ClipboardUtilitiesWin\\.(cpp|h)$'], - ['include', 'fonts/opentype/'], ['include', 'fonts/win/FontCacheSkiaWin\\.cpp$'], ['include', 'fonts/win/FontFallbackWin\\.(cpp|h)$'], ['include', 'fonts/win/FontPlatformDataWin\\.cpp$'], @@ -343,7 +325,6 @@ ['exclude', 'win/'], ['exclude', 'Win\\.cpp$'], ['exclude', '/(Windows)[^/]*\\.cpp$'], - ['include', 'fonts/opentype/OpenTypeSanitizer\\.cpp$'], ], }], ['OS=="win" and chromium_win_pch==1', {
diff --git a/third_party/WebKit/Source/platform/blink_platform.gypi b/third_party/WebKit/Source/platform/blink_platform.gypi index 9b15c6b..5527747 100644 --- a/third_party/WebKit/Source/platform/blink_platform.gypi +++ b/third_party/WebKit/Source/platform/blink_platform.gypi
@@ -102,7 +102,6 @@ 'PrerenderClient.h', 'PurgeableVector.cpp', 'PurgeableVector.h', - 'RefCountedSupplement.h', 'ScriptForbiddenScope.cpp', 'ScriptForbiddenScope.h', 'SecureTextInput.cpp', @@ -358,7 +357,6 @@ 'exported/WebScrollbarThemeGeometryNative.h', 'exported/WebScrollbarThemePainter.cpp', 'exported/WebSecurityOrigin.cpp', - 'exported/WebServicePortProviderClient.cpp', 'exported/WebServiceWorkerProviderClient.cpp', 'exported/WebServiceWorkerProxy.cpp', 'exported/WebServiceWorkerRequest.cpp', @@ -1116,6 +1114,7 @@ 'platform_test_files': [ 'DecimalTest.cpp', 'DragImageTest.cpp', + 'HistogramTest.cpp', 'LayoutUnitTest.cpp', 'LifecycleContextTest.cpp', 'PODArenaTest.cpp', @@ -1243,6 +1242,7 @@ 'testing/CompositorTest.cpp', 'testing/CompositorTest.h', 'testing/FakeDisplayItemClient.h', + 'testing/FakeGraphicsLayer.h', 'testing/FontTestHelpers.cpp', 'testing/FontTestHelpers.h', 'testing/GeometryPrinters.cpp',
diff --git a/third_party/WebKit/Source/platform/exported/WebServicePortProviderClient.cpp b/third_party/WebKit/Source/platform/exported/WebServicePortProviderClient.cpp deleted file mode 100644 index e49c4b57..0000000 --- a/third_party/WebKit/Source/platform/exported/WebServicePortProviderClient.cpp +++ /dev/null
@@ -1,11 +0,0 @@ -// 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. - -#include "public/platform/modules/navigator_services/WebServicePortProviderClient.h" - -// This WebServicePortProviderClient.cpp, which includes only -// WebServicePortProvierClient.h, should be in Source/platform/exported, -// because WebServicePortProviderClient is not compiled without this cpp. -// So if we don't have this cpp, we will see unresolved symbol error -// when constructor/destructor's address is required.
diff --git a/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp b/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp index e145c23f..69f6ef70 100644 --- a/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp +++ b/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp
@@ -50,7 +50,7 @@ // to preserve pre-existing behavior while refactoring this code. This should be // investigated further. crbug.com/472634 SkPaint layerPaint; - layerPaint.setXfermode(paint.getXfermode()); + layerPaint.setXfermode(sk_ref_sp(paint.getXfermode())); SkAutoCanvasRestore ar(canvas, false); canvas->saveLayer(nullptr, &layerPaint);
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp index 26b816f..019a7d5 100644 --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
@@ -31,6 +31,7 @@ #include "platform/animation/CompositorFloatAnimationCurve.h" #include "platform/graphics/CompositorFactory.h" #include "platform/scroll/ScrollableArea.h" +#include "platform/testing/FakeGraphicsLayer.h" #include "platform/testing/WebLayerTreeViewImplForTesting.h" #include "platform/transforms/Matrix3DTransformOperation.h" #include "platform/transforms/RotateTransformOperation.h" @@ -56,21 +57,15 @@ String debugName(const GraphicsLayer*) const override { return String(); } }; -class GraphicsLayerForTesting : public GraphicsLayer { -public: - explicit GraphicsLayerForTesting(GraphicsLayerClient* client) - : GraphicsLayer(client) { } -}; - } // anonymous namespace class GraphicsLayerTest : public testing::Test { public: GraphicsLayerTest() { - m_clipLayer = adoptPtr(new GraphicsLayerForTesting(&m_client)); - m_scrollElasticityLayer = adoptPtr(new GraphicsLayerForTesting(&m_client)); - m_graphicsLayer = adoptPtr(new GraphicsLayerForTesting(&m_client)); + m_clipLayer = adoptPtr(new FakeGraphicsLayer(&m_client)); + m_scrollElasticityLayer = adoptPtr(new FakeGraphicsLayer(&m_client)); + m_graphicsLayer = adoptPtr(new FakeGraphicsLayer(&m_client)); m_clipLayer->addChild(m_scrollElasticityLayer.get()); m_scrollElasticityLayer->addChild(m_graphicsLayer.get()); m_graphicsLayer->platformLayer()->setScrollClipLayer( @@ -94,9 +89,9 @@ protected: WebLayer* m_platformLayer; - OwnPtr<GraphicsLayerForTesting> m_graphicsLayer; - OwnPtr<GraphicsLayerForTesting> m_scrollElasticityLayer; - OwnPtr<GraphicsLayerForTesting> m_clipLayer; + OwnPtr<FakeGraphicsLayer> m_graphicsLayer; + OwnPtr<FakeGraphicsLayer> m_scrollElasticityLayer; + OwnPtr<FakeGraphicsLayer> m_clipLayer; private: OwnPtr<WebLayerTreeView> m_layerTreeView;
diff --git a/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp b/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp index c8c45e3..40e1e6c 100644 --- a/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp
@@ -25,6 +25,7 @@ #include "platform/graphics/Image.h" #include "platform/graphics/GraphicsLayer.h" +#include "platform/testing/FakeGraphicsLayer.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSurface.h" @@ -96,20 +97,12 @@ RefPtr<SkImage> m_image; }; -class GraphicsLayerForTesting : public GraphicsLayer { -public: - explicit GraphicsLayerForTesting(GraphicsLayerClient* client) - : GraphicsLayer(client) - { - } -}; - } // anonymous namespace TEST(ImageLayerChromiumTest, imageLayerContentReset) { MockGraphicsLayerClient client; - OwnPtr<GraphicsLayerForTesting> graphicsLayer = adoptPtr(new GraphicsLayerForTesting(&client)); + OwnPtr<FakeGraphicsLayer> graphicsLayer = adoptPtr(new FakeGraphicsLayer(&client)); ASSERT_TRUE(graphicsLayer.get()); ASSERT_FALSE(graphicsLayer->hasContentsLayer()); @@ -131,7 +124,7 @@ TEST(ImageLayerChromiumTest, opaqueImages) { MockGraphicsLayerClient client; - OwnPtr<GraphicsLayerForTesting> graphicsLayer = adoptPtr(new GraphicsLayerForTesting(&client)); + OwnPtr<FakeGraphicsLayer> graphicsLayer = adoptPtr(new FakeGraphicsLayer(&client)); ASSERT_TRUE(graphicsLayer.get()); bool opaque = true;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp index 451ffed..92a2d15 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp
@@ -59,9 +59,9 @@ { RefPtr<SkImageFilter> foreground(builder.build(inputEffect(0), operatingColorSpace())); RefPtr<SkImageFilter> background(builder.build(inputEffect(1), operatingColorSpace())); - RefPtr<SkXfermode> mode(adoptRef(SkXfermode::Create(WebCoreCompositeToSkiaComposite(CompositeSourceOver, m_mode)))); + sk_sp<SkXfermode> mode(SkXfermode::Make(WebCoreCompositeToSkiaComposite(CompositeSourceOver, m_mode))); SkImageFilter::CropRect cropRect = getCropRect(); - return adoptRef(SkXfermodeImageFilter::Create(mode.get(), background.get(), foreground.get(), &cropRect)); + return fromSkSp(SkXfermodeImageFilter::Make(std::move(mode), background.get(), foreground.get(), &cropRect)); } TextStream& FEBlend::externalRepresentation(TextStream& ts, int indent) const
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp index 035ee87b..1dbe3a68 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp
@@ -28,6 +28,7 @@ #include "SkXfermodeImageFilter.h" #include "platform/graphics/filters/SkiaImageFilterBuilder.h" +#include "platform/graphics/skia/SkiaUtils.h" #include "platform/text/TextStream.h" namespace blink { @@ -205,12 +206,12 @@ RefPtr<SkImageFilter> foreground(builder.build(inputEffect(0), operatingColorSpace(), !mayProduceInvalidPreMultipliedPixels())); RefPtr<SkImageFilter> background(builder.build(inputEffect(1), operatingColorSpace(), !mayProduceInvalidPreMultipliedPixels())); SkImageFilter::CropRect cropRect = getCropRect(); - RefPtr<SkXfermode> mode; + sk_sp<SkXfermode> mode; if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC) - mode = adoptRef(SkArithmeticMode::Create(SkFloatToScalar(m_k1), SkFloatToScalar(m_k2), SkFloatToScalar(m_k3), SkFloatToScalar(m_k4), requiresPMColorValidation)); + mode = SkArithmeticMode::Make(SkFloatToScalar(m_k1), SkFloatToScalar(m_k2), SkFloatToScalar(m_k3), SkFloatToScalar(m_k4), requiresPMColorValidation); else - mode = adoptRef(SkXfermode::Create(toXfermode(m_type))); - return adoptRef(SkXfermodeImageFilter::Create(mode.get(), background.get(), foreground.get(), &cropRect)); + mode = SkXfermode::Make(toXfermode(m_type)); + return fromSkSp(SkXfermodeImageFilter::Make(std::move(mode), background.get(), foreground.get(), &cropRect)); } static TextStream& operator<<(TextStream& ts, const CompositeOperationType& type)
diff --git a/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp b/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp index 150b48b..337b10cb 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp
@@ -217,10 +217,7 @@ RefPtr<SkImageFilter> flipImageFilter = adoptRef(SkImageFilter::CreateMatrixFilter( flipMatrix, kNone_SkFilterQuality, maskedInput.get())); - RefPtr<SkImageFilter> combineImageFilter = adoptRef(SkXfermodeImageFilter::Create( - nullptr, flipImageFilter.get(), input)); - - return combineImageFilter.release(); + return fromSkSp(SkXfermodeImageFilter::Make(nullptr, flipImageFilter.get(), input, nullptr)); } } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp index ab50406..0810046d 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -90,7 +90,7 @@ } // namespace -PassRefPtr<DrawingBuffer> DrawingBuffer::create(PassOwnPtr<WebGraphicsContext3DProvider> contextProvider, const IntSize& size, bool premultipliedAlpha, PreserveDrawingBuffer preserve, WebGraphicsContext3D::Attributes requestedAttributes) +PassRefPtr<DrawingBuffer> DrawingBuffer::create(PassOwnPtr<WebGraphicsContext3DProvider> contextProvider, const IntSize& size, bool premultipliedAlpha, bool wantAlphaChannel, bool wantDepthBuffer, bool wantStencilBuffer, bool wantAntialiasing, PreserveDrawingBuffer preserve) { ASSERT(contextProvider); @@ -106,8 +106,9 @@ } ASSERT(extensionsUtil->supportsExtension("GL_OES_packed_depth_stencil")); extensionsUtil->ensureExtensionEnabled("GL_OES_packed_depth_stencil"); - bool multisampleSupported = (extensionsUtil->supportsExtension("GL_CHROMIUM_framebuffer_multisample") - || extensionsUtil->supportsExtension("GL_EXT_multisampled_render_to_texture")) + bool multisampleSupported = wantAntialiasing + && (extensionsUtil->supportsExtension("GL_CHROMIUM_framebuffer_multisample") + || extensionsUtil->supportsExtension("GL_EXT_multisampled_render_to_texture")) && extensionsUtil->supportsExtension("GL_OES_rgb8_rgba8"); if (multisampleSupported) { extensionsUtil->ensureExtensionEnabled("GL_OES_rgb8_rgba8"); @@ -120,8 +121,8 @@ if (discardFramebufferSupported) extensionsUtil->ensureExtensionEnabled("GL_EXT_discard_framebuffer"); - RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(std::move(contextProvider), extensionsUtil.release(), multisampleSupported, discardFramebufferSupported, premultipliedAlpha, preserve, requestedAttributes)); - if (!drawingBuffer->initialize(size)) { + RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(std::move(contextProvider), extensionsUtil.release(), discardFramebufferSupported, wantAlphaChannel, premultipliedAlpha, preserve)); + if (!drawingBuffer->initialize(size, wantDepthBuffer, wantStencilBuffer, multisampleSupported)) { drawingBuffer->beginDestruction(); return PassRefPtr<DrawingBuffer>(); } @@ -133,7 +134,13 @@ shouldFailDrawingBufferCreationForTesting = true; } -DrawingBuffer::DrawingBuffer(PassOwnPtr<WebGraphicsContext3DProvider> contextProvider, PassOwnPtr<Extensions3DUtil> extensionsUtil, bool multisampleExtensionSupported, bool discardFramebufferSupported, bool premultipliedAlpha, PreserveDrawingBuffer preserve, WebGraphicsContext3D::Attributes requestedAttributes) +DrawingBuffer::DrawingBuffer( + PassOwnPtr<WebGraphicsContext3DProvider> contextProvider, + PassOwnPtr<Extensions3DUtil> extensionsUtil, + bool discardFramebufferSupported, + bool wantAlphaChannel, + bool premultipliedAlpha, + PreserveDrawingBuffer preserve) : m_preserveDrawingBuffer(preserve) , m_scissorEnabled(false) , m_texture2DBinding(0) @@ -145,10 +152,10 @@ , m_gl(m_contextProvider->contextGL()) , m_extensionsUtil(std::move(extensionsUtil)) , m_size(-1, -1) - , m_requestedAttributes(requestedAttributes) - , m_multisampleExtensionSupported(multisampleExtensionSupported) , m_discardFramebufferSupported(discardFramebufferSupported) + , m_wantAlphaChannel(wantAlphaChannel) , m_premultipliedAlpha(premultipliedAlpha) + , m_hasImplicitStencilBuffer(false) , m_fbo(0) , m_depthStencilBuffer(0) , m_multisampleFBO(0) @@ -268,7 +275,7 @@ bitmap->setSize(size()); unsigned char* pixels = bitmap->pixels(); - bool needPremultiply = m_actualAttributes.alpha && !m_premultipliedAlpha; + bool needPremultiply = m_wantAlphaChannel && !m_premultipliedAlpha; WebGLImageConversion::AlphaOp op = needPremultiply ? WebGLImageConversion::AlphaDoPremultiply : WebGLImageConversion::AlphaDoNothing; if (pixels) readBackFramebuffer(pixels, size().width(), size().height(), ReadbackSkia, op); @@ -282,9 +289,8 @@ RefPtr<MailboxInfo> frontColorBufferMailbox = recycledMailbox(); // No buffer available to recycle, create a new one. - if (!frontColorBufferMailbox) { + if (!frontColorBufferMailbox) frontColorBufferMailbox = createNewMailbox(createTextureAndAllocateMemory(m_size)); - } if (m_preserveDrawingBuffer == Discard) { std::swap(frontColorBufferMailbox->textureInfo, m_colorBuffer); @@ -367,7 +373,7 @@ { TextureParameters parameters; parameters.target = GL_TEXTURE_2D; - if (m_requestedAttributes.alpha) { + if (m_wantAlphaChannel) { parameters.internalColorFormat = GL_RGBA; parameters.colorFormat = GL_RGBA; parameters.internalRenderbufferFormat = GL_RGBA8_OES; @@ -449,7 +455,7 @@ ASSERT_NOT_REACHED(); } -bool DrawingBuffer::initialize(const IntSize& size) +bool DrawingBuffer::initialize(const IntSize& size, bool wantDepthBuffer, bool wantStencilBuffer, bool useMultisampling) { if (m_gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR) { // Need to try to restore the context again later. @@ -460,7 +466,7 @@ int maxSampleCount = 0; m_antiAliasingMode = None; - if (m_requestedAttributes.antialias && m_multisampleExtensionSupported) { + if (useMultisampling) { m_gl->GetIntegerv(GL_MAX_SAMPLES_ANGLE, &maxSampleCount); m_antiAliasingMode = MSAAExplicitResolve; if (m_extensionsUtil->supportsExtension("GL_EXT_multisampled_render_to_texture")) { @@ -475,27 +481,13 @@ m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fbo); createSecondaryBuffers(); - // We first try to initialize everything with the requested attributes. - if (!reset(size)) + if (!reset(size, wantDepthBuffer || wantStencilBuffer)) return false; - // If that succeeds, we then see what we actually got and update our actual attributes to reflect that. - m_actualAttributes = m_requestedAttributes; - if (m_requestedAttributes.alpha) { - GLint alphaBits = 0; - m_gl->GetIntegerv(GL_ALPHA_BITS, &alphaBits); - m_actualAttributes.alpha = alphaBits > 0; + + if (m_depthStencilBuffer) { + DCHECK(wantDepthBuffer || wantStencilBuffer); + m_hasImplicitStencilBuffer = !wantStencilBuffer; } - if (m_requestedAttributes.depth) { - GLint depthBits = 0; - m_gl->GetIntegerv(GL_DEPTH_BITS, &depthBits); - m_actualAttributes.depth = depthBits > 0; - } - if (m_requestedAttributes.stencil) { - GLint stencilBits = 0; - m_gl->GetIntegerv(GL_STENCIL_BITS, &stencilBits); - m_actualAttributes.stencil = stencilBits > 0; - } - m_actualAttributes.antialias = multisample(); if (m_gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR) { // It's possible that the drawing buffer allocation provokes a context loss, so check again just in case. http://crbug.com/512302 @@ -545,9 +537,9 @@ GLboolean unpackPremultiplyAlphaNeeded = GL_FALSE; GLboolean unpackUnpremultiplyAlphaNeeded = GL_FALSE; - if (m_actualAttributes.alpha && m_premultipliedAlpha && !premultiplyAlpha) + if (m_wantAlphaChannel && m_premultipliedAlpha && !premultiplyAlpha) unpackUnpremultiplyAlphaNeeded = GL_TRUE; - else if (m_actualAttributes.alpha && !m_premultipliedAlpha && premultiplyAlpha) + else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha) unpackPremultiplyAlphaNeeded = GL_TRUE; gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, flipY, unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded); @@ -574,8 +566,8 @@ if (!m_layer) { m_layer = adoptPtr(Platform::current()->compositorSupport()->createExternalTextureLayer(this)); - m_layer->setOpaque(!m_actualAttributes.alpha); - m_layer->setBlendBackgroundColor(m_actualAttributes.alpha); + m_layer->setOpaque(!m_wantAlphaChannel); + m_layer->setBlendBackgroundColor(m_wantAlphaChannel); m_layer->setPremultipliedAlpha(m_premultipliedAlpha); m_layer->setNearestNeighbor(m_filterQuality == kNone_SkFilterQuality); GraphicsLayer::registerContentsLayer(m_layer->layer()); @@ -654,10 +646,10 @@ } } -bool DrawingBuffer::resizeFramebuffer(const IntSize& size) +bool DrawingBuffer::resizeFramebuffer(const IntSize& size, bool wantDepthOrStencilBuffer) { m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fbo); - if (m_antiAliasingMode != MSAAExplicitResolve) + if (m_antiAliasingMode != MSAAExplicitResolve && wantDepthOrStencilBuffer) resizeDepthStencil(size); if (m_gl->CheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) return false; @@ -665,7 +657,7 @@ return true; } -bool DrawingBuffer::resizeMultisampleFramebuffer(const IntSize& size) +bool DrawingBuffer::resizeMultisampleFramebuffer(const IntSize& size, bool wantDepthOrStencilBuffer) { if (m_antiAliasingMode == MSAAExplicitResolve) { m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_multisampleFBO); @@ -677,7 +669,8 @@ return false; m_gl->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_multisampleColorBuffer); - resizeDepthStencil(size); + if (wantDepthOrStencilBuffer) + resizeDepthStencil(size); if (m_gl->CheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) return false; } @@ -687,9 +680,6 @@ void DrawingBuffer::resizeDepthStencil(const IntSize& size) { - if (!m_requestedAttributes.depth && !m_requestedAttributes.stencil) - return; - if (!m_depthStencilBuffer) m_gl->GenRenderbuffers(1, &m_depthStencilBuffer); m_gl->BindRenderbuffer(GL_RENDERBUFFER, m_depthStencilBuffer); @@ -717,11 +707,6 @@ m_gl->Clear(clearMask); } -bool DrawingBuffer::hasImplicitStencilBuffer() const -{ - return m_depthStencilBuffer && m_requestedAttributes.depth && !m_requestedAttributes.stencil; -} - void DrawingBuffer::setSize(const IntSize& size) { if (m_size == size) @@ -744,7 +729,7 @@ return adjustedSize; } -bool DrawingBuffer::reset(const IntSize& newSize) +bool DrawingBuffer::reset(const IntSize& newSize, bool wantDepthOrStencilBuffer) { ASSERT(!newSize.isEmpty()); IntSize adjustedSize = adjustSize(newSize, m_size, m_maxTextureSize); @@ -763,7 +748,8 @@ attachColorBufferToCurrentFBO(); // resize multisample FBO - if (!resizeMultisampleFramebuffer(adjustedSize) || !resizeFramebuffer(adjustedSize)) { + if (!resizeMultisampleFramebuffer(adjustedSize, wantDepthOrStencilBuffer) + || !resizeFramebuffer(adjustedSize, wantDepthOrStencilBuffer)) { adjustedSize.scale(s_resourceAdjustedRatio); continue; } @@ -781,12 +767,12 @@ m_gl->ColorMask(true, true, true, true); GLbitfield clearMask = GL_COLOR_BUFFER_BIT; - if (m_actualAttributes.depth) { + if (!!m_depthStencilBuffer) { m_gl->ClearDepthf(1.0f); clearMask |= GL_DEPTH_BUFFER_BIT; m_gl->DepthMask(true); } - if (m_actualAttributes.stencil) { + if (!!m_depthStencilBuffer) { m_gl->ClearStencil(0); clearMask |= GL_STENCIL_BUFFER_BIT; m_gl->StencilMaskSeparate(GL_FRONT, 0xFFFFFFFF); @@ -967,7 +953,7 @@ // TODO(erikchen): Add support for a CHROMIUM_image back buffer whose // behavior mimics a texture with internal format GL_RGB. // https://crbug.com/581777. - if (!m_requestedAttributes.alpha) + if (!m_wantAlphaChannel) return createDefaultTextureAndAllocateMemory(size); if (!RuntimeEnabledFeatures::webGLImageChromiumEnabled())
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h index 140c949d5..5981cd9 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
@@ -76,7 +76,15 @@ Discard }; - static PassRefPtr<DrawingBuffer> create(PassOwnPtr<WebGraphicsContext3DProvider>, const IntSize&, bool premultipliedAlpha, PreserveDrawingBuffer, WebGraphicsContext3D::Attributes requestedAttributes); + static PassRefPtr<DrawingBuffer> create( + PassOwnPtr<WebGraphicsContext3DProvider>, + const IntSize&, + bool premultipliedAlpha, + bool wantAlphaChannel, + bool wantDepthBuffer, + bool wantStencilBuffer, + bool wantAntialiasing, + PreserveDrawingBuffer); static void forceNextDrawingBufferCreationToFail(); ~DrawingBuffer() override; @@ -92,11 +100,13 @@ // in the situation where the end user only asked for a depth buffer. In this case, we need to // upgrade clears of the depth buffer to clears of the depth and stencil buffers in order to // avoid performance problems on some GPUs. - bool hasImplicitStencilBuffer() const; + bool hasImplicitStencilBuffer() const { return m_hasImplicitStencilBuffer; } + bool hasDepthBuffer() const { return !!m_depthStencilBuffer; } + bool hasStencilBuffer() const { return !!m_depthStencilBuffer; } // Given the desired buffer size, provides the largest dimensions that will fit in the pixel budget. static IntSize adjustSize(const IntSize& desiredSize, const IntSize& curSize, int maxTextureSize); - bool reset(const IntSize&); + bool reset(const IntSize&, bool wantDepthOrStencilBuffer); void bind(GLenum target); IntSize size() const { return m_size; } @@ -154,10 +164,6 @@ gpu::gles2::GLES2Interface* contextGL(); WebGraphicsContext3DProvider* contextProvider(); - // Returns the actual context attributes for this drawing buffer which may differ from the - // requested context attributes due to implementation limits. - WebGraphicsContext3D::Attributes getActualAttributes() const { return m_actualAttributes; } - // WebExternalTextureLayerClient implementation. bool prepareMailbox(WebExternalTextureMailbox*, WebExternalBitmap*) override; void mailboxReleased(const WebExternalTextureMailbox&, bool lostResource = false) override; @@ -183,13 +189,12 @@ DrawingBuffer( PassOwnPtr<WebGraphicsContext3DProvider>, PassOwnPtr<Extensions3DUtil>, - bool multisampleExtensionSupported, bool discardFramebufferSupported, + bool wantAlphaChannel, bool premultipliedAlpha, - PreserveDrawingBuffer, - WebGraphicsContext3D::Attributes requestedAttributes); + PreserveDrawingBuffer); - bool initialize(const IntSize&); + bool initialize(const IntSize&, bool wantDepthBuffer, bool wantStencilBuffer, bool useMultisampling); private: struct TextureParameters { @@ -254,8 +259,8 @@ // Create the depth/stencil and multisample buffers, if needed. void createSecondaryBuffers(); - bool resizeFramebuffer(const IntSize&); - bool resizeMultisampleFramebuffer(const IntSize&); + bool resizeFramebuffer(const IntSize&, bool wantDepthOrStencilBuffer); + bool resizeMultisampleFramebuffer(const IntSize&, bool wantDepthOrStencilBuffer); void resizeDepthStencil(const IntSize&); void clearPlatformLayer(); @@ -299,7 +304,7 @@ void attachColorBufferToCurrentFBO(); - PreserveDrawingBuffer m_preserveDrawingBuffer; + const PreserveDrawingBuffer m_preserveDrawingBuffer; bool m_scissorEnabled; GLuint m_texture2DBinding; GLuint m_drawFramebufferBinding; @@ -311,10 +316,10 @@ gpu::gles2::GLES2Interface* m_gl; // Lifetime is tied to the m_contextProvider. OwnPtr<Extensions3DUtil> m_extensionsUtil; IntSize m_size; - WebGraphicsContext3D::Attributes m_requestedAttributes; - bool m_multisampleExtensionSupported; - bool m_discardFramebufferSupported; - bool m_premultipliedAlpha; + const bool m_discardFramebufferSupported; + const bool m_wantAlphaChannel; + const bool m_premultipliedAlpha; + bool m_hasImplicitStencilBuffer; GLuint m_fbo; // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buffer. TextureInfo m_colorBuffer; @@ -349,7 +354,6 @@ AntialiasingMode m_antiAliasingMode; - WebGraphicsContext3D::Attributes m_actualAttributes; int m_maxTextureSize; int m_sampleCount; int m_packAlignment;
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp index 51eb2685..d3f0314 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
@@ -237,15 +237,18 @@ { OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(contextProvider->contextGL()); RefPtr<DrawingBufferForTests> drawingBuffer = adoptRef(new DrawingBufferForTests(contextProvider, extensionsUtil.release(), preserve)); - if (!drawingBuffer->initialize(size)) { + bool wantDepthBuffer = false; + bool wantStencilBuffer = false; + bool multisampleExtensionSupported = false; + if (!drawingBuffer->initialize(size, wantDepthBuffer, wantStencilBuffer, multisampleExtensionSupported)) { drawingBuffer->beginDestruction(); - return PassRefPtr<DrawingBufferForTests>(); + return nullptr; } return drawingBuffer.release(); } DrawingBufferForTests(PassOwnPtr<WebGraphicsContext3DProvider> contextProvider, PassOwnPtr<Extensions3DUtil> extensionsUtil, PreserveDrawingBuffer preserve) - : DrawingBuffer(contextProvider, extensionsUtil, false /* multisampleExtensionSupported */, false /* discardFramebufferSupported */, false /* premultipliedAlpha */, preserve, WebGraphicsContext3D::Attributes()) + : DrawingBuffer(contextProvider, extensionsUtil, false /* discardFramebufferSupported */, true /* wantAlphaChannel */, false /* premultipliedAlpha */, preserve) , m_live(0) { } @@ -287,6 +290,7 @@ m_context = context.get(); OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new WebGraphicsContext3DProviderForTests(context.release(), gl.release())); m_drawingBuffer = DrawingBufferForTests::create(provider.release(), IntSize(initialWidth, initialHeight), DrawingBuffer::Preserve); + CHECK(m_drawingBuffer); } WebGraphicsContext3DForTests* webContext() @@ -312,7 +316,7 @@ EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); // Resize to 100x50. - m_drawingBuffer->reset(IntSize(initialWidth, alternateHeight)); + m_drawingBuffer->reset(IntSize(initialWidth, alternateHeight), false); m_drawingBuffer->mailboxReleased(mailbox, false); // Produce a mailbox at this size. @@ -321,7 +325,7 @@ EXPECT_EQ(alternateSize, webContext()->mostRecentlyProducedSize()); // Reset to initial size. - m_drawingBuffer->reset(IntSize(initialWidth, initialHeight)); + m_drawingBuffer->reset(IntSize(initialWidth, initialHeight), false); m_drawingBuffer->mailboxReleased(mailbox, false); // Prepare another mailbox and verify that it's the correct size. @@ -520,6 +524,7 @@ EXPECT_CALL(*m_gl, BindTexImage2DMock(m_imageId0)).Times(1); m_drawingBuffer = DrawingBufferForTests::create(provider.release(), IntSize(initialWidth, initialHeight), DrawingBuffer::Preserve); + CHECK(m_drawingBuffer); testing::Mock::VerifyAndClearExpectations(webContext()); } @@ -552,7 +557,7 @@ EXPECT_CALL(*m_gl, DestroyImageMock(m_imageId0)).Times(1); EXPECT_CALL(*m_gl, ReleaseTexImage2DMock(m_imageId0)).Times(1); // Resize to 100x50. - m_drawingBuffer->reset(IntSize(initialWidth, alternateHeight)); + m_drawingBuffer->reset(IntSize(initialWidth, alternateHeight), false); m_drawingBuffer->mailboxReleased(mailbox, false); testing::Mock::VerifyAndClearExpectations(webContext()); @@ -572,7 +577,7 @@ EXPECT_CALL(*m_gl, DestroyImageMock(m_imageId2)).Times(1); EXPECT_CALL(*m_gl, ReleaseTexImage2DMock(m_imageId2)).Times(1); // Reset to initial size. - m_drawingBuffer->reset(IntSize(initialWidth, initialHeight)); + m_drawingBuffer->reset(IntSize(initialWidth, initialHeight), false); m_drawingBuffer->mailboxReleased(mailbox, false); testing::Mock::VerifyAndClearExpectations(webContext()); @@ -631,12 +636,6 @@ void GetIntegerv(GLenum ptype, GLint* value) override { switch (ptype) { - case GL_DEPTH_BITS: - *value = (m_depthAttachment || m_depthStencilAttachment) ? 24 : 0; - return; - case GL_STENCIL_BITS: - *value = (m_stencilAttachment || m_depthStencilAttachment) ? 8 : 0; - return; case GL_MAX_TEXTURE_SIZE: *value = 1024; return; @@ -721,13 +720,24 @@ OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new WebGraphicsContext3DProviderForTests(context.release(), gl.release())); DrawingBuffer::PreserveDrawingBuffer preserve = DrawingBuffer::Preserve; - WebGraphicsContext3D::Attributes requestedAttributes; - requestedAttributes.stencil = cases[i].requestStencil; - requestedAttributes.depth = cases[i].requestDepth; - RefPtr<DrawingBuffer> drawingBuffer = DrawingBuffer::create(provider.release(), IntSize(10, 10), false /* premultipliedAlpha */, preserve, requestedAttributes); + bool premultipliedAlpha = false; + bool wantAlphaChannel = true; + bool wantDepthBuffer = cases[i].requestDepth; + bool wantStencilBuffer = cases[i].requestStencil; + bool wantAntialiasing = false; + RefPtr<DrawingBuffer> drawingBuffer = DrawingBuffer::create( + provider.release(), + IntSize(10, 10), + premultipliedAlpha, + wantAlphaChannel, + wantDepthBuffer, + wantStencilBuffer, + wantAntialiasing, + preserve); - EXPECT_EQ(cases[i].requestDepth, drawingBuffer->getActualAttributes().depth); - EXPECT_EQ(cases[i].requestStencil, drawingBuffer->getActualAttributes().stencil); + // When we request a depth or a stencil buffer, we will get both. + EXPECT_EQ(cases[i].requestDepth || cases[i].requestStencil, drawingBuffer->hasDepthBuffer()); + EXPECT_EQ(cases[i].requestDepth || cases[i].requestStencil, drawingBuffer->hasStencilBuffer()); EXPECT_EQ(cases[i].expectedRenderBuffers, trackingContext->numAllocatedRenderBuffer()); if (cases[i].requestDepth || cases[i].requestStencil) { EXPECT_NE(0u, trackingContext->depthStencilAttachment()); @@ -739,9 +749,9 @@ EXPECT_EQ(0u, trackingContext->stencilAttachment()); } - drawingBuffer->reset(IntSize(10, 20)); - EXPECT_EQ(cases[i].requestDepth, drawingBuffer->getActualAttributes().depth); - EXPECT_EQ(cases[i].requestStencil, drawingBuffer->getActualAttributes().stencil); + drawingBuffer->reset(IntSize(10, 20), false); + EXPECT_EQ(cases[i].requestDepth || cases[i].requestStencil, drawingBuffer->hasDepthBuffer()); + EXPECT_EQ(cases[i].requestDepth || cases[i].requestStencil, drawingBuffer->hasStencilBuffer()); EXPECT_EQ(cases[i].expectedRenderBuffers, trackingContext->numAllocatedRenderBuffer()); if (cases[i].requestDepth || cases[i].requestStencil) { EXPECT_NE(0u, trackingContext->depthStencilAttachment());
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp index 1bbd920a..0cac7150 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp +++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
@@ -147,7 +147,15 @@ if (m_runState == RunState::PostAnimationCleanup) resetAnimationState(); - if (m_animationCurve && m_runState != RunState::WaitingToCancelOnCompositor) { + if (m_runState == RunState::WaitingToCancelOnCompositor) { + // Ignore user scroll if WaitingToCancelOnCompositor. Can be in this + // state when holding down an arrow. + // TODO(ymalik): Handle this case by either updating the target on the + // current scroll or starting a new animation (see crbug.com/599876). + return true; + } + + if (m_animationCurve) { if ((targetPos - m_targetOffset).isZero()) return true;
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h index 06fc1196..c4e493f 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h +++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h
@@ -81,6 +81,7 @@ FRIEND_TEST_ALL_PREFIXES(ScrollAnimatorTest, MainThreadStates); FRIEND_TEST_ALL_PREFIXES(ScrollAnimatorTest, AnimatedScrollTakeover); FRIEND_TEST_ALL_PREFIXES(ScrollAnimatorTest, CancellingAnimationResetsState); + FRIEND_TEST_ALL_PREFIXES(ScrollAnimatorTest, CancellingCompositorAnimation); enum class RunState { // No animation.
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp index 3bc1b30..0298780 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp +++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
@@ -444,4 +444,77 @@ reset(*scrollAnimator); } +// Test the behavior when in WaitingToCancelOnCompositor and a new user scroll +// happens. +TEST(ScrollAnimatorTest, CancellingCompositorAnimation) +{ + RawPtr<MockScrollableArea> scrollableArea = MockScrollableArea::create(true); + RawPtr<TestScrollAnimator> scrollAnimator = adoptPtrWillBeNoop(new TestScrollAnimator(scrollableArea.get(), getMockedTime)); + + EXPECT_CALL(*scrollableArea, minimumScrollPosition()).Times(AtLeast(1)) + .WillRepeatedly(Return(IntPoint())); + EXPECT_CALL(*scrollableArea, maximumScrollPosition()).Times(AtLeast(1)) + .WillRepeatedly(Return(IntPoint(1000, 1000))); + // Called when reset, not setting anywhere else. + EXPECT_CALL(*scrollableArea, setScrollOffset(_, _)).Times(1); + // Called from first and last user scroll, and first update. + EXPECT_CALL(*scrollableArea, registerForAnimation()).Times(3); + EXPECT_CALL(*scrollableArea, scheduleAnimation()).Times(AtLeast(1)) + .WillRepeatedly(Return(true)); + + EXPECT_FALSE(scrollAnimator->hasAnimationThatRequiresService()); + + // First user scroll. + ScrollResult result = scrollAnimator->userScroll(ScrollByLine, FloatSize(100, 0)); + EXPECT_TRUE(scrollAnimator->hasAnimationThatRequiresService()); + EXPECT_TRUE(result.didScrollX); + EXPECT_FLOAT_EQ(0.0, result.unusedScrollDeltaX); + EXPECT_TRUE(scrollAnimator->hasRunningAnimation()); + EXPECT_EQ(100, scrollAnimator->desiredTargetPosition().x()); + EXPECT_EQ(0, scrollAnimator->desiredTargetPosition().y()); + + // Update compositor animation. + gMockedTime += 0.05; + scrollAnimator->setShouldSendToCompositor(true); + scrollAnimator->updateCompositorAnimations(); + EXPECT_EQ(scrollAnimator->m_runState, + ScrollAnimatorCompositorCoordinator::RunState::RunningOnCompositor); + + // Cancel + scrollAnimator->cancelAnimation(); + EXPECT_EQ(scrollAnimator->m_runState, + ScrollAnimatorCompositorCoordinator::RunState::WaitingToCancelOnCompositor); + + // Second user scroll should not affect the run state. + result = scrollAnimator->userScroll(ScrollByLine, FloatSize(100, 0)); + EXPECT_TRUE(scrollAnimator->hasAnimationThatRequiresService()); + EXPECT_TRUE(result.didScrollX); + EXPECT_FLOAT_EQ(0.0, result.unusedScrollDeltaX); + EXPECT_EQ(scrollAnimator->m_runState, + ScrollAnimatorCompositorCoordinator::RunState::WaitingToCancelOnCompositor); + // Desired target position is what it was before. + EXPECT_EQ(100, scrollAnimator->desiredTargetPosition().x()); + EXPECT_EQ(0, scrollAnimator->desiredTargetPosition().y()); + + // Update compositor animation. + gMockedTime += 0.05; + scrollAnimator->updateCompositorAnimations(); + EXPECT_EQ(scrollAnimator->m_runState, + ScrollAnimatorCompositorCoordinator::RunState::Idle); + + // Third user scroll after compositor update is treated like a new scroll. + result = scrollAnimator->userScroll(ScrollByLine, FloatSize(100, 0)); + EXPECT_TRUE(scrollAnimator->hasAnimationThatRequiresService()); + EXPECT_TRUE(result.didScrollX); + EXPECT_FLOAT_EQ(0.0, result.unusedScrollDeltaX); + EXPECT_EQ(scrollAnimator->m_runState, + ScrollAnimatorCompositorCoordinator::RunState::WaitingToSendToCompositor); + EXPECT_EQ(100, scrollAnimator->desiredTargetPosition().x()); + EXPECT_EQ(0, scrollAnimator->desiredTargetPosition().y()); + reset(*scrollAnimator); + + // Forced GC in order to finalize objects depending on the mock object. + Heap::collectAllGarbage(); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp index 52d9f73..4938193 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp +++ b/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp
@@ -8,6 +8,7 @@ #include "platform/graphics/GraphicsLayer.h" #include "platform/scroll/ScrollbarTheme.h" #include "platform/scroll/ScrollbarThemeMock.h" +#include "platform/testing/FakeGraphicsLayer.h" #include "platform/testing/TestingPlatformSupport.h" #include "public/platform/Platform.h" #include "testing/gmock/include/gmock/gmock.h" @@ -156,17 +157,12 @@ bool isTrackingPaintInvalidations() const override { return true; } }; -class MockGraphicsLayer : public GraphicsLayer { -public: - explicit MockGraphicsLayer(GraphicsLayerClient* client) : GraphicsLayer(client) { } -}; - TEST_F(ScrollableAreaTest, ScrollbarGraphicsLayerInvalidation) { ScrollbarTheme::setMockScrollbarsEnabled(true); RawPtr<MockScrollableArea> scrollableArea = MockScrollableArea::create(IntPoint(0, 100)); MockGraphicsLayerClient graphicsLayerClient; - MockGraphicsLayer graphicsLayer(&graphicsLayerClient); + FakeGraphicsLayer graphicsLayer(&graphicsLayerClient); graphicsLayer.setDrawsContent(true); graphicsLayer.setSize(FloatSize(111, 222)); @@ -229,10 +225,10 @@ // Composited scrollbars only need repainting when parts become invalid // (e.g. if the track changes appearance when the thumb reaches the end). MockGraphicsLayerClient graphicsLayerClient; - MockGraphicsLayer layerForHorizontalScrollbar(&graphicsLayerClient); + FakeGraphicsLayer layerForHorizontalScrollbar(&graphicsLayerClient); layerForHorizontalScrollbar.setDrawsContent(true); layerForHorizontalScrollbar.setSize(FloatSize(10, 10)); - MockGraphicsLayer layerForVerticalScrollbar(&graphicsLayerClient); + FakeGraphicsLayer layerForVerticalScrollbar(&graphicsLayerClient); layerForVerticalScrollbar.setDrawsContent(true); layerForVerticalScrollbar.setSize(FloatSize(10, 10)); EXPECT_CALL(*scrollableArea, layerForHorizontalScrollbar()).WillRepeatedly(Return(&layerForHorizontalScrollbar));
diff --git a/third_party/WebKit/Source/platform/testing/FakeGraphicsLayer.h b/third_party/WebKit/Source/platform/testing/FakeGraphicsLayer.h new file mode 100644 index 0000000..3189ba61 --- /dev/null +++ b/third_party/WebKit/Source/platform/testing/FakeGraphicsLayer.h
@@ -0,0 +1,18 @@ +// 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. + +#ifndef FakeGraphicsLayer_h +#define FakeGraphicsLayer_h + +namespace blink { + +// A simple GraphicsLayer implementation suitable for use in unit tests. +class FakeGraphicsLayer : public GraphicsLayer { +public: + explicit FakeGraphicsLayer(GraphicsLayerClient* client) : GraphicsLayer(client) { } +}; + +} // namespace blink + +#endif // FakeGraphicsLayer_h
diff --git a/third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp b/third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp index 9691763..c014507 100644 --- a/third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp +++ b/third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp
@@ -39,14 +39,14 @@ USING_FAST_MALLOC(LineBreakIteratorPool); WTF_MAKE_NONCOPYABLE(LineBreakIteratorPool); public: + LineBreakIteratorPool() { } + static LineBreakIteratorPool& sharedPool() { static WTF::ThreadSpecific<LineBreakIteratorPool>* pool = new WTF::ThreadSpecific<LineBreakIteratorPool>; return **pool; } - static PassOwnPtr<LineBreakIteratorPool> create() { return adoptPtr(new LineBreakIteratorPool); } - icu::BreakIterator* take(const AtomicString& locale) { icu::BreakIterator* iterator = 0; @@ -93,16 +93,12 @@ } private: - LineBreakIteratorPool() { } - static const size_t capacity = 4; typedef std::pair<AtomicString, icu::BreakIterator*> Entry; typedef Vector<Entry, capacity> Pool; Pool m_pool; HashMap<icu::BreakIterator*, AtomicString> m_vendedIterators; - - friend WTF::ThreadSpecific<LineBreakIteratorPool>::operator LineBreakIteratorPool*(); }; enum TextContext { NoContext, PriorContext, PrimaryContext };
diff --git a/third_party/WebKit/Source/platform/web_process_memory_dump_impl.h b/third_party/WebKit/Source/platform/web_process_memory_dump_impl.h index 2c5db22..9f16b5a 100644 --- a/third_party/WebKit/Source/platform/web_process_memory_dump_impl.h +++ b/third_party/WebKit/Source/platform/web_process_memory_dump_impl.h
@@ -7,6 +7,7 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/trace_event/memory_dump_request_args.h" #include "public/platform/WebProcessMemoryDump.h" #include "wtf/HashMap.h"
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h index 6594a9fb..6b06883 100644 --- a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h +++ b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h
@@ -170,9 +170,9 @@ bool isGrantedUniversalAccess() const { return m_universalAccess; } bool canAccessDatabase() const { return !isUnique(); } - bool canAccessLocalStorage() const { return !isUnique(); } + bool canAccessLocalStorage() const { return !isUnique() && !hasSuborigin(); } bool canAccessSharedWorkers() const { return !isUnique(); } - bool canAccessServiceWorkers() const { return !isUnique(); } + bool canAccessServiceWorkers() const { return !isUnique() && !hasSuborigin(); } bool canAccessCookies() const { return !isUnique(); } bool canAccessPasswordManager() const { return !isUnique(); } bool canAccessFileSystem() const { return !isUnique(); }
diff --git a/third_party/WebKit/Source/web/AssociatedURLLoader.cpp b/third_party/WebKit/Source/web/AssociatedURLLoader.cpp index 62f393e..6bff687 100644 --- a/third_party/WebKit/Source/web/AssociatedURLLoader.cpp +++ b/third_party/WebKit/Source/web/AssociatedURLLoader.cpp
@@ -171,8 +171,8 @@ , m_enableErrorNotifications(false) , m_didFail(false) { - ASSERT(m_loader); - ASSERT(m_client); + DCHECK(m_loader); + DCHECK(m_client); } void AssociatedURLLoader::ClientAdapter::willFollowRedirect(ResourceRequest& newRequest, const ResourceResponse& redirectResponse) @@ -229,7 +229,7 @@ if (!m_client) return; - RELEASE_ASSERT(dataLength <= static_cast<unsigned>(std::numeric_limits<int>::max())); + CHECK_LE(dataLength, static_cast<unsigned>(std::numeric_limits<int>::max())); m_client->didReceiveData(m_loader, data, dataLength, -1); } @@ -292,7 +292,7 @@ , m_options(options) , m_client(0) { - ASSERT(m_frameImpl); + DCHECK(m_frameImpl); } AssociatedURLLoader::~AssociatedURLLoader() @@ -314,16 +314,16 @@ void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data) { - ASSERT(0); // Synchronous loading is not supported. + DCHECK(0); // Synchronous loading is not supported. } void AssociatedURLLoader::loadAsynchronously(const WebURLRequest& request, WebURLLoaderClient* client) { - ASSERT(!m_loader); - ASSERT(!m_client); + DCHECK(!m_loader); + DCHECK(!m_client); m_client = client; - ASSERT(m_client); + DCHECK(m_client); bool allowLoad = true; WebURLRequest newRequest(request); @@ -358,7 +358,7 @@ } Document* webcoreDocument = m_frameImpl->frame()->document(); - ASSERT(webcoreDocument); + DCHECK(webcoreDocument); m_loader = DocumentThreadableLoader::create(*webcoreDocument, m_clientAdapter.get(), options, resourceLoaderOptions); m_loader->start(webcoreRequest); }
diff --git a/third_party/WebKit/Source/web/AudioOutputDeviceClientImpl.cpp b/third_party/WebKit/Source/web/AudioOutputDeviceClientImpl.cpp index 392bdba..84f42b8 100644 --- a/third_party/WebKit/Source/web/AudioOutputDeviceClientImpl.cpp +++ b/third_party/WebKit/Source/web/AudioOutputDeviceClientImpl.cpp
@@ -26,7 +26,8 @@ void AudioOutputDeviceClientImpl::checkIfAudioSinkExistsAndIsAuthorized(ExecutionContext* context, const WebString& sinkId, PassOwnPtr<WebSetSinkIdCallbacks> callbacks) { - ASSERT(context && context->isDocument()); + DCHECK(context); + DCHECK(context->isDocument()); Document* document = toDocument(context); WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame()); webFrame->client()->checkIfAudioSinkExistsAndIsAuthorized(sinkId, WebSecurityOrigin(context->getSecurityOrigin()), callbacks.leakPtr());
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp index 5ab1636..2de9423 100644 --- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp +++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -343,7 +343,7 @@ return nullptr; WebNavigationPolicy policy = effectiveNavigationPolicy(navigationPolicy, features); - ASSERT(frame->document()); + DCHECK(frame->document()); Fullscreen::fullyExitFullscreen(*frame->document()); WebViewImpl* newView = toWebViewImpl( @@ -527,7 +527,7 @@ void ChromeClientImpl::scheduleAnimation(Widget* widget) { - ASSERT(widget->isFrameView()); + DCHECK(widget->isFrameView()); FrameView* view = toFrameView(widget); LocalFrame* frame = view->frame().localFrameRoot(); @@ -549,7 +549,7 @@ { WebRect screenRect(rectInViewport); - ASSERT(widget->isFrameView()); + DCHECK(widget->isFrameView()); const FrameView* view = toFrameView(widget); LocalFrame* frame = view->frame().localFrameRoot(); WebWidgetClient* client = nullptr; @@ -712,8 +712,8 @@ WebFileChooserCompletionImpl* chooserCompletion = new WebFileChooserCompletionImpl(fileChooser); - ASSERT(fileChooser); - ASSERT(fileChooser->settings().selectedFiles.size()); + DCHECK(fileChooser); + DCHECK(fileChooser->settings().selectedFiles.size()); // If the enumeration can't happen, call the callback with an empty list. if (!client->enumerateChosenDirectory(fileChooser->settings().selectedFiles[0], chooserCompletion)) @@ -751,8 +751,8 @@ m_webView->client()->didChangeCursor(cursor); } else { WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); - ASSERT(webFrame); - ASSERT(webFrame->frameWidget()); + DCHECK(webFrame); + DCHECK(webFrame->frameWidget()); if (toWebFrameWidgetImpl(webFrame->frameWidget())->client()) toWebFrameWidgetImpl(webFrame->frameWidget())->client()->didChangeCursor(cursor); } @@ -798,8 +798,8 @@ m_webView->setRootGraphicsLayer(rootLayer); return; } - ASSERT(webFrame); - ASSERT(webFrame->frameWidget()); + DCHECK(webFrame); + DCHECK(webFrame->frameWidget()); toWebFrameWidgetImpl(webFrame->frameWidget())->setRootGraphicsLayer(rootLayer); } } @@ -825,8 +825,8 @@ m_webView->attachCompositorAnimationTimeline(compositorTimeline); return; } - ASSERT(webFrame); - ASSERT(webFrame->frameWidget()); + DCHECK(webFrame); + DCHECK(webFrame->frameWidget()); toWebFrameWidgetImpl(webFrame->frameWidget())->attachCompositorAnimationTimeline(compositorTimeline); } } @@ -845,8 +845,8 @@ m_webView->detachCompositorAnimationTimeline(compositorTimeline); return; } - ASSERT(webFrame); - ASSERT(webFrame->frameWidget()); + DCHECK(webFrame); + DCHECK(webFrame->frameWidget()); toWebFrameWidgetImpl(webFrame->frameWidget())->detachCompositorAnimationTimeline(compositorTimeline); } } @@ -882,7 +882,7 @@ if (WebViewImpl::useExternalPopupMenus()) return new ExternalPopupMenu(frame, select, *m_webView); - ASSERT(RuntimeEnabledFeatures::pagePopupEnabled()); + DCHECK(RuntimeEnabledFeatures::pagePopupEnabled()); return PopupMenuImpl::create(this, select); } @@ -1061,14 +1061,14 @@ void ChromeClientImpl::registerPopupOpeningObserver(PopupOpeningObserver* observer) { - ASSERT(observer); + DCHECK(observer); m_popupOpeningObservers.append(observer); } void ChromeClientImpl::unregisterPopupOpeningObserver(PopupOpeningObserver* observer) { size_t index = m_popupOpeningObservers.find(observer); - ASSERT(index != kNotFound); + DCHECK_NE(index, kNotFound); m_popupOpeningObservers.remove(index); }
diff --git a/third_party/WebKit/Source/web/ColorChooserPopupUIController.cpp b/third_party/WebKit/Source/web/ColorChooserPopupUIController.cpp index 2ffeae0..bd1b92e7 100644 --- a/third_party/WebKit/Source/web/ColorChooserPopupUIController.cpp +++ b/third_party/WebKit/Source/web/ColorChooserPopupUIController.cpp
@@ -125,8 +125,8 @@ void ColorChooserPopupUIController::setValueAndClosePopup(int numValue, const String& stringValue) { - ASSERT(m_popup); - ASSERT(m_client); + DCHECK(m_popup); + DCHECK(m_client); if (numValue == ColorPickerPopupActionSetValue) setValue(stringValue); if (numValue == ColorPickerPopupActionChooseOtherColor) @@ -136,7 +136,7 @@ void ColorChooserPopupUIController::setValue(const String& value) { - ASSERT(m_client); + DCHECK(m_client); Color color; bool success = color.setFromString(value); ASSERT_UNUSED(success, success); @@ -158,7 +158,7 @@ void ColorChooserPopupUIController::openPopup() { - ASSERT(!m_popup); + DCHECK(!m_popup); m_popup = m_chromeClient->openPagePopup(this); }
diff --git a/third_party/WebKit/Source/web/ColorChooserUIController.cpp b/third_party/WebKit/Source/web/ColorChooserUIController.cpp index cf6e0f1b..93ebd3c 100644 --- a/third_party/WebKit/Source/web/ColorChooserUIController.cpp +++ b/third_party/WebKit/Source/web/ColorChooserUIController.cpp
@@ -80,7 +80,7 @@ void ColorChooserUIController::didChooseColor(const WebColor& color) { - ASSERT(m_client); + DCHECK(m_client); m_client->didChooseColor(Color(static_cast<RGBA32>(color))); } @@ -93,7 +93,7 @@ void ColorChooserUIController::openColorChooser() { - ASSERT(!m_chooser); + DCHECK(!m_chooser); WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(m_frame); WebFrameClient* webFrameClient = frame->client(); if (!webFrameClient)
diff --git a/third_party/WebKit/Source/web/ContextFeaturesClientImpl.cpp b/third_party/WebKit/Source/web/ContextFeaturesClientImpl.cpp index 4f61b87..e55239a 100644 --- a/third_party/WebKit/Source/web/ContextFeaturesClientImpl.cpp +++ b/third_party/WebKit/Source/web/ContextFeaturesClientImpl.cpp
@@ -56,7 +56,7 @@ bool isEnabled() const { - ASSERT(m_value != NeedsRefresh); + DCHECK_NE(m_value, NeedsRefresh); return m_value == IsEnabled; } @@ -126,7 +126,7 @@ bool ContextFeaturesClientImpl::isEnabled(Document* document, ContextFeatures::FeatureType type, bool defaultValue) { - ASSERT(document); + DCHECK(document); ContextFeaturesCache::Entry& cache = ContextFeaturesCache::from(*document).entryFor(type); if (cache.needsRefresh(defaultValue)) cache.set(askIfIsEnabled(document, type, defaultValue), defaultValue); @@ -135,7 +135,7 @@ void ContextFeaturesClientImpl::urlDidChange(Document* document) { - ASSERT(document); + DCHECK(document); ContextFeaturesCache::from(*document).validateAgainst(document); }
diff --git a/third_party/WebKit/Source/web/DatabaseClientImpl.cpp b/third_party/WebKit/Source/web/DatabaseClientImpl.cpp index be93f9f..a301c60 100644 --- a/third_party/WebKit/Source/web/DatabaseClientImpl.cpp +++ b/third_party/WebKit/Source/web/DatabaseClientImpl.cpp
@@ -53,7 +53,7 @@ bool DatabaseClientImpl::allowDatabase(ExecutionContext* executionContext, const String& name, const String& displayName, unsigned long estimatedSize) { - ASSERT(executionContext->isContextThread()); + DCHECK(executionContext->isContextThread()); Document* document = toDocument(executionContext); WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame()); if (!webFrame)
diff --git a/third_party/WebKit/Source/web/DateTimeChooserImpl.cpp b/third_party/WebKit/Source/web/DateTimeChooserImpl.cpp index c63522a..f32233f 100644 --- a/third_party/WebKit/Source/web/DateTimeChooserImpl.cpp +++ b/third_party/WebKit/Source/web/DateTimeChooserImpl.cpp
@@ -52,8 +52,8 @@ , m_parameters(parameters) , m_locale(Locale::create(parameters.locale)) { - ASSERT(m_chromeClient); - ASSERT(m_client); + DCHECK(m_chromeClient); + DCHECK(m_client); m_popup = m_chromeClient->openPagePopup(this); } @@ -205,7 +205,7 @@ void DateTimeChooserImpl::didClosePopup() { - ASSERT(m_client); + DCHECK(m_client); m_popup = nullptr; m_client->didEndChooser(); }
diff --git a/third_party/WebKit/Source/web/DragClientImpl.cpp b/third_party/WebKit/Source/web/DragClientImpl.cpp index bf8f662..d7b7979 100644 --- a/third_party/WebKit/Source/web/DragClientImpl.cpp +++ b/third_party/WebKit/Source/web/DragClientImpl.cpp
@@ -72,7 +72,7 @@ float deviceScaleFactor = m_webView->client()->screenInfo().deviceScaleFactor; if (deviceScaleFactor != resolutionScale) { - ASSERT(resolutionScale > 0); + DCHECK_GT(resolutionScale, 0); float scale = deviceScaleFactor / resolutionScale; dragImage->scale(scale, scale); }
diff --git a/third_party/WebKit/Source/web/ExternalDateTimeChooser.cpp b/third_party/WebKit/Source/web/ExternalDateTimeChooser.cpp index ba6b512f..8d9719b1 100644 --- a/third_party/WebKit/Source/web/ExternalDateTimeChooser.cpp +++ b/third_party/WebKit/Source/web/ExternalDateTimeChooser.cpp
@@ -78,12 +78,12 @@ ExternalDateTimeChooser::ExternalDateTimeChooser(DateTimeChooserClient* client) : m_client(client) { - ASSERT(client); + DCHECK(client); } RawPtr<ExternalDateTimeChooser> ExternalDateTimeChooser::create(ChromeClientImpl* chromeClient, WebViewClient* webViewClient, DateTimeChooserClient* client, const DateTimeChooserParameters& parameters) { - ASSERT(chromeClient); + DCHECK(chromeClient); RawPtr<ExternalDateTimeChooser> chooser = new ExternalDateTimeChooser(client); if (!chooser->openDateTimeChooser(chromeClient, webViewClient, parameters)) chooser.clear();
diff --git a/third_party/WebKit/Source/web/FindInPageCoordinates.cpp b/third_party/WebKit/Source/web/FindInPageCoordinates.cpp index 86186c98..1e09e7b7 100644 --- a/third_party/WebKit/Source/web/FindInPageCoordinates.cpp +++ b/third_party/WebKit/Source/web/FindInPageCoordinates.cpp
@@ -48,7 +48,7 @@ static const LayoutBlock* enclosingScrollableAncestor(const LayoutObject* layoutObject) { - ASSERT(!layoutObject->isLayoutView()); + DCHECK(!layoutObject->isLayoutView()); // Trace up the containingBlocks until we reach either the layoutObject view or a scrollable object. const LayoutBlock* container = layoutObject->containingBlock(); @@ -59,9 +59,9 @@ static FloatRect toNormalizedRect(const FloatRect& absoluteRect, const LayoutObject* layoutObject, const LayoutBlock* container) { - ASSERT(layoutObject); + DCHECK(layoutObject); - ASSERT(container || layoutObject->isLayoutView()); + DCHECK(container || layoutObject->isLayoutView()); if (!container) return FloatRect(); @@ -117,7 +117,7 @@ layoutObject = container; } - ASSERT(layoutObject->isLayoutView()); + DCHECK(layoutObject->isLayoutView()); // Jump to the layoutObject owning the frame, if any. layoutObject = layoutObject->frame() ? layoutObject->frame()->ownerLayoutObject() : 0;
diff --git a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp index 881f8a6..5a31bc5 100644 --- a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp +++ b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp
@@ -659,7 +659,7 @@ { if (!m_webFrame->client()) return; - ASSERT(m_webFrame->frame()->document()); + DCHECK(m_webFrame->frame()->document()); Fullscreen::fullyExitFullscreen(*m_webFrame->frame()->document()); m_webFrame->client()->loadURLExternally( WrappedResourceRequest(request), static_cast<WebNavigationPolicy>(policy), suggestedName, shouldReplaceCurrentEntry); @@ -671,7 +671,7 @@ if (!webview->client()) return false; - ASSERT(offset); + DCHECK(offset); if (offset > webview->client()->historyForwardListCount()) return false; if (offset < -webview->client()->historyBackListCount()) @@ -932,7 +932,7 @@ { if (!m_webFrame->client()) return; - ASSERT(m_webFrame->getSecurityOrigin().isUnique()); + DCHECK(m_webFrame->getSecurityOrigin().isUnique()); m_webFrame->client()->didUpdateToUniqueOrigin(m_webFrame->getSecurityOrigin().isPotentiallyTrustworthy()); }
diff --git a/third_party/WebKit/Source/web/FullscreenController.cpp b/third_party/WebKit/Source/web/FullscreenController.cpp index 11b1ac3..19b19ee 100644 --- a/third_party/WebKit/Source/web/FullscreenController.cpp +++ b/third_party/WebKit/Source/web/FullscreenController.cpp
@@ -79,7 +79,7 @@ } Fullscreen::from(document).didEnterFullScreenForElement(element.get()); - ASSERT(Fullscreen::currentFullScreenElementFrom(document) == element); + DCHECK_EQ(Fullscreen::currentFullScreenElementFrom(document), element); if (isHTMLVideoElement(element)) { HTMLVideoElement* videoElement = toHTMLVideoElement(element); @@ -157,7 +157,7 @@ void FullscreenController::exitFullScreenForElement(Element* element) { - ASSERT(element); + DCHECK(element); // The client is exiting full screen, so don't send a notification. if (m_isCancelingFullScreen)
diff --git a/third_party/WebKit/Source/web/InspectorOverlay.cpp b/third_party/WebKit/Source/web/InspectorOverlay.cpp index a18cd7d..cff0af0 100644 --- a/third_party/WebKit/Source/web/InspectorOverlay.cpp +++ b/third_party/WebKit/Source/web/InspectorOverlay.cpp
@@ -117,7 +117,7 @@ // Skip cache because the following paint may conflict with the view's real painting. DisplayItemCacheSkipper cacheSkipper(graphicsContext); FrameView* view = m_overlay->overlayMainFrame()->view(); - ASSERT(!view->needsLayout()); + DCHECK(!view->needsLayout()); view->paint(graphicsContext, CullRect(IntRect(0, 0, view->width(), view->height()))); } @@ -193,7 +193,7 @@ InspectorOverlay::~InspectorOverlay() { - ASSERT(!m_overlayPage); + DCHECK(!m_overlayPage); } DEFINE_TRACE(InspectorOverlay) @@ -471,7 +471,7 @@ DEFINE_STATIC_LOCAL(Persistent<FrameLoaderClient>, dummyFrameLoaderClient, (EmptyFrameLoaderClient::create())); Page::PageClients pageClients; fillWithEmptyClients(pageClients); - ASSERT(!m_overlayChromeClient); + DCHECK(!m_overlayChromeClient); m_overlayChromeClient = InspectorOverlayChromeClient::create(m_webViewImpl->page()->chromeClient(), *this); pageClients.chromeClient = m_overlayChromeClient.get(); m_overlayPage = Page::create(pageClients); @@ -507,11 +507,11 @@ loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html", "UTF-8", KURL(), ForceSynchronousLoad))); v8::Isolate* isolate = toIsolate(frame.get()); ScriptState* scriptState = ScriptState::forMainWorld(frame.get()); - ASSERT(scriptState); + DCHECK(scriptState); ScriptState::Scope scope(scriptState); v8::Local<v8::Object> global = scriptState->context()->Global(); v8::Local<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), global, isolate); - ASSERT(!overlayHostObj.IsEmpty()); + DCHECK(!overlayHostObj.IsEmpty()); v8CallOrCrash(global->Set(scriptState->context(), v8AtomicString(isolate, "InspectorOverlayHost"), overlayHostObj)); #if OS(WIN) @@ -609,37 +609,37 @@ void InspectorOverlay::overlayStartedPropertyChange(const String& property) { - ASSERT(m_layoutEditor); + DCHECK(m_layoutEditor); m_layoutEditor->overlayStartedPropertyChange(property); } void InspectorOverlay::overlayPropertyChanged(float value) { - ASSERT(m_layoutEditor); + DCHECK(m_layoutEditor); m_layoutEditor->overlayPropertyChanged(value); } void InspectorOverlay::overlayEndedPropertyChange() { - ASSERT(m_layoutEditor); + DCHECK(m_layoutEditor); m_layoutEditor->overlayEndedPropertyChange(); } void InspectorOverlay::overlayNextSelector() { - ASSERT(m_layoutEditor); + DCHECK(m_layoutEditor); m_layoutEditor->nextSelector(); } void InspectorOverlay::overlayPreviousSelector() { - ASSERT(m_layoutEditor); + DCHECK(m_layoutEditor); m_layoutEditor->previousSelector(); } void InspectorOverlay::overlayClearSelection(bool commitChanges) { - ASSERT(m_layoutEditor); + DCHECK(m_layoutEditor); m_hoveredNodeForInspectMode = m_layoutEditor->element(); if (commitChanges)
diff --git a/third_party/WebKit/Source/web/LinkHighlightImpl.cpp b/third_party/WebKit/Source/web/LinkHighlightImpl.cpp index e5a6bdd..6c638d1 100644 --- a/third_party/WebKit/Source/web/LinkHighlightImpl.cpp +++ b/third_party/WebKit/Source/web/LinkHighlightImpl.cpp
@@ -75,17 +75,17 @@ , m_isAnimating(false) , m_startTime(monotonicallyIncreasingTime()) { - ASSERT(m_node); - ASSERT(owningWebViewImpl); + DCHECK(m_node); + DCHECK(owningWebViewImpl); WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport(); - ASSERT(compositorSupport); + DCHECK(compositorSupport); m_contentLayer = adoptPtr(compositorSupport->createContentLayer(this)); m_clipLayer = adoptPtr(compositorSupport->createLayer()); m_clipLayer->setTransformOrigin(WebFloatPoint3D()); m_clipLayer->addChild(m_contentLayer->layer()); m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimationPlayer()); - ASSERT(m_compositorPlayer); + DCHECK(m_compositorPlayer); m_compositorPlayer->setAnimationDelegate(this); if (m_owningWebViewImpl->linkHighlightsTimeline()) m_owningWebViewImpl->linkHighlightsTimeline()->playerAttached(*this); @@ -146,7 +146,7 @@ static void convertTargetSpaceQuadToCompositedLayer(const FloatQuad& targetSpaceQuad, LayoutObject* targetLayoutObject, const LayoutBoxModelObject& paintInvalidationContainer, FloatQuad& compositedSpaceQuad) { - ASSERT(targetLayoutObject); + DCHECK(targetLayoutObject); for (unsigned i = 0; i < 4; ++i) { IntPoint point; switch (i) { @@ -216,7 +216,7 @@ // Get quads for node in absolute coordinates. Vector<FloatQuad> quads; computeQuads(*m_node, quads); - ASSERT(quads.size()); + DCHECK(quads.size()); Path newPath; for (size_t quadIndex = 0; quadIndex < quads.size(); ++quadIndex) {
diff --git a/third_party/WebKit/Source/web/LocalFileSystemClient.cpp b/third_party/WebKit/Source/web/LocalFileSystemClient.cpp index 6587418..a48522c 100644 --- a/third_party/WebKit/Source/web/LocalFileSystemClient.cpp +++ b/third_party/WebKit/Source/web/LocalFileSystemClient.cpp
@@ -53,19 +53,19 @@ bool LocalFileSystemClient::requestFileSystemAccessSync(ExecutionContext* context) { - ASSERT(context); + DCHECK(context); if (context->isDocument()) { ASSERT_NOT_REACHED(); return false; } - ASSERT(context->isWorkerGlobalScope()); + DCHECK(context->isWorkerGlobalScope()); return WorkerContentSettingsClient::from(*toWorkerGlobalScope(context))->requestFileSystemAccessSync(); } void LocalFileSystemClient::requestFileSystemAccessAsync(ExecutionContext* context, PassOwnPtr<ContentSettingCallbacks> callbacks) { - ASSERT(context); + DCHECK(context); if (!context->isDocument()) { ASSERT_NOT_REACHED(); return;
diff --git a/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp b/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp index 885b0b48..6f6f381 100644 --- a/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp +++ b/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp
@@ -59,10 +59,11 @@ ScriptPromise NotificationPermissionClientImpl::requestPermission(ScriptState* scriptState, NotificationPermissionCallback* deprecatedCallback) { - ASSERT(scriptState); + DCHECK(scriptState); ExecutionContext* context = scriptState->getExecutionContext(); - ASSERT(context && context->isDocument()); + DCHECK(context); + DCHECK(context->isDocument()); Document* document = toDocument(context); WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame());
diff --git a/third_party/WebKit/Source/web/PageOverlay.cpp b/third_party/WebKit/Source/web/PageOverlay.cpp index 156ad70..34ebc84 100644 --- a/third_party/WebKit/Source/web/PageOverlay.cpp +++ b/third_party/WebKit/Source/web/PageOverlay.cpp
@@ -99,7 +99,7 @@ LayoutRect PageOverlay::visualRect() const { - ASSERT(m_layer.get()); + DCHECK(m_layer.get()); return LayoutRect(FloatPoint(), m_layer->size()); } @@ -110,7 +110,7 @@ void PageOverlay::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& gc, GraphicsLayerPaintingPhase phase, const IntRect& interestRect) const { - ASSERT(m_layer); + DCHECK(m_layer); m_delegate->paintPageOverlay(*this, gc, interestRect.size()); }
diff --git a/third_party/WebKit/Source/web/PopupMenuImpl.cpp b/third_party/WebKit/Source/web/PopupMenuImpl.cpp index 8a6001f..de694c6 100644 --- a/third_party/WebKit/Source/web/PopupMenuImpl.cpp +++ b/third_party/WebKit/Source/web/PopupMenuImpl.cpp
@@ -169,7 +169,7 @@ , m_isInGroup(false) , m_buffer(buffer) { - ASSERT(m_buffer); + DCHECK(m_buffer); #if OS(LINUX) // On other platforms, the <option> background color is the same as the // <select> background color. On Linux, that makes the <option> @@ -182,7 +182,7 @@ void serializeBaseStyle() { - ASSERT(!m_isInGroup); + DCHECK(!m_isInGroup); PagePopupClient::addString("baseStyle: {", m_buffer); addProperty("backgroundColor", m_backgroundColor.serialized(), m_buffer); addProperty("color", baseStyle().visitedDependentColor(CSSPropertyColor).serialized(), m_buffer); @@ -208,7 +208,7 @@ const FontDescription& baseFont() { return m_isInGroup ? m_groupStyle->getFontDescription() : m_baseStyle.getFontDescription(); } void startGroupChildren(const ComputedStyle& groupStyle) { - ASSERT(!m_isInGroup); + DCHECK(!m_isInGroup); PagePopupClient::addString("children: [", m_buffer); m_isInGroup = true; m_groupStyle = &groupStyle; @@ -248,7 +248,7 @@ PopupMenuImpl::~PopupMenuImpl() { - ASSERT(!m_popup); + DCHECK(!m_popup); } DEFINE_TRACE(PopupMenuImpl) @@ -304,7 +304,7 @@ void PopupMenuImpl::addElementStyle(ItemIterationContext& context, HTMLElement& element) { const ComputedStyle* style = m_ownerElement->itemComputedStyle(element); - ASSERT(style); + DCHECK(style); SharedBuffer* data = context.m_buffer; // TODO(tkent): We generate unnecessary "style: {\n},\n" even if no // additional style. @@ -404,12 +404,12 @@ void PopupMenuImpl::setValueAndClosePopup(int numValue, const String& stringValue) { - ASSERT(m_popup); - ASSERT(m_ownerElement); + DCHECK(m_popup); + DCHECK(m_ownerElement); RawPtr<PopupMenuImpl> protector(this); bool success; int listIndex = stringValue.toInt(&success); - ASSERT(success); + DCHECK(success); { EventQueueScope scope; m_ownerElement->valueChanged(listIndex); @@ -431,10 +431,10 @@ void PopupMenuImpl::setValue(const String& value) { - ASSERT(m_ownerElement); + DCHECK(m_ownerElement); bool success; int listIndex = value.toInt(&success); - ASSERT(success); + DCHECK(success); m_ownerElement->provisionalSelectionChanged(listIndex); } @@ -473,7 +473,7 @@ void PopupMenuImpl::show() { - ASSERT(!m_popup); + DCHECK(!m_popup); m_popup = m_chromeClient->openPagePopup(this); }
diff --git a/third_party/WebKit/Source/web/RemoteFrameOwner.cpp b/third_party/WebKit/Source/web/RemoteFrameOwner.cpp index 9a1270d9..07da06f 100644 --- a/third_party/WebKit/Source/web/RemoteFrameOwner.cpp +++ b/third_party/WebKit/Source/web/RemoteFrameOwner.cpp
@@ -58,7 +58,7 @@ void RemoteFrameOwner::clearContentFrame() { - ASSERT(m_frame->owner() == this); + DCHECK_EQ(m_frame->owner(), this); m_frame = nullptr; #if !ENABLE(OILPAN) // Balance the ref() in setContentFrame().
diff --git a/third_party/WebKit/Source/web/RotationViewportAnchor.cpp b/third_party/WebKit/Source/web/RotationViewportAnchor.cpp index 674c933..8cf14252 100644 --- a/third_party/WebKit/Source/web/RotationViewportAnchor.cpp +++ b/third_party/WebKit/Source/web/RotationViewportAnchor.cpp
@@ -122,10 +122,10 @@ return; // Inner rectangle should be within the outer one. - ASSERT(outerViewRect.contains(innerViewRect)); + DCHECK(outerViewRect.contains(innerViewRect)); // Outer rectangle is used as a scale, we need positive width and height. - ASSERT(!outerViewRect.isEmpty()); + DCHECK(!outerViewRect.isEmpty()); m_normalizedVisualViewportOffset = FloatSize(innerViewRect.location() - outerViewRect.location());
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp index c9c4d368..bbdcbbe7 100644 --- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp +++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
@@ -43,10 +43,6 @@ #include "modules/fetch/Headers.h" #include "modules/geofencing/CircularGeofencingRegion.h" #include "modules/geofencing/GeofencingEvent.h" -#include "modules/navigatorconnect/AcceptConnectionObserver.h" -#include "modules/navigatorconnect/CrossOriginServiceWorkerClient.h" -#include "modules/navigatorconnect/ServicePortCollection.h" -#include "modules/navigatorconnect/WorkerNavigatorServices.h" #include "modules/notifications/Notification.h" #include "modules/notifications/NotificationEvent.h" #include "modules/notifications/NotificationEventInit.h" @@ -61,7 +57,6 @@ #include "modules/serviceworkers/ServiceWorkerWindowClient.h" #include "modules/serviceworkers/WaitUntilObserver.h" #include "platform/RuntimeEnabledFeatures.h" -#include "public/platform/WebCrossOriginServiceWorkerClient.h" #include "public/platform/modules/notifications/WebNotificationData.h" #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h" @@ -82,7 +77,7 @@ ServiceWorkerGlobalScopeProxy::~ServiceWorkerGlobalScopeProxy() { // Verify that the proxy has been detached. - ASSERT(!m_embeddedWorker); + DCHECK(!m_embeddedWorker); } DEFINE_TRACE(ServiceWorkerGlobalScopeProxy) @@ -105,7 +100,7 @@ void ServiceWorkerGlobalScopeProxy::dispatchExtendableMessageEvent(int eventID, const WebString& message, const WebSecurityOrigin& sourceOrigin, const WebMessagePortChannelArray& webChannels, const WebServiceWorkerClientInfo& client) { - ASSERT(RuntimeEnabledFeatures::serviceWorkerExtendableMessageEventEnabled()); + DCHECK(RuntimeEnabledFeatures::serviceWorkerExtendableMessageEventEnabled()); WebSerializedScriptValue value = WebSerializedScriptValue::fromString(message); MessagePortArray* ports = MessagePort::toMessagePortArray(m_workerGlobalScope, webChannels); @@ -125,7 +120,7 @@ void ServiceWorkerGlobalScopeProxy::dispatchExtendableMessageEvent(int eventID, const WebString& message, const WebSecurityOrigin& sourceOrigin, const WebMessagePortChannelArray& webChannels, WebPassOwnPtr<WebServiceWorker::Handle> handle) { - ASSERT(RuntimeEnabledFeatures::serviceWorkerExtendableMessageEventEnabled()); + DCHECK(RuntimeEnabledFeatures::serviceWorkerExtendableMessageEventEnabled()); WebSerializedScriptValue value = WebSerializedScriptValue::fromString(message); MessagePortArray* ports = MessagePort::toMessagePortArray(m_workerGlobalScope, webChannels); @@ -201,13 +196,6 @@ workerGlobalScope()->dispatchExtendableEvent(event.release(), observer); } -void ServiceWorkerGlobalScopeProxy::dispatchServicePortConnectEvent(WebServicePortConnectEventCallbacks* rawCallbacks, const WebURL& targetURL, const WebString& origin, WebServicePortID portID) -{ - OwnPtr<WebServicePortConnectEventCallbacks> callbacks = adoptPtr(rawCallbacks); - ServicePortCollection* collection = WorkerNavigatorServices::services(workerGlobalScope(), *workerGlobalScope()->navigator()); - collection->dispatchConnectEvent(callbacks.release(), targetURL, origin, portID); -} - void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID, const WebString& tag, LastChanceOption lastChance) { if (!RuntimeEnabledFeatures::backgroundSyncEnabled()) { @@ -219,16 +207,6 @@ workerGlobalScope()->dispatchExtendableEvent(event.release(), observer); } -void ServiceWorkerGlobalScopeProxy::dispatchCrossOriginMessageEvent(const WebCrossOriginServiceWorkerClient& webClient, const WebString& message, const WebMessagePortChannelArray& webChannels) -{ - MessagePortArray* ports = MessagePort::toMessagePortArray(workerGlobalScope(), webChannels); - WebSerializedScriptValue value = WebSerializedScriptValue::fromString(message); - // FIXME: Have proper source for this MessageEvent. - RawPtr<MessageEvent> event = MessageEvent::create(ports, value, webClient.origin.string()); - event->setType(EventTypeNames::crossoriginmessage); - workerGlobalScope()->dispatchEvent(event); -} - void ServiceWorkerGlobalScopeProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int) { client().reportException(errorMessage, lineNumber, columnNumber, sourceURL); @@ -241,7 +219,7 @@ void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& message) { - ASSERT(m_embeddedWorker); + DCHECK(m_embeddedWorker); document().postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbeddedWorkerImpl::postMessageToPageInspector, m_embeddedWorker, message)); } @@ -258,14 +236,14 @@ void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope* workerGlobalScope) { - ASSERT(!m_workerGlobalScope); + DCHECK(!m_workerGlobalScope); m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalScope); client().workerContextStarted(this); } void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() { - ASSERT(m_embeddedWorker); + DCHECK(m_embeddedWorker); document().postTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbeddedWorkerImpl::terminateWorkerContext, m_embeddedWorker)); } @@ -299,19 +277,19 @@ WebServiceWorkerContextClient& ServiceWorkerGlobalScopeProxy::client() const { - ASSERT(m_client); + DCHECK(m_client); return *m_client; } Document& ServiceWorkerGlobalScopeProxy::document() const { - ASSERT(m_document); + DCHECK(m_document); return *m_document; } ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() const { - ASSERT(m_workerGlobalScope); + DCHECK(m_workerGlobalScope); return m_workerGlobalScope; }
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h index 8a84d698..912b2487 100644 --- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h +++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h
@@ -72,7 +72,6 @@ // WebServiceWorkerContextProxy overrides: void setRegistration(WebPassOwnPtr<WebServiceWorkerRegistration::Handle>) override; void dispatchActivateEvent(int) override; - void dispatchCrossOriginMessageEvent(const WebCrossOriginServiceWorkerClient&, const WebString& message, const WebMessagePortChannelArray&) override; void dispatchExtendableMessageEvent(int eventID, const WebString& message, const WebSecurityOrigin& sourceOrigin, const WebMessagePortChannelArray&, const WebServiceWorkerClientInfo&) override; void dispatchExtendableMessageEvent(int eventID, const WebString& message, const WebSecurityOrigin& sourceOrigin, const WebMessagePortChannelArray&, WebPassOwnPtr<WebServiceWorker::Handle>) override; void dispatchFetchEvent(int, const WebServiceWorkerRequest&) override; @@ -83,7 +82,6 @@ void dispatchNotificationClickEvent(int, int64_t notificationID, const WebNotificationData&, int actionIndex) override; void dispatchNotificationCloseEvent(int, int64_t notificationID, const WebNotificationData&) override; void dispatchPushEvent(int, const WebString& data) override; - void dispatchServicePortConnectEvent(WebServicePortConnectEventCallbacks*, const WebURL& targetURL, const WebString& origin, WebServicePortID) override; void dispatchSyncEvent(int, const WebString& tag, LastChanceOption) override; // WorkerReportingProxy overrides:
diff --git a/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp b/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp index bbe63674..a7f489e7 100644 --- a/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp +++ b/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp
@@ -104,16 +104,16 @@ static WebSharedWorkerRepositoryClient::DocumentID getId(void* document) { - ASSERT(document); + DCHECK(document); return reinterpret_cast<WebSharedWorkerRepositoryClient::DocumentID>(document); } void SharedWorkerRepositoryClientImpl::connect(SharedWorker* worker, PassOwnPtr<WebMessagePortChannel> port, const KURL& url, const String& name, ExceptionState& exceptionState) { - ASSERT(m_client); + DCHECK(m_client); // No nested workers (for now) - connect() should only be called from document context. - ASSERT(worker->getExecutionContext()->isDocument()); + DCHECK(worker->getExecutionContext()->isDocument()); Document* document = toDocument(worker->getExecutionContext()); // TODO(estark): this is broken, as it only uses the first header @@ -155,7 +155,7 @@ void SharedWorkerRepositoryClientImpl::documentDetached(Document* document) { - ASSERT(m_client); + DCHECK(m_client); m_client->documentDetached(getId(document)); }
diff --git a/third_party/WebKit/Source/web/StorageQuotaClientImpl.cpp b/third_party/WebKit/Source/web/StorageQuotaClientImpl.cpp index 29870a4..1f1e740 100644 --- a/third_party/WebKit/Source/web/StorageQuotaClientImpl.cpp +++ b/third_party/WebKit/Source/web/StorageQuotaClientImpl.cpp
@@ -59,7 +59,7 @@ void StorageQuotaClientImpl::requestQuota(ExecutionContext* executionContext, WebStorageQuotaType storageType, unsigned long long newQuotaInBytes, StorageQuotaCallback* successCallback, StorageErrorCallback* errorCallback) { - ASSERT(executionContext); + DCHECK(executionContext); if (executionContext->isDocument()) { Document* document = toDocument(executionContext);
diff --git a/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp b/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp index fbd3ce7..3a0a955 100644 --- a/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp +++ b/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp
@@ -51,7 +51,7 @@ void SuspendableScriptExecutor::run() { ExecutionContext* context = getExecutionContext(); - ASSERT(context); + DCHECK(context); if (!context->activeDOMObjectsAreSuspended()) { suspendIfNeeded(); executeAndDestroySelf();
diff --git a/third_party/WebKit/Source/web/TextFinder.cpp b/third_party/WebKit/Source/web/TextFinder.cpp index 8cc306a..0443f93 100644 --- a/third_party/WebKit/Source/web/TextFinder.cpp +++ b/third_party/WebKit/Source/web/TextFinder.cpp
@@ -137,7 +137,8 @@ ownerFrame().frame()->selection().clear(); } - ASSERT(ownerFrame().frame() && ownerFrame().frame()->view()); + DCHECK(ownerFrame().frame()); + DCHECK(ownerFrame().frame()->view()); const FindOptions findOptions = (options.forward ? 0 : Backwards) | (options.matchCase ? 0 : CaseInsensitive) | (wrapWithinFrame ? WrapAround : 0) @@ -283,12 +284,12 @@ WebLocalFrameImpl* mainFrameImpl = ownerFrame().viewImpl()->mainFrameImpl(); PositionInFlatTree searchStart = PositionInFlatTree::firstPositionInNode(ownerFrame().frame()->document()); PositionInFlatTree searchEnd = PositionInFlatTree::lastPositionInNode(ownerFrame().frame()->document()); - ASSERT(searchStart.document() == searchEnd.document()); + DCHECK_EQ(searchStart.document(), searchEnd.document()); if (m_resumeScopingFromRange) { // This is a continuation of a scoping operation that timed out and didn't // complete last time around, so we should start from where we left off. - ASSERT(m_resumeScopingFromRange->collapsed()); + DCHECK(m_resumeScopingFromRange->collapsed()); searchStart = fromPositionInDOMTree<EditingInFlatTreeStrategy>(m_resumeScopingFromRange->endPosition()); if (searchStart.document() != searchEnd.document()) return; @@ -551,7 +552,7 @@ updateFindMatchRects(); frameRects.reserveCapacity(frameRects.size() + m_findMatchesCache.size()); for (const FindMatch& match : m_findMatchesCache) { - ASSERT(!match.m_rect.isEmpty()); + DCHECK(!match.m_rect.isEmpty()); frameRects.append(match.m_rect); } } @@ -586,7 +587,7 @@ int nearest = -1; distanceSquared = FLT_MAX; for (size_t i = 0; i < m_findMatchesCache.size(); ++i) { - ASSERT(!m_findMatchesCache[i].m_rect.isEmpty()); + DCHECK(!m_findMatchesCache[i].m_rect.isEmpty()); FloatSize offset = point - m_findMatchesCache[i].m_rect.center(); float width = offset.width(); float height = offset.height(); @@ -726,7 +727,8 @@ if (!frame || !frame->view() || !frame->page() || !ownerFrame().hasVisibleContent()) return false; - ASSERT(frame->document() && frame->view()); + DCHECK(frame->document()); + DCHECK(frame->view()); // If the frame completed the scoping operation and found 0 matches the last // time it was searched, then we don't have to search it again if the user is
diff --git a/third_party/WebKit/Source/web/TextFinder.h b/third_party/WebKit/Source/web/TextFinder.h index 587bf7b2..025a574 100644 --- a/third_party/WebKit/Source/web/TextFinder.h +++ b/third_party/WebKit/Source/web/TextFinder.h
@@ -198,7 +198,7 @@ WebLocalFrameImpl& ownerFrame() const { - ASSERT(m_ownerFrame); + DCHECK(m_ownerFrame); return *m_ownerFrame; }
diff --git a/third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp b/third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp index 34c5944..ec6ee91 100644 --- a/third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp +++ b/third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp
@@ -113,7 +113,7 @@ void ValidationMessageClientImpl::checkAnchorStatus(Timer<ValidationMessageClientImpl>*) { - ASSERT(m_currentAnchor); + DCHECK(m_currentAnchor); if (monotonicallyIncreasingTime() >= m_finishTime || !currentView()) { hideValidationMessage(*m_currentAnchor); return;
diff --git a/third_party/WebKit/Source/web/WebAXObject.cpp b/third_party/WebKit/Source/web/WebAXObject.cpp index 4df47cd..cdc8468 100644 --- a/third_party/WebKit/Source/web/WebAXObject.cpp +++ b/third_party/WebKit/Source/web/WebAXObject.cpp
@@ -62,7 +62,7 @@ namespace blink { -#if ENABLE(ASSERT) +#if DCHECK_IS_ON() // It's not safe to call some WebAXObject APIs if a layout is pending. // Clients should call updateLayoutAndCheckValidity first. static bool isLayoutClean(Document* document) @@ -632,7 +632,9 @@ if (isDetached()) return WebRect(); - ASSERT(isLayoutClean(m_private->getDocument())); +#if DCHECK_IS_ON() + DCHECK(isLayoutClean(m_private->getDocument())); +#endif return pixelSnappedIntRect(m_private->elementRect()); } @@ -1440,7 +1442,7 @@ WebVector<int> wordStartOffsets(wordBoundaries.size()); WebVector<int> wordEndOffsets(wordBoundaries.size()); for (size_t i = 0; i < wordBoundaries.size(); ++i) { - ASSERT(wordBoundaries[i].isSimple()); + DCHECK(wordBoundaries[i].isSimple()); wordStartOffsets[i] = wordBoundaries[i].anchorOffset; wordEndOffsets[i] = wordBoundaries[i].focusOffset; }
diff --git a/third_party/WebKit/Source/web/WebArrayBufferConverter.cpp b/third_party/WebKit/Source/web/WebArrayBufferConverter.cpp index 7179ad5..b25e409 100644 --- a/third_party/WebKit/Source/web/WebArrayBufferConverter.cpp +++ b/third_party/WebKit/Source/web/WebArrayBufferConverter.cpp
@@ -38,7 +38,7 @@ { // We no longer use |creationContext| because it's often misused and points // to a context faked by user script. - ASSERT(creationContext->CreationContext() == isolate->GetCurrentContext()); + DCHECK(creationContext->CreationContext() == isolate->GetCurrentContext()); if (!buffer) return v8::Local<v8::Value>(); return toV8(PassRefPtr<DOMArrayBuffer>(*buffer), isolate->GetCurrentContext()->Global(), isolate);
diff --git a/third_party/WebKit/Source/web/WebBlob.cpp b/third_party/WebKit/Source/web/WebBlob.cpp index e682c2b..70fa3b6 100644 --- a/third_party/WebKit/Source/web/WebBlob.cpp +++ b/third_party/WebKit/Source/web/WebBlob.cpp
@@ -56,7 +56,7 @@ if (V8Blob::hasInstance(value, v8::Isolate::GetCurrent())) { v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value); Blob* blob = V8Blob::toImpl(object); - ASSERT(blob); + DCHECK(blob); return blob; } return WebBlob(); @@ -83,7 +83,7 @@ { // We no longer use |creationContext| because it's often misused and points // to a context faked by user script. - ASSERT(creationContext->CreationContext() == isolate->GetCurrentContext()); + DCHECK(creationContext->CreationContext() == isolate->GetCurrentContext()); if (!m_private.get()) return v8::Local<v8::Value>(); return toV8(m_private.get(), isolate->GetCurrentContext()->Global(), isolate);
diff --git a/third_party/WebKit/Source/web/WebCache.cpp b/third_party/WebKit/Source/web/WebCache.cpp index f30502c..8d0995c 100644 --- a/third_party/WebKit/Source/web/WebCache.cpp +++ b/third_party/WebKit/Source/web/WebCache.cpp
@@ -64,7 +64,7 @@ void WebCache::getUsageStats(UsageStats* result) { - ASSERT(result); + DCHECK(result); MemoryCache* cache = memoryCache(); if (cache) {
diff --git a/third_party/WebKit/Source/web/WebDOMActivityLogger.cpp b/third_party/WebKit/Source/web/WebDOMActivityLogger.cpp index 814abb37..00060b6 100644 --- a/third_party/WebKit/Source/web/WebDOMActivityLogger.cpp +++ b/third_party/WebKit/Source/web/WebDOMActivityLogger.cpp
@@ -94,7 +94,7 @@ void setDOMActivityLogger(int worldId, const WebString& extensionId, WebDOMActivityLogger* logger) { - ASSERT(logger); + DCHECK(logger); V8DOMActivityLogger::setActivityLogger(worldId, extensionId, adoptPtr(new DOMActivityLoggerContainer(adoptPtr(logger)))); }
diff --git a/third_party/WebKit/Source/web/WebDOMFileSystem.cpp b/third_party/WebKit/Source/web/WebDOMFileSystem.cpp index 4c91e7d..3fb40013 100644 --- a/third_party/WebKit/Source/web/WebDOMFileSystem.cpp +++ b/third_party/WebKit/Source/web/WebDOMFileSystem.cpp
@@ -49,7 +49,7 @@ return WebDOMFileSystem(); v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value); DOMFileSystem* domFileSystem = V8DOMFileSystem::toImpl(object); - ASSERT(domFileSystem); + DCHECK(domFileSystem); return WebDOMFileSystem(domFileSystem); } @@ -68,7 +68,8 @@ const WebURL& rootURL, SerializableType serializableType) { - ASSERT(frame && toWebLocalFrameImpl(frame)->frame()); + DCHECK(frame); + DCHECK(toWebLocalFrameImpl(frame)->frame()); DOMFileSystem* domFileSystem = DOMFileSystem::create(toWebLocalFrameImpl(frame)->frame()->document(), name, static_cast<FileSystemType>(type), rootURL); if (serializableType == SerializableTypeSerializable) domFileSystem->makeClonable(); @@ -87,13 +88,13 @@ WebString WebDOMFileSystem::name() const { - ASSERT(m_private.get()); + DCHECK(m_private.get()); return m_private->name(); } WebFileSystem::Type WebDOMFileSystem::type() const { - ASSERT(m_private.get()); + DCHECK(m_private.get()); switch (m_private->type()) { case FileSystemTypeTemporary: return WebFileSystem::TypeTemporary; @@ -111,7 +112,7 @@ WebURL WebDOMFileSystem::rootURL() const { - ASSERT(m_private.get()); + DCHECK(m_private.get()); return m_private->rootURL(); } @@ -119,7 +120,7 @@ { // We no longer use |creationContext| because it's often misused and points // to a context faked by user script. - ASSERT(creationContext->CreationContext() == isolate->GetCurrentContext()); + DCHECK(creationContext->CreationContext() == isolate->GetCurrentContext()); if (!m_private.get()) return v8::Local<v8::Value>(); return toV8(m_private.get(), isolate->GetCurrentContext()->Global(), isolate); @@ -133,12 +134,12 @@ { // We no longer use |creationContext| because it's often misused and points // to a context faked by user script. - ASSERT(creationContext->CreationContext() == isolate->GetCurrentContext()); + DCHECK(creationContext->CreationContext() == isolate->GetCurrentContext()); if (!m_private.get()) return v8::Local<v8::Value>(); if (entryType == EntryTypeDirectory) return toV8(DirectoryEntry::create(m_private.get(), path), isolate->GetCurrentContext()->Global(), isolate); - ASSERT(entryType == EntryTypeFile); + DCHECK_EQ(entryType, EntryTypeFile); return toV8(FileEntry::create(m_private.get(), path), isolate->GetCurrentContext()->Global(), isolate); }
diff --git a/third_party/WebKit/Source/web/WebDataSourceImpl.cpp b/third_party/WebKit/Source/web/WebDataSourceImpl.cpp index 03b0c52..8bd0ea0 100644 --- a/third_party/WebKit/Source/web/WebDataSourceImpl.cpp +++ b/third_party/WebKit/Source/web/WebDataSourceImpl.cpp
@@ -138,7 +138,7 @@ WebDataSourceImpl::~WebDataSourceImpl() { // Verify that detachFromFrame() has been called. - ASSERT(!m_extraData); + DCHECK(!m_extraData); } void WebDataSourceImpl::detachFromFrame()
diff --git a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp index 4fe3913..1f1287a 100644 --- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp +++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
@@ -301,7 +301,7 @@ : m_client(client) , m_webLocalFrameImpl(webLocalFrameImpl) , m_attached(false) -#if ENABLE(ASSERT) +#if DCHECK_IS_ON() , m_hasBeenDisposed(false) #endif , m_instrumentingAgents(m_webLocalFrameImpl->frame()->instrumentingAgents()) @@ -319,13 +319,15 @@ , m_stateMuted(false) , m_layerTreeId(0) { - ASSERT(isMainThread()); - ASSERT(m_webLocalFrameImpl->frame()); + DCHECK(isMainThread()); + DCHECK(m_webLocalFrameImpl->frame()); } WebDevToolsAgentImpl::~WebDevToolsAgentImpl() { - ASSERT(m_hasBeenDisposed); +#if DCHECK_IS_ON() + DCHECK(m_hasBeenDisposed); +#endif } void WebDevToolsAgentImpl::dispose() @@ -334,8 +336,8 @@ // same behavior (and correctness) with and without Oilpan. if (m_attached) Platform::current()->currentThread()->removeTaskObserver(this); -#if ENABLE(ASSERT) - ASSERT(!m_hasBeenDisposed); +#if DCHECK_IS_ON() + DCHECK(!m_hasBeenDisposed); m_hasBeenDisposed = true; #endif } @@ -369,8 +371,8 @@ void WebDevToolsAgentImpl::willBeDestroyed() { - ASSERT(m_webLocalFrameImpl->frame()); - ASSERT(m_inspectedFrames->root()->view()); + DCHECK(m_webLocalFrameImpl->frame()); + DCHECK(m_inspectedFrames->root()->view()); detach(); m_resourceContentLoader->dispose();
diff --git a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h index 99f56ea..a019547 100644 --- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h +++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h
@@ -143,7 +143,7 @@ WebDevToolsAgentClient* m_client; Member<WebLocalFrameImpl> m_webLocalFrameImpl; bool m_attached; -#if ENABLE(ASSERT) +#if DCHECK_IS_ON() bool m_hasBeenDisposed; #endif
diff --git a/third_party/WebKit/Source/web/WebDevToolsFrontendImpl.cpp b/third_party/WebKit/Source/web/WebDevToolsFrontendImpl.cpp index 853465ab..3a903de 100644 --- a/third_party/WebKit/Source/web/WebDevToolsFrontendImpl.cpp +++ b/third_party/WebKit/Source/web/WebDevToolsFrontendImpl.cpp
@@ -71,7 +71,7 @@ if (m_webFrame == frame) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); ScriptState* scriptState = ScriptState::forMainWorld(m_webFrame->frame()); - ASSERT(scriptState); + DCHECK(scriptState); ScriptState::Scope scope(scriptState); if (m_devtoolsHost) @@ -79,7 +79,7 @@ m_devtoolsHost = DevToolsHost::create(this, m_webFrame->frame()); v8::Local<v8::Object> global = scriptState->context()->Global(); v8::Local<v8::Value> devtoolsHostObj = toV8(m_devtoolsHost.get(), global, scriptState->isolate()); - ASSERT(!devtoolsHostObj.IsEmpty()); + DCHECK(!devtoolsHostObj.IsEmpty()); global->Set(v8AtomicString(isolate, "DevToolsHost"), devtoolsHostObj); }
diff --git a/third_party/WebKit/Source/web/WebDocument.cpp b/third_party/WebKit/Source/web/WebDocument.cpp index f7eb3888..082b5fb 100644 --- a/third_party/WebKit/Source/web/WebDocument.cpp +++ b/third_party/WebKit/Source/web/WebDocument.cpp
@@ -212,7 +212,7 @@ void WebDocument::insertStyleSheet(const WebString& sourceCode) { RawPtr<Document> document = unwrap<Document>(); - ASSERT(document); + DCHECK(document); RawPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(CSSParserContext(*document, 0)); parsedSheet->parseString(sourceCode); document->styleEngine().injectAuthorSheet(parsedSheet);
diff --git a/third_party/WebKit/Source/web/WebElementTest.cpp b/third_party/WebKit/Source/web/WebElementTest.cpp index 9800e18..fd9a356 100644 --- a/third_party/WebKit/Source/web/WebElementTest.cpp +++ b/third_party/WebKit/Source/web/WebElementTest.cpp
@@ -79,7 +79,7 @@ WebElement WebElementTest::testElement() { Element* element = document().getElementById("testElement"); - ASSERT(element); + DCHECK(element); return WebElement(element); }
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp index edb4683..2d98cff 100644 --- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp +++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -103,9 +103,9 @@ if (m_workerThread) m_workerThread->terminateAndWait(); - ASSERT(runningWorkerInstances().contains(this)); + DCHECK(runningWorkerInstances().contains(this)); runningWorkerInstances().remove(this); - ASSERT(m_webView); + DCHECK(m_webView); // Detach the client before closing the view to avoid getting called back. m_mainFrame->setClient(0); @@ -124,9 +124,9 @@ void WebEmbeddedWorkerImpl::startWorkerContext( const WebEmbeddedWorkerStartData& data) { - ASSERT(!m_askedToTerminate); - ASSERT(!m_mainScriptLoader); - ASSERT(m_pauseAfterDownloadState == DontPauseAfterDownload); + DCHECK(!m_askedToTerminate); + DCHECK(!m_mainScriptLoader); + DCHECK_EQ(m_pauseAfterDownloadState, DontPauseAfterDownload); m_workerStartData = data; if (data.pauseAfterDownloadMode == WebEmbeddedWorkerStartData::PauseAfterDownload) m_pauseAfterDownloadState = DoPauseAfterDownload; @@ -153,7 +153,7 @@ if (!m_workerThread) { // The worker thread has not been created yet if the worker is asked to // terminate during waiting for debugger or paused after download. - ASSERT(m_workerStartData.waitForDebuggerMode == WebEmbeddedWorkerStartData::WaitForDebugger || m_pauseAfterDownloadState == IsPausedAfterDownload); + DCHECK(m_workerStartData.waitForDebuggerMode == WebEmbeddedWorkerStartData::WaitForDebugger || m_pauseAfterDownloadState == IsPausedAfterDownload); // This deletes 'this'. m_workerContextClient->workerContextFailedToStart(); return; @@ -164,8 +164,8 @@ void WebEmbeddedWorkerImpl::resumeAfterDownload() { - ASSERT(!m_askedToTerminate); - ASSERT(m_pauseAfterDownloadState == IsPausedAfterDownload); + DCHECK(!m_askedToTerminate); + DCHECK_EQ(m_pauseAfterDownloadState, IsPausedAfterDownload); m_pauseAfterDownloadState = DontPauseAfterDownload; startWorkerThread(); @@ -229,7 +229,7 @@ // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader. // This code, and probably most of the code in this class should be shared // with SharedWorker. - ASSERT(!m_webView); + DCHECK(!m_webView); m_webView = WebView::create(0); WebSettings* settings = m_webView->settings(); // FIXME: http://crbug.com/363843. This needs to find a better way to @@ -276,12 +276,12 @@ void WebEmbeddedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) { - ASSERT(!m_mainScriptLoader); - ASSERT(!m_networkProvider); - ASSERT(m_mainFrame); - ASSERT(m_workerContextClient); - ASSERT(m_loadingShadowPage); - ASSERT(!m_askedToTerminate); + DCHECK(!m_mainScriptLoader); + DCHECK(!m_networkProvider); + DCHECK(m_mainFrame); + DCHECK(m_workerContextClient); + DCHECK(m_loadingShadowPage); + DCHECK(!m_askedToTerminate); m_loadingShadowPage = false; m_networkProvider = adoptPtr(m_workerContextClient->createServiceWorkerNetworkProvider(frame->dataSource())); m_mainScriptLoader = WorkerScriptLoader::create(); @@ -312,7 +312,7 @@ void WebEmbeddedWorkerImpl::onScriptLoaderFinished() { - ASSERT(m_mainScriptLoader); + DCHECK(m_mainScriptLoader); if (m_askedToTerminate) return; @@ -340,8 +340,8 @@ void WebEmbeddedWorkerImpl::startWorkerThread() { - ASSERT(m_pauseAfterDownloadState == DontPauseAfterDownload); - ASSERT(!m_askedToTerminate); + DCHECK_EQ(m_pauseAfterDownloadState, DontPauseAfterDownload); + DCHECK(!m_askedToTerminate); Document* document = m_mainFrame->frame()->document();
diff --git a/third_party/WebKit/Source/web/WebEntities.cpp b/third_party/WebKit/Source/web/WebEntities.cpp index 22b247e1..28241c3 100644 --- a/third_party/WebKit/Source/web/WebEntities.cpp +++ b/third_party/WebKit/Source/web/WebEntities.cpp
@@ -38,7 +38,7 @@ WebEntities::WebEntities(bool xmlEntities) { - ASSERT(m_entitiesMap.isEmpty()); + DCHECK(m_entitiesMap.isEmpty()); m_entitiesMap.set(0x003c, "lt"); m_entitiesMap.set(0x003e, "gt"); m_entitiesMap.set(0x0026, "amp");
diff --git a/third_party/WebKit/Source/web/WebFrame.cpp b/third_party/WebKit/Source/web/WebFrame.cpp index 1ef98bd..c44e647 100644 --- a/third_party/WebKit/Source/web/WebFrame.cpp +++ b/third_party/WebKit/Source/web/WebFrame.cpp
@@ -100,7 +100,7 @@ // In this case, the core LocalFrame is already initialized, so just // update a bit of state. LocalFrame& localFrame = *toWebLocalFrameImpl(frame)->frame(); - ASSERT(owner == localFrame.owner()); + DCHECK_EQ(owner, localFrame.owner()); if (owner) { owner->setContentFrame(localFrame); if (owner->isLocal()) @@ -135,7 +135,7 @@ // At the moment, this is only used to replicate sandbox flags // for frames with a remote owner. FrameOwner* owner = toImplBase()->frame()->owner(); - ASSERT(owner); + DCHECK(owner); toRemoteFrameOwner(owner)->setSandboxFlags(static_cast<SandboxFlags>(flags)); } @@ -168,7 +168,7 @@ next = m_firstChild; m_firstChild = newChild; } else { - ASSERT(previousSibling->m_parent == this); + DCHECK_EQ(previousSibling->m_parent, this); next = previousSibling->m_nextSibling; previousSibling->m_nextSibling = newChild; newChild->m_previousSibling = previousSibling; @@ -344,7 +344,7 @@ template <typename VisitorDispatcher> ALWAYS_INLINE void WebFrame::traceFramesImpl(VisitorDispatcher visitor, WebFrame* frame) { - ASSERT(frame); + DCHECK(frame); traceFrame(visitor, frame->m_parent); for (WebFrame* child = frame->firstChild(); child; child = child->nextSibling()) traceFrame(visitor, child);
diff --git a/third_party/WebKit/Source/web/WebFrameSerializer.cpp b/third_party/WebKit/Source/web/WebFrameSerializer.cpp index 2c8a1e611..09fab01 100644 --- a/third_party/WebKit/Source/web/WebFrameSerializer.cpp +++ b/third_party/WebKit/Source/web/WebFrameSerializer.cpp
@@ -111,7 +111,7 @@ return false; KURL cidURI = MHTMLParser::convertContentIDToURI(contentID); - ASSERT(cidURI.isValid()); + DCHECK(cidURI.isValid()); if (isHTMLFrameElementBase(&element)) { rewrittenLink = cidURI.getString(); @@ -154,8 +154,8 @@ const WebString& boundary, WebLocalFrame* webFrame, bool useBinaryEncoding, MHTMLPartsGenerationDelegate* webDelegate) { - ASSERT(webFrame); - ASSERT(webDelegate); + DCHECK(webFrame); + DCHECK(webDelegate); // Translate arguments from public to internal blink APIs. LocalFrame* frame = toWebLocalFrameImpl(webFrame)->frame();
diff --git a/third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp b/third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp index ee95063..d5331af 100644 --- a/third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp +++ b/third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp
@@ -130,7 +130,7 @@ // Skip the open tag of original META tag which declare charset since we // have overrided the META which have correct charset declaration after // serializing open tag of HEAD element. - ASSERT(element); + DCHECK(element); if (isHTMLMetaElement(element) && toHTMLMetaElement(element)->computeEncoding().isValid()) { // Found META tag declared charset, we need to skip it when // serializing DOM. @@ -449,13 +449,13 @@ , m_xmlEntities(true) { // Must specify available webframe. - ASSERT(frame); + DCHECK(frame); m_specifiedWebLocalFrameImpl = toWebLocalFrameImpl(frame); // Make sure we have non null client and delegate. - ASSERT(client); - ASSERT(delegate); + DCHECK(client); + DCHECK(delegate); - ASSERT(m_dataBuffer.isEmpty()); + DCHECK(m_dataBuffer.isEmpty()); } bool WebFrameSerializerImpl::serialize() @@ -487,7 +487,7 @@ WebCString(), WebFrameSerializerClient::CurrentFrameIsFinished); } - ASSERT(m_dataBuffer.isEmpty()); + DCHECK(m_dataBuffer.isEmpty()); return didSerialization; }
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp index 15be6d5..688de4b 100644 --- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp +++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -35,6 +35,7 @@ #include "core/editing/FrameSelection.h" #include "core/editing/InputMethodController.h" #include "core/editing/PlainTextRange.h" +#include "core/frame/FrameHost.h" #include "core/frame/FrameView.h" #include "core/frame/RemoteFrame.h" #include "core/frame/Settings.h" @@ -103,7 +104,7 @@ , m_selfKeepAlive(this) #endif { - ASSERT(m_localRoot->frame()->isLocalRoot()); + DCHECK(m_localRoot->frame()->isLocalRoot()); initializeLayerTreeView(); m_localRoot->setFrameWidget(this); allInstances().add(this); @@ -127,7 +128,7 @@ void WebFrameWidgetImpl::close() { WebDevToolsAgentImpl::webFrameWidgetImplClosed(this); - ASSERT(allInstances().contains(this)); + DCHECK(allInstances().contains(this)); allInstances().remove(this); m_localRoot->setFrameWidget(nullptr); @@ -199,7 +200,10 @@ void WebFrameWidgetImpl::resizeVisualViewport(const WebSize& newSize) { - // FIXME: Implement visual viewport for out-of-process iframes. + // TODO(alexmos, kenrb): resizing behavior such as this should be changed + // to use Page messages. https://crbug.com/599688. + page()->frameHost().visualViewport().setSize(newSize); + page()->frameHost().visualViewport().clampToBoundaries(); } void WebFrameWidgetImpl::updateMainFrameLayoutSize() @@ -218,7 +222,7 @@ void WebFrameWidgetImpl::setIgnoreInputEvents(bool newValue) { - ASSERT(m_ignoreInputEvents != newValue); + DCHECK_NE(m_ignoreInputEvents, newValue); m_ignoreInputEvents = newValue; } @@ -235,7 +239,7 @@ void WebFrameWidgetImpl::beginFrame(double lastFrameTimeMonotonic) { TRACE_EVENT1("blink", "WebFrameWidgetImpl::beginFrame", "frameTime", lastFrameTimeMonotonic); - ASSERT(lastFrameTimeMonotonic); + DCHECK(lastFrameTimeMonotonic); PageWidgetDelegate::animate(*page(), lastFrameTimeMonotonic); } @@ -275,8 +279,8 @@ void WebFrameWidgetImpl::updateLayerTreeDeviceScaleFactor() { - ASSERT(page()); - ASSERT(m_layerTreeView); + DCHECK(page()); + DCHECK(m_layerTreeView); float deviceScaleFactor = page()->deviceScaleFactor(); m_layerTreeView->setDeviceScaleFactor(deviceScaleFactor); @@ -756,7 +760,7 @@ WebInputEventResult WebFrameWidgetImpl::handleKeyEvent(const WebKeyboardEvent& event) { - ASSERT((event.type == WebInputEvent::RawKeyDown) + DCHECK((event.type == WebInputEvent::RawKeyDown) || (event.type == WebInputEvent::KeyDown) || (event.type == WebInputEvent::KeyUp)); @@ -815,7 +819,7 @@ WebInputEventResult WebFrameWidgetImpl::handleCharEvent(const WebKeyboardEvent& event) { - ASSERT(event.type == WebInputEvent::Char); + DCHECK_EQ(event.type, WebInputEvent::Char); // Please refer to the comments explaining the m_suppressNextKeypressEvent // member. The m_suppressNextKeypressEvent is set if the KeyDown is @@ -1004,7 +1008,7 @@ // FIXME: only unittests, click to play, Android priting, and printing (for headers and footers) // make this assert necessary. We should make them not hit this code and then delete allowsBrokenNullLayerTreeView. - ASSERT(m_layerTreeView || !m_client || m_client->allowsBrokenNullLayerTreeView()); + DCHECK(m_layerTreeView || !m_client || m_client->allowsBrokenNullLayerTreeView()); } void WebFrameWidgetImpl::setIsAcceleratedCompositingActive(bool active) @@ -1015,7 +1019,7 @@ if (m_layerTreeViewClosed) return; - ASSERT(!active || m_layerTreeView); + DCHECK(!active || m_layerTreeView); if (m_isAcceleratedCompositingActive == active) return;
diff --git a/third_party/WebKit/Source/web/WebGeolocationController.cpp b/third_party/WebKit/Source/web/WebGeolocationController.cpp index 1c9f17a..8021a926 100644 --- a/third_party/WebKit/Source/web/WebGeolocationController.cpp +++ b/third_party/WebKit/Source/web/WebGeolocationController.cpp
@@ -46,8 +46,8 @@ static GeolocationController& controller(const WebPrivatePtr<GeolocationControllerPrivate>& controller) { - ASSERT(!controller.isNull()); - ASSERT(controller->m_controller); + DCHECK(!controller.isNull()); + DCHECK(controller->m_controller); return *controller->m_controller; }
diff --git a/third_party/WebKit/Source/web/WebGeolocationPermissionRequestManager.cpp b/third_party/WebKit/Source/web/WebGeolocationPermissionRequestManager.cpp index 3badcc3d..cc221d91 100644 --- a/third_party/WebKit/Source/web/WebGeolocationPermissionRequestManager.cpp +++ b/third_party/WebKit/Source/web/WebGeolocationPermissionRequestManager.cpp
@@ -51,7 +51,7 @@ { Geolocation* geolocation = permissionRequest.geolocation(); WebGeolocationPermissionRequestManagerPrivate* manager = ensureManager(); - ASSERT(!manager->m_geolocationIdMap.contains(geolocation)); + DCHECK(!manager->m_geolocationIdMap.contains(geolocation)); static int lastId; int id = ++lastId; manager->m_geolocationIdMap.add(geolocation, id);
diff --git a/third_party/WebKit/Source/web/WebHeap.cpp b/third_party/WebKit/Source/web/WebHeap.cpp index 6111435..f7caabe3 100644 --- a/third_party/WebKit/Source/web/WebHeap.cpp +++ b/third_party/WebKit/Source/web/WebHeap.cpp
@@ -36,7 +36,7 @@ WebHeap::SafePointScope::SafePointScope() { - RELEASE_ASSERT(!ThreadState::current()->isAtSafePoint()); + CHECK(!ThreadState::current()->isAtSafePoint()); ThreadState::current()->enterSafePoint(BlinkGC::HeapPointersOnStack, this); }
diff --git a/third_party/WebKit/Source/web/WebHelperPluginImpl.cpp b/third_party/WebKit/Source/web/WebHelperPluginImpl.cpp index 15c57f13..a497530c 100644 --- a/third_party/WebKit/Source/web/WebHelperPluginImpl.cpp +++ b/third_party/WebKit/Source/web/WebHelperPluginImpl.cpp
@@ -60,7 +60,7 @@ // FIXME: Oilpan: it is potentially problematic to support plugin // disposal during an Oilpan GC. If it happens, we need to know // and evaluate possible ways to handle it. - ASSERT(!ThreadState::current()->sweepForbidden()); + DCHECK(!ThreadState::current()->sweepForbidden()); if (m_pluginContainer) m_pluginContainer->dispose(); #endif @@ -68,14 +68,14 @@ bool WebHelperPluginImpl::initialize(const String& pluginType, WebLocalFrameImpl* frame) { - ASSERT(!m_objectElement && !m_pluginContainer); + DCHECK(!m_objectElement && !m_pluginContainer); if (!frame->frame()->loader().client()) return false; m_objectElement = HTMLObjectElement::create(*frame->frame()->document(), 0, false); Vector<String> attributeNames; Vector<String> attributeValues; - ASSERT(frame->frame()->document()->url().isValid()); + DCHECK(frame->frame()->document()->url().isValid()); m_pluginContainer = toWebPluginContainerImpl(frame->frame()->loader().client()->createPlugin( m_objectElement.get(), frame->frame()->document()->url(), @@ -109,8 +109,8 @@ WebPlugin* WebHelperPluginImpl::getPlugin() { - ASSERT(m_pluginContainer); - ASSERT(m_pluginContainer->plugin()); + DCHECK(m_pluginContainer); + DCHECK(m_pluginContainer->plugin()); return m_pluginContainer->plugin(); }
diff --git a/third_party/WebKit/Source/web/WebImageDecoder.cpp b/third_party/WebKit/Source/web/WebImageDecoder.cpp index b95cd85..1750509 100644 --- a/third_party/WebKit/Source/web/WebImageDecoder.cpp +++ b/third_party/WebKit/Source/web/WebImageDecoder.cpp
@@ -64,37 +64,37 @@ void WebImageDecoder::setData(const WebData& data, bool allDataReceived) { - ASSERT(m_private); + DCHECK(m_private); m_private->setData(PassRefPtr<SharedBuffer>(data).get(), allDataReceived); } bool WebImageDecoder::isFailed() const { - ASSERT(m_private); + DCHECK(m_private); return m_private->failed(); } bool WebImageDecoder::isSizeAvailable() const { - ASSERT(m_private); + DCHECK(m_private); return m_private->isSizeAvailable(); } WebSize WebImageDecoder::size() const { - ASSERT(m_private); + DCHECK(m_private); return m_private->size(); } size_t WebImageDecoder::frameCount() const { - ASSERT(m_private); + DCHECK(m_private); return m_private->frameCount(); } bool WebImageDecoder::isFrameCompleteAtIndex(int index) const { - ASSERT(m_private); + DCHECK(m_private); ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index); if (!frameBuffer) return false; @@ -103,7 +103,7 @@ WebImage WebImageDecoder::getFrameAtIndex(int index = 0) const { - ASSERT(m_private); + DCHECK(m_private); ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index); if (!frameBuffer) return WebImage();
diff --git a/third_party/WebKit/Source/web/WebInputEventConversion.cpp b/third_party/WebKit/Source/web/WebInputEventConversion.cpp index 58d1c02..881250c 100644 --- a/third_party/WebKit/Source/web/WebInputEventConversion.cpp +++ b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
@@ -356,8 +356,8 @@ // According to the behavior of Webkit in Windows platform, // we need to convert KeyDown to RawKeydown and Char events // See WebKit/WebKit/Win/WebView.cpp - ASSERT(m_type == KeyDown); - ASSERT(type == RawKeyDown || type == Char); + DCHECK(m_type == KeyDown); + DCHECK(type == RawKeyDown || type == Char); m_type = type; if (type == RawKeyDown) {
diff --git a/third_party/WebKit/Source/web/WebKit.cpp b/third_party/WebKit/Source/web/WebKit.cpp index 4d721c3..ec8817aa 100644 --- a/third_party/WebKit/Source/web/WebKit.cpp +++ b/third_party/WebKit/Source/web/WebKit.cpp
@@ -88,7 +88,7 @@ // currentThread is null if we are running on a thread without a message loop. if (WebThread* currentThread = platform->currentThread()) { - ASSERT(!s_endOfTaskRunner); + DCHECK(!s_endOfTaskRunner); s_endOfTaskRunner = new EndOfTaskRunner; currentThread->addTaskObserver(s_endOfTaskRunner); } @@ -168,7 +168,7 @@ void resetPluginCache(bool reloadPages) { - ASSERT(!reloadPages); + DCHECK(!reloadPages); Page::refreshPlugins(); }
diff --git a/third_party/WebKit/Source/web/WebLeakDetector.cpp b/third_party/WebKit/Source/web/WebLeakDetector.cpp index f3440dc..c70ff48b 100644 --- a/third_party/WebKit/Source/web/WebLeakDetector.cpp +++ b/third_party/WebKit/Source/web/WebLeakDetector.cpp
@@ -59,7 +59,7 @@ , m_delayedReportTimer(this, &WebLeakDetectorImpl::delayedReport) , m_numberOfGCNeeded(0) { - ASSERT(m_client); + DCHECK(m_client); } ~WebLeakDetectorImpl() override {} @@ -139,7 +139,7 @@ void WebLeakDetectorImpl::delayedReport(Timer<WebLeakDetectorImpl>*) { - ASSERT(m_client); + DCHECK(m_client); WebLeakDetectorClient::Result result; result.numberOfLiveAudioNodes = InstanceCounters::counterValue(InstanceCounters::AudioHandlerCounter);
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp index 370c44a3..d7c1ff6 100644 --- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp +++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -286,7 +286,7 @@ virtual void begin(float width, float height) { - ASSERT(!m_printedPageWidth); + DCHECK(!m_printedPageWidth); m_printedPageWidth = width; PrintContext::begin(m_printedPageWidth, height); } @@ -713,7 +713,7 @@ void WebLocalFrameImpl::executeScript(const WebScriptSource& source) { - ASSERT(frame()); + DCHECK(frame()); TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), OrdinalNumber::first()); v8::HandleScope handleScope(toIsolate(frame())); frame()->script().executeScriptInMainWorld(ScriptSourceCode(source.code, source.url, position)); @@ -721,9 +721,9 @@ void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSource* sourcesIn, unsigned numSources, int extensionGroup) { - ASSERT(frame()); - RELEASE_ASSERT(worldID > 0); - RELEASE_ASSERT(worldID < EmbedderWorldIdLimit); + DCHECK(frame()); + CHECK_GT(worldID, 0); + CHECK_LT(worldID, EmbedderWorldIdLimit); HeapVector<ScriptSourceCode> sources = createSourcesVector(sourcesIn, numSources); v8::HandleScope handleScope(toIsolate(frame())); @@ -732,25 +732,25 @@ void WebLocalFrameImpl::setIsolatedWorldSecurityOrigin(int worldID, const WebSecurityOrigin& securityOrigin) { - ASSERT(frame()); + DCHECK(frame()); DOMWrapperWorld::setIsolatedWorldSecurityOrigin(worldID, securityOrigin.get()); } void WebLocalFrameImpl::setIsolatedWorldContentSecurityPolicy(int worldID, const WebString& policy) { - ASSERT(frame()); + DCHECK(frame()); DOMWrapperWorld::setIsolatedWorldContentSecurityPolicy(worldID, policy); } void WebLocalFrameImpl::setIsolatedWorldHumanReadableName(int worldID, const WebString& humanReadableName) { - ASSERT(frame()); + DCHECK(frame()); DOMWrapperWorld::setIsolatedWorldHumanReadableName(worldID, humanReadableName); } void WebLocalFrameImpl::addMessageToConsole(const WebConsoleMessage& message) { - ASSERT(frame()); + DCHECK(frame()); MessageLevel webCoreMessageLevel; switch (message.level) { @@ -785,7 +785,7 @@ v8::Local<v8::Value> WebLocalFrameImpl::executeScriptAndReturnValue(const WebScriptSource& source) { - ASSERT(frame()); + DCHECK(frame()); TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), OrdinalNumber::first()); return frame()->script().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(source.code, source.url, position)); @@ -793,16 +793,16 @@ void WebLocalFrameImpl::requestExecuteScriptAndReturnValue(const WebScriptSource& source, bool userGesture, WebScriptExecutionCallback* callback) { - ASSERT(frame()); + DCHECK(frame()); SuspendableScriptExecutor::createAndRun(frame(), 0, createSourcesVector(&source, 1), 0, userGesture, callback); } void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSource* sourcesIn, unsigned numSources, int extensionGroup, WebVector<v8::Local<v8::Value>>* results) { - ASSERT(frame()); - RELEASE_ASSERT(worldID > 0); - RELEASE_ASSERT(worldID < EmbedderWorldIdLimit); + DCHECK(frame()); + CHECK_GT(worldID, 0); + CHECK_LT(worldID, EmbedderWorldIdLimit); HeapVector<ScriptSourceCode> sources = createSourcesVector(sourcesIn, numSources); @@ -821,9 +821,9 @@ void WebLocalFrameImpl::requestExecuteScriptInIsolatedWorld(int worldID, const WebScriptSource* sourcesIn, unsigned numSources, int extensionGroup, bool userGesture, WebScriptExecutionCallback* callback) { - ASSERT(frame()); - RELEASE_ASSERT(worldID > 0); - RELEASE_ASSERT(worldID < EmbedderWorldIdLimit); + DCHECK(frame()); + CHECK_GT(worldID, 0); + CHECK_LT(worldID, EmbedderWorldIdLimit); SuspendableScriptExecutor::createAndRun(frame(), worldID, createSourcesVector(sourcesIn, numSources), extensionGroup, userGesture, callback); } @@ -831,7 +831,7 @@ // TODO(bashi): Consider returning MaybeLocal. v8::Local<v8::Value> WebLocalFrameImpl::callFunctionEvenIfScriptDisabled(v8::Local<v8::Function> function, v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> argv[]) { - ASSERT(frame()); + DCHECK(frame()); v8::Local<v8::Value> result; if (!frame()->script().callFunction(function, receiver, argc, static_cast<v8::Local<v8::Value>*>(argv)).ToLocal(&result)) return v8::Local<v8::Value>(); @@ -841,7 +841,7 @@ v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const { ScriptState* scriptState = ScriptState::forMainWorld(frame()); - ASSERT(scriptState); + DCHECK(scriptState); return scriptState->context(); } @@ -861,7 +861,7 @@ { // TODO(clamy): Remove this function once RenderFrame calls load for all // requests. - ASSERT(frame()); + DCHECK(frame()); WebFrameLoadType loadType = ignoreCache ? WebFrameLoadType::ReloadBypassingCache : WebFrameLoadType::Reload; WebURLRequest request = requestForReload(loadType, overrideUrl); @@ -902,7 +902,7 @@ void WebLocalFrameImpl::loadHTMLString(const WebData& data, const WebURL& baseURL, const WebURL& unreachableURL, bool replace) { - ASSERT(frame()); + DCHECK(frame()); loadData(data, WebString::fromUTF8("text/html"), WebString::fromUTF8("UTF-8"), baseURL, unreachableURL, replace, WebFrameLoadType::Standard, WebHistoryItem(), WebHistoryDifferentDocumentLoad, false); } @@ -918,13 +918,13 @@ WebDataSource* WebLocalFrameImpl::provisionalDataSource() const { - ASSERT(frame()); + DCHECK(frame()); return DataSourceForDocLoader(frame()->loader().provisionalDocumentLoader()); } WebDataSource* WebLocalFrameImpl::dataSource() const { - ASSERT(frame()); + DCHECK(frame()); return DataSourceForDocLoader(frame()->loader().documentLoader()); } @@ -1027,13 +1027,13 @@ if (range.isNull()) return kNotFound; Element* editable = frame()->selection().rootEditableElementOrDocumentElement(); - ASSERT(editable); + DCHECK(editable); return PlainTextRange::create(*editable, range).start(); } bool WebLocalFrameImpl::executeCommand(const WebString& name, const WebNode& node) { - ASSERT(frame()); + DCHECK(frame()); if (name.length() <= 2) return false; @@ -1058,7 +1058,7 @@ bool WebLocalFrameImpl::executeCommand(const WebString& name, const WebString& value, const WebNode& node) { - ASSERT(frame()); + DCHECK(frame()); WebPluginContainerImpl* pluginContainer = pluginContainerFromNode(frame(), node); if (pluginContainer && pluginContainer->executeEditCommand(name, value)) @@ -1069,7 +1069,7 @@ bool WebLocalFrameImpl::isCommandEnabled(const WebString& name) const { - ASSERT(frame()); + DCHECK(frame()); return frame()->editor().createCommand(name).isEnabled(); } @@ -1252,7 +1252,7 @@ int WebLocalFrameImpl::printBegin(const WebPrintParams& printParams, const WebNode& constrainToNode) { - ASSERT(!frame()->document()->isFrameSet()); + DCHECK(!frame()->document()->isFrameSet()); WebPluginContainerImpl* pluginContainer = nullptr; if (constrainToNode.isNull()) { // If this is a plugin document, check if the plugin supports its own @@ -1280,15 +1280,18 @@ float WebLocalFrameImpl::getPrintPageShrink(int page) { - ASSERT(m_printContext && page >= 0); + DCHECK(m_printContext); + DCHECK_GE(page, 0); return m_printContext->getPageShrink(page); } float WebLocalFrameImpl::printPage(int page, WebCanvas* canvas) { #if ENABLE(PRINTING) - - ASSERT(m_printContext && page >= 0 && frame() && frame()->document()); + DCHECK(m_printContext); + DCHECK_GE(page, 0); + DCHECK(frame()); + DCHECK(frame()->document()); return m_printContext->spoolSinglePage(canvas, page); #else @@ -1298,7 +1301,7 @@ void WebLocalFrameImpl::printEnd() { - ASSERT(m_printContext); + DCHECK(m_printContext); m_printContext->end(); m_printContext.clear(); } @@ -1342,7 +1345,7 @@ WebString WebLocalFrameImpl::pageProperty(const WebString& propertyName, int pageIndex) { - ASSERT(m_printContext); + DCHECK(m_printContext); return m_printContext->pageProperty(frame(), propertyName.utf8().data(), pageIndex); } @@ -1355,7 +1358,7 @@ { if (WebTestInterfaceFactory* factory = m_testInterfaces.get(name)) { ScriptState* scriptState = ScriptState::forMainWorld(frame()); - ASSERT(scriptState->contextIsValid()); + DCHECK(scriptState->contextIsValid()); v8::EscapableHandleScope handleScope(scriptState->isolate()); ScriptState::Scope scope(scriptState); return handleScope.Escape(factory->createInstance(scriptState->context())); @@ -1365,7 +1368,7 @@ void WebLocalFrameImpl::printPagesWithBoundaries(WebCanvas* canvas, const WebSize& pageSizeInPixels) { - ASSERT(m_printContext); + DCHECK(m_printContext); m_printContext->spoolAllPagesWithBoundaries(canvas, FloatSize(pageSizeInPixels.width, pageSizeInPixels.height)); } @@ -1479,7 +1482,7 @@ WebLocalFrameImpl::~WebLocalFrameImpl() { // The widget for the frame, if any, must have already been closed. - ASSERT(!m_frameWidget); + DCHECK(!m_frameWidget); frameCount--; #if !ENABLE(OILPAN) @@ -1561,7 +1564,7 @@ RawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const FrameLoadRequest& request, const AtomicString& name, HTMLFrameOwnerElement* ownerElement) { - ASSERT(m_client); + DCHECK(m_client); TRACE_EVENT0("blink", "WebLocalFrameImpl::createChildframe"); WebTreeScopeType scope = frame()->document() == ownerElement->treeScope() ? WebTreeScopeType::Document @@ -1610,7 +1613,7 @@ { // This is only possible on the main frame. if (m_textFinder && m_textFinder->totalMatchCount() > 0) { - ASSERT(!parent()); + DCHECK(!parent()); m_textFinder->increaseMarkerVersion(); } } @@ -1619,7 +1622,7 @@ { TRACE_EVENT0("blink", "WebLocalFrameImpl::createFrameView"); - ASSERT(frame()); // If frame() doesn't exist, we probably didn't init properly. + DCHECK(frame()); // If frame() doesn't exist, we probably didn't init properly. WebViewImpl* webView = viewImpl(); @@ -1837,7 +1840,7 @@ void WebLocalFrameImpl::setDevToolsAgentClient(WebDevToolsAgentClient* devToolsClient) { - ASSERT(devToolsClient); + DCHECK(devToolsClient); m_devToolsAgent = WebDevToolsAgentImpl::create(this, devToolsClient); } @@ -1851,7 +1854,7 @@ // At the moment, this is only used to replicate frame owner properties // for frames with a remote owner. FrameOwner* owner = frame()->owner(); - ASSERT(owner); + DCHECK(owner); toRemoteFrameOwner(owner)->setScrollingMode(frameOwnerProperties.scrollingMode); toRemoteFrameOwner(owner)->setMarginWidth(frameOwnerProperties.marginWidth); toRemoteFrameOwner(owner)->setMarginHeight(frameOwnerProperties.marginHeight); @@ -1886,7 +1889,7 @@ void WebLocalFrameImpl::sendPings(const WebNode& contextNode, const WebURL& destinationURL) { - ASSERT(frame()); + DCHECK(frame()); Element* anchor = contextNode.constUnwrap<Node>()->enclosingLinkEventParentOrSelf(); if (isHTMLAnchorElement(anchor)) toHTMLAnchorElement(anchor)->sendPings(destinationURL); @@ -1904,7 +1907,7 @@ WebURLRequest WebLocalFrameImpl::requestForReload(WebFrameLoadType loadType, const WebURL& overrideUrl) const { - ASSERT(frame()); + DCHECK(frame()); ResourceRequest request = frame()->loader().resourceRequestForReload( static_cast<FrameLoadType>(loadType), overrideUrl); return WrappedResourceRequest(request); @@ -1913,8 +1916,8 @@ void WebLocalFrameImpl::load(const WebURLRequest& request, WebFrameLoadType webFrameLoadType, const WebHistoryItem& item, WebHistoryLoadType webHistoryLoadType, bool isClientRedirect) { - ASSERT(frame()); - ASSERT(!request.isNull()); + DCHECK(frame()); + DCHECK(!request.isNull()); const ResourceRequest& resourceRequest = request.toResourceRequest(); if (resourceRequest.url().protocolIs("javascript") @@ -1937,7 +1940,7 @@ WebFrameLoadType webFrameLoadType, const WebHistoryItem& item, WebHistoryLoadType webHistoryLoadType, bool isClientRedirect) { - ASSERT(frame()); + DCHECK(frame()); // If we are loading substitute data to replace an existing load, then // inherit all of the properties of that original request. This way, @@ -1952,7 +1955,7 @@ request.setCheckForBrowserSideNavigation(false); FrameLoadRequest frameRequest(0, request, SubstituteData(data, mimeType, textEncoding, unreachableURL)); - ASSERT(frameRequest.substituteData().isValid()); + DCHECK(frameRequest.substituteData().isValid()); frameRequest.setReplacesCurrentItem(replace); if (isClientRedirect) frameRequest.setClientRedirect(ClientRedirect); @@ -1984,7 +1987,7 @@ void WebLocalFrameImpl::setCommittedFirstRealLoad() { - ASSERT(frame()); + DCHECK(frame()); ensureFrameLoaderHasCommitted(frame()->loader()); } @@ -2012,8 +2015,8 @@ void WebLocalFrameImpl::requestRunTask(WebSuspendableTask* task) const { - ASSERT(frame()); - ASSERT(frame()->document()); + DCHECK(frame()); + DCHECK(frame()->document()); frame()->document()->postSuspendableTask(WebSuspendableTaskWrapper::create(adoptPtr(task))); } @@ -2055,7 +2058,7 @@ void WebLocalFrameImpl::increaseMatchCount(int count, int identifier) { // This function should only be called on the mainframe. - ASSERT(!parent()); + DCHECK(!parent()); ensureTextFinder().increaseMatchCount(identifier, count); } @@ -2066,13 +2069,13 @@ void WebLocalFrameImpl::dispatchMessageEventWithOriginCheck(const WebSecurityOrigin& intendedTargetOrigin, const WebDOMEvent& event) { - ASSERT(!event.isNull()); + DCHECK(!event.isNull()); frame()->localDOMWindow()->dispatchMessageEventWithOriginCheck(intendedTargetOrigin.get(), event, nullptr); } int WebLocalFrameImpl::findMatchMarkersVersion() const { - ASSERT(!parent()); + DCHECK(!parent()); if (m_textFinder) return m_textFinder->findMatchMarkersVersion(); @@ -2081,13 +2084,13 @@ int WebLocalFrameImpl::selectNearestFindMatch(const WebFloatPoint& point, WebRect* selectionRect) { - ASSERT(!parent()); + DCHECK(!parent()); return ensureTextFinder().selectNearestFindMatch(point, selectionRect); } WebFloatRect WebLocalFrameImpl::activeFindMatchRect() { - ASSERT(!parent()); + DCHECK(!parent()); if (m_textFinder) return m_textFinder->activeFindMatchRect(); @@ -2096,7 +2099,7 @@ void WebLocalFrameImpl::findMatchRects(WebVector<WebFloatRect>& outputRects) { - ASSERT(!parent()); + DCHECK(!parent()); ensureTextFinder().findMatchRects(outputRects); } @@ -2132,7 +2135,7 @@ WebLocalFrameImpl* WebLocalFrameImpl::activeMatchFrame() const { - ASSERT(!parent()); + DCHECK(!parent()); if (m_textFinder) return m_textFinder->activeMatchFrame();
diff --git a/third_party/WebKit/Source/web/WebMediaDevicesRequest.cpp b/third_party/WebKit/Source/web/WebMediaDevicesRequest.cpp index a20f5815..5110270 100644 --- a/third_party/WebKit/Source/web/WebMediaDevicesRequest.cpp +++ b/third_party/WebKit/Source/web/WebMediaDevicesRequest.cpp
@@ -49,19 +49,20 @@ WebSecurityOrigin WebMediaDevicesRequest::getSecurityOrigin() const { - ASSERT(!isNull() && m_private->getExecutionContext()); + DCHECK(!isNull()); + DCHECK(m_private->getExecutionContext()); return WebSecurityOrigin(m_private->getExecutionContext()->getSecurityOrigin()); } WebDocument WebMediaDevicesRequest::ownerDocument() const { - ASSERT(!isNull()); + DCHECK(!isNull()); return WebDocument(m_private->ownerDocument()); } void WebMediaDevicesRequest::requestSucceeded(WebVector<WebMediaDeviceInfo> webDevices) { - ASSERT(!isNull()); + DCHECK(!isNull()); MediaDeviceInfoVector devices(webDevices.size()); for (size_t i = 0; i < webDevices.size(); ++i)
diff --git a/third_party/WebKit/Source/web/WebNode.cpp b/third_party/WebKit/Source/web/WebNode.cpp index 9bdeae6..25e5e5c 100644 --- a/third_party/WebKit/Source/web/WebNode.cpp +++ b/third_party/WebKit/Source/web/WebNode.cpp
@@ -248,7 +248,7 @@ { WebExceptionCode ec = 0; WebElement element = querySelector(selector, ec); - ASSERT(!ec); + DCHECK(!ec); return element; } @@ -272,7 +272,7 @@ { WebExceptionCode ec = 0; querySelectorAll(selector, results, ec); - ASSERT(!ec); + DCHECK(!ec); } bool WebNode::focused() const
diff --git a/third_party/WebKit/Source/web/WebPagePopupImpl.cpp b/third_party/WebKit/Source/web/WebPagePopupImpl.cpp index 5b7c2bab..6c16c2f 100644 --- a/third_party/WebKit/Source/web/WebPagePopupImpl.cpp +++ b/third_party/WebKit/Source/web/WebPagePopupImpl.cpp
@@ -81,7 +81,7 @@ explicit PagePopupChromeClient(WebPagePopupImpl* popup) : m_popup(popup) { - ASSERT(m_popup->widgetClient()); + DCHECK(m_popup->widgetClient()); } void closeWindowSoon() override @@ -123,7 +123,7 @@ m_popup->m_webView->scheduleAnimation(); if (m_popup->isAcceleratedCompositingActive()) { - ASSERT(m_popup->m_layerTreeView); + DCHECK(m_popup->m_layerTreeView); m_popup->m_layerTreeView->setNeedsBeginFrame(); return; } @@ -238,18 +238,18 @@ , m_rootGraphicsLayer(0) , m_isAcceleratedCompositingActive(false) { - ASSERT(client); + DCHECK(client); } WebPagePopupImpl::~WebPagePopupImpl() { - ASSERT(!m_page); + DCHECK(!m_page); } bool WebPagePopupImpl::initialize(WebViewImpl* webView, PagePopupClient* popupClient) { - ASSERT(webView); - ASSERT(popupClient); + DCHECK(webView); + DCHECK(popupClient); m_webView = webView; m_popupClient = popupClient; @@ -288,9 +288,9 @@ if (AXObjectCache* cache = m_popupClient->ownerElement().document().existingAXObjectCache()) cache->childrenChanged(&m_popupClient->ownerElement()); - ASSERT(frame->localDOMWindow()); + DCHECK(frame->localDOMWindow()); PagePopupSupplement::install(*frame, *this, m_popupClient); - ASSERT(m_popupClient->ownerElement().document().existingAXObjectCache() == frame->document()->existingAXObjectCache()); + DCHECK_EQ(m_popupClient->ownerElement().document().existingAXObjectCache(), frame->document()->existingAXObjectCache()); RefPtr<SharedBuffer> data = SharedBuffer::create(); m_popupClient->writeDocument(data.get()); @@ -325,7 +325,7 @@ if (!document) return 0; AXObjectCache* cache = document->axObjectCache(); - ASSERT(cache); + DCHECK(cache); return toAXObjectCacheImpl(cache)->getOrCreate(document->layoutView()); } @@ -535,7 +535,7 @@ void WebPagePopupImpl::compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback* callback) { - ASSERT(isAcceleratedCompositingActive()); + DCHECK(isAcceleratedCompositingActive()); m_layerTreeView->compositeAndReadbackAsync(callback); }
diff --git a/third_party/WebKit/Source/web/WebPerformance.cpp b/third_party/WebKit/Source/web/WebPerformance.cpp index 95b1812..7d7bfe5 100644 --- a/third_party/WebKit/Source/web/WebPerformance.cpp +++ b/third_party/WebKit/Source/web/WebPerformance.cpp
@@ -190,6 +190,21 @@ return millisecondsToSeconds(m_private->timing()->firstContentfulPaint()); } +double WebPerformance::parseStart() const +{ + return millisecondsToSeconds(m_private->timing()->parseStart()); +} + +double WebPerformance::parseStop() const +{ + return millisecondsToSeconds(m_private->timing()->parseStop()); +} + +double WebPerformance::parseBlockedOnScriptLoadDuration() const +{ + return millisecondsToSeconds(m_private->timing()->parseBlockedOnScriptLoadDuration()); +} + WebPerformance::WebPerformance(const RawPtr<Performance>& performance) : m_private(performance) {
diff --git a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp index c46a25054..f650f41 100644 --- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp +++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
@@ -140,7 +140,7 @@ LayoutObjectDrawingRecorder drawingRecorder(context, *m_element->layoutObject(), DisplayItem::Type::WebPlugin, cullRect.m_rect); context.save(); - ASSERT(parent()->isFrameView()); + DCHECK(parent()->isFrameView()); FrameView* view = toFrameView(parent()); // The plugin is positioned in the root frame's coordinates, so it needs to @@ -459,7 +459,7 @@ v8::Local<v8::Value> v8value = toV8(m_element.get(), scriptState->context()->Global(), scriptState->isolate()); if (v8value.IsEmpty()) return v8::Local<v8::Object>(); - ASSERT(v8value->IsObject()); + DCHECK(v8value->IsObject()); return v8::Local<v8::Object>::Cast(v8value); } @@ -474,7 +474,7 @@ return WebString(); const KURL& kurl = url; - ASSERT(kurl.protocolIs("javascript")); + DCHECK(kurl.protocolIs("javascript")); String script = decodeURLEscapeSequences( kurl.getString().substring(strlen("javascript:"))); @@ -680,7 +680,7 @@ { #if ENABLE(OILPAN) // The plugin container must have been disposed of by now. - ASSERT(!m_webPlugin); + DCHECK(!m_webPlugin); #else dispose(); #endif @@ -694,7 +694,7 @@ setWantsWheelEvents(false); if (m_webPlugin) { - RELEASE_ASSERT(!m_webPlugin->container() || m_webPlugin->container() == this); + CHECK(!m_webPlugin->container() || m_webPlugin->container() == this); m_webPlugin->destroy(); m_webPlugin = nullptr; } @@ -714,7 +714,7 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) { - ASSERT(parent()->isFrameView()); + DCHECK(parent()->isFrameView()); // We cache the parent FrameView here as the plugin widget could be deleted // in the call to HandleEvent. See http://b/issue?id=1362948 @@ -742,7 +742,7 @@ void WebPluginContainerImpl::handleDragEvent(MouseEvent* event) { - ASSERT(event->isDragEvent()); + DCHECK(event->isDragEvent()); WebDragStatus dragStatus = WebDragStatusUnknown; if (event->type() == EventTypeNames::dragenter) @@ -897,7 +897,7 @@ void WebPluginContainerImpl::computeClipRectsForPlugin( const HTMLFrameOwnerElement* ownerElement, IntRect& windowRect, IntRect& clippedLocalRect, IntRect& unclippedIntLocalRect) const { - ASSERT(ownerElement); + DCHECK(ownerElement); if (!ownerElement->layoutObject()) { clippedLocalRect = IntRect();
diff --git a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp b/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp index fbf358e1..431d580 100644 --- a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp +++ b/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
@@ -591,7 +591,7 @@ child->initializeCoreFrame(frame()->host(), owner.get(), name, uniqueName); // Partially related with the above FIXME--the init() call may trigger JS dispatch. However, // if the parent is remote, it should never be detached synchronously... - ASSERT(child->frame()); + DCHECK(child->frame()); return child; } @@ -625,7 +625,7 @@ void WebRemoteFrameImpl::initializeFromFrame(WebLocalFrame* source) const { - ASSERT(source); + DCHECK(source); WebLocalFrameImpl* localFrameImpl = toWebLocalFrameImpl(source); client()->initializeChildFrame( @@ -635,7 +635,7 @@ void WebRemoteFrameImpl::setReplicatedOrigin(const WebSecurityOrigin& origin) const { - ASSERT(frame()); + DCHECK(frame()); frame()->securityContext()->setReplicatedOrigin(origin); // If the origin of a remote frame changed, the accessibility object for the owner @@ -655,33 +655,33 @@ void WebRemoteFrameImpl::setReplicatedSandboxFlags(WebSandboxFlags flags) const { - ASSERT(frame()); + DCHECK(frame()); frame()->securityContext()->enforceSandboxFlags(static_cast<SandboxFlags>(flags)); } void WebRemoteFrameImpl::setReplicatedName(const WebString& name, const WebString& uniqueName) const { - ASSERT(frame()); + DCHECK(frame()); frame()->tree().setPrecalculatedName(name, uniqueName); } void WebRemoteFrameImpl::setReplicatedShouldEnforceStrictMixedContentChecking(bool shouldEnforce) const { - ASSERT(frame()); + DCHECK(frame()); frame()->securityContext()->setShouldEnforceStrictMixedContentChecking(shouldEnforce); } void WebRemoteFrameImpl::setReplicatedPotentiallyTrustworthyUniqueOrigin(bool isUniqueOriginPotentiallyTrustworthy) const { - ASSERT(frame()); + DCHECK(frame()); // If |isUniqueOriginPotentiallyTrustworthy| is true, then the origin must be unique. - ASSERT(!isUniqueOriginPotentiallyTrustworthy || frame()->securityContext()->getSecurityOrigin()->isUnique()); + DCHECK(!isUniqueOriginPotentiallyTrustworthy || frame()->securityContext()->getSecurityOrigin()->isUnique()); frame()->securityContext()->getSecurityOrigin()->setUniqueOriginIsPotentiallyTrustworthy(isUniqueOriginPotentiallyTrustworthy); } void WebRemoteFrameImpl::DispatchLoadEventForFrameOwner() const { - ASSERT(frame()->owner()->isLocal()); + DCHECK(frame()->owner()->isLocal()); frame()->owner()->dispatchLoad(); }
diff --git a/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp b/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp index 5595abb..a792019 100644 --- a/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp +++ b/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp
@@ -110,6 +110,11 @@ RuntimeEnabledFeatures::setDisplayList2dCanvasEnabled(enable); } +void WebRuntimeFeatures::enableDocumentWriteEvaluator(bool enable) +{ + RuntimeEnabledFeatures::setDocumentWriteEvaluatorEnabled(enable); +} + void WebRuntimeFeatures::enableExperimentalCanvasFeatures(bool enable) { RuntimeEnabledFeatures::setExperimentalCanvasFeaturesEnabled(enable);
diff --git a/third_party/WebKit/Source/web/WebScopedWindowFocusAllowedIndicator.cpp b/third_party/WebKit/Source/web/WebScopedWindowFocusAllowedIndicator.cpp index dbddb91..e32eb89 100644 --- a/third_party/WebKit/Source/web/WebScopedWindowFocusAllowedIndicator.cpp +++ b/third_party/WebKit/Source/web/WebScopedWindowFocusAllowedIndicator.cpp
@@ -39,7 +39,7 @@ void WebScopedWindowFocusAllowedIndicator::initialize(WebDocument* webDocument) { Document* document = webDocument->unwrap<Document>(); - ASSERT(document); + DCHECK(document); m_private.reset(new ScopedWindowFocusAllowedIndicator(document)); }
diff --git a/third_party/WebKit/Source/web/WebSelection.cpp b/third_party/WebKit/Source/web/WebSelection.cpp index b30d42b2..f043d2e3 100644 --- a/third_party/WebKit/Source/web/WebSelection.cpp +++ b/third_party/WebKit/Source/web/WebSelection.cpp
@@ -11,9 +11,9 @@ static WebSelectionBound getWebSelectionBound(const CompositedSelection& selection, bool isStart) { - ASSERT(selection.type != NoSelection); + DCHECK_NE(selection.type, NoSelection); const CompositedSelectionBound& bound = isStart ? selection.start : selection.end; - ASSERT(bound.layer); + DCHECK(bound.layer); WebSelectionBound::Type type = WebSelectionBound::Caret; if (selection.type == RangeSelection) {
diff --git a/third_party/WebKit/Source/web/WebSettingsImpl.cpp b/third_party/WebKit/Source/web/WebSettingsImpl.cpp index b464582a..48f4923 100644 --- a/third_party/WebKit/Source/web/WebSettingsImpl.cpp +++ b/third_party/WebKit/Source/web/WebSettingsImpl.cpp
@@ -53,7 +53,7 @@ , m_viewportMetaNonUserScalableQuirk(false) , m_clobberUserAgentInitialScaleQuirk(false) { - ASSERT(settings); + DCHECK(settings); } void WebSettingsImpl::setFromStrings(const WebString& name, const WebString& value)
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp index abf6665..286f930 100644 --- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp +++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
@@ -92,7 +92,7 @@ WebSharedWorkerImpl::~WebSharedWorkerImpl() { - ASSERT(m_webView); + DCHECK(m_webView); // Detach the client before closing the view to avoid getting called back. m_mainFrame->setClient(0); @@ -124,7 +124,7 @@ // Create 'shadow page'. This page is never displayed, it is used to proxy the // loading requests from the worker context to the rest of WebKit and Chromium // infrastructure. - ASSERT(!m_webView); + DCHECK(!m_webView); m_webView = WebView::create(0); // FIXME: http://crbug.com/363843. This needs to find a better way to // not create graphics layers. @@ -168,8 +168,8 @@ void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) { - ASSERT(!m_loadingDocument); - ASSERT(!m_mainScriptLoader); + DCHECK(!m_loadingDocument); + DCHECK(!m_mainScriptLoader); m_networkProvider = adoptPtr(m_client->createServiceWorkerNetworkProvider(frame->dataSource())); m_mainScriptLoader = WorkerScriptLoader::create(); m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextSharedWorker); @@ -305,8 +305,8 @@ void WebSharedWorkerImpl::onScriptLoaderFinished() { - ASSERT(m_loadingDocument); - ASSERT(m_mainScriptLoader); + DCHECK(m_loadingDocument); + DCHECK(m_mainScriptLoader); if (m_askedToTerminate) return; if (m_mainScriptLoader->failed()) {
diff --git a/third_party/WebKit/Source/web/WebSpeechRecognitionResult.cpp b/third_party/WebKit/Source/web/WebSpeechRecognitionResult.cpp index 1bdb388..1b86dcb 100644 --- a/third_party/WebKit/Source/web/WebSpeechRecognitionResult.cpp +++ b/third_party/WebKit/Source/web/WebSpeechRecognitionResult.cpp
@@ -42,7 +42,7 @@ void WebSpeechRecognitionResult::assign(const WebVector<WebString>& transcripts, const WebVector<float>& confidences, bool final) { - ASSERT(transcripts.size() == confidences.size()); + DCHECK_EQ(transcripts.size(), confidences.size()); HeapVector<Member<SpeechRecognitionAlternative>> alternatives(transcripts.size()); for (size_t i = 0; i < transcripts.size(); ++i)
diff --git a/third_party/WebKit/Source/web/WebSurroundingText.cpp b/third_party/WebKit/Source/web/WebSurroundingText.cpp index 0bbc7e67..82fd5b0 100644 --- a/third_party/WebKit/Source/web/WebSurroundingText.cpp +++ b/third_party/WebKit/Source/web/WebSurroundingText.cpp
@@ -58,7 +58,7 @@ size_t WebSurroundingText::hitOffsetInTextContent() const { - ASSERT(m_private->startOffsetInContent() == m_private->endOffsetInContent()); + DCHECK_EQ(m_private->startOffsetInContent(), m_private->endOffsetInContent()); return m_private->startOffsetInContent(); }
diff --git a/third_party/WebKit/Source/web/WebUserMediaRequest.cpp b/third_party/WebKit/Source/web/WebUserMediaRequest.cpp index b13ac15a..51ed869 100644 --- a/third_party/WebKit/Source/web/WebUserMediaRequest.cpp +++ b/third_party/WebKit/Source/web/WebUserMediaRequest.cpp
@@ -62,31 +62,31 @@ bool WebUserMediaRequest::audio() const { - ASSERT(!isNull()); + DCHECK(!isNull()); return m_private->audio(); } bool WebUserMediaRequest::video() const { - ASSERT(!isNull()); + DCHECK(!isNull()); return m_private->video(); } WebMediaConstraints WebUserMediaRequest::audioConstraints() const { - ASSERT(!isNull()); + DCHECK(!isNull()); return m_private->audioConstraints(); } WebMediaConstraints WebUserMediaRequest::videoConstraints() const { - ASSERT(!isNull()); + DCHECK(!isNull()); return m_private->videoConstraints(); } WebSecurityOrigin WebUserMediaRequest::getSecurityOrigin() const { - ASSERT(!isNull()); + DCHECK(!isNull()); if (!m_private->getExecutionContext()) return WebSecurityOrigin::createFromString("test://test"); return WebSecurityOrigin(m_private->getExecutionContext()->getSecurityOrigin()); @@ -94,31 +94,32 @@ WebDocument WebUserMediaRequest::ownerDocument() const { - ASSERT(!isNull()); + DCHECK(!isNull()); return WebDocument(m_private->ownerDocument()); } void WebUserMediaRequest::requestSucceeded(const WebMediaStream& streamDescriptor) { - ASSERT(!isNull() && !streamDescriptor.isNull()); + DCHECK(!isNull()); + DCHECK(!streamDescriptor.isNull()); m_private->succeed(streamDescriptor); } void WebUserMediaRequest::requestDenied(const WebString& description) { - ASSERT(!isNull()); + DCHECK(!isNull()); m_private->failPermissionDenied(description); } void WebUserMediaRequest::requestFailedConstraint(const WebString& constraintName, const WebString& description) { - ASSERT(!isNull()); + DCHECK(!isNull()); m_private->failConstraint(constraintName, description); } void WebUserMediaRequest::requestFailedUASpecific(const WebString& name, const WebString& constraintName, const WebString& description) { - ASSERT(!isNull()); + DCHECK(!isNull()); m_private->failUASpecific(name, constraintName, description); }
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp index 1e934d3..c335f2d 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.cpp +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -69,6 +69,7 @@ #include "core/layout/LayoutPart.h" #include "core/layout/LayoutView.h" #include "core/layout/TextAutosizer.h" +#include "core/layout/api/LayoutViewItem.h" #include "core/layout/compositing/PaintLayerCompositor.h" #include "core/loader/DocumentLoader.h" #include "core/loader/FrameLoadRequest.h" @@ -265,7 +266,7 @@ : m_client(client) , m_userGestureObserved(userGestureObserved) { - ASSERT(m_userGestureObserved); + DCHECK(m_userGestureObserved); } UserGestureNotifier::~UserGestureNotifier() @@ -362,7 +363,7 @@ void WebView::didExitModalLoop() { - ASSERT(pageLoadDeferrerStack().size()); + DCHECK(pageLoadDeferrerStack().size()); pageLoadDeferrerStack().removeLast(); } @@ -373,13 +374,13 @@ void WebViewImpl::setCredentialManagerClient(WebCredentialManagerClient* webCredentialManagerClient) { - ASSERT(m_page); + DCHECK(m_page); provideCredentialManagerClientTo(*m_page, new CredentialManagerClient(webCredentialManagerClient)); } void WebViewImpl::setPrerendererClient(WebPrerendererClient* prerendererClient) { - ASSERT(m_page); + DCHECK(m_page); providePrerendererClientTo(*m_page, new PrerendererClientImpl(prerendererClient)); } @@ -478,12 +479,12 @@ WebViewImpl::~WebViewImpl() { - ASSERT(!m_page); + DCHECK(!m_page); // Each highlight uses m_owningWebViewImpl->m_linkHighlightsTimeline // in destructor. m_linkHighlightsTimeline might be destroyed earlier // than m_linkHighlights. - ASSERT(m_linkHighlights.isEmpty()); + DCHECK(m_linkHighlights.isEmpty()); } WebDevToolsAgentImpl* WebViewImpl::mainFrameDevToolsAgentImpl() @@ -507,7 +508,7 @@ bool WebViewImpl::tabKeyCyclesThroughElements() const { - ASSERT(m_page); + DCHECK(m_page); return m_page->tabKeyCyclesThroughElements(); } @@ -532,7 +533,7 @@ if (event.button == WebMouseEvent::ButtonLeft) { pagePopup = m_pagePopup; hidePopups(); - ASSERT(!m_pagePopup); + DCHECK(!m_pagePopup); } m_lastMouseDownPoint = WebPoint(event.x, event.y); @@ -659,7 +660,7 @@ bool WebViewImpl::scrollBy(const WebFloatSize& delta, const WebFloatSize& velocity) { - ASSERT(m_flingSourceDevice != WebGestureDeviceUninitialized); + DCHECK_NE(m_flingSourceDevice, WebGestureDeviceUninitialized); if (!m_page || !m_page->mainFrame() || !m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFrame()->view()) return false; @@ -736,9 +737,9 @@ m_globalPositionOnFlingStart = WebPoint(event.globalX, event.globalY); m_flingModifier = event.modifiers; m_flingSourceDevice = event.sourceDevice; - ASSERT(m_flingSourceDevice != WebGestureDeviceUninitialized); + DCHECK_NE(m_flingSourceDevice, WebGestureDeviceUninitialized); OwnPtr<WebGestureCurve> flingCurve = adoptPtr(Platform::current()->createFlingAnimationCurve(event.sourceDevice, WebFloatPoint(event.data.flingStart.velocityX, event.data.flingStart.velocityY), WebSize())); - ASSERT(flingCurve); + DCHECK(flingCurve); m_gestureAnimation = WebActiveGestureAnimation::createAtAnimationStart(flingCurve.release(), this); scheduleAnimation(); eventResult = WebInputEventResult::HandledSystem; @@ -826,7 +827,7 @@ // element from immediately reopening the same popup. RefPtr<WebPagePopupImpl> pagePopup = m_pagePopup; hidePopups(); - ASSERT(!m_pagePopup); + DCHECK(!m_pagePopup); m_client->cancelScheduledContentIntents(); if (detectContentOnTouch(targetedEvent)) { @@ -912,10 +913,10 @@ WebInputEventResult WebViewImpl::handleSyntheticWheelFromTouchpadPinchEvent(const WebGestureEvent& pinchEvent) { - ASSERT(pinchEvent.type == WebInputEvent::GesturePinchUpdate); + DCHECK_EQ(pinchEvent.type, WebInputEvent::GesturePinchUpdate); // Touchscreen pinch events should not reach Blink. - ASSERT(pinchEvent.sourceDevice == WebGestureDeviceTouchpad); + DCHECK_EQ(pinchEvent.sourceDevice, WebGestureDeviceTouchpad); // For pinch gesture events, match typical trackpad behavior on Windows by sending fake // wheel events with the ctrl modifier set when we see trackpad pinch gestures. Ideally @@ -941,7 +942,7 @@ // - a formula that's relatively easy to use from JavaScript // Note that 'wheel' event deltaY values have their sign inverted. So to // convert a wheel deltaY back to a scale use Math.exp(-deltaY/100). - ASSERT(pinchEvent.data.pinchUpdate.scale > 0); + DCHECK_GT(pinchEvent.data.pinchUpdate.scale, 0); wheelEvent.deltaY = 100.0f * log(pinchEvent.data.pinchUpdate.scale); wheelEvent.hasPreciseScrollingDeltas = true; wheelEvent.wheelTicksX = 0; @@ -955,14 +956,14 @@ void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters& parameters) { TRACE_EVENT0("blink", "WebViewImpl::transferActiveWheelFlingAnimation"); - ASSERT(!m_gestureAnimation); + DCHECK(!m_gestureAnimation); m_positionOnFlingStart = parameters.point; m_globalPositionOnFlingStart = parameters.globalPoint; m_flingModifier = parameters.modifiers; OwnPtr<WebGestureCurve> curve = adoptPtr(Platform::current()->createFlingAnimationCurve(parameters.sourceDevice, WebFloatPoint(parameters.delta), parameters.cumulativeScroll)); - ASSERT(curve); + DCHECK(curve); m_gestureAnimation = WebActiveGestureAnimation::createWithTimeOffset(curve.release(), this, parameters.startTime); - ASSERT(parameters.sourceDevice != WebGestureDeviceUninitialized); + DCHECK_NE(parameters.sourceDevice, WebGestureDeviceUninitialized); m_flingSourceDevice = parameters.sourceDevice; scheduleAnimation(); } @@ -1064,7 +1065,7 @@ WebInputEventResult WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) { - ASSERT((event.type == WebInputEvent::RawKeyDown) + DCHECK((event.type == WebInputEvent::RawKeyDown) || (event.type == WebInputEvent::KeyDown) || (event.type == WebInputEvent::KeyUp)); TRACE_EVENT2("input", "WebViewImpl::handleKeyEvent", @@ -1153,7 +1154,7 @@ WebInputEventResult WebViewImpl::handleCharEvent(const WebKeyboardEvent& event) { - ASSERT(event.type == WebInputEvent::Char); + DCHECK_EQ(event.type, WebInputEvent::Char); TRACE_EVENT1("input", "WebViewImpl::handleCharEvent", "text", String(event.text).utf8()); @@ -1258,8 +1259,8 @@ const int newWidth = source.width + leftMargin + rightMargin; const int newX = source.x - leftMargin; - ASSERT(newWidth >= 0); - ASSERT(scrollOffset.width() + newX + newWidth <= maxSize.width); + DCHECK_GE(newWidth, 0); + DCHECK_LE(scrollOffset.width() + newX + newWidth, maxSize.width); return WebRect(newX, source.y, newWidth, source.height); } @@ -1684,10 +1685,10 @@ PagePopup* WebViewImpl::openPagePopup(PagePopupClient* client) { - ASSERT(client); + DCHECK(client); if (hasOpenedPopup()) hidePopups(); - ASSERT(!m_pagePopup); + DCHECK(!m_pagePopup); WebWidget* popupWidget = m_client->createPopupMenu(WebPopupTypePage); // createPopupMenu returns nullptr if this renderer process is about to die. @@ -1704,9 +1705,9 @@ void WebViewImpl::closePagePopup(PagePopup* popup) { - ASSERT(popup); + DCHECK(popup); WebPagePopupImpl* popupImpl = toWebPagePopupImpl(popup); - ASSERT(m_pagePopup.get() == popupImpl); + DCHECK_EQ(m_pagePopup.get(), popupImpl); if (m_pagePopup.get() != popupImpl) return; m_pagePopup->closePopup(); @@ -1734,9 +1735,9 @@ // See https://crbug.com/566130 if (!mainFrameImpl() || !mainFrameImpl()->frame()->isLocalFrame()) return; - ASSERT(!m_popupMouseWheelEventListener); + DCHECK(!m_popupMouseWheelEventListener); Document* document = mainFrameImpl()->frame()->document(); - ASSERT(document); + DCHECK(document); // We register an empty event listener, EmptyEventListener, so that mouse // wheel events get sent to the WebView. m_popupMouseWheelEventListener = EmptyEventListener::create(); @@ -1749,9 +1750,9 @@ // See https://crbug.com/566130 if (!mainFrameImpl() || !mainFrameImpl()->frame()->isLocalFrame()) return; - ASSERT(m_popupMouseWheelEventListener); + DCHECK(m_popupMouseWheelEventListener); Document* document = mainFrameImpl()->frame()->document(); - ASSERT(document); + DCHECK(document); // Document may have already removed the event listener, for instance, due // to a navigation, but remove it anyway. document->removeEventListener(EventTypeNames::mousewheel, m_popupMouseWheelEventListener.release(), false); @@ -1777,7 +1778,7 @@ void WebViewImpl::close() { WebDevToolsAgentImpl::webViewImplClosed(this); - ASSERT(allInstances().contains(this)); + DCHECK(allInstances().contains(this)); allInstances().remove(this); if (m_page) { @@ -1869,7 +1870,8 @@ void WebViewImpl::resizeViewWhileAnchored(FrameView* view) { - ASSERT(mainFrameImpl() && mainFrameImpl()->frame()->isLocalFrame()); + DCHECK(mainFrameImpl()); + DCHECK(mainFrameImpl()->frame()->isLocalFrame()); { // Avoids unnecessary invalidations while various bits of state in TextAutosizer are updated. @@ -1938,14 +1940,14 @@ void WebViewImpl::beginFrame(double lastFrameTimeMonotonic) { TRACE_EVENT1("blink", "WebViewImpl::beginFrame", "frameTime", lastFrameTimeMonotonic); - ASSERT(lastFrameTimeMonotonic); + DCHECK(lastFrameTimeMonotonic); // Create synthetic wheel events as necessary for fling. if (m_gestureAnimation) { if (m_gestureAnimation->animate(lastFrameTimeMonotonic)) scheduleAnimation(); else { - ASSERT(m_flingSourceDevice != WebGestureDeviceUninitialized); + DCHECK_NE(m_flingSourceDevice, WebGestureDeviceUninitialized); WebGestureDevice lastFlingSourceDevice = m_flingSourceDevice; endActiveFlingAnimation(); @@ -2016,7 +2018,7 @@ { // This should only be used when compositing is not being used for this // WebView, and it is painting into the recording of its parent. - ASSERT(!isAcceleratedCompositingActive()); + DCHECK(!isAcceleratedCompositingActive()); double paintStart = currentTime(); PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLocalMainFrame()); @@ -2034,7 +2036,7 @@ // Note: This method exists on OS(ANDROID) and will hopefully be // removed once the link disambiguation feature renders using // the compositor. - ASSERT(isAcceleratedCompositingActive()); + DCHECK(isAcceleratedCompositingActive()); PageWidgetDelegate::paintIgnoringCompositing(*m_page, canvas, rect, *m_page->deprecatedLocalMainFrame()); } @@ -2396,7 +2398,7 @@ return false; Element* editable = focused->selection().rootEditableElementOrDocumentElement(); - ASSERT(editable); + DCHECK(editable); PlainTextRange plainTextRange(PlainTextRange::create(*editable, range)); if (plainTextRange.isNull()) return false; @@ -2794,7 +2796,7 @@ { if (!m_webSettings) m_webSettings = adoptPtr(new WebSettingsImpl(&m_page->settings(), m_devToolsEmulator.get())); - ASSERT(m_webSettings); + DCHECK(m_webSettings); return m_webSettings.get(); } @@ -3133,19 +3135,19 @@ void WebViewImpl::setVisualViewportOffset(const WebFloatPoint& offset) { - ASSERT(page()); + DCHECK(page()); page()->frameHost().visualViewport().setLocation(offset); } WebFloatPoint WebViewImpl::visualViewportOffset() const { - ASSERT(page()); + DCHECK(page()); return page()->frameHost().visualViewport().visibleRect().location(); } WebFloatSize WebViewImpl::visualViewportSize() const { - ASSERT(page()); + DCHECK(page()); return page()->frameHost().visualViewport().visibleRect().size(); } @@ -3175,7 +3177,7 @@ void WebViewImpl::setPageScaleFactorAndLocation(float scaleFactor, const FloatPoint& location) { - ASSERT(page()); + DCHECK(page()); page()->frameHost().visualViewport().setScaleAndLocation( clampPageScaleFactorToLimits(scaleFactor), @@ -3184,7 +3186,7 @@ void WebViewImpl::setPageScaleFactor(float scaleFactor) { - ASSERT(page()); + DCHECK(page()); scaleFactor = clampPageScaleFactorToLimits(scaleFactor); if (scaleFactor == pageScaleFactor()) @@ -3424,10 +3426,10 @@ { if (!page()->mainFrame()->isLocalFrame()) return IntSize(); - LayoutView* root = page()->deprecatedLocalMainFrame()->contentLayoutObject(); - if (!root) + LayoutViewItem root = page()->deprecatedLocalMainFrame()->contentLayoutItem(); + if (root.isNull()) return IntSize(); - return root->documentRect().size(); + return root.documentRect().size(); } WebSize WebViewImpl::contentsPreferredMinimumSize() @@ -3621,7 +3623,7 @@ WebDragOperationsMask operationsAllowed, int modifiers) { - ASSERT(!m_currentDragData); + DCHECK(!m_currentDragData); m_currentDragData = DataObject::create(webDragData); m_operationsAllowed = operationsAllowed; @@ -3642,7 +3644,7 @@ void WebViewImpl::dragTargetDragLeave() { - ASSERT(m_currentDragData); + DCHECK(m_currentDragData); DragData dragData( m_currentDragData.get(), @@ -3662,7 +3664,7 @@ const WebPoint& screenPoint, int modifiers) { - ASSERT(m_currentDragData); + DCHECK(m_currentDragData); WebAutofillClient* autofillClient = mainFrameImpl() ? mainFrameImpl()->autofillClient() : 0; UserGestureNotifier notifier(autofillClient, &m_userGestureObserved); @@ -3719,7 +3721,7 @@ WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPoint, const WebPoint& screenPoint, DragAction dragAction, int modifiers) { - ASSERT(m_currentDragData); + DCHECK(m_currentDragData); m_currentDragData->setModifiers(modifiers); DragData dragData( @@ -4131,14 +4133,14 @@ { if (!m_client) return; - ASSERT(!m_doingDragAndDrop); + DCHECK(!m_doingDragAndDrop); m_doingDragAndDrop = true; m_client->startDragging(WebLocalFrameImpl::fromFrame(frame), dragData, mask, dragImage, dragImageOffset); } void WebViewImpl::setIgnoreInputEvents(bool newValue) { - ASSERT(m_ignoreInputEvents != newValue); + DCHECK_NE(m_ignoreInputEvents, newValue); m_ignoreInputEvents = newValue; } @@ -4240,7 +4242,7 @@ // In SPv2, we attach layers via PaintArtifactCompositor, rather than // supplying a root GraphicsLayer from PaintLayerCompositor. - ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); + DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); VisualViewport& visualViewport = page()->frameHost().visualViewport(); visualViewport.attachToLayerTree(layer); @@ -4334,7 +4336,7 @@ // FIXME: only unittests, click to play, Android printing, and printing (for headers and footers) // make this assert necessary. We should make them not hit this code and then delete allowsBrokenNullLayerTreeView. - ASSERT(m_layerTreeView || !m_client || m_client->allowsBrokenNullLayerTreeView()); + DCHECK(m_layerTreeView || !m_client || m_client->allowsBrokenNullLayerTreeView()); if (Platform::current()->isThreadedAnimationEnabled() && m_layerTreeView) { m_linkHighlightsTimeline = adoptPtr(CompositorFactory::current().createAnimationTimeline()); @@ -4423,8 +4425,8 @@ void WebViewImpl::updateLayerTreeDeviceScaleFactor() { - ASSERT(page()); - ASSERT(m_layerTreeView); + DCHECK(page()); + DCHECK(m_layerTreeView); float deviceScaleFactor = m_compositorDeviceScaleFactorOverride ? m_compositorDeviceScaleFactorOverride : page()->deviceScaleFactor(); m_layerTreeView->setDeviceScaleFactor(deviceScaleFactor); @@ -4481,7 +4483,7 @@ void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState, bool isInitialState) { - ASSERT(visibilityState == WebPageVisibilityStateVisible || visibilityState == WebPageVisibilityStateHidden || visibilityState == WebPageVisibilityStatePrerender); + DCHECK(visibilityState == WebPageVisibilityStateVisible || visibilityState == WebPageVisibilityStateHidden || visibilityState == WebPageVisibilityStatePrerender); if (page()) m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int>(visibilityState)), isInitialState); @@ -4565,13 +4567,13 @@ // Otherwise, PaintLayerCompositor is expected to supply a root // GraphicsLayer via setRootGraphicsLayer. - ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); + DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); // TODO(jbroman): This should probably have hookups for overlays, visual // viewport, etc. WebLayer* rootLayer = m_paintArtifactCompositor.getWebLayer(); - ASSERT(rootLayer); + DCHECK(rootLayer); m_layerTreeView->setRootLayer(*rootLayer); // TODO(jbroman): This is cargo-culted from setRootGraphicsLayer. Is it
diff --git a/third_party/WebKit/Source/web/WorkerContentSettingsClient.cpp b/third_party/WebKit/Source/web/WorkerContentSettingsClient.cpp index fcbd5f1..6c4bd1a 100644 --- a/third_party/WebKit/Source/web/WorkerContentSettingsClient.cpp +++ b/third_party/WebKit/Source/web/WorkerContentSettingsClient.cpp
@@ -69,7 +69,7 @@ WorkerContentSettingsClient* WorkerContentSettingsClient::from(ExecutionContext& context) { WorkerClients* clients = toWorkerGlobalScope(context).clients(); - ASSERT(clients); + DCHECK(clients); return static_cast<WorkerContentSettingsClient*>(HeapSupplement<WorkerClients>::from(*clients, supplementName())); } @@ -81,7 +81,7 @@ void provideContentSettingsClientToWorker(WorkerClients* clients, PassOwnPtr<WebWorkerContentSettingsClientProxy> proxy) { - ASSERT(clients); + DCHECK(clients); WorkerContentSettingsClient::provideTo(*clients, WorkerContentSettingsClient::supplementName(), WorkerContentSettingsClient::create(proxy)); }
diff --git a/third_party/WebKit/Source/web/mac/WebSubstringUtil.mm b/third_party/WebKit/Source/web/mac/WebSubstringUtil.mm index af5d327..26f6185 100644 --- a/third_party/WebKit/Source/web/mac/WebSubstringUtil.mm +++ b/third_party/WebKit/Source/web/mac/WebSubstringUtil.mm
@@ -72,7 +72,7 @@ Node* container = it.currentContainer(); LayoutObject* layoutObject = container->layoutObject(); - ASSERT(layoutObject); + DCHECK(layoutObject); if (!layoutObject) continue;
diff --git a/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp b/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp index d622662..07b010a3 100644 --- a/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp +++ b/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp
@@ -56,8 +56,8 @@ WebLayer* getRootScrollLayer() { PaintLayerCompositor* compositor = frame()->contentLayoutObject()->compositor(); - ASSERT(compositor); - ASSERT(compositor->scrollLayer()); + DCHECK(compositor); + DCHECK(compositor->scrollLayer()); WebLayer* webScrollLayer = compositor->scrollLayer()->platformLayer(); return webScrollLayer;
diff --git a/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp b/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp index c1bbbac..8844846 100644 --- a/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp +++ b/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp
@@ -245,7 +245,7 @@ m_webViewWidget = nullptr; } if (m_webView) { - ASSERT(m_webView->mainFrame()->isWebRemoteFrame() || !testClientForFrame(m_webView->mainFrame())->isLoading()); + DCHECK(m_webView->mainFrame()->isWebRemoteFrame() || !testClientForFrame(m_webView->mainFrame())->isLoading()); m_webView->willCloseLayerTreeView(); m_webView->close(); m_webView = nullptr; @@ -285,7 +285,7 @@ void TestWebFrameClient::didStopLoading() { - ASSERT(m_loadsInProgress > 0); + DCHECK_GT(m_loadsInProgress, 0); --m_loadsInProgress; }
diff --git a/third_party/WebKit/Source/web/tests/PrerenderingTest.cpp b/third_party/WebKit/Source/web/tests/PrerenderingTest.cpp index db52f42..8e99e2c8 100644 --- a/third_party/WebKit/Source/web/tests/PrerenderingTest.cpp +++ b/third_party/WebKit/Source/web/tests/PrerenderingTest.cpp
@@ -65,13 +65,13 @@ void setExtraDataForNextPrerender(WebPrerender::ExtraData* extraData) { - ASSERT(!m_extraData); + DCHECK(!m_extraData); m_extraData = adoptPtr(extraData); } WebPrerender releaseWebPrerender() { - ASSERT(!m_webPrerenders.empty()); + DCHECK(!m_webPrerenders.empty()); WebPrerender retval(m_webPrerenders.front()); m_webPrerenders.pop_front(); return retval; @@ -93,7 +93,7 @@ { prerender->setExtraData(m_extraData.leakPtr()); - ASSERT(!prerender->isNull()); + DCHECK(!prerender->isNull()); m_webPrerenders.push_back(*prerender); } @@ -199,7 +199,7 @@ { Document* document = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame()->document(); Element* console = document->getElementById("console"); - ASSERT(isHTMLUListElement(console)); + DCHECK(isHTMLUListElement(console)); return *console; } @@ -210,13 +210,13 @@ WebString consoleAt(unsigned i) { - ASSERT(consoleLength() > i); + DCHECK_GT(consoleLength(), i); Node* item = NodeTraversal::childAt(console(), 1 + i); - ASSERT(item); - ASSERT(isHTMLLIElement(item)); - ASSERT(item->hasChildren()); + DCHECK(item); + DCHECK(isHTMLLIElement(item)); + DCHECK(item->hasChildren()); return item->textContent(); }
diff --git a/third_party/WebKit/Source/web/tests/ScreenWakeLockTest.cpp b/third_party/WebKit/Source/web/tests/ScreenWakeLockTest.cpp index f9b5c23..0ecebcffcd 100644 --- a/third_party/WebKit/Source/web/tests/ScreenWakeLockTest.cpp +++ b/third_party/WebKit/Source/web/tests/ScreenWakeLockTest.cpp
@@ -80,21 +80,21 @@ blink::LocalFrame* frame() { - ASSERT(m_webViewHelper.webViewImpl()); - ASSERT(m_webViewHelper.webViewImpl()->mainFrameImpl()); + DCHECK(m_webViewHelper.webViewImpl()); + DCHECK(m_webViewHelper.webViewImpl()->mainFrameImpl()); return m_webViewHelper.webViewImpl()->mainFrameImpl()->frame(); } blink::Screen* screen() { - ASSERT(frame()); - ASSERT(frame()->localDOMWindow()); + DCHECK(frame()); + DCHECK(frame()->localDOMWindow()); return frame()->localDOMWindow()->screen(); } bool screenKeepAwake() { - ASSERT(screen()); + DCHECK(screen()); return ScreenWakeLock::keepAwake(*screen()); } @@ -105,20 +105,20 @@ void setKeepAwake(bool keepAwake) { - ASSERT(screen()); + DCHECK(screen()); ScreenWakeLock::setKeepAwake(*screen(), keepAwake); } void show() { - ASSERT(m_webViewHelper.webView()); + DCHECK(m_webViewHelper.webView()); m_webViewHelper.webView()->setVisibilityState( blink::WebPageVisibilityStateVisible, false); } void hide() { - ASSERT(m_webViewHelper.webView()); + DCHECK(m_webViewHelper.webView()); m_webViewHelper.webView()->setVisibilityState( blink::WebPageVisibilityStateHidden, false); }
diff --git a/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp b/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp index e5a9db9..4e78e3f 100644 --- a/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp +++ b/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
@@ -84,8 +84,8 @@ WebLayer* getRootScrollLayer() { PaintLayerCompositor* compositor = frame()->contentLayoutObject()->compositor(); - ASSERT(compositor); - ASSERT(compositor->scrollLayer()); + DCHECK(compositor); + DCHECK(compositor->scrollLayer()); WebLayer* webScrollLayer = compositor->scrollLayer()->platformLayer(); return webScrollLayer; @@ -157,7 +157,7 @@ Document* document = frame()->document(); Element* scrollableElement = document->getElementById("scroller"); - ASSERT(scrollableElement); + DCHECK(scrollableElement); scrollableElement->setScrollTop(1.0); scrollableElement->setScrollLeft(1.0); @@ -175,7 +175,7 @@ ASSERT_TRUE(box->usesCompositedScrolling()); CompositedLayerMapping* compositedLayerMapping = box->layer()->compositedLayerMapping(); ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer()); - ASSERT(compositedLayerMapping->scrollingContentsLayer()); + DCHECK(compositedLayerMapping->scrollingContentsLayer()); WebLayer* webScrollLayer = compositedLayerMapping->scrollingContentsLayer()->platformLayer(); ASSERT_TRUE(webScrollLayer); ASSERT_NEAR(1.2, webScrollLayer->scrollPositionDouble().x, 0.01); @@ -379,7 +379,7 @@ // Verify the properties of the accelerated scrolling element starting from the LayoutObject // all the way to the WebLayer. Element* scrollableElement = frame()->document()->getElementById("scrollable"); - ASSERT(scrollableElement); + DCHECK(scrollableElement); LayoutObject* layoutObject = scrollableElement->layoutObject(); ASSERT_TRUE(layoutObject->isBox()); @@ -391,7 +391,7 @@ CompositedLayerMapping* compositedLayerMapping = box->layer()->compositedLayerMapping(); ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer()); - ASSERT(compositedLayerMapping->scrollingContentsLayer()); + DCHECK(compositedLayerMapping->scrollingContentsLayer()); GraphicsLayer* graphicsLayer = compositedLayerMapping->scrollingContentsLayer(); ASSERT_EQ(box->layer()->getScrollableArea(), graphicsLayer->getScrollableArea()); @@ -419,7 +419,7 @@ // Verify the properties of the accelerated scrolling element starting from the LayoutObject // all the way to the WebLayer. Element* overflowElement = frame()->document()->getElementById("unscrollable-y"); - ASSERT(overflowElement); + DCHECK(overflowElement); LayoutObject* layoutObject = overflowElement->layoutObject(); ASSERT_TRUE(layoutObject->isBox()); @@ -431,7 +431,7 @@ CompositedLayerMapping* compositedLayerMapping = box->layer()->compositedLayerMapping(); ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer()); - ASSERT(compositedLayerMapping->scrollingContentsLayer()); + DCHECK(compositedLayerMapping->scrollingContentsLayer()); GraphicsLayer* graphicsLayer = compositedLayerMapping->scrollingContentsLayer(); ASSERT_EQ(box->layer()->getScrollableArea(), graphicsLayer->getScrollableArea()); @@ -442,7 +442,7 @@ ASSERT_FALSE(webScrollLayer->userScrollableVertical()); overflowElement = frame()->document()->getElementById("unscrollable-x"); - ASSERT(overflowElement); + DCHECK(overflowElement); layoutObject = overflowElement->layoutObject(); ASSERT_TRUE(layoutObject->isBox()); @@ -454,7 +454,7 @@ compositedLayerMapping = box->layer()->compositedLayerMapping(); ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer()); - ASSERT(compositedLayerMapping->scrollingContentsLayer()); + DCHECK(compositedLayerMapping->scrollingContentsLayer()); graphicsLayer = compositedLayerMapping->scrollingContentsLayer(); ASSERT_EQ(box->layer()->getScrollableArea(), graphicsLayer->getScrollableArea()); @@ -565,7 +565,7 @@ Document* document = frame()->document(); Element* scrollableElement = document->getElementById("scroller"); - ASSERT(scrollableElement); + DCHECK(scrollableElement); LayoutObject* layoutObject = scrollableElement->layoutObject(); ASSERT_TRUE(layoutObject->isBox());
diff --git a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp index 260d46f..b400edc 100644 --- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp +++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
@@ -151,8 +151,8 @@ WebLayer* getRootScrollLayer() { PaintLayerCompositor* compositor = frame()->contentLayoutObject()->compositor(); - ASSERT(compositor); - ASSERT(compositor->scrollLayer()); + DCHECK(compositor); + DCHECK(compositor->scrollLayer()); WebLayer* webScrollLayer = compositor->scrollLayer()->platformLayer(); return webScrollLayer; @@ -1701,7 +1701,7 @@ navigateTo(m_baseURL + "window_dimensions.html"); Element* output = frame()->document()->getElementById("output"); - ASSERT(output); + DCHECK(output); EXPECT_EQ(std::string("1600x1200"), std::string(output->innerHTML().ascii().data())); } @@ -1717,7 +1717,7 @@ navigateTo(m_baseURL + "window_dimensions_wide_div.html"); Element* output = frame()->document()->getElementById("output"); - ASSERT(output); + DCHECK(output); EXPECT_EQ(std::string("2000x1500"), std::string(output->innerHTML().ascii().data())); }
diff --git a/third_party/WebKit/Source/web/tests/WebDocumentTest.cpp b/third_party/WebKit/Source/web/tests/WebDocumentTest.cpp index a451a14..4247354 100644 --- a/third_party/WebKit/Source/web/tests/WebDocumentTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebDocumentTest.cpp
@@ -76,7 +76,7 @@ ASSERT_EQ(0U, elementCount); HTMLElement* bodyElement = coreDoc->body(); - ASSERT(bodyElement); + DCHECK(bodyElement); const ComputedStyle& styleBeforeInsertion = bodyElement->computedStyleRef();
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp index 835c19d3..ab618ab 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -257,7 +257,7 @@ webViewHelper->initializeAndLoad(m_baseURL + "nodeimage.html"); webViewHelper->resize(WebSize(640, 480)); RawPtr<LocalFrame> frame = toLocalFrame(webViewHelper->webViewImpl()->page()->mainFrame()); - ASSERT(frame); + DCHECK(frame); Element* element = frame->document()->getElementById(testcase.c_str()); return frame->nodeImage(*element); } @@ -265,7 +265,7 @@ void removeElementById(WebLocalFrameImpl* frame, const AtomicString& id) { Element* element = frame->frame()->document()->getElementById(id); - ASSERT(element); + DCHECK(element); element->remove(); } @@ -5972,7 +5972,7 @@ virtual WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString&, const WebString&, WebSandboxFlags, const WebFrameOwnerProperties& frameOwnerProperties) { - ASSERT(m_childClient); + DCHECK(m_childClient); m_childFrameCreationCount++; WebFrame* frame = WebLocalFrame::create(scope, m_childClient); parent->appendChild(frame);
diff --git a/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp b/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp index 3cb162d..4f86d07 100644 --- a/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
@@ -142,7 +142,7 @@ void TestPlugin::printPage(int pageNumber, WebCanvas* canvas) { - ASSERT(m_testClient); + DCHECK(m_testClient); m_testClient->onPrintPage(); } @@ -160,14 +160,14 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->settings()->setPluginsEnabled(true); webView->resize(WebSize(300, 300)); webView->updateAllLifecyclePhases(); runPendingTasks(); WebPluginContainer* pluginContainerOne = getWebPluginContainer(webView, WebString::fromUTF8("translated-plugin")); - ASSERT(pluginContainerOne); + DCHECK(pluginContainerOne); WebPoint point1 = pluginContainerOne->rootFrameToLocalPoint(WebPoint(10, 10)); ASSERT_EQ(0, point1.x); ASSERT_EQ(0, point1.y); @@ -176,7 +176,7 @@ ASSERT_EQ(90, point2.y); WebPluginContainer* pluginContainerTwo = getWebPluginContainer(webView, WebString::fromUTF8("rotated-plugin")); - ASSERT(pluginContainerTwo); + DCHECK(pluginContainerTwo); WebPoint point3 = pluginContainerTwo->rootFrameToLocalPoint(WebPoint(0, 10)); ASSERT_EQ(10, point3.x); ASSERT_EQ(0, point3.y); @@ -192,7 +192,7 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "test.pdf", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->updateAllLifecyclePhases(); WebDocument document = webView->mainFrame()->document(); @@ -209,7 +209,7 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "iframe_pdf.html", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->updateAllLifecyclePhases(); WebDocument document = webView->mainFrame()->document(); @@ -227,7 +227,7 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "test.pdf", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->updateAllLifecyclePhases(); runPendingTasks(); WebFrame* frame = webView->mainFrame(); @@ -240,7 +240,7 @@ SkPictureRecorder recorder; frame->printPage(0, recorder.beginRecording(IntRect())); frame->printEnd(); - ASSERT(pluginWebFrameClient.printedAtLeastOnePage()); + DCHECK(pluginWebFrameClient.printedAtLeastOnePage()); } TEST_F(WebPluginContainerTest, PrintAllPages) @@ -250,7 +250,7 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "test.pdf", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->updateAllLifecyclePhases(); runPendingTasks(); WebFrame* frame = webView->mainFrame(); @@ -263,7 +263,7 @@ SkPictureRecorder recorder; frame->printPagesWithBoundaries(recorder.beginRecording(IntRect()), WebSize()); frame->printEnd(); - ASSERT(pluginWebFrameClient.printedAtLeastOnePage()); + DCHECK(pluginWebFrameClient.printedAtLeastOnePage()); } TEST_F(WebPluginContainerTest, LocalToWindowPointTest) @@ -272,14 +272,14 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->settings()->setPluginsEnabled(true); webView->resize(WebSize(300, 300)); webView->updateAllLifecyclePhases(); runPendingTasks(); WebPluginContainer* pluginContainerOne = getWebPluginContainer(webView, WebString::fromUTF8("translated-plugin")); - ASSERT(pluginContainerOne); + DCHECK(pluginContainerOne); WebPoint point1 = pluginContainerOne->localToRootFramePoint(WebPoint(0, 0)); ASSERT_EQ(10, point1.x); ASSERT_EQ(10, point1.y); @@ -288,7 +288,7 @@ ASSERT_EQ(100, point2.y); WebPluginContainer* pluginContainerTwo = getWebPluginContainer(webView, WebString::fromUTF8("rotated-plugin")); - ASSERT(pluginContainerTwo); + DCHECK(pluginContainerTwo); WebPoint point3 = pluginContainerTwo->localToRootFramePoint(WebPoint(10, 0)); ASSERT_EQ(0, point3.x); ASSERT_EQ(10, point3.y); @@ -304,7 +304,7 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->settings()->setPluginsEnabled(true); webView->resize(WebSize(300, 300)); webView->updateAllLifecyclePhases(); @@ -325,7 +325,7 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->settings()->setPluginsEnabled(true); webView->resize(WebSize(300, 300)); webView->updateAllLifecyclePhases(); @@ -379,7 +379,7 @@ CustomPluginWebFrameClient<EventTestPlugin> pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->settings()->setPluginsEnabled(true); webView->resize(WebSize(300, 300)); webView->updateAllLifecyclePhases(); @@ -421,7 +421,7 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->settings()->setPluginsEnabled(true); webView->resize(WebSize(300, 300)); webView->updateAllLifecyclePhases(); @@ -457,7 +457,7 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_containing_page.html", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->settings()->setPluginsEnabled(true); webView->resize(WebSize(300, 300)); webView->updateAllLifecyclePhases(); @@ -466,7 +466,7 @@ WebElement pluginElement = webView->mainFrame()->firstChild()->document().getElementById("translated-plugin"); RawPtr<WebPluginContainerImpl> pluginContainerImpl = toWebPluginContainerImpl(pluginElement.pluginContainer()); - ASSERT(pluginContainerImpl.get()); + DCHECK(pluginContainerImpl.get()); pluginContainerImpl->setFrameRect(IntRect(0, 0, 300, 300)); IntRect windowRect, clipRect, unobscuredRect; @@ -487,7 +487,7 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->settings()->setPluginsEnabled(true); webView->resize(WebSize(300, 300)); webView->updateAllLifecyclePhases(); @@ -496,7 +496,7 @@ WebElement pluginElement = webView->mainFrame()->document().getElementById("subpixel-positioned-plugin"); RawPtr<WebPluginContainerImpl> pluginContainerImpl = toWebPluginContainerImpl(pluginElement.pluginContainer()); - ASSERT(pluginContainerImpl.get()); + DCHECK(pluginContainerImpl.get()); IntRect windowRect, clipRect, unobscuredRect; Vector<IntRect> cutOutRects; @@ -539,7 +539,7 @@ CustomPluginWebFrameClient<TopmostPlugin> pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->settings()->setPluginsEnabled(true); webView->resize(WebSize(300, 300)); webView->updateAllLifecyclePhases(); @@ -641,7 +641,7 @@ TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper FrameTestHelpers::WebViewHelper webViewHelper; WebViewImpl* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient); - ASSERT(webView); + DCHECK(webView); webView->settings()->setPluginsEnabled(true); webView->resize(WebSize(300, 300)); webView->updateAllLifecyclePhases();
diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp index 4f742f91..b7a7bb9 100644 --- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -34,6 +34,7 @@ #include "core/dom/Document.h" #include "core/dom/Element.h" #include "core/editing/FrameSelection.h" +#include "core/editing/InputMethodController.h" #include "core/editing/markers/DocumentMarkerController.h" #include "core/frame/EventHandlerRegistry.h" #include "core/frame/FrameHost.h" @@ -968,6 +969,35 @@ EXPECT_EQ(-1, info.compositionEnd); } +TEST_F(WebViewTest, FinishCompositionDoesNotRevealSelection) +{ + URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("form_with_input.html")); + WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form_with_input.html"); + webView->setInitialFocus(false); + EXPECT_EQ(0, webView->mainFrame()->scrollOffset().width); + EXPECT_EQ(0, webView->mainFrame()->scrollOffset().height); + + // Set up a composition from existing text that needs to be committed. + Vector<CompositionUnderline> emptyUnderlines; + WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); + frame->frame()->inputMethodController().setCompositionFromExistingText(emptyUnderlines, 3, 3); + + // Scroll the input field out of the viewport. + RawPtr<Element> element = static_cast<RawPtr<Element>>(webView->mainFrame()->document().getElementById("btn")); + element->scrollIntoView(); + float offsetHeight = webView->mainFrame()->scrollOffset().height; + EXPECT_EQ(0, webView->mainFrame()->scrollOffset().width); + EXPECT_LT(0, offsetHeight); + + WebTextInputInfo info = webView->textInputInfo(); + EXPECT_EQ("hello", std::string(info.value.utf8().data())); + + // Verify that the input field is not scrolled back into the viewport. + webView->confirmComposition(WebWidget::DoNotKeepSelection); + EXPECT_EQ(0, webView->mainFrame()->scrollOffset().width); + EXPECT_EQ(offsetHeight, webView->mainFrame()->scrollOffset().height); +} + TEST_F(WebViewTest, InsertNewLinePlacementAfterConfirmComposition) { URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("text_area_populated.html")); @@ -1442,7 +1472,7 @@ if (!element || !element->layoutObject()) return false; - ASSERT(m_webViewHelper.webView()); + DCHECK(m_webViewHelper.webView()); element->scrollIntoViewIfNeeded(); // TODO(bokan): Technically incorrect, event positions should be in viewport space. crbug.com/371902. @@ -1462,7 +1492,7 @@ bool WebViewTest::tapElementById(WebInputEvent::Type type, const WebString& id) { - ASSERT(m_webViewHelper.webView()); + DCHECK(m_webViewHelper.webView()); RawPtr<Element> element = static_cast<RawPtr<Element>>(m_webViewHelper.webView()->mainFrame()->document().getElementById(id)); return tapElement(type, element); } @@ -2345,7 +2375,7 @@ // Adding a handler on a div results in a has-handlers call. Element* parentDiv = document->getElementById("parentdiv"); - ASSERT(parentDiv); + DCHECK(parentDiv); registry->didAddEventHandler(*parentDiv, touchEvent); EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(false)); EXPECT_EQ(1, client.getAndResetHasTouchEventHandlerCallCount(true)); @@ -2378,10 +2408,10 @@ // Adding a handler inside of a child iframe results in a has-handlers call. Element* childFrame = document->getElementById("childframe"); - ASSERT(childFrame); + DCHECK(childFrame); Document* childDocument = toHTMLIFrameElement(childFrame)->contentDocument(); Element* childDiv = childDocument->getElementById("childdiv"); - ASSERT(childDiv); + DCHECK(childDiv); registry->didAddEventHandler(*childDiv, touchEvent); EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(false)); EXPECT_EQ(1, client.getAndResetHasTouchEventHandlerCallCount(true)); @@ -2719,7 +2749,7 @@ FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frameView(); - // Auto-resizing used to ASSERT(needsLayout()) in LayoutBlockFlow::layout. This EXPECT is + // Auto-resizing used to DCHECK(needsLayout()) in LayoutBlockFlow::layout. This EXPECT is // merely a dummy. The real test is that we don't trigger asserts in debug builds. EXPECT_FALSE(frameView->needsLayout()); };
diff --git a/third_party/WebKit/Source/web/tests/data/form_with_input.html b/third_party/WebKit/Source/web/tests/data/form_with_input.html new file mode 100644 index 0000000..20debbf --- /dev/null +++ b/third_party/WebKit/Source/web/tests/data/form_with_input.html
@@ -0,0 +1,14 @@ +<!DOCTYPE HTML> +<style> + body { + height:2000px; + margin: 0px; + } +</style> +<body name="body"> +<form method="post" name="myform"> + <textarea>hello</textarea> + <br><br><br><br> + <input type="submit" name="send" id="btn" value="Send"> +</form> +</body>
diff --git a/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp b/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp index ed9d2bc..da2f265 100644 --- a/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp +++ b/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp
@@ -77,9 +77,9 @@ SimDisplayItemList SimCompositor::beginFrame() { - ASSERT(m_webViewImpl); - ASSERT(!m_deferCommits); - ASSERT(m_needsAnimate); + DCHECK(m_webViewImpl); + DCHECK(!m_deferCommits); + DCHECK(m_needsAnimate); m_needsAnimate = false; // Always advance the time as if the compositor was running at 60fps.
diff --git a/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.cpp b/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.cpp index 52abc19..17df7e3 100644 --- a/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.cpp +++ b/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.cpp
@@ -30,7 +30,7 @@ { Color color = 0; if (!colorString.isNull()) - RELEASE_ASSERT(CSSParser::parseColor(color, colorString, true)); + CHECK(CSSParser::parseColor(color, colorString, true)); for (auto& command : m_commands) { if (command.type == type && (colorString.isNull() || command.color == color.rgb())) return true;
diff --git a/third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp b/third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp index 460195b..919bf3f 100644 --- a/third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp +++ b/third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp
@@ -20,7 +20,7 @@ : m_currentRequest(nullptr) { Platform::current()->unitTestSupport()->setLoaderDelegate(this); - ASSERT(!s_network); + DCHECK(!s_network); s_network = this; } @@ -33,7 +33,7 @@ SimNetwork& SimNetwork::current() { - ASSERT(s_network); + DCHECK(s_network); return *s_network; } @@ -49,7 +49,7 @@ client->didReceiveResponse(loader, response); return; } - ASSERT(it->value); + DCHECK(it->value); m_currentRequest = it->value; m_currentRequest->didReceiveResponse(client, loader, response); }
diff --git a/third_party/WebKit/Source/web/tests/sim/SimRequest.cpp b/third_party/WebKit/Source/web/tests/sim/SimRequest.cpp index 31ff3b6..9aacb90 100644 --- a/third_party/WebKit/Source/web/tests/sim/SimRequest.cpp +++ b/third_party/WebKit/Source/web/tests/sim/SimRequest.cpp
@@ -29,7 +29,7 @@ SimRequest::~SimRequest() { - ASSERT(!m_isReady); + DCHECK(!m_isReady); } void SimRequest::didReceiveResponse(WebURLLoaderClient* client, WebURLLoader* loader, const WebURLResponse& response) @@ -48,20 +48,21 @@ void SimRequest::start() { SimNetwork::current().servePendingRequests(); - ASSERT(m_isReady); + DCHECK(m_isReady); m_client->didReceiveResponse(m_loader, m_response); } void SimRequest::write(const String& data) { - ASSERT(m_isReady && !m_error.reason); + DCHECK(m_isReady); + DCHECK(!m_error.reason); m_totalEncodedDataLength += data.length(); m_client->didReceiveData(m_loader, data.utf8().data(), data.length(), data.length()); } void SimRequest::finish() { - ASSERT(m_isReady); + DCHECK(m_isReady); if (m_error.reason) { m_client->didFail(m_loader, m_error); } else {
diff --git a/third_party/WebKit/Source/wtf/BUILD.gn b/third_party/WebKit/Source/wtf/BUILD.gn index 90d6caf..5e85447 100644 --- a/third_party/WebKit/Source/wtf/BUILD.gn +++ b/third_party/WebKit/Source/wtf/BUILD.gn
@@ -73,10 +73,7 @@ cflags = [ "/wd4068" ] # Unknown pragma. } else { # Non-Windows. - sources -= [ - "ThreadSpecificWin.cpp", - "ThreadingWin.cpp", - ] + sources -= [ "ThreadingWin.cpp" ] } if (is_android) {
diff --git a/third_party/WebKit/Source/wtf/DEPS b/third_party/WebKit/Source/wtf/DEPS index abbfb758..d3ca278 100644 --- a/third_party/WebKit/Source/wtf/DEPS +++ b/third_party/WebKit/Source/wtf/DEPS
@@ -6,6 +6,7 @@ "+base/numerics", "+base/rand_util.h", "+base/strings", + "+base/threading", "+base/time/time.h", "+base/tuple.h", "+build",
diff --git a/third_party/WebKit/Source/wtf/ThreadSpecific.h b/third_party/WebKit/Source/wtf/ThreadSpecific.h index 2e82293b..36ff656 100644 --- a/third_party/WebKit/Source/wtf/ThreadSpecific.h +++ b/third_party/WebKit/Source/wtf/ThreadSpecific.h
@@ -42,244 +42,58 @@ #ifndef WTF_ThreadSpecific_h #define WTF_ThreadSpecific_h +#include "base/threading/thread_local_storage.h" #include "wtf/Allocator.h" #include "wtf/Noncopyable.h" #include "wtf/Partitions.h" -#include "wtf/StdLibExtras.h" #include "wtf/WTF.h" -#include "wtf/WTFExport.h" - -#if OS(POSIX) -#include <pthread.h> -#elif OS(WIN) -#include <windows.h> -#endif namespace WTF { -#if OS(WIN) -// ThreadSpecificThreadExit should be called each time when a thread is detached. -// This is done automatically for threads created with WTF::createThread. -WTF_EXPORT void ThreadSpecificThreadExit(); -#endif - -template<typename T> class ThreadSpecific { +template<typename T> +class ThreadSpecific { USING_FAST_MALLOC(ThreadSpecific); WTF_MAKE_NONCOPYABLE(ThreadSpecific); public: - ThreadSpecific(); - bool isSet(); // Useful as a fast check to see if this thread has set this value. - T* operator->(); - operator T*(); - T& operator*(); + ThreadSpecific() + : m_slot(&destory) + { } + + operator T*() { return get(); } + T* operator->() { return get(); } + T& operator*() { return *get(); } private: -#if OS(WIN) - WTF_EXPORT friend void ThreadSpecificThreadExit(); -#endif - // Not implemented. It's technically possible to destroy a thread specific key, but one would need // to make sure that all values have been destroyed already (usually, that all threads that used it // have exited). It's unlikely that any user of this call will be in that situation - and having // a destructor defined can be confusing, given that it has such strong pre-requisites to work correctly. ~ThreadSpecific(); - T* get(); - void set(T*); - void static destroy(void* ptr); - - struct Data { - WTF_MAKE_NONCOPYABLE(Data); - public: - Data(T* value, ThreadSpecific<T>* owner) : value(value), owner(owner) {} - - T* value; - ThreadSpecific<T>* owner; -#if OS(WIN) - void (*destructor)(void*); -#endif - }; - -#if OS(POSIX) - pthread_key_t m_key; -#elif OS(WIN) - int m_index; -#endif -}; - -#if OS(POSIX) - -typedef pthread_key_t ThreadSpecificKey; - -inline void threadSpecificKeyCreate(ThreadSpecificKey* key, void (*destructor)(void *)) -{ - int error = pthread_key_create(key, destructor); - if (error) - CRASH(); -} - -inline void threadSpecificKeyDelete(ThreadSpecificKey key) -{ - int error = pthread_key_delete(key); - if (error) - CRASH(); -} - -inline void threadSpecificSet(ThreadSpecificKey key, void* value) -{ - pthread_setspecific(key, value); -} - -inline void* threadSpecificGet(ThreadSpecificKey key) -{ - return pthread_getspecific(key); -} - -template<typename T> -inline ThreadSpecific<T>::ThreadSpecific() -{ - int error = pthread_key_create(&m_key, destroy); - if (error) - CRASH(); -} - -template<typename T> -inline T* ThreadSpecific<T>::get() -{ - Data* data = static_cast<Data*>(pthread_getspecific(m_key)); - return data ? data->value : 0; -} - -template<typename T> -inline void ThreadSpecific<T>::set(T* ptr) -{ - ASSERT(!get()); - pthread_setspecific(m_key, new Data(ptr, this)); -} - -#elif OS(WIN) - -// TLS_OUT_OF_INDEXES is not defined on WinCE. -#ifndef TLS_OUT_OF_INDEXES -#define TLS_OUT_OF_INDEXES 0xffffffff -#endif - -// The maximum number of TLS keys that can be created. For simplification, we assume that: -// 1) Once the instance of ThreadSpecific<> is created, it will not be destructed until the program dies. -// 2) We do not need to hold many instances of ThreadSpecific<> data. This fixed number should be far enough. -const int kMaxTlsKeySize = 256; - -WTF_EXPORT long& tlsKeyCount(); -WTF_EXPORT DWORD* tlsKeys(); - -class PlatformThreadSpecificKey; -typedef PlatformThreadSpecificKey* ThreadSpecificKey; - -WTF_EXPORT void threadSpecificKeyCreate(ThreadSpecificKey*, void (*)(void *)); -WTF_EXPORT void threadSpecificKeyDelete(ThreadSpecificKey); -WTF_EXPORT void threadSpecificSet(ThreadSpecificKey, void*); -WTF_EXPORT void* threadSpecificGet(ThreadSpecificKey); - -template<typename T> -inline ThreadSpecific<T>::ThreadSpecific() - : m_index(-1) -{ - DWORD tlsKey = TlsAlloc(); - if (tlsKey == TLS_OUT_OF_INDEXES) - CRASH(); - - m_index = InterlockedIncrement(&tlsKeyCount()) - 1; - if (m_index >= kMaxTlsKeySize) - CRASH(); - tlsKeys()[m_index] = tlsKey; -} - -template<typename T> -inline ThreadSpecific<T>::~ThreadSpecific() -{ - // Does not invoke destructor functions. They will be called from ThreadSpecificThreadExit when the thread is detached. - TlsFree(tlsKeys()[m_index]); -} - -template<typename T> -inline T* ThreadSpecific<T>::get() -{ - Data* data = static_cast<Data*>(TlsGetValue(tlsKeys()[m_index])); - return data ? data->value : 0; -} - -template<typename T> -inline void ThreadSpecific<T>::set(T* ptr) -{ - ASSERT(!get()); - Data* data = new Data(ptr, this); - data->destructor = &ThreadSpecific<T>::destroy; - TlsSetValue(tlsKeys()[m_index], data); -} - -#else -#error ThreadSpecific is not implemented for this platform. -#endif - -template<typename T> -inline void ThreadSpecific<T>::destroy(void* ptr) -{ - if (isShutdown()) - return; - - Data* data = static_cast<Data*>(ptr); - -#if OS(POSIX) - // We want get() to keep working while data destructor works, because it can be called indirectly by the destructor. - // Some pthreads implementations zero out the pointer before calling destroy(), so we temporarily reset it. - pthread_setspecific(data->owner->m_key, ptr); -#endif - - data->value->~T(); - Partitions::fastFree(data->value); - -#if OS(POSIX) - pthread_setspecific(data->owner->m_key, 0); -#elif OS(WIN) - TlsSetValue(tlsKeys()[data->owner->m_index], 0); -#else -#error ThreadSpecific is not implemented for this platform. -#endif - - delete data; -} - -template<typename T> -inline bool ThreadSpecific<T>::isSet() -{ - return !!get(); -} - -template<typename T> -inline ThreadSpecific<T>::operator T*() -{ - T* ptr = static_cast<T*>(get()); - if (!ptr) { - // Set up thread-specific value's memory pointer before invoking constructor, in case any function it calls - // needs to access the value, to avoid recursion. - ptr = static_cast<T*>(Partitions::fastZeroedMalloc(sizeof(T), WTF_HEAP_PROFILER_TYPE_NAME(T))); - set(ptr); - new (NotNull, ptr) T; + T* get() + { + T* ptr = static_cast<T*>(m_slot.Get()); + if (!ptr) { + // Set up thread-specific value's memory pointer before invoking constructor, in case any function it calls + // needs to access the value, to avoid recursion. + ptr = static_cast<T*>(Partitions::fastZeroedMalloc(sizeof(T), WTF_HEAP_PROFILER_TYPE_NAME(T))); + m_slot.Set(ptr); + new (NotNull, ptr) T; + } + return ptr; } - return ptr; -} -template<typename T> -inline T* ThreadSpecific<T>::operator->() -{ - return operator T*(); -} + static void destory(void* value) + { + if (isShutdown()) + return; + T* ptr = static_cast<T*>(value); + ptr->~T(); + Partitions::fastFree(ptr); + } -template<typename T> -inline T& ThreadSpecific<T>::operator*() -{ - return *operator T*(); -} + base::ThreadLocalStorage::Slot m_slot; +}; } // namespace WTF
diff --git a/third_party/WebKit/Source/wtf/ThreadSpecificWin.cpp b/third_party/WebKit/Source/wtf/ThreadSpecificWin.cpp deleted file mode 100644 index da2e0d4a..0000000 --- a/third_party/WebKit/Source/wtf/ThreadSpecificWin.cpp +++ /dev/null
@@ -1,137 +0,0 @@ -/* - * Copyright (C) 2009 Jian Li <jianli@chromium.org> - * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "ThreadSpecific.h" - -#if OS(WIN) - -#include "StdLibExtras.h" -#include "ThreadingPrimitives.h" -#include "wtf/Allocator.h" -#include "wtf/DoublyLinkedList.h" - -namespace WTF { - -static DoublyLinkedList<PlatformThreadSpecificKey>& destructorsList() -{ - DEFINE_STATIC_LOCAL(DoublyLinkedList<PlatformThreadSpecificKey>, staticList, ()); - return staticList; -} - -static Mutex& destructorsMutex() -{ - DEFINE_STATIC_LOCAL(Mutex, staticMutex, ()); - return staticMutex; -} - -class PlatformThreadSpecificKey : public DoublyLinkedListNode<PlatformThreadSpecificKey> { - USING_FAST_MALLOC(PlatformThreadSpecificKey); - WTF_MAKE_NONCOPYABLE(PlatformThreadSpecificKey); -public: - friend class DoublyLinkedListNode<PlatformThreadSpecificKey>; - - PlatformThreadSpecificKey(void (*destructor)(void *)) - : m_destructor(destructor) - { - m_tlsKey = TlsAlloc(); - if (m_tlsKey == TLS_OUT_OF_INDEXES) - CRASH(); - } - - ~PlatformThreadSpecificKey() - { - TlsFree(m_tlsKey); - } - - void setValue(void* data) { TlsSetValue(m_tlsKey, data); } - void* value() { return TlsGetValue(m_tlsKey); } - - void callDestructor() - { - if (void* data = value()) - m_destructor(data); - } - -private: - void (*m_destructor)(void *); - DWORD m_tlsKey; - PlatformThreadSpecificKey* m_prev; - PlatformThreadSpecificKey* m_next; -}; - -long& tlsKeyCount() -{ - static long count; - return count; -} - -DWORD* tlsKeys() -{ - static DWORD keys[kMaxTlsKeySize]; - return keys; -} - -void threadSpecificKeyCreate(ThreadSpecificKey* key, void (*destructor)(void *)) -{ - *key = new PlatformThreadSpecificKey(destructor); - - MutexLocker locker(destructorsMutex()); - destructorsList().push(*key); -} - -void threadSpecificKeyDelete(ThreadSpecificKey key) -{ - MutexLocker locker(destructorsMutex()); - destructorsList().remove(key); - delete key; -} - -void threadSpecificSet(ThreadSpecificKey key, void* data) -{ - key->setValue(data); -} - -void* threadSpecificGet(ThreadSpecificKey key) -{ - return key->value(); -} - -void ThreadSpecificThreadExit() -{ - for (long i = 0; i < tlsKeyCount(); i++) { - // The layout of ThreadSpecific<T>::Data does not depend on T. So we are safe to do the static cast to ThreadSpecific<int> in order to access its data member. - ThreadSpecific<int>::Data* data = static_cast<ThreadSpecific<int>::Data*>(TlsGetValue(tlsKeys()[i])); - if (data) - data->destructor(data); - } - - MutexLocker locker(destructorsMutex()); - PlatformThreadSpecificKey* key = destructorsList().head(); - while (key) { - PlatformThreadSpecificKey* nextKey = key->next(); - key->callDestructor(); - key = nextKey; - } -} - -} // namespace WTF - -#endif // OS(WIN)
diff --git a/third_party/WebKit/Source/wtf/wtf.gypi b/third_party/WebKit/Source/wtf/wtf.gypi index 3234b5d..ae453df 100644 --- a/third_party/WebKit/Source/wtf/wtf.gypi +++ b/third_party/WebKit/Source/wtf/wtf.gypi
@@ -109,7 +109,6 @@ 'ThreadRestrictionVerifier.h', 'ThreadSafeRefCounted.h', 'ThreadSpecific.h', - 'ThreadSpecificWin.cpp', 'Threading.h', 'ThreadingPrimitives.h', 'ThreadingPthreads.cpp',
diff --git a/third_party/WebKit/public/blink_headers.gypi b/third_party/WebKit/public/blink_headers.gypi index d0020f6..d1252dc 100644 --- a/third_party/WebKit/public/blink_headers.gypi +++ b/third_party/WebKit/public/blink_headers.gypi
@@ -46,7 +46,6 @@ "platform/WebCredential.h", "platform/WebCredentialManagerClient.h", "platform/WebCredentialManagerError.h", - "platform/WebCrossOriginServiceWorkerClient.h", "platform/WebCrypto.h", "platform/WebCryptoAlgorithm.h", "platform/WebCryptoAlgorithmParams.h", @@ -258,9 +257,6 @@ "platform/modules/installedapp/WebInstalledAppClient.h", "platform/modules/mediasession/WebMediaSession.h", "platform/modules/mediasession/WebMediaSessionError.h", - "platform/modules/navigator_services/WebServicePort.h", - "platform/modules/navigator_services/WebServicePortProvider.h", - "platform/modules/navigator_services/WebServicePortProviderClient.h", "platform/modules/nfc/WebNFCClient.h", "platform/modules/nfc/WebNFCError.h", "platform/modules/nfc/WebNFCMessage.h",
diff --git a/third_party/WebKit/public/platform/Platform.h b/third_party/WebKit/public/platform/Platform.h index cc60cf06..5c02cdc3 100644 --- a/third_party/WebKit/public/platform/Platform.h +++ b/third_party/WebKit/public/platform/Platform.h
@@ -92,7 +92,6 @@ class WebMemoryDumpProvider; class WebMessagePortChannel; class WebMimeRegistry; -class WebNavigatorConnectProvider; class WebNotificationManager; class WebPermissionClient; class WebPluginListBuilder; @@ -106,8 +105,6 @@ class WebSandboxSupport; class WebScrollbarBehavior; class WebSecurityOrigin; -class WebServicePortProvider; -class WebServicePortProviderClient; class WebServiceWorkerCacheStorage; class WebSocketHandle; class WebSpeechSynthesizer; @@ -460,6 +457,13 @@ // GPU ---------------------------------------------------------------- // + struct ContextAttributes { + bool shareResources = true; + bool preferDiscreteGPU = false; + bool noAutomaticFlushes = false; + bool failIfMajorPerformanceCaveat = false; + unsigned webGLVersion = 0; + }; struct GraphicsInfo { unsigned vendorId = 0; unsigned deviceId = 0; @@ -478,7 +482,11 @@ // created or initialized. // Passing an existing provider to shareContext will create the new context // in the same share group as the one passed. - virtual WebGraphicsContext3DProvider* createOffscreenGraphicsContext3DProvider(const WebGraphicsContext3D::Attributes&, WebGraphicsContext3DProvider* shareContext, GraphicsInfo* glInfo) { return nullptr; } + virtual WebGraphicsContext3DProvider* createOffscreenGraphicsContext3DProvider( + const ContextAttributes&, + const WebURL& topDocumentURL, + WebGraphicsContext3DProvider* shareContext, + GraphicsInfo*) { return nullptr; } // Returns a newly allocated and initialized offscreen context provider, // backed by the process-wide shared main thread context. Returns null if @@ -612,15 +620,6 @@ virtual WebPushProvider* pushProvider() { return nullptr; } - // navigator.connect -------------------------------------------------- - - virtual WebNavigatorConnectProvider* navigatorConnectProvider() { return nullptr; } - - // Returns pointer to a new blink owned WebServicePortProvider instance, - // associated with a particular ServicePortCollection (identified by the - // WebServicePortProviderClient passed in). - virtual WebServicePortProvider* createServicePortProvider(WebServicePortProviderClient*) { return nullptr; } - // Permissions -------------------------------------------------------- virtual WebPermissionClient* permissionClient() { return nullptr; }
diff --git a/third_party/WebKit/public/platform/WebCrossOriginServiceWorkerClient.h b/third_party/WebKit/public/platform/WebCrossOriginServiceWorkerClient.h deleted file mode 100644 index 3dd1f87..0000000 --- a/third_party/WebKit/public/platform/WebCrossOriginServiceWorkerClient.h +++ /dev/null
@@ -1,26 +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. - -#ifndef WebCrossOriginServiceWorkerClient_h -#define WebCrossOriginServiceWorkerClient_h - -#include "public/platform/WebMessagePortChannel.h" -#include "public/platform/WebURL.h" - -namespace blink { - -struct WebCrossOriginServiceWorkerClient { - WebURL targetURL; - WebURL origin; - int clientID; - - WebCrossOriginServiceWorkerClient() - : clientID(-1) - { - } -}; - -} // namespace blink - -#endif // WebCrossOriginServiceWorkerClient_h
diff --git a/third_party/WebKit/public/platform/WebGraphicsContext3D.h b/third_party/WebKit/public/platform/WebGraphicsContext3D.h index 35871ec4..9f2dd422 100644 --- a/third_party/WebKit/public/platform/WebGraphicsContext3D.h +++ b/third_party/WebKit/public/platform/WebGraphicsContext3D.h
@@ -31,19 +31,10 @@ #ifndef WebGraphicsContext3D_h #define WebGraphicsContext3D_h -#include "WebCommon.h" #include "WebNonCopyable.h" -#include "WebString.h" - -namespace gpu { -namespace gles2 { -class GLES2Interface; -} -} - -struct GrGLInterface; namespace blink { +class WebString; // This interface abstracts the operations performed by the // GraphicsContext3D in order to implement WebGL. Nearly all of the @@ -51,23 +42,6 @@ // the OpenGL ES 2.0 API. class WebGraphicsContext3D : public WebNonCopyable { public: - // Context creation attributes. - struct Attributes { - bool alpha = true; - bool depth = true; - bool stencil = true; - bool antialias = true; - bool shareResources = true; - bool preferDiscreteGPU = false; - bool noAutomaticFlushes = false; - bool failIfMajorPerformanceCaveat = false; - unsigned webGLVersion = 0; - // FIXME: ideally this would be a WebURL, but it is currently not - // possible to pass a WebURL by value across the WebKit API boundary. - // See https://bugs.webkit.org/show_bug.cgi?id=103793#c13 . - WebString topDocumentURL; - }; - class WebGraphicsContextLostCallback { public: virtual void onContextLost() = 0;
diff --git a/third_party/WebKit/public/platform/modules/navigator_services/OWNERS b/third_party/WebKit/public/platform/modules/navigator_services/OWNERS deleted file mode 100644 index 1b10b343..0000000 --- a/third_party/WebKit/public/platform/modules/navigator_services/OWNERS +++ /dev/null
@@ -1 +0,0 @@ -mek@chromium.org
diff --git a/third_party/WebKit/public/platform/modules/navigator_services/WebServicePort.h b/third_party/WebKit/public/platform/modules/navigator_services/WebServicePort.h deleted file mode 100644 index 8e2e0a9..0000000 --- a/third_party/WebKit/public/platform/modules/navigator_services/WebServicePort.h +++ /dev/null
@@ -1,27 +0,0 @@ -// 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. - -#ifndef WebServicePort_h -#define WebServicePort_h - -#include "public/platform/WebURL.h" - -namespace blink { - -using WebServicePortID = int; - -// Struct containing the data representing a ServicePort. -struct WebServicePort { - // Members corresponding to ServicePort.idl attributes. - WebURL targetUrl; - WebString name; - WebString data; - - // Unique ID to identify this port. - WebServicePortID id = -1; -}; - -} // namespace blink - -#endif // WebServicePort_h
diff --git a/third_party/WebKit/public/platform/modules/navigator_services/WebServicePortCallbacks.h b/third_party/WebKit/public/platform/modules/navigator_services/WebServicePortCallbacks.h deleted file mode 100644 index 106d43c..0000000 --- a/third_party/WebKit/public/platform/modules/navigator_services/WebServicePortCallbacks.h +++ /dev/null
@@ -1,18 +0,0 @@ -// 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. - -#ifndef WebServicePortCallbacks_h -#define WebServicePortCallbacks_h - -#include "public/platform/WebCallbacks.h" -#include "public/platform/modules/navigator_services/WebServicePort.h" - -namespace blink { - -using WebServicePortConnectCallbacks = WebCallbacks<WebServicePortID, void>; -using WebServicePortConnectEventCallbacks = WebCallbacks<const WebServicePort&, void>; - -} // namespace blink - -#endif // WebServicePortCallbacks_h
diff --git a/third_party/WebKit/public/platform/modules/navigator_services/WebServicePortProvider.h b/third_party/WebKit/public/platform/modules/navigator_services/WebServicePortProvider.h deleted file mode 100644 index 28136e6..0000000 --- a/third_party/WebKit/public/platform/modules/navigator_services/WebServicePortProvider.h +++ /dev/null
@@ -1,67 +0,0 @@ -// 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. - -#ifndef WebServicePortProvider_h -#define WebServicePortProvider_h - -#include "public/platform/WebMessagePortChannel.h" -#include "public/platform/WebVector.h" -#include "public/platform/modules/navigator_services/WebServicePort.h" -#include "public/platform/modules/navigator_services/WebServicePortCallbacks.h" - -namespace blink { - -class WebString; -class WebURL; - - -// One instance of this class is associated with each ServicePortCollection. -// When a ServicePortCollection is destroyed the WebServicePortProvider -// associated with it is also destroyed. All communication from ServicePorts and -// the ServicePortCollection to embedding code goes via this interface. -class WebServicePortProvider { -public: - virtual void destroy() { BLINK_ASSERT_NOT_REACHED(); } - - // Initiates a connection from the given origin to the given URL. When - // successful the service can communicate with the client over the given - // channel. The origin isn't passed as WebSecurityOrigin because that would - // be a layering violation (platform/ code shouldn't depend on web/ code). - // Ownership of the WebServicePortConnectCallbacks is transferred to the provider. - virtual void connect(const WebURL&, const WebString& origin, WebServicePortConnectCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } - - // Called when javascript code calls postMessage on a ServicePort that is owned - // by the ServicePortCollection this provider is associated with. - // Passes ownership of WebMessagePortChannelArray. - virtual void postMessage(WebServicePortID, const WebString&, WebMessagePortChannelArray*) { BLINK_ASSERT_NOT_REACHED(); } - - // Called when a ServicePort owned by the ServicePortCollection this - // provider is associated with is closed (explicitly or via garbage - // collection). - virtual void closePort(WebServicePortID) { BLINK_ASSERT_NOT_REACHED(); } - -protected: - virtual ~WebServicePortProvider() {} -}; - -} // namespace blink - -#if INSIDE_BLINK - -namespace WTF { - -template<typename T> struct OwnedPtrDeleter; -template<> struct OwnedPtrDeleter<blink::WebServicePortProvider> { - static void deletePtr(blink::WebServicePortProvider* provider) - { - if (provider) - provider->destroy(); - } -}; - -} // namespace WTF - -#endif // INSIDE_BLINK - -#endif // WebServicePortProvider_h
diff --git a/third_party/WebKit/public/platform/modules/navigator_services/WebServicePortProviderClient.h b/third_party/WebKit/public/platform/modules/navigator_services/WebServicePortProviderClient.h deleted file mode 100644 index b4e3316..0000000 --- a/third_party/WebKit/public/platform/modules/navigator_services/WebServicePortProviderClient.h +++ /dev/null
@@ -1,30 +0,0 @@ -// 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. - -#ifndef WebServicePortProviderClient_h -#define WebServicePortProviderClient_h - -#include "public/platform/WebCommon.h" -#include "public/platform/WebMessagePortChannel.h" -#include "public/platform/modules/navigator_services/WebServicePort.h" - -namespace blink { - -class WebString; - -// Interface implemented by blink, used for communication back from embedding -// code to blink. An instance of this interface is passed to the embedder when -// a WebServicePortProvider is created. -class BLINK_PLATFORM_EXPORT WebServicePortProviderClient { -public: - // Post a message to one of the ports owned by a ServicePortCollection. - virtual void postMessage(WebServicePortID, const WebString&, const WebMessagePortChannelArray&) = 0; - -protected: - virtual ~WebServicePortProviderClient() {} -}; - -} // namespace blink - -#endif // WebServicePortProviderClient_h
diff --git a/third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h b/third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h index aae5827..18c4a5c8 100644 --- a/third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h +++ b/third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h
@@ -40,8 +40,11 @@ // Ownership of the WebUSBClientRequestDeviceCallbacks is transferred to the client. virtual void requestDevice(const WebUSBDeviceRequestOptions&, WebUSBClientRequestDeviceCallbacks*) = 0; - // Sets the observer of device changes through the WebUSBClient. - virtual void setObserver(Observer*) = 0; + // Adds an observer of device changes to the WebUSBClient. + virtual void addObserver(Observer*) = 0; + + // Removes an observer of device changes from the WebUSBClient. + virtual void removeObserver(Observer*) = 0; }; } // namespace blink
diff --git a/third_party/WebKit/public/web/WebPerformance.h b/third_party/WebKit/public/web/WebPerformance.h index 524a837..a5b83b8 100644 --- a/third_party/WebKit/public/web/WebPerformance.h +++ b/third_party/WebKit/public/web/WebPerformance.h
@@ -90,6 +90,9 @@ BLINK_EXPORT double firstTextPaint() const; BLINK_EXPORT double firstImagePaint() const; BLINK_EXPORT double firstContentfulPaint() const; + BLINK_EXPORT double parseStart() const; + BLINK_EXPORT double parseStop() const; + BLINK_EXPORT double parseBlockedOnScriptLoadDuration() const; #if BLINK_IMPLEMENTATION WebPerformance(const PassRefPtrWillBeRawPtr<Performance>&);
diff --git a/third_party/WebKit/public/web/WebRuntimeFeatures.h b/third_party/WebKit/public/web/WebRuntimeFeatures.h index 39009ab..294e1a7 100644 --- a/third_party/WebKit/public/web/WebRuntimeFeatures.h +++ b/third_party/WebKit/public/web/WebRuntimeFeatures.h
@@ -76,6 +76,8 @@ BLINK_EXPORT static void enableCompositorAnimationTimelines(bool); + BLINK_EXPORT static void enableDocumentWriteEvaluator(bool); + BLINK_EXPORT static void enableExperimentalCanvasFeatures(bool); BLINK_EXPORT static void enableExperimentalFramework(bool);
diff --git a/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h b/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h index 5928196..319a529c 100644 --- a/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h +++ b/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h
@@ -34,7 +34,6 @@ #include "public/platform/WebGeofencingEventType.h" #include "public/platform/WebMessagePortChannel.h" #include "public/platform/WebPassOwnPtr.h" -#include "public/platform/modules/navigator_services/WebServicePortCallbacks.h" #include "public/platform/modules/serviceworker/WebServiceWorker.h" #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" @@ -43,7 +42,6 @@ class WebServiceWorkerRequest; class WebString; struct WebCircularGeofencingRegion; -struct WebCrossOriginServiceWorkerClient; struct WebNotificationData; struct WebServiceWorkerClientInfo; @@ -70,10 +68,6 @@ virtual void dispatchNotificationClickEvent(int eventID, int64_t notificationID, const WebNotificationData&, int actionIndex) = 0; virtual void dispatchNotificationCloseEvent(int eventID, int64_t notificationID, const WebNotificationData&) = 0; virtual void dispatchPushEvent(int eventID, const WebString& data) = 0; - virtual void dispatchCrossOriginMessageEvent(const WebCrossOriginServiceWorkerClient&, const WebString& message, const WebMessagePortChannelArray&) = 0; - - // Passes ownership of the callbacks. - virtual void dispatchServicePortConnectEvent(WebServicePortConnectEventCallbacks*, const WebURL& targetURL, const WebString& origin, WebServicePortID) = 0; enum LastChanceOption { IsNotLastChance,
diff --git a/third_party/leveldatabase/chromium_logger.h b/third_party/leveldatabase/chromium_logger.h index 27ab3abf..9c34d40 100644 --- a/third_party/leveldatabase/chromium_logger.h +++ b/third_party/leveldatabase/chromium_logger.h
@@ -9,6 +9,7 @@ #include "base/files/file.h" #include "base/format_macros.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/string_util.h" #include "base/time/time.h" #include "third_party/leveldatabase/src/include/leveldb/env.h"
diff --git a/third_party/libFuzzer/BUILD.gn b/third_party/libFuzzer/BUILD.gn new file mode 100644 index 0000000..daf86c6 --- /dev/null +++ b/third_party/libFuzzer/BUILD.gn
@@ -0,0 +1,21 @@ +# 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. + +source_set("libfuzzer") { + # libfuzzer should be compiled without coverage (infinite loop in trace_cmp). + configs -= [ "//build/config/sanitizers:default_sanitizer_coverage_flags" ] + sources = [ + "src/FuzzerCrossOver.cpp", + "src/FuzzerDriver.cpp", + "src/FuzzerIO.cpp", + "src/FuzzerInterface.cpp", + "src/FuzzerLoop.cpp", + "src/FuzzerMain.cpp", + "src/FuzzerMutate.cpp", + "src/FuzzerSHA1.cpp", + "src/FuzzerTracePC.cpp", + "src/FuzzerTraceState.cpp", + "src/FuzzerUtil.cpp", + ] +}
diff --git a/third_party/libFuzzer/LICENSE.TXT b/third_party/libFuzzer/LICENSE.TXT new file mode 100644 index 0000000..84090c07 --- /dev/null +++ b/third_party/libFuzzer/LICENSE.TXT
@@ -0,0 +1,70 @@ +============================================================================== +LLVM Release License +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== +Copyrights and Licenses for Third Party Software Distributed with LLVM: +============================================================================== +The LLVM software contains code written by third parties. Such software will +have its own individual LICENSE.TXT file in the directory in which it appears. +This file will describe the copyrights, license, and restrictions which apply +to that code. + +The disclaimer of warranty in the University of Illinois Open Source License +applies to all code in the LLVM Distribution, and nothing in any of the +other licenses gives permission to use the names of the LLVM Team or the +University of Illinois to endorse or promote products derived from this +Software. + +The following pieces of software have additional or alternate copyrights, +licenses, and/or restrictions: + +Program Directory +------- --------- +Autoconf llvm/autoconf + llvm/projects/ModuleMaker/autoconf +Google Test llvm/utils/unittest/googletest +OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} +pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} +ARM contributions llvm/lib/Target/ARM/LICENSE.TXT +md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h
diff --git a/third_party/libFuzzer/OWNERS b/third_party/libFuzzer/OWNERS new file mode 100644 index 0000000..45df3e02 --- /dev/null +++ b/third_party/libFuzzer/OWNERS
@@ -0,0 +1,5 @@ +aizatsky@chromium.org +inferno@chromium.org +kcc@chromium.org +mmoroz@chromium.org +ochang@chromium.org
diff --git a/third_party/libFuzzer/README.chromium b/third_party/libFuzzer/README.chromium new file mode 100644 index 0000000..158c2ac --- /dev/null +++ b/third_party/libFuzzer/README.chromium
@@ -0,0 +1,13 @@ +Name: libFuzzer +URL: http://llvm.org/docs/LibFuzzer.html +Version: 1d3e15006639ad8c1aadd2d7bac4dab9a6be7da6 +License: University of Illinois/NCSA Open Source +License File: LICENSE.TXT +Security Critical: no + +Description: +Library for in-process coverage-guided fuzz testing (fuzzing) of other +libraries. + +Local Modifications: +None.
diff --git a/third_party/libjingle/README.chromium b/third_party/libjingle/README.chromium index 2c46c8b..e1dacf4 100644 --- a/third_party/libjingle/README.chromium +++ b/third_party/libjingle/README.chromium
@@ -1,7 +1,7 @@ Name: libjingle URL: http://www.webrtc.org Version: unknown -Revision: 12115 +Revision: 12188 License: BSD License File: source/talk/COPYING Security Critical: yes
diff --git a/third_party/libvpx/README.chromium b/third_party/libvpx/README.chromium index 9a72a09..e30eda8 100644 --- a/third_party/libvpx/README.chromium +++ b/third_party/libvpx/README.chromium
@@ -5,9 +5,9 @@ License File: source/libvpx/LICENSE Security Critical: yes -Date: Tuesday March 22 2016 +Date: Tuesday March 29 2016 Branch: master -Commit: a6246927767f9ed8e10393876aa1f489e84ca0d3 +Commit: 904cb53302dfebee4a0d795ad6ccebdd5da5f542 Description: Contains the sources used to compile libvpx binaries used by Google Chrome and
diff --git a/third_party/libvpx/source/config/vpx_version.h b/third_party/libvpx/source/config/vpx_version.h index b2164a0..f8fb67823 100644 --- a/third_party/libvpx/source/config/vpx_version.h +++ b/third_party/libvpx/source/config/vpx_version.h
@@ -1,7 +1,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 5 #define VERSION_PATCH 0 -#define VERSION_EXTRA "623-ga624692" +#define VERSION_EXTRA "650-g904cb53" #define VERSION_PACKED ((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH)) -#define VERSION_STRING_NOSP "v1.5.0-623-ga624692" -#define VERSION_STRING " v1.5.0-623-ga624692" +#define VERSION_STRING_NOSP "v1.5.0-650-g904cb53" +#define VERSION_STRING " v1.5.0-650-g904cb53"
diff --git a/third_party/mozilla/NSWorkspace+Utils.h b/third_party/mozilla/NSWorkspace+Utils.h index 2ef1d10..13096a9 100644 --- a/third_party/mozilla/NSWorkspace+Utils.h +++ b/third_party/mozilla/NSWorkspace+Utils.h
@@ -58,7 +58,9 @@ // OS feature checks + (NSString*)osVersionString; -+ (BOOL)isLeopardOrHigher; +// Begin Google Modified +//+ (BOOL)isLeopardOrHigher; +// End Google Modified @end
diff --git a/third_party/mozilla/NSWorkspace+Utils.m b/third_party/mozilla/NSWorkspace+Utils.m index 157f1d06..f6aab2c0 100644 --- a/third_party/mozilla/NSWorkspace+Utils.m +++ b/third_party/mozilla/NSWorkspace+Utils.m
@@ -156,6 +156,8 @@ return [versionInfo objectForKey:@"ProductVersion"]; } +// Begin Google Modified +#if 0 // // +systemVersion // @@ -183,5 +185,7 @@ return [self systemVersion] >= 0x1050; #endif } +#endif +// End Google Modified @end
diff --git a/third_party/mozilla/README.chromium b/third_party/mozilla/README.chromium index 9c2dd71..5f4dfb3 100644 --- a/third_party/mozilla/README.chromium +++ b/third_party/mozilla/README.chromium
@@ -3,6 +3,7 @@ URL: http://caminobrowser.org/ Version: unknown License: MPL 1.1/GPL 2.0/LGPL 2.1 +Security Critical: yes Description: This directory contains the following files come from (Mozilla) Camino @@ -25,6 +26,8 @@ - -[NSPasteboard htmlFromRtf] was added to do rtf->html conversion. - NSWorkspace+Utils.m was modified to compile on the x86_64 architecture. - MOZILLA_EXPORT was added to some constants in NSPasteboard+Utils.h. +- +[NSWorkspace(CaminoDefaultBrowserAdditions) isLeopardOrHigher] hidden since + it relies on methods deprecated in 10.8 (and is unused in Chrome). -----------------------------------------------------------------
diff --git a/tools/android/loading/analyze.py b/tools/android/loading/analyze.py index fd1ba4ef..db0106f 100755 --- a/tools/android/loading/analyze.py +++ b/tools/android/loading/analyze.py
@@ -29,11 +29,12 @@ import controller import device_setup import frame_load_lens -import loading_model +import loading_graph_view +import loading_graph_view_visualization import loading_trace -import model_graph import options - +import request_dependencies_lens +import request_track # TODO(mattcary): logging.info isn't that useful, as the whole (tools) world # uses logging info; we need to introduce logging modules to get finer-grained @@ -68,11 +69,11 @@ json.dump(json_data, output, sort_keys=True, indent=2) -def _GetPrefetchHtml(graph, name=None): +def _GetPrefetchHtml(graph_view, name=None): """Generate prefetch page for the resources in resource graph. Args: - graph: a ResourceGraph. + graph_view: (LoadingGraphView) name: optional string used in the generated page. Returns: @@ -89,8 +90,8 @@ <head> <title>%s</title> """ % title) - for info in graph.ResourceInfo(): - output.append('<link rel="prefetch" href="%s">\n' % info.Url()) + for node in graph_view.deps_graph.graph.Nodes(): + output.append('<link rel="prefetch" href="%s">\n' % node.request.url) output.append("""</head> <body>%s</body> </html> @@ -139,8 +140,7 @@ if prefetch: assert not OPTIONS.local logging.warning('Generating prefetch') - prefetch_html = _GetPrefetchHtml( - loading_model.ResourceGraph(cold_data), name=url) + prefetch_html = _GetPrefetchHtml(_ProcessJsonTrace(cold_data), name=url) tmp = tempfile.NamedTemporaryFile() tmp.write(prefetch_html) tmp.flush() @@ -165,19 +165,24 @@ logging.warning('Wrote ' + json_output) -def _ProcessRequests(filename): +def _ProcessTraceFile(filename): with open(filename) as f: - trace = loading_trace.LoadingTrace.FromJsonDict(json.load(f)) + return _ProcessJsonTrace(json.load(f)) + + +def _ProcessJsonTrace(json_dict): + trace = loading_trace.LoadingTrace.FromJsonDict(json_dict) content_lens = ( content_classification_lens.ContentClassificationLens.WithRulesFiles( trace, OPTIONS.ad_rules, OPTIONS.tracking_rules)) frame_lens = frame_load_lens.FrameLoadLens(trace) activity = activity_lens.ActivityLens(trace) - graph = loading_model.ResourceGraph( - trace, content_lens, frame_lens, activity) + deps_lens = request_dependencies_lens.RequestDependencyLens(trace) + graph_view = loading_graph_view.LoadingGraphView( + trace, deps_lens, content_lens, frame_lens, activity) if OPTIONS.noads: - graph.Set(node_filter=graph.FilterAds) - return graph + graph_view.RemoveAds() + return graph_view def InvalidCommand(cmd): @@ -189,8 +194,10 @@ OPTIONS.ParseArgs(arg_str, description='Generates a PNG from a trace', extra=['request_json', ('--png_output', ''), ('--eog', False)]) - graph = _ProcessRequests(OPTIONS.request_json) - visualization = model_graph.GraphVisualization(graph) + graph_view = _ProcessTraceFile(OPTIONS.request_json) + visualization = ( + loading_graph_view_visualization.LoadingGraphViewVisualization( + graph_view)) tmp = tempfile.NamedTemporaryFile() visualization.OutputDot(tmp) tmp.flush() @@ -208,26 +215,13 @@ tmp.close() -def DoCompare(arg_str): - OPTIONS.ParseArgs(arg_str, description='Compares two traces', - extra=['g1_json', 'g2_json']) - g1 = _ProcessRequests(OPTIONS.g1_json) - g2 = _ProcessRequests(OPTIONS.g2_json) - discrepancies = loading_model.ResourceGraph.CheckImageLoadConsistency(g1, g2) - if discrepancies: - print '%d discrepancies' % len(discrepancies) - print '\n'.join([str(r) for r in discrepancies]) - else: - print 'Consistent!' - - def DoPrefetchSetup(arg_str): OPTIONS.ParseArgs(arg_str, description='Sets up prefetch', extra=['request_json', 'target_html', ('--upload', False)]) - graph = _ProcessRequests(OPTIONS.request_json) + graph_view = _ProcessTraceFile(OPTIONS.request_json) with open(OPTIONS.target_html, 'w') as html: html.write(_GetPrefetchHtml( - graph, name=os.path.basename(OPTIONS.request_json))) + graph_view, name=os.path.basename(OPTIONS.request_json))) if OPTIONS.upload: device = device_setup.GetFirstDevice() destination = os.path.join('/sdcard/Download', @@ -265,35 +259,34 @@ def DoLongPole(arg_str): OPTIONS.ParseArgs(arg_str, description='Calculates long pole', extra='request_json') - graph = _ProcessRequests(OPTIONS.request_json) + graph_view = _ProcessTraceFile(OPTIONS.request_json) path_list = [] - cost = graph.Cost(path_list=path_list) - print '%s (%s)' % (path_list[-1], cost) + cost = graph_view.deps_graph.Cost(path_list=path_list) + print '%s (%s)' % (path_list[-1].request.url, cost) def DoNodeCost(arg_str): OPTIONS.ParseArgs(arg_str, description='Calculates node cost', extra='request_json') - graph = _ProcessRequests(OPTIONS.request_json) - print sum((n.NodeCost() for n in graph.Nodes())) + graph_view = _ProcessTraceFile(OPTIONS.request_json) + print sum((n.cost for n in graph_view.deps_graph.graph.Nodes())) def DoCost(arg_str): OPTIONS.ParseArgs(arg_str, description='Calculates total cost', extra=['request_json', ('--path', False)]) - graph = _ProcessRequests(OPTIONS.request_json) + graph_view = _ProcessTraceFile(OPTIONS.request_json) path_list = [] - print 'Graph cost: %s' % graph.Cost(path_list) + print 'Graph cost: %s' % graph_view.deps_graph.Cost(path_list=path_list) if OPTIONS.path: - for p in path_list: - print ' ' + p.ShortName() + for n in path_list: + print ' ' + request_track.ShortName(n.request.url) COMMAND_MAP = { 'png': DoPng, - 'compare': DoCompare, 'prefetch_setup': DoPrefetchSetup, 'log_requests': DoLogRequests, 'longpole': DoLongPole,
diff --git a/tools/android/loading/dependency_graph.py b/tools/android/loading/dependency_graph.py index 13f5485..955177c 100644 --- a/tools/android/loading/dependency_graph.py +++ b/tools/android/loading/dependency_graph.py
@@ -11,19 +11,20 @@ import request_track -class _RequestNode(graph.Node): +class RequestNode(graph.Node): def __init__(self, request): - super(_RequestNode, self).__init__() + super(RequestNode, self).__init__() self.request = request self.cost = request.Cost() -class _Edge(graph.Edge): +class Edge(graph.Edge): def __init__(self, from_node, to_node, reason): - super(_Edge, self).__init__(from_node, to_node) + super(Edge, self).__init__(from_node, to_node) self.reason = reason self.cost = request_track.TimeBetween( self.from_node.request, self.to_node.request, self.reason) + self.is_timing = False class RequestDependencyGraph(object): @@ -34,16 +35,21 @@ _CAN_BE_TIMING_PARENT = set(['script', 'magic-debug-content']) _CAN_MAKE_TIMING_DEPENDENCE = set(['json', 'other', 'magic-debug-content']) - def __init__(self, requests, dependencies_lens): + def __init__(self, requests, dependencies_lens, + node_class=RequestNode, edge_class=Edge): """Creates a request dependency graph. Args: requests: ([Request]) a list of requests. dependencies_lens: (RequestDependencyLens) + node_class: (subclass of RequestNode) + edge_class: (subclass of Edge) """ + assert issubclass(node_class, RequestNode) + assert issubclass(edge_class, Edge) self._requests = requests deps = dependencies_lens.GetRequestDependencies() - self._nodes_by_id = {r.request_id : _RequestNode(r) for r in self._requests} + self._nodes_by_id = {r.request_id : node_class(r) for r in self._requests} edges = [] for (parent_request, child_request, reason) in deps: if (parent_request.request_id not in self._nodes_by_id @@ -51,7 +57,7 @@ continue parent_node = self._nodes_by_id[parent_request.request_id] child_node = self._nodes_by_id[child_request.request_id] - edges.append(_Edge(parent_node, child_node, reason)) + edges.append(edge_class(parent_node, child_node, reason)) self._first_request_node = self._nodes_by_id[self._requests[0].request_id] self._deps_graph = graph.DirectedGraph(self._nodes_by_id.values(), edges) self._HandleTimingDependencies() @@ -73,17 +79,20 @@ if request_id in request_id_to_cost: node.cost = request_id_to_cost[request_id] - def Cost(self, from_first_request=True): + def Cost(self, from_first_request=True, path_list=None, costs_out=None): """Returns the cost of the graph, that is the costliest path. Args: from_first_request: (boolean) If True, only considers paths that originate from the first request node. + path_list: (list) See graph.Cost(). + costs_out: (list) See graph.Cost(). """ if from_first_request: - return self._deps_graph.Cost([self._first_request_node]) + return self._deps_graph.Cost( + [self._first_request_node], path_list, costs_out) else: - return self._deps_graph.Cost() + return self._deps_graph.Cost(path_list=path_list, costs_out=costs_out) def _HandleTimingDependencies(self): try: @@ -162,6 +171,7 @@ # eligible. if (edges_by_end_time[end_mark].to_node.request.end_msec <= current.to_node.request.start_msec): + current.is_timing = True self._deps_graph.UpdateEdge( current, edges_by_end_time[end_mark].to_node, current.to_node)
diff --git a/tools/android/loading/gce/README.md b/tools/android/loading/gce/README.md index 52e0c820..0399de0 100644 --- a/tools/android/loading/gce/README.md +++ b/tools/android/loading/gce/README.md
@@ -73,7 +73,9 @@ * `urls`: array of URLs * `repeat_count`: Number of times each URL will be loaded. Each load of a URL - generates a separate trace file. + generates a separate trace file. Optional. +* `emulate_device`: Name of the device to emulate. Optional. +* `emulate_network`: Type of network emulation. Optional. ## Stop the app in the cloud
diff --git a/tools/android/loading/gce/deploy.sh b/tools/android/loading/gce/deploy.sh index 0a3a531b..2362414b 100755 --- a/tools/android/loading/gce/deploy.sh +++ b/tools/android/loading/gce/deploy.sh
@@ -28,7 +28,7 @@ # Copy other dependencies. mkdir $tmp_src_dir/third_party rsync -av --exclude=".*" --exclude "*.pyc" --exclude "*.html" --exclude "*.md" \ - --delete third_party/catapult $tmp_src_dir/third_party + third_party/catapult $tmp_src_dir/third_party mkdir $tmp_src_dir/tools/perf cp -r tools/perf/chrome_telemetry_build $tmp_src_dir/tools/perf mkdir -p $tmp_src_dir/build/android @@ -36,6 +36,10 @@ cp build/android/video_recorder.py $tmp_src_dir/build/android/ cp build/android/devil_chromium.json $tmp_src_dir/build/android/ cp -r build/android/pylib $tmp_src_dir/build/android/ +mkdir -p \ + $tmp_src_dir/third_party/WebKit/Source/devtools/front_end/emulated_devices +cp third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json \ + $tmp_src_dir/third_party/WebKit/Source/devtools/front_end/emulated_devices/ # Tar up the source and copy it to Google Cloud Storage. source_tarball=$tmpdir/source.tgz
diff --git a/tools/android/loading/gce/main.py b/tools/android/loading/gce/main.py index b950c54..95c18c54 100644 --- a/tools/android/loading/gce/main.py +++ b/tools/android/loading/gce/main.py
@@ -84,30 +84,16 @@ blob.upload_from_string(data_string) return blob.public_url - def _DeleteFile(self, filename): - client = self._GetStorageClient() - bucket = self._GetStorageBucket(client) - try: - bucket.delete_blob(filename) - return True - except NotFound: - return False - - def _ReadFile(self, filename): - client = self._GetStorageClient() - bucket = self._GetStorageBucket(client) - blob = bucket.get_blob(filename) - if not blob: - return None - return blob.download_as_string() - - def _GenerateTrace(self, url, filename, log_filename): + def _GenerateTrace(self, url, emulate_device, emulate_network, filename, + log_filename): """ Generates a trace using analyze.py Args: - url: url as a string. - filename: name of the file where the trace is saved. - log_filename: name of the file where standard output and errors are logged + url: URL as a string. + emulate_device: Name of the device to emulate. Empty for no emulation. + emulate_network: Type of network emulation. Empty for no emulation. + filename: Name of the file where the trace is saved. + log_filename: Name of the file where standard output and errors are logged Returns: True if the trace was generated successfully. @@ -117,20 +103,26 @@ except OSError: pass # Nothing to remove. analyze_path = self._src_path + '/tools/android/loading/analyze.py' - command_line = ['python', analyze_path, 'log_requests', + command_line = ['python', analyze_path, 'log_requests', '--local_noisy', '--clear_cache', '--local', '--headless', '--local_binary', self._chrome_path, '--url', url, '--output', filename] + if len(emulate_device): + command_line += ['--emulate_device', emulate_device] + if len(emulate_network): + command_line += ['--emulate_network', emulate_network] with open(log_filename, 'w') as log_file: ret = subprocess.call(command_line , stderr = subprocess.STDOUT, stdout = log_file) return ret == 0 - def _ProcessTasks(self, repeat_count): + def _ProcessTasks(self, repeat_count, emulate_device, emulate_network): """Iterates over _tasks and runs analyze.py on each of them. Uploads the resulting traces to Google Cloud Storage. Args: repeat_count: The number of traces generated for each URL. + emulate_device: Name of the device to emulate. Empty for no emulation. + emulate_network: Type of network emulation. Empty for no emulation. """ failures_dir = self._base_path_in_bucket + 'failures/' traces_dir = self._base_path_in_bucket + 'traces/' @@ -145,7 +137,8 @@ for repeat in range(repeat_count): print 'Generating trace for URL: %s' % url remote_filename = local_filename + '/' + str(repeat) - if self._GenerateTrace(url, local_filename, log_filename): + if self._GenerateTrace( + url, emulate_device, emulate_network, local_filename, log_filename): print 'Uploading: %s' % remote_filename self._UploadFile(local_filename, traces_dir + remote_filename) else: @@ -176,18 +169,22 @@ self._tasks = load_parameters['urls'] except KeyError: return 'Error: invalid urls' + # Optional parameters. try: - repeat_count = int(load_parameters['repeat_count']) - except (KeyError, ValueError): + repeat_count = int(load_parameters.get('repeat_count', '1')) + except ValueError: return 'Error: invalid repeat_count' + emulate_device = load_parameters.get('emulate_device', '') + emulate_network = load_parameters.get('emulate_network', '') if len(self._tasks) == 0: return 'Error: Empty task list' elif self._thread is not None and self._thread.is_alive(): return 'Error: Already running' else: - self._thread = threading.Thread(target = self._ProcessTasks, - args = (repeat_count,)) + self._thread = threading.Thread( + target = self._ProcessTasks, + args = (repeat_count, emulate_device, emulate_network)) self._thread.start() return 'Starting generation of ' + str(len(self._tasks)) + 'tasks'
diff --git a/tools/android/loading/graph.py b/tools/android/loading/graph.py index 789d917..d051d58 100644 --- a/tools/android/loading/graph.py +++ b/tools/android/loading/graph.py
@@ -75,6 +75,10 @@ """Returns the set of edges of this graph.""" return self._edges + def RootNodes(self): + """Returns an iterable of nodes that have no incoming edges.""" + return filter(lambda n: not self.InEdges(n), self._nodes) + def UpdateEdge(self, edge, new_from_node, new_to_node): """Updates an edge. @@ -125,15 +129,23 @@ sources.append(successor) return sorted_nodes - def ReachableNodes(self, roots): - """Returns a list of nodes from a set of root nodes.""" + def ReachableNodes(self, roots, should_stop=lambda n: False): + """Returns a list of nodes from a set of root nodes. + + Args: + roots: ([Node]) List of roots to start from. + should_stop: (callable) Returns True when a node should stop the + exploration and be skipped. + """ visited = set() - fifo = collections.deque(roots) + fifo = collections.deque([n for n in roots if not should_stop(n)]) while len(fifo) != 0: node = fifo.pop() + if should_stop(node): + continue visited.add(node) for e in self.OutEdges(node): - if e.to_node not in visited: + if e.to_node not in visited and not should_stop(e.to_node): visited.add(e.to_node) fifo.appendleft(e.to_node) return list(visited)
diff --git a/tools/android/loading/loading_graph_view.py b/tools/android/loading/loading_graph_view.py new file mode 100644 index 0000000..c312af0 --- /dev/null +++ b/tools/android/loading/loading_graph_view.py
@@ -0,0 +1,88 @@ +# 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. + +"""Views a trace as an annotated request dependency graph.""" + +import dependency_graph + + +class RequestNode(dependency_graph.RequestNode): + """Represents a request in the graph. + + is_ad and is_tracking are set according to the ContentClassificationLens + passed to LoadingGraphView. + """ + def __init__(self, request): + super(RequestNode, self).__init__(request) + self.is_ad = False + self.is_tracking = False + + +class Edge(dependency_graph.Edge): + """Represents a dependency between two nodes. + + activity is set according to the ActivityLens passed to LoadingGraphView. + """ + def __init__(self, from_node, to_node, reason): + super(Edge, self).__init__(from_node, to_node, reason) + self.activity = {} + + +class LoadingGraphView(object): + """Represents a trace as a dependency graph. The graph is annotated using + optional lenses passed to it. + """ + def __init__(self, trace, dependencies_lens, content_lens=None, + frame_lens=None, activity=None): + """Initalizes a LoadingGraphView instance. + + Args: + trace: (LoadingTrace) a loading trace. + dependencies_lens: (RequestDependencyLens) + content_lens: (ContentClassificationLens) + frame_lens: (FrameLoadLens) + activity: (ActivityLens) + """ + self._requests = trace.request_track.GetEvents() + self._deps_lens = dependencies_lens + self._content_lens = content_lens + self._frame_lens = frame_lens + self._activity_lens = activity + self._graph = None + self._BuildGraph() + + def RemoveAds(self): + """Updates the graph to remove the Ads. + + Nodes that are only reachable through ad nodes are excluded as well. + """ + roots = self._graph.graph.RootNodes() + self._requests = [n.request for n in self._graph.graph.ReachableNodes( + roots, should_stop=lambda n: n.is_ad or n.is_tracking)] + self._BuildGraph() + + @property + def deps_graph(self): + return self._graph + + def _BuildGraph(self): + self._graph = dependency_graph.RequestDependencyGraph( + self._requests, self._deps_lens, RequestNode, Edge) + self._AnnotateNodes() + self._AnnotateEdges() + + def _AnnotateNodes(self): + if self._content_lens is None: + return + for node in self._graph.graph.Nodes(): + node.is_ad = self._content_lens.IsAdRequest(node.request) + node.is_tracking = self._content_lens.IsTrackingRequest(node.request) + + def _AnnotateEdges(self): + if self._activity_lens is None: + return + for edge in self._graph.graph.Edges(): + dep = (edge.from_node.request, edge.to_node.request, edge.reason) + activity = self._activity_lens.BreakdownEdgeActivityByInitiator(dep) + edge.activity = activity
diff --git a/tools/android/loading/loading_graph_view_unittest.py b/tools/android/loading/loading_graph_view_unittest.py new file mode 100644 index 0000000..b1a93c0 --- /dev/null +++ b/tools/android/loading/loading_graph_view_unittest.py
@@ -0,0 +1,84 @@ +# 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. + +import unittest + +import loading_graph_view +import request_dependencies_lens +from request_dependencies_lens_unittest import TestRequests + + +class MockContentClassificationLens(object): + def __init__(self, ad_request_ids, tracking_request_ids): + self._ad_requests_ids = ad_request_ids + self._tracking_request_ids = tracking_request_ids + + def IsAdRequest(self, request): + return request.request_id in self._ad_requests_ids + + def IsTrackingRequest(self, request): + return request.request_id in self._tracking_request_ids + + +class LoadingGraphViewTestCase(unittest.TestCase): + def setUp(self): + super(LoadingGraphViewTestCase, self).setUp() + self.trace = TestRequests.CreateLoadingTrace() + self.deps_lens = request_dependencies_lens.RequestDependencyLens(self.trace) + + def testAnnotateNodesNoLenses(self): + graph_view = loading_graph_view.LoadingGraphView(self.trace, self.deps_lens) + for node in graph_view.deps_graph.graph.Nodes(): + self.assertFalse(node.is_ad) + self.assertFalse(node.is_tracking) + for edge in graph_view.deps_graph.graph.Edges(): + self.assertFalse(edge.is_timing) + + def testAnnotateNodesContentLens(self): + ad_request_ids = set([TestRequests.JS_REQUEST_UNRELATED_FRAME.request_id]) + tracking_request_ids = set([TestRequests.JS_REQUEST.request_id]) + content_lens = MockContentClassificationLens( + ad_request_ids, tracking_request_ids) + graph_view = loading_graph_view.LoadingGraphView(self.trace, self.deps_lens, + content_lens) + for node in graph_view.deps_graph.graph.Nodes(): + request_id = node.request.request_id + self.assertEqual(request_id in ad_request_ids, node.is_ad) + self.assertEqual(request_id in tracking_request_ids, node.is_tracking) + + def testRemoveAds(self): + ad_request_ids = set([TestRequests.JS_REQUEST_UNRELATED_FRAME.request_id]) + tracking_request_ids = set([TestRequests.JS_REQUEST.request_id]) + content_lens = MockContentClassificationLens( + ad_request_ids, tracking_request_ids) + graph_view = loading_graph_view.LoadingGraphView(self.trace, self.deps_lens, + content_lens) + graph_view.RemoveAds() + request_ids = set([n.request.request_id + for n in graph_view.deps_graph.graph.Nodes()]) + expected_request_ids = set([r.request_id for r in [ + TestRequests.FIRST_REDIRECT_REQUEST, + TestRequests.SECOND_REDIRECT_REQUEST, + TestRequests.REDIRECTED_REQUEST, + TestRequests.REQUEST, + TestRequests.JS_REQUEST_OTHER_FRAME]]) + self.assertSetEqual(expected_request_ids, request_ids) + + def testRemoveAdsPruneGraph(self): + ad_request_ids = set([TestRequests.SECOND_REDIRECT_REQUEST.request_id]) + tracking_request_ids = set([]) + content_lens = MockContentClassificationLens( + ad_request_ids, tracking_request_ids) + graph_view = loading_graph_view.LoadingGraphView( + self.trace, self.deps_lens, content_lens) + graph_view.RemoveAds() + request_ids = set([n.request.request_id + for n in graph_view.deps_graph.graph.Nodes()]) + expected_request_ids = set( + [TestRequests.FIRST_REDIRECT_REQUEST.request_id]) + self.assertSetEqual(expected_request_ids, request_ids) + + +if __name__ == '__main__': + unittest.main()
diff --git a/tools/android/loading/loading_graph_view_visualization.py b/tools/android/loading/loading_graph_view_visualization.py new file mode 100644 index 0000000..d083575 --- /dev/null +++ b/tools/android/loading/loading_graph_view_visualization.py
@@ -0,0 +1,169 @@ +# 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. + +"""Visualize a loading_graph_view.LoadingGraphView.""" + +import request_track + + +class LoadingGraphViewVisualization(object): + """Manipulate visual representations of a request graph. + + Currently only DOT output is supported. + """ + _LONG_EDGE_THRESHOLD_MS = 2000 # Time in milliseconds. + + _CONTENT_KIND_TO_COLOR = { + 'application': 'blue', # Scripts. + 'font': 'grey70', + 'image': 'orange', # This probably catches gifs? + 'video': 'hotpink1', + 'audio': 'hotpink2', + } + + _CONTENT_TYPE_TO_COLOR = { + 'html': 'red', + 'css': 'green', + 'script': 'blue', + 'javascript': 'blue', + 'json': 'purple', + 'gif': 'grey', + 'image': 'orange', + 'jpeg': 'orange', + 'ping': 'cyan', # Empty response + 'redirect': 'forestgreen', + 'png': 'orange', + 'plain': 'brown3', + 'octet-stream': 'brown3', + 'other': 'white', + } + + _EDGE_REASON_TO_COLOR = { + 'redirect': 'black', + 'parser': 'red', + 'script': 'blue', + 'script_inferred': 'purple', + } + + _ACTIVITY_TYPE_LABEL = ( + ('idle', 'I'), ('unrelated_work', 'W'), ('script', 'S'), + ('parsing', 'P'), ('other_url', 'O'), ('unknown_url', 'U')) + + def __init__(self, graph_view): + """Initialize. + + Args: + graph_view: (loading_graph_view.LoadingGraphView) the graph to visualize. + """ + self._graph_view = graph_view + self._global_start = None + + def OutputDot(self, output): + """Output DOT (graphviz) representation. + + Args: + output: a file-like output stream to receive the dot file. + """ + nodes = self._graph_view.deps_graph.graph.Nodes() + self._global_start = min(n.request.start_msec for n in nodes) + g = self._graph_view.deps_graph.graph + + output.write("""digraph dependencies { + rankdir = LR; + """) + + isolated_nodes = [ + n for n in nodes if ( + len(g.InEdges(n)) == 0 and len(g.OutEdges(n)) == 0)] + if isolated_nodes: + output.write("""subgraph cluster_isolated { + color=black; + label="Isolated Nodes"; + """) + for n in isolated_nodes: + output.write(self._DotNode(n)) + output.write('}\n') + + output.write("""subgraph cluster_nodes { + color=invis; + """) + for n in nodes: + if n in isolated_nodes: + continue + output.write(self._DotNode(n)) + + edges = g.Edges() + for edge in edges: + output.write(self._DotEdge(edge)) + + output.write('}\n') + output.write('}\n') + + def _ContentTypeToColor(self, content_type): + if not content_type: + type_str = 'other' + elif '/' in content_type: + kind, type_str = content_type.split('/', 1) + if kind in self._CONTENT_KIND_TO_COLOR: + return self._CONTENT_KIND_TO_COLOR[kind] + else: + type_str = content_type + return self._CONTENT_TYPE_TO_COLOR[type_str] + + def _DotNode(self, node): + """Returns a graphviz node description for a given node. + + Args: + node: (RequestNode) + + Returns: + A string describing the resource in graphviz format. + The resource is color-coded according to its content type, and its shape + is oval if its max-age is less than 300s (or if it's not cacheable). + """ + color = self._ContentTypeToColor(node.request.GetContentType()) + request = node.request + max_age = request.MaxAge() + shape = 'polygon' if max_age > 300 else 'oval' + styles = ['filled'] + if node.is_ad or node.is_tracking: + styles += ['bold', 'diagonals'] + return ('"%s" [label = "%s\\n%.2f->%.2f (%.2f)"; style = "%s"; ' + 'fillcolor = %s; shape = %s];\n' + % (request.request_id, request_track.ShortName(request.url), + request.start_msec - self._global_start, + request.end_msec - self._global_start, + request.end_msec - request.start_msec, + ','.join(styles), color, shape)) + + def _DotEdge(self, edge): + """Returns a graphviz edge description for a given edge. + + Args: + edge: (Edge) + + Returns: + A string encoding the graphviz representation of the edge. + """ + style = {'color': 'orange'} + label = '%.02f' % edge.cost + if edge.is_timing: + style['style'] = 'dashed' + style['color'] = self._EDGE_REASON_TO_COLOR[edge.reason] + if edge.cost > self._LONG_EDGE_THRESHOLD_MS: + style['penwidth'] = '5' + style['weight'] = '2' + style_str = '; '.join('%s=%s' % (k, v) for (k, v) in style.items()) + + label = '%.02f' % edge.cost + if edge.activity: + separator = ' - ' + for activity_type, activity_label in self._ACTIVITY_TYPE_LABEL: + label += '%s%s:%.02f ' % ( + separator, activity_label, edge.activity[activity_type]) + separator = ' ' + arrow = '[%s; label="%s"]' % (style_str, label) + from_request_id = edge.from_node.request.request_id + to_request_id = edge.to_node.request.request_id + return '"%s" -> "%s" %s;\n' % (from_request_id, to_request_id, arrow)
diff --git a/tools/android/loading/loading_model.py b/tools/android/loading/loading_model.py deleted file mode 100644 index b7f80029..0000000 --- a/tools/android/loading/loading_model.py +++ /dev/null
@@ -1,610 +0,0 @@ -# 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. - -"""Models for loading in chrome. - -(Redirect the following to the general model module once we have one) -A model is an object with the following methods. - CostMs(): return the cost of the model in milliseconds. - Set(): set model-specific parameters. - -ResourceGraph - This creates a DAG of resource dependencies from loading.log_requests to model - loading time. The model may be parameterized by changing the loading time of - a particular or all resources. -""" - -import logging -import os - -import sys - -import activity_lens -import dag -import loading_trace -import request_dependencies_lens -import request_track - -class ResourceGraph(object): - """A model of loading by a DAG of resource dependencies. - - See model parameters in Set(). - """ - # The lens to build request dependencies. Exposed here for subclasses in - # unittesting. - REQUEST_LENS = request_dependencies_lens.RequestDependencyLens - - EDGE_KIND_KEY = 'edge_kind' - EDGE_KINDS = request_track.Request.INITIATORS + ( - 'script_inferred', 'after-load', 'before-load', 'timing') - - def __init__(self, trace, content_lens=None, frame_lens=None, - activity=None): - """Create from a LoadingTrace (or json of a trace). - - Args: - trace: (LoadingTrace/JSON) Loading trace or JSON of a trace. - content_lens: (ContentClassificationLens) Lens used to annotate the - nodes, or None. - frame_lens: (FrameLoadLens) Lens used to augment graph with load nodes. - activity: (ActivityLens) Lens used to augment the edges with the - activity. - """ - if type(trace) == dict: - trace = loading_trace.LoadingTrace.FromJsonDict(trace) - self._trace = trace - self._content_lens = content_lens - self._frame_lens = frame_lens - self._activity_lens = activity - self._BuildDag(trace) - # Sort before splitting children so that we can correctly dectect if a - # reparented child is actually a dependency for a child of its new parent. - try: - for n in dag.TopologicalSort(self._nodes): - self._SplitChildrenByTime(self._node_info[n.Index()]) - except AssertionError as exc: - sys.stderr.write('Bad topological sort: %s\n' - 'Skipping child split\n' % str(exc)) - self._cache_all = False - self._node_filter = lambda _: True - - @classmethod - def CheckImageLoadConsistency(cls, g1, g2): - """Check that images have the same dependencies between ResourceGraphs. - - Image resources are identified by their short names. - - Args: - g1: a ResourceGraph instance - g2: a ResourceGraph instance - - Returns: - A list of discrepancy tuples. If this list is empty, g1 and g2 are - consistent with respect to image load dependencies. Otherwise, each tuple - is of the form: - ( g1 resource short name or str(list of short names), - g2 resource short name or str(list of short names), - human-readable discrepancy reason ) - Either or both of the g1 and g2 image resource short names may be None if - it's not applicable for the discrepancy reason. - """ - discrepancies = [] - g1_image_to_info = g1._ExtractImages() - g2_image_to_info = g2._ExtractImages() - for image in set(g1_image_to_info.keys()) - set(g2_image_to_info.keys()): - discrepancies.append((image, None, 'Missing in g2')) - for image in set(g2_image_to_info.keys()) - set(g1_image_to_info.keys()): - discrepancies.append((None, image, 'Missing in g1')) - - for image in set(g1_image_to_info.keys()) & set(g2_image_to_info.keys()): - def PredecessorInfo(g, n): - info = [g._ShortName(p) for p in n.Node().Predecessors()] - info.sort() - return str(info) - g1_pred = PredecessorInfo(g1, g1_image_to_info[image]) - g2_pred = PredecessorInfo(g2, g2_image_to_info[image]) - if g1_pred != g2_pred: - discrepancies.append((g1_pred, g2_pred, - 'Predecessor mismatch for ' + image)) - - return discrepancies - - def Set(self, cache_all=None, node_filter=None): - """Set model parameters. - - TODO(mattcary): add parameters for caching certain types of resources (just - scripts, just cacheable, etc). - - Args: - cache_all: boolean that if true ignores empirical resource load times for - all resources. - node_filter: a Node->boolean used to restrict the graph for most - operations. - """ - if self._cache_all is not None: - self._cache_all = cache_all - if node_filter is not None: - self._node_filter = node_filter - - def Nodes(self, sort=False): - """Return iterable of all nodes via their NodeInfos. - - Args: - sort: if true, return nodes in sorted order. This may prune additional - nodes from the unsorted list (eg, non-root, non-ad nodes reachable only - by ad nodes) - - Returns: - Iterable of node infos. - - """ - if sort: - return (self._node_info[n.Index()] - for n in dag.TopologicalSort(self._nodes, self._node_filter)) - return (n for n in self._node_info if self._node_filter(n.Node())) - - def EdgeCosts(self, node_filter=None): - """Edge costs. - - Args: - node_filter: if not none, a Node->boolean filter to use instead of the - current one from Set. - - Returns: - The total edge costs of our graph. - - """ - node_filter = self._node_filter if node_filter is None else node_filter - total = 0 - for n in self._node_info: - if not node_filter(n.Node()): - continue - for s in n.Node().Successors(): - if node_filter(s): - total += self.EdgeCost(n.Node(), s) - return total - - def Intersect(self, other_nodes): - """Return iterable of nodes that intersect with another graph. - - Args: - other_nodes: iterable of the nodes of another graph, eg from Nodes(). - - Returns: - an iterable of (mine, other) pairs for all nodes for which the URL is - identical. - """ - other_map = {n.Url(): n for n in other_nodes} - for n in self._node_info: - if self._node_filter(n.Node()) and n.Url() in other_map: - yield(n, other_map[n.Url()]) - - def Cost(self, path_list=None, costs_out=None): - """Compute cost of current model. - - Args: - path_list: if not None, gets a list of NodeInfo in the longest path. - costs_out: if not None, gets a vector of node costs by node index. Any - filtered nodes will have zero cost. - - Returns: - Cost of the longest path. - - """ - costs = [0] * len(self._nodes) - for n in dag.TopologicalSort(self._nodes, self._node_filter): - cost = 0 - if n.Predecessors(): - cost = max([costs[p.Index()] + self.EdgeCost(p, n) - for p in n.Predecessors()]) - if not self._cache_all: - cost += self.NodeCost(n) - costs[n.Index()] = cost - max_cost = max(costs) - if costs_out is not None: - del costs_out[:] - costs_out.extend(costs) - assert max_cost > 0 # Otherwise probably the filter went awry. - if path_list is not None: - del path_list[:] - n = (i for i in self._nodes if costs[i.Index()] == max_cost).next() - path_list.append(self._node_info[n.Index()]) - while n.Predecessors(): - n = reduce(lambda costliest, next: - next if (self._node_filter(next) and - costs[next.Index()] > costs[costliest.Index()]) - else costliest, - n.Predecessors()) - path_list.insert(0, self._node_info[n.Index()]) - return max_cost - - def FilterAds(self, node): - """A filter for use in eg, Cost, to remove advertising nodes. - - Args: - node: A dag.Node. - - Returns: - True if the node is not ad-related. - """ - node_info = self._node_info[node.Index()] - return not (node_info.IsAd() or node_info.IsTracking()) - - def ResourceInfo(self): - """Get resource info. - - Returns: - A list of NodeInfo objects that describe the resources fetched. - """ - return [n for n in self._node_info if n.Request() is not None] - - def DebugString(self): - """Graph structure for debugging. - - TODO(mattcary): this fails for graphs with more than one component or where - self._nodes[0] is not a root. - - Returns: - A human-readable string of the graph. - """ - output = [] - queue = [self._nodes[0]] - visited = set() - while queue: - n = queue.pop(0) - assert n not in visited - visited.add(n) - children = n.SortedSuccessors() - output.append('%d -> [%s]' % - (n.Index(), ' '.join([str(c.Index()) for c in children]))) - for c in children: - assert n in c.Predecessors() # Integrity checking - queue.append(c) - assert len(visited) == len(self._nodes) - return '\n'.join(output) - - def NodeInfo(self, node): - """Return the node info for a graph node. - - Args: - node: (int, dag.Node or NodeInfo) a node representation. An int is taken - to be the node's index. - - Returns: - The NodeInfo instance corresponding to the node. - """ - if type(node) is self._NodeInfo: - return node - elif type(node) is int: - return self._node_info[node] - return self._node_info[node.Index()] - - def ShortName(self, node): - """Convenience function for redirecting to NodeInfo.""" - return self.NodeInfo(node).ShortName() - - def Url(self, node): - """Convenience function for redirecting to NodeInfo.""" - return self.NodeInfo(node).Url() - - def NodeCost(self, node): - """Convenience function for redirecting to NodeInfo.""" - return self.NodeInfo(node).NodeCost() - - def EdgeCost(self, parent, child): - """Convenience function for redirecting to NodeInfo.""" - return self.NodeInfo(parent).EdgeCost(self.NodeInfo(child)) - - def EdgeAnnotations(self, parent, child): - """Convenience function for redirecting to NodeInfo.""" - return self.NodeInfo(parent).EdgeAnnotations(self.NodeInfo(child)) - - ## - ## Internal items - ## - - # This resource type may induce a timing dependency. See _SplitChildrenByTime - # for details. - # TODO(mattcary): are these right? - _CAN_BE_TIMING_PARENT = set(['script', 'magic-debug-content']) - _CAN_MAKE_TIMING_DEPENDENCE = set(['json', 'other', 'magic-debug-content']) - - class _NodeInfo(object): - """Our internal class that adds cost and other information to nodes. - - Costs are stored on the node as well as edges. Edge information is only - stored on successor edges and not predecessor, that is, you get them from - the parent and not the child. - - We also store the request on the node, and expose request-derived - information like content type. - """ - def __init__(self, node, request): - """Create a new node info. - - Args: - node: The node to augment. - request: The request associated with this node, or an (index, msec) - tuple. - """ - self._node = node - self._is_ad = False - self._is_tracking = False - self._edge_costs = {} - self._edge_annotations = {} - - if type(request) == tuple: - self._request = None - self._node_cost = 0 - self._shortname = 'LOAD %s' % request[0] - self._start_time = request[1] - else: - self._shortname = None - self._start_time = None - self._request = request - # All fields in timing are millis relative to request_time. - self._node_cost = max( - [0] + [t for f, t in request.timing._asdict().iteritems() - if f != 'request_time']) - - def __str__(self): - return self.ShortName() - - def Node(self): - return self._node - - def Index(self): - return self._node.Index() - - def SetRequestContent(self, is_ad, is_tracking): - """Sets the kind of content the request relates to. - - Args: - is_ad: (bool) Whether the request is an Ad. - is_tracking: (bool) Whether the request is related to tracking. - """ - (self._is_ad, self._is_tracking) = (is_ad, is_tracking) - - def IsAd(self): - return self._is_ad - - def IsTracking(self): - return self._is_tracking - - def Request(self): - return self._request - - def NodeCost(self): - return self._node_cost - - def EdgeCost(self, s): - return self._edge_costs.get(s, 0) - - def StartTime(self): - if self._start_time: - return self._start_time - return self._request.timing.request_time * 1000 - - def EndTime(self): - return self.StartTime() + self._node_cost - - def EdgeAnnotations(self, s): - assert s.Node() in self.Node().Successors() - return self._edge_annotations.get(s, {}) - - def ContentType(self): - if self._request is None: - return 'synthetic' - return self._request.GetContentType() - - def ShortName(self): - """Returns either the hostname of the resource, or the filename, - or the end of the path. Tries to include the domain as much as possible. - """ - if self._shortname: - return self._shortname - return request_track.ShortName(self._request.url) - - def Url(self): - return self._request.url - - def SetEdgeCost(self, child, cost): - assert child.Node() in self._node.Successors() - self._edge_costs[child] = cost - - def AddEdgeAnnotations(self, s, annotations): - assert s.Node() in self._node.Successors() - self._edge_annotations.setdefault(s, {}).update(annotations) - - def ReparentTo(self, old_parent, new_parent): - """Move costs and annotatations from old_parent to new_parent. - - Also updates the underlying node connections, ie, do not call - old_parent.RemoveSuccessor(), etc. - - Args: - old_parent: the NodeInfo of a current parent of self. We assert this - is actually a parent. - new_parent: the NodeInfo of the new parent. We assert it is not already - a parent. - """ - assert old_parent.Node() in self.Node().Predecessors() - assert new_parent.Node() not in self.Node().Predecessors() - edge_annotations = old_parent._edge_annotations.pop(self, {}) - edge_cost = old_parent._edge_costs.pop(self) - old_parent.Node().RemoveSuccessor(self.Node()) - new_parent.Node().AddSuccessor(self.Node()) - new_parent.SetEdgeCost(self, edge_cost) - new_parent.AddEdgeAnnotations(self, edge_annotations) - - def __eq__(self, o): - """Note this works whether o is a Node or a NodeInfo.""" - return self.Index() == o.Index() - - def __hash__(self): - return hash(self.Node().Index()) - - def _BuildDag(self, trace): - """Build DAG of resources. - - Build a DAG from our requests and augment with NodeInfo (see above) in a - parallel array indexed by Node.Index(). - - Creates self._nodes and self._node_info. - - Args: - trace: A LoadingTrace. - """ - self._nodes = [] - self._node_info = [] - index_by_request = {} - for request in trace.request_track.GetEvents(): - next_index = len(self._nodes) - assert request not in index_by_request - index_by_request[request] = next_index - node = dag.Node(next_index) - node_info = self._NodeInfo(node, request) - if self._content_lens: - node_info.SetRequestContent( - self._content_lens.IsAdRequest(request), - self._content_lens.IsTrackingRequest(request)) - self._nodes.append(node) - self._node_info.append(node_info) - - dependencies = self.REQUEST_LENS(trace).GetRequestDependencies() - for dep in dependencies: - (parent_rq, child_rq, reason) = dep - parent = self._node_info[index_by_request[parent_rq]] - child = self._node_info[index_by_request[child_rq]] - edge_cost = request_track.TimeBetween(parent_rq, child_rq, reason) - if edge_cost < 0: - edge_cost = 0 - if child.StartTime() < parent.StartTime(): - logging.error('Inverted dependency: %s->%s', - parent.ShortName(), child.ShortName()) - # Note that child.StartTime() < parent.EndTime() appears to happen a - # fair amount in practice. - parent.Node().AddSuccessor(child.Node()) - parent.SetEdgeCost(child, edge_cost) - parent.AddEdgeAnnotations(child, {self.EDGE_KIND_KEY: reason}) - if self._activity_lens: - activity = self._activity_lens.BreakdownEdgeActivityByInitiator(dep) - parent.AddEdgeAnnotations(child, {'activity': activity}) - - self._AugmentFrameLoads(index_by_request) - - def _AugmentFrameLoads(self, index_by_request): - if not self._frame_lens: - return - loads = self._frame_lens.GetFrameLoadInfo() - load_index_to_node = {} - for l in loads: - next_index = len(self._nodes) - node = dag.Node(next_index) - node_info = self._NodeInfo(node, (l.index, l.msec)) - load_index_to_node[l.index] = next_index - self._nodes.append(node) - self._node_info.append(node_info) - frame_deps = self._frame_lens.GetFrameLoadDependencies() - for load_idx, rq in frame_deps[0]: - parent = self._node_info[load_index_to_node[load_idx]] - child = self._node_info[index_by_request[rq]] - parent.Node().AddSuccessor(child.Node()) - parent.AddEdgeAnnotations(child, {self.EDGE_KIND_KEY: 'after-load'}) - for rq, load_idx in frame_deps[1]: - child = self._node_info[load_index_to_node[load_idx]] - parent = self._node_info[index_by_request[rq]] - parent.Node().AddSuccessor(child.Node()) - parent.AddEdgeAnnotations(child, {self.EDGE_KIND_KEY: 'before-load'}) - - def _SplitChildrenByTime(self, parent): - """Split children of a node by request times. - - The initiator of a request may not be the true dependency of a request. For - example, a script may appear to load several resources independently, but in - fact one of them may be a JSON data file, and the remaining resources assets - described in the JSON. The assets should be dependent upon the JSON data - file, and not the original script. - - This function approximates that by rearranging the children of a node - according to their request times. The predecessor of each child is made to - be the node with the greatest finishing time, that is before the start time - of the child. - - We do this by sorting the nodes twice, once by start time and once by end - time. We mark the earliest end time, and then we walk the start time list, - advancing the end time mark when it is less than our current start time. - - This is refined by only considering assets which we believe actually create - a dependency. We only split if the original parent is a script, and the new - parent a data file. We confirm these relationships heuristically by loading - pages multiple times and ensuring that dependencies do not change; see - CheckImageLoadConsistency() for details. - - We incorporate this heuristic by skipping over any non-script/json resources - when moving the end mark. - - TODO(mattcary): More heuristics, like incorporating cachability somehow, and - not just picking arbitrarily if there are two nodes with the same end time - (does that ever really happen?) - - Args: - parent: the NodeInfo whose children we are going to rearrange. - - """ - if parent.ContentType() not in self._CAN_BE_TIMING_PARENT: - return # No dependency changes. - children_by_start_time = [self._node_info[s.Index()] - for s in parent.Node().Successors()] - children_by_start_time.sort(key=lambda c: c.StartTime()) - children_by_end_time = [self._node_info[s.Index()] - for s in parent.Node().Successors()] - children_by_end_time.sort(key=lambda c: c.EndTime()) - end_mark = 0 - for current in children_by_start_time: - if current.StartTime() < parent.EndTime() - 1e-5: - logging.warning('Child loaded before parent finished: %s -> %s', - parent.ShortName(), current.ShortName()) - go_to_next_child = False - while end_mark < len(children_by_end_time): - if children_by_end_time[end_mark] == current: - go_to_next_child = True - break - elif (children_by_end_time[end_mark].ContentType() not in - self._CAN_MAKE_TIMING_DEPENDENCE): - end_mark += 1 - elif (end_mark < len(children_by_end_time) - 1 and - children_by_end_time[end_mark + 1].EndTime() < - current.StartTime()): - end_mark += 1 - else: - break - if end_mark >= len(children_by_end_time): - break # It's not possible to rearrange any more children. - if go_to_next_child: - continue # We can't rearrange this child, but the next child may be - # eligible. - if children_by_end_time[end_mark].EndTime() <= current.StartTime(): - current.ReparentTo(parent, children_by_end_time[end_mark]) - children_by_end_time[end_mark].AddEdgeAnnotations( - current, {self.EDGE_KIND_KEY: 'timing'}) - - def _ExtractImages(self): - """Return interesting image resources. - - Uninteresting image resources are things like ads that we don't expect to be - constant across fetches. - - Returns: - Dict of image url + short name to NodeInfo. - """ - image_to_info = {} - for n in self._node_info: - if (n.ContentType() is not None and - n.ContentType().startswith('image') and - self.FilterAds(n)): - key = str((n.Url(), n.ShortName(), n.StartTime())) - assert key not in image_to_info, n.Url() - image_to_info[key] = n - return image_to_info
diff --git a/tools/android/loading/loading_model_unittest.py b/tools/android/loading/loading_model_unittest.py deleted file mode 100644 index ee5e84d..0000000 --- a/tools/android/loading/loading_model_unittest.py +++ /dev/null
@@ -1,154 +0,0 @@ -# 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. - -import os -import sys -import unittest - -import dag -import loading_model -import request_track -import request_dependencies_lens -import test_utils - - -class LoadingModelTestCase(unittest.TestCase): - def SortedIndicies(self, graph): - return [n.Index() for n in dag.TopologicalSort(graph._nodes)] - - def SuccessorIndicies(self, node): - return [c.Index() for c in node.SortedSuccessors()] - - def test_DictConstruction(self): - graph = test_utils.TestResourceGraph( - {'request_track': { - 'events': [ - test_utils.MakeRequest(0, 'null', 100, 100.5, 101).ToJsonDict(), - test_utils.MakeRequest(1, 0, 102, 102.5, 103).ToJsonDict(), - test_utils.MakeRequest(2, 0, 102, 102.5, 103).ToJsonDict(), - test_utils.MakeRequest(3, 2, 104, 114.5, 105).ToJsonDict()], - 'metadata': { - request_track.RequestTrack._DUPLICATES_KEY: 0, - request_track.RequestTrack._INCONSISTENT_INITIATORS_KEY: 0}}, - 'url': 'foo.com', - 'tracing_track': {'events': []}, - 'page_track': {'events': []}, - 'metadata': {}}) - self.assertEqual(self.SuccessorIndicies(graph._nodes[0]), [1, 2]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[1]), []) - self.assertEqual(self.SuccessorIndicies(graph._nodes[2]), [3]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[3]), []) - - def test_Costing(self): - requests = [test_utils.MakeRequest(0, 'null', 100, 105, 110), - test_utils.MakeRequest(1, 0, 115, 117, 120), - test_utils.MakeRequest(2, 0, 112, 116, 120), - test_utils.MakeRequest(3, 1, 122, 124, 126), - test_utils.MakeRequest(4, 3, 127, 127.5, 128), - test_utils.MakeRequest(5, 'null', 100, 103, 105), - test_utils.MakeRequest(6, 5, 105, 107, 110)] - graph = test_utils.TestResourceGraph.FromRequestList(requests) - self.assertEqual(self.SuccessorIndicies(graph._nodes[0]), [1, 2]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[1]), [3]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[2]), []) - self.assertEqual(self.SuccessorIndicies(graph._nodes[3]), [4]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[4]), []) - self.assertEqual(self.SuccessorIndicies(graph._nodes[5]), [6]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[6]), []) - self.assertEqual(self.SortedIndicies(graph), [0, 5, 1, 2, 6, 3, 4]) - self.assertEqual(28, graph.Cost()) - graph.Set(cache_all=True) - self.assertEqual(8, graph.Cost()) - - def test_MaxPath(self): - requests = [test_utils.MakeRequest(0, 'null', 100, 110, 111), - test_utils.MakeRequest(1, 0, 115, 120, 121), - test_utils.MakeRequest(2, 0, 112, 120, 121), - test_utils.MakeRequest(3, 1, 122, 126, 127), - test_utils.MakeRequest(4, 3, 127, 128, 129), - test_utils.MakeRequest(5, 'null', 100, 105, 106), - test_utils.MakeRequest(6, 5, 105, 110, 111)] - graph = test_utils.TestResourceGraph.FromRequestList(requests) - path_list = [] - self.assertEqual(29, graph.Cost(path_list)) - self.assertEqual([0, 1, 3, 4], [n.Index() for n in path_list]) - - # More interesting would be a test when a node has multiple predecessors, - # but it's not possible for us to construct such a graph from requests yet. - - def test_TimingSplit(self): - # Timing adds node 1 as a parent to 2 but not 3. - requests = [ - test_utils.MakeRequest(0, 'null', 100, 110, 110, - magic_content_type=True), - test_utils.MakeRequest(1, 0, 115, 120, 120, - magic_content_type=True), - test_utils.MakeRequest(2, 0, 121, 122, 122, - magic_content_type=True), - test_utils.MakeRequest(3, 0, 112, 119, 119, - magic_content_type=True), - test_utils.MakeRequest(4, 2, 122, 126, 126), - test_utils.MakeRequest(5, 2, 122, 126, 126)] - graph = test_utils.TestResourceGraph.FromRequestList(requests) - self.assertEqual(self.SuccessorIndicies(graph._nodes[0]), [1, 3]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[1]), [2]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[2]), [4, 5]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[3]), []) - self.assertEqual(self.SuccessorIndicies(graph._nodes[4]), []) - self.assertEqual(self.SuccessorIndicies(graph._nodes[5]), []) - self.assertEqual(self.SortedIndicies(graph), [0, 1, 3, 2, 4, 5]) - - # Change node 1 so it is a parent of 3, which becomes the parent of 2. - requests[1] = test_utils.MakeRequest( - 1, 0, 110, 111, 111, magic_content_type=True) - graph = test_utils.TestResourceGraph.FromRequestList(requests) - self.assertEqual(self.SuccessorIndicies(graph._nodes[0]), [1]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[1]), [3]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[2]), [4, 5]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[3]), [2]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[4]), []) - self.assertEqual(self.SuccessorIndicies(graph._nodes[5]), []) - self.assertEqual(self.SortedIndicies(graph), [0, 1, 3, 2, 4, 5]) - - # Add an initiator dependence to 1 that will become the parent of 3. - requests[1] = test_utils.MakeRequest( - 1, 0, 110, 111, 111, magic_content_type=True) - requests.append(test_utils.MakeRequest(6, 1, 111, 112, 112)) - graph = test_utils.TestResourceGraph.FromRequestList(requests) - # Check it doesn't change until we change the content type of 6. - self.assertEqual(self.SuccessorIndicies(graph._nodes[6]), []) - requests[6] = test_utils.MakeRequest(6, 1, 111, 112, 112, - magic_content_type=True) - graph = test_utils.TestResourceGraph.FromRequestList(requests) - self.assertEqual(self.SuccessorIndicies(graph._nodes[0]), [1]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[1]), [6]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[2]), [4, 5]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[3]), [2]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[4]), []) - self.assertEqual(self.SuccessorIndicies(graph._nodes[5]), []) - self.assertEqual(self.SuccessorIndicies(graph._nodes[6]), [3]) - self.assertEqual(self.SortedIndicies(graph), [0, 1, 6, 3, 2, 4, 5]) - - def test_TimingSplitImage(self): - # If we're all image types, then we shouldn't split by timing. - requests = [test_utils.MakeRequest(0, 'null', 100, 110, 110), - test_utils.MakeRequest(1, 0, 115, 120, 120), - test_utils.MakeRequest(2, 0, 121, 122, 122), - test_utils.MakeRequest(3, 0, 112, 119, 119), - test_utils.MakeRequest(4, 2, 122, 126, 126), - test_utils.MakeRequest(5, 2, 122, 126, 126)] - for r in requests: - r.response_headers['Content-Type'] = 'image/gif' - graph = test_utils.TestResourceGraph.FromRequestList(requests) - self.assertEqual(self.SuccessorIndicies(graph._nodes[0]), [1, 2, 3]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[1]), []) - self.assertEqual(self.SuccessorIndicies(graph._nodes[2]), [4, 5]) - self.assertEqual(self.SuccessorIndicies(graph._nodes[3]), []) - self.assertEqual(self.SuccessorIndicies(graph._nodes[4]), []) - self.assertEqual(self.SuccessorIndicies(graph._nodes[5]), []) - self.assertEqual(self.SortedIndicies(graph), [0, 1, 2, 3, 4, 5]) - - -if __name__ == '__main__': - unittest.main()
diff --git a/tools/android/loading/loading_trace.py b/tools/android/loading/loading_trace.py index 6dbd13d..7630bcc07 100644 --- a/tools/android/loading/loading_trace.py +++ b/tools/android/loading/loading_trace.py
@@ -34,7 +34,8 @@ self.metadata = metadata self.page_track = page self.request_track = request - self.tracing_track = tracing_track + self._tracing_track = tracing_track + self._tracing_json_str = None def ToJsonDict(self): """Returns a dictionary representing this instance.""" @@ -94,3 +95,23 @@ else categories)) connection.MonitorUrl(url, timeout_seconds=timeout_seconds) return cls(url, chrome_metadata, page, request, trace) + + @property + def tracing_track(self): + if not self._tracing_track: + self._RestoreTracingTrack() + return self._tracing_track + + def Slim(self): + """Slims the memory usage of a trace by dropping the TraceEvents from it. + + The tracing track is restored on-demand when accessed. + """ + self._tracing_json_str = json.dumps(self._tracing_track.ToJsonDict()) + self._tracing_track = None + + def _RestoreTracingTrack(self): + assert self._tracing_json_str + self._tracing_track = tracing.TracingTrack.FromJsonDict( + json.loads(self._tracing_json_str)) + self._tracing_json_str = None
diff --git a/tools/android/loading/loading_trace_database.py b/tools/android/loading/loading_trace_database.py new file mode 100644 index 0000000..89d608a --- /dev/null +++ b/tools/android/loading/loading_trace_database.py
@@ -0,0 +1,43 @@ +# 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. + +"""Represents a database of on-disk traces.""" + +import json + + +class LoadingTraceDatabase: + + def __init__(self, traces_dict): + """traces_dict is a dictionary mapping filenames of traces to metadata + about those traces.""" + self._traces_dict = traces_dict + + def GetTraceFilesForURL(self, url): + """Given a URL, returns the set of filenames of traces that were generated + for this URL.""" + trace_files = [f for f in self._traces_dict.keys() + if self._traces_dict[f]["url"] == url] + return trace_files + + def ToJsonDict(self): + """Returns a dict representing this instance.""" + return self._traces_dict + + def ToJsonFile(self, json_path): + """Save a json file representing this instance.""" + json_dict = self.ToJsonDict() + with open(json_path, 'w') as output_file: + json.dump(json_dict, output_file, indent=2) + + @classmethod + def FromJsonDict(cls, json_dict): + """Returns an instance from a dict returned by ToJsonDict().""" + return LoadingTraceDatabase(json_dict) + + @classmethod + def FromJsonFile(cls, json_path): + """Returns an instance from a json file saved by ToJsonFile().""" + with open(json_path) as input_file: + return cls.FromJsonDict(json.load(input_file))
diff --git a/tools/android/loading/loading_trace_database_unittest.py b/tools/android/loading/loading_trace_database_unittest.py new file mode 100644 index 0000000..775638c --- /dev/null +++ b/tools/android/loading/loading_trace_database_unittest.py
@@ -0,0 +1,37 @@ +# 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. + +import unittest + +from loading_trace_database import LoadingTraceDatabase + + +class LoadingTraceDatabaseUnittest(unittest.TestCase): + _JSON_DATABASE = { + "traces/trace1.json" : { "url" : "http://bar.html", }, + "traces/trace2.json" : { "url" : "http://bar.html", }, + "traces/trace3.json" : { "url" : "http://qux.html", }, + } + + def setUp(self): + self.database = LoadingTraceDatabase.FromJsonDict(self._JSON_DATABASE) + + def testGetTraceFilesForURL(self): + # Test a URL with no matching traces. + self.assertEqual( + self.database.GetTraceFilesForURL("http://foo.html"), + []) + + # Test a URL with matching traces. + self.assertEqual( + set(self.database.GetTraceFilesForURL("http://bar.html")), + set(["traces/trace1.json", "traces/trace2.json"])) + + def testSerialization(self): + self.assertEqual( + self._JSON_DATABASE, self.database.ToJsonDict()) + + +if __name__ == '__main__': + unittest.main()
diff --git a/tools/android/loading/model_graph.py b/tools/android/loading/model_graph.py deleted file mode 100644 index eaded4aa..0000000 --- a/tools/android/loading/model_graph.py +++ /dev/null
@@ -1,184 +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. - -"""Visualize a loading_model.ResourceGraph.""" - -import dag -import itertools - -import loading_model - - -class GraphVisualization(object): - """Manipulate visual representations of a resource graph. - - The output will change as the ResourceGraph is changed, for example by setting - filters. - - Currently only DOT output is supported. - """ - _LONG_EDGE_THRESHOLD_MS = 2000 # Time in milliseconds. - - _CONTENT_KIND_TO_COLOR = { - 'application': 'blue', # Scripts. - 'font': 'grey70', - 'image': 'orange', # This probably catches gifs? - 'video': 'hotpink1', - 'audio': 'hotpink2', - } - - _CONTENT_TYPE_TO_COLOR = { - 'html': 'red', - 'css': 'green', - 'script': 'blue', - 'javascript': 'blue', - 'json': 'purple', - 'gif': 'grey', - 'image': 'orange', - 'jpeg': 'orange', - 'ping': 'cyan', # Empty response - 'redirect': 'forestgreen', - 'png': 'orange', - 'plain': 'brown3', - 'octet-stream': 'brown3', - 'other': 'white', - 'synthetic': 'yellow', - } - - _EDGE_KIND_TO_COLOR = { - 'redirect': 'black', - 'parser': 'red', - 'script': 'blue', - 'script_inferred': 'purple', - 'after-load': 'forestgreen', - 'before-load': 'forestgreen', - } - - _ACTIVITY_TYPE_LABEL = ( - ('idle', 'I'), ('unrelated_work', 'W'), ('script', 'S'), - ('parsing', 'P'), ('other_url', 'O'), ('unknown_url', 'U')) - - def __init__(self, graph): - """Initialize. - - Args: - graph: (loading_model.ResourceGraph) the graph to visualize. - """ - self._graph = graph - self._global_start = None - - def OutputDot(self, output): - """Output DOT (graphviz) representation. - - Args: - output: a file-like output stream to receive the dot file. - """ - sorted_nodes = [n for n in self._graph.Nodes(sort=True)] - self._global_start = min([n.StartTime() for n in sorted_nodes]) - visited_nodes = set([n for n in sorted_nodes]) - - output.write("""digraph dependencies { - rankdir = LR; - """) - - orphans = set() - for n in sorted_nodes: - for s in itertools.chain(n.Node().Successors(), - n.Node().Predecessors()): - if s in visited_nodes: - break - else: - orphans.add(n) - if orphans: - output.write("""subgraph cluster_orphans { - color=black; - label="Orphans"; - """) - for n in orphans: - # Ignore synthetic nodes for orphan display. - if not self._graph.NodeInfo(n).Request(): - continue - output.write(self.DotNode(n)) - output.write('}\n') - - output.write("""subgraph cluster_nodes { - color=invis; - """) - - for n in sorted_nodes: - if n in orphans: - continue - output.write(self.DotNode(n)) - - for n in visited_nodes: - for s in n.Node().Successors(): - if s not in visited_nodes: - continue - style = 'color = orange' - label = '%.02f' % self._graph.EdgeCost(n, s) - annotations = self._graph.EdgeAnnotations(n, s) - edge_kind = annotations.get( - loading_model.ResourceGraph.EDGE_KIND_KEY, None) - assert ((edge_kind is None) - or (edge_kind in loading_model.ResourceGraph.EDGE_KINDS)) - style = 'color = %s' % self._EDGE_KIND_TO_COLOR[edge_kind] - if edge_kind == 'timing': - style += '; style=dashed' - if self._graph.EdgeCost(n, s) > self._LONG_EDGE_THRESHOLD_MS: - style += '; penwidth=5; weight=2' - - label = '%.02f' % self._graph.EdgeCost(n, s) - if 'activity' in annotations: - activity = annotations['activity'] - separator = ' - ' - for activity_type, activity_label in self._ACTIVITY_TYPE_LABEL: - label += '%s%s:%.02f ' % ( - separator, activity_label, activity[activity_type]) - separator = ' ' - arrow = '[%s; label="%s"]' % (style, label) - output.write('%d -> %d %s;\n' % (n.Index(), s.Index(), arrow)) - output.write('}\n') - - output.write('}\n') - - def _ContentTypeToColor(self, content_type): - if not content_type: - type_str = 'other' - elif '/' in content_type: - kind, type_str = content_type.split('/', 1) - if kind in self._CONTENT_KIND_TO_COLOR: - return self._CONTENT_KIND_TO_COLOR[kind] - else: - type_str = content_type - return self._CONTENT_TYPE_TO_COLOR[type_str] - - def DotNode(self, node): - """Returns a graphviz node description for a given node. - - Args: - node: a dag.Node or ResourceGraph node info. - - Returns: - A string describing the resource in graphviz format. - The resource is color-coded according to its content type, and its shape - is oval if its max-age is less than 300s (or if it's not cacheable). - """ - if type(node) is dag.Node: - node = self._graph.NodeInfo(node) - color = self._ContentTypeToColor(node.ContentType()) - if node.Request(): - max_age = node.Request().MaxAge() - shape = 'polygon' if max_age > 300 else 'oval' - else: - shape = 'doubleoctagon' - styles = ['filled'] - if node.IsAd() or node.IsTracking(): - styles += ['bold', 'diagonals'] - return ('%d [label = "%s\\n%.2f->%.2f (%.2f)"; style = "%s"; ' - 'fillcolor = %s; shape = %s];\n' - % (node.Index(), node.ShortName(), - node.StartTime() - self._global_start, - node.EndTime() - self._global_start, - node.EndTime() - node.StartTime(), - ','.join(styles), color, shape))
diff --git a/tools/android/loading/model_graph_unittest.py b/tools/android/loading/model_graph_unittest.py deleted file mode 100644 index 831b1e15..0000000 --- a/tools/android/loading/model_graph_unittest.py +++ /dev/null
@@ -1,33 +0,0 @@ -# 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. - -import gzip -import json -import os.path -import tempfile -import unittest - -import frame_load_lens -import loading_model -import loading_trace -import model_graph - -TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'testdata') - -class ModelGraphTestCase(unittest.TestCase): - _ROLLING_STONE = os.path.join(TEST_DATA_DIR, 'rollingstone.trace.gz') - - def test_EndToEnd(self): - # Test that we don't crash. This also runs through frame_load_lens. - tmp = tempfile.NamedTemporaryFile() - with gzip.GzipFile(self._ROLLING_STONE) as f: - trace = loading_trace.LoadingTrace.FromJsonDict(json.load(f)) - frame_lens = frame_load_lens.FrameLoadLens(trace) - graph = loading_model.ResourceGraph(trace=trace, frame_lens=frame_lens) - visualization = model_graph.GraphVisualization(graph) - visualization.OutputDot(tmp) - - -if __name__ == '__main__': - unittest.main()
diff --git a/tools/android/loading/test_utils.py b/tools/android/loading/test_utils.py index 8e07826..a0b5b16d 100644 --- a/tools/android/loading/test_utils.py +++ b/tools/android/loading/test_utils.py
@@ -6,7 +6,6 @@ import dependency_graph import devtools_monitor -import loading_model import loading_trace import page_track import request_track @@ -158,15 +157,6 @@ return deps -class TestResourceGraph(loading_model.ResourceGraph): - """Replace the default request lens in a ResourceGraph with our SimpleLens.""" - REQUEST_LENS = SimpleLens - - @classmethod - def FromRequestList(cls, requests, page_events=None, trace_events=None): - return cls(LoadingTraceFromEvents(requests, page_events, trace_events)) - - class TestDependencyGraph(dependency_graph.RequestDependencyGraph): """A dependency graph created from requests using a simple lens.""" def __init__(self, requests):
diff --git a/tools/checklicenses/checklicenses.py b/tools/checklicenses/checklicenses.py index 8067eaa..cfd418b 100755 --- a/tools/checklicenses/checklicenses.py +++ b/tools/checklicenses/checklicenses.py
@@ -95,6 +95,7 @@ 'Public domain BSD', 'Public domain BSD-like', 'Public domain LGPL (v2.1 or later)', + 'Public domain University of Illinois/NCSA Open Source License (BSD like)', 'Public domain', 'SGI Free Software License B', 'SunSoft (BSD like)',
diff --git a/tools/gn/exec_process.cc b/tools/gn/exec_process.cc index e80abd6..e5ab248 100644 --- a/tools/gn/exec_process.cc +++ b/tools/gn/exec_process.cc
@@ -9,6 +9,7 @@ #include "base/command_line.h" #include "base/files/file_util.h" #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "base/process/kill.h" #include "base/process/launch.h" #include "base/process/process.h"
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py index 059166c..db8684d 100644 --- a/tools/json_schema_compiler/cc_generator.py +++ b/tools/json_schema_compiler/cc_generator.py
@@ -127,16 +127,15 @@ .Cblock(self._GenerateInitializersAndBody(type_)) .Append('%s::~%s() {}' % (classname_in_namespace, classname)) ) - if 'use_movable_types' in type_.namespace.compiler_options: - # Note: we use 'rhs' because some API objects have a member 'other'. - (c.Append('%s::%s(%s&& rhs)' % - (classname_in_namespace, classname, classname)) - .Cblock(self._GenerateMoveCtor(type_)) - .Append('%s& %s::operator=(%s&& rhs)' % - (classname_in_namespace, classname_in_namespace, - classname)) - .Cblock(self._GenerateMoveAssignOperator(type_)) - ) + # Note: we use 'rhs' because some API objects have a member 'other'. + (c.Append('%s::%s(%s&& rhs)' % + (classname_in_namespace, classname, classname)) + .Cblock(self._GenerateMoveCtor(type_)) + .Append('%s& %s::operator=(%s&& rhs)' % + (classname_in_namespace, classname_in_namespace, + classname)) + .Cblock(self._GenerateMoveAssignOperator(type_)) + ) if type_.origin.from_json: c.Cblock(self._GenerateTypePopulate(classname_in_namespace, type_)) if cpp_namespace is None: # only generate for top-level types @@ -483,17 +482,12 @@ if type_.additional_properties.property_type == PropertyType.ANY: c.Append('value->MergeDictionary(&additional_properties);') else: - # Non-copyable types will be wrapped in a linked_ptr for inclusion in - # maps, so we need to unwrap them. - needs_unwrap = ( - not 'use_movable_types' in type_.namespace.compiler_options and - not self._type_helper.IsCopyable(type_.additional_properties)) (c.Sblock('for (const auto& it : additional_properties) {') .Cblock(self._CreateValueFromType( 'value->SetWithoutPathExpansion(it.first, %s);', type_.additional_properties.name, type_.additional_properties, - '%sit.second' % ('*' if needs_unwrap else ''))) + 'it.second')) .Eblock('}') )
diff --git a/tools/json_schema_compiler/cpp_type_generator.py b/tools/json_schema_compiler/cpp_type_generator.py index 24cbf61..82113ce9 100644 --- a/tools/json_schema_compiler/cpp_type_generator.py +++ b/tools/json_schema_compiler/cpp_type_generator.py
@@ -120,13 +120,12 @@ # never needs to be wrapped in pointer shenanigans. # TODO(kalman): change this - but it's an exceedingly far-reaching change. if not self.FollowRef(type_).property_type == PropertyType.ENUM: - if is_in_container and (is_ptr or not self.IsCopyable(type_)): - # Only wrap the object in a linked_ptr if this API isn't using movable - # types. Since base::Values aren't yet movable, wrap them too. - # TODO(devlin): Eventually, movable types should be the default. - if (not 'use_movable_types' in type_.namespace.compiler_options or - cpp_type == 'base::Value' or cpp_type == 'base::DictionaryValue'): - cpp_type = 'linked_ptr<%s>' % cpp_util.PadForGenerics(cpp_type) + is_base_value = (cpp_type == 'base::Value' or + cpp_type == 'base::DictionaryValue') + # Only wrap the object in a linked_ptr if it's a base::Value. + # TODO(devlin): Change this to scoped_ptr. + if is_in_container and is_base_value: + cpp_type = 'linked_ptr<%s>' % cpp_util.PadForGenerics(cpp_type) elif is_ptr: cpp_type = 'scoped_ptr<%s>' % cpp_util.PadForGenerics(cpp_type)
diff --git a/tools/json_schema_compiler/cpp_type_generator_test.py b/tools/json_schema_compiler/cpp_type_generator_test.py index 69d80dc..db4e8cff 100755 --- a/tools/json_schema_compiler/cpp_type_generator_test.py +++ b/tools/json_schema_compiler/cpp_type_generator_test.py
@@ -148,7 +148,7 @@ manager = CppTypeGenerator(self.models.get('windows'), _FakeSchemaLoader(None)) self.assertEquals( - 'std::vector<linked_ptr<Window> >', + 'std::vector<Window>', manager.GetCppType( self.windows.functions['getAll'].callback.params[0].type_)) manager = CppTypeGenerator(self.models.get('permissions'), @@ -182,7 +182,7 @@ environment=CppNamespaceEnvironment('%(namespace)s')) manager = CppTypeGenerator(m, _FakeSchemaLoader(m)) self.assertEquals( - 'std::vector<linked_ptr<tabs::Tab> >', + 'std::vector<tabs::Tab>', manager.GetCppType( self.windows.types['Window'].properties['tabs'].type_)) @@ -193,7 +193,7 @@ manager.GetCppType( self.permissions.types['Permissions'].properties['origins'].type_, is_in_container=False)) - self.assertEquals('linked_ptr<std::vector<std::string> >', + self.assertEquals('std::vector<std::string>', manager.GetCppType( self.permissions.types['Permissions'].properties['origins'].type_, is_in_container=True))
diff --git a/tools/json_schema_compiler/h_generator.py b/tools/json_schema_compiler/h_generator.py index 5452885..31a7ec2 100644 --- a/tools/json_schema_compiler/h_generator.py +++ b/tools/json_schema_compiler/h_generator.py
@@ -228,10 +228,9 @@ .Append('%(classname)s();') .Append('~%(classname)s();') ) - if 'use_movable_types' in type_.namespace.compiler_options: - (c.Append('%(classname)s(%(classname)s&& rhs);') - .Append('%(classname)s& operator=(%(classname)s&& rhs);') - ) + (c.Append('%(classname)s(%(classname)s&& rhs);') + .Append('%(classname)s& operator=(%(classname)s&& rhs);') + ) if type_.origin.from_json: (c.Append() .Comment('Populates a %s object from a base::Value. Returns'
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py index 5fda70ea..58efe28 100755 --- a/tools/json_schema_compiler/idl_schema.py +++ b/tools/json_schema_compiler/idl_schema.py
@@ -500,8 +500,6 @@ compiler_options['implemented_in'] = node.value elif node.name == 'camel_case_enum_to_string': compiler_options['camel_case_enum_to_string'] = node.value - elif node.name == 'use_movable_types': - compiler_options['use_movable_types'] = node.value elif node.name == 'deprecated': deprecated = str(node.value) elif node.name == 'documentation_title':
diff --git a/tools/json_schema_compiler/json_schema.py b/tools/json_schema_compiler/json_schema.py index bb4e9c4b..e00c11d7 100644 --- a/tools/json_schema_compiler/json_schema.py +++ b/tools/json_schema_compiler/json_schema.py
@@ -37,9 +37,13 @@ def Load(filename): - with open(filename, 'r') as handle: - schemas = json_parse.Parse(handle.read()) - return schemas + try: + with open(filename, 'r') as handle: + schemas = json_parse.Parse(handle.read()) + return schemas + except: + print('FAILED: Exception encountered while loading "%s"' % filename) + raise # A dictionary mapping |filename| to the object resulting from loading the JSON
diff --git a/tools/json_schema_compiler/test/arrays_unittest.cc b/tools/json_schema_compiler/test/arrays_unittest.cc index f54347f..2c3a461 100644 --- a/tools/json_schema_compiler/test/arrays_unittest.cc +++ b/tools/json_schema_compiler/test/arrays_unittest.cc
@@ -162,9 +162,9 @@ scoped_ptr<RefArrayType> ref_array_type(new RefArrayType()); EXPECT_TRUE(RefArrayType::Populate(*value, ref_array_type.get())); ASSERT_EQ(3u, ref_array_type->refs.size()); - EXPECT_EQ(1, ref_array_type->refs[0]->val); - EXPECT_EQ(2, ref_array_type->refs[1]->val); - EXPECT_EQ(3, ref_array_type->refs[2]->val); + EXPECT_EQ(1, ref_array_type->refs[0].val); + EXPECT_EQ(2, ref_array_type->refs[1].val); + EXPECT_EQ(3, ref_array_type->refs[2].val); } { scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); @@ -219,8 +219,8 @@ ObjectArray::Params::Create(*params_value)); EXPECT_TRUE(params.get()); ASSERT_EQ(2u, params->objects.size()); - EXPECT_EQ(1, params->objects[0]->additional_properties["val"]); - EXPECT_EQ(2, params->objects[1]->additional_properties["val"]); + EXPECT_EQ(1, params->objects[0].additional_properties["val"]); + EXPECT_EQ(2, params->objects[1].additional_properties["val"]); } TEST(JsonSchemaCompilerArrayTest, RefArrayParamsCreate) { @@ -233,8 +233,8 @@ RefArray::Params::Create(*params_value)); EXPECT_TRUE(params.get()); ASSERT_EQ(2u, params->refs.size()); - EXPECT_EQ(1, params->refs[0]->val); - EXPECT_EQ(2, params->refs[1]->val); + EXPECT_EQ(1, params->refs[0].val); + EXPECT_EQ(2, params->refs[1].val); } TEST(JsonSchemaCompilerArrayTest, ReturnIntegerArrayResultCreate) { @@ -253,11 +253,11 @@ } TEST(JsonSchemaCompilerArrayTest, ReturnRefArrayResultCreate) { - std::vector<linked_ptr<Item> > items; - items.push_back(linked_ptr<Item>(new Item())); - items.push_back(linked_ptr<Item>(new Item())); - items[0]->val = 1; - items[1]->val = 2; + std::vector<Item> items; + items.push_back(Item()); + items.push_back(Item()); + items[0].val = 1; + items[1].val = 2; scoped_ptr<base::ListValue> results = ReturnRefArray::Results::Create(items);
diff --git a/tools/json_schema_compiler/test/choices_unittest.cc b/tools/json_schema_compiler/test/choices_unittest.cc index 387bdb6..f86c978 100644 --- a/tools/json_schema_compiler/test/choices_unittest.cc +++ b/tools/json_schema_compiler/test/choices_unittest.cc
@@ -281,7 +281,7 @@ EXPECT_FALSE(obj->as_choice2->as_choice_type); ASSERT_TRUE(obj->as_choice2->as_choice_types); { - std::vector<linked_ptr<ChoiceType> >* choice_types = + std::vector<ChoiceType>* choice_types = obj->as_choice2->as_choice_types.get(); // Bleh too much effort to test everything. ASSERT_EQ(2u, choice_types->size());
diff --git a/tools/json_schema_compiler/test/idl_schemas_unittest.cc b/tools/json_schema_compiler/test/idl_schemas_unittest.cc index 1817afb5..4c5ff1a 100644 --- a/tools/json_schema_compiler/test/idl_schemas_unittest.cc +++ b/tools/json_schema_compiler/test/idl_schemas_unittest.cc
@@ -157,10 +157,10 @@ scoped_ptr<Function11::Params> f11_params = Function11::Params::Create(list); ASSERT_TRUE(f11_params != NULL); ASSERT_EQ(2u, f11_params->arg.size()); - EXPECT_EQ(5, f11_params->arg[0]->x); - EXPECT_EQ("foo", f11_params->arg[0]->y); - EXPECT_EQ(6, f11_params->arg[1]->x); - EXPECT_EQ("bar", f11_params->arg[1]->y); + EXPECT_EQ(5, f11_params->arg[0].x); + EXPECT_EQ("foo", f11_params->arg[0].y); + EXPECT_EQ(6, f11_params->arg[1].x); + EXPECT_EQ("bar", f11_params->arg[1].y); } TEST(IdlCompiler, ObjectTypes) {
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 47a66359..b81b18c 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -14,29 +14,28 @@ 'chromium': { 'Android': 'android_without_codecs_gyp_release_bot_minimal_symbols', 'Linux x64': 'noswarming_gn_release_bot', - 'Linux': 'noswarming_gyp_release_bot_x86', 'Mac': 'noswarming_gyp_release_bot_mac_strip', - 'Win': 'noswarming_gyp_release_bot', + 'Win': 'noswarming_gyp_release_bot_minimal_symbols_x86', }, 'chromium.android': { 'Android Cronet ARM64 Builder': - 'android_cronet_gyp_release_bot_minimal_symbols_arm64', + 'android_cronet_gn_release_bot_minimal_symbols_arm64', 'Android Cronet ARM64 Builder (dbg)': - 'android_cronet_gyp_debug_static_bot_arm64', + 'android_cronet_gn_debug_static_bot_arm64', 'Android Cronet ARMv6 Builder': - 'android_cronet_gyp_release_bot_minimal_symbols_armv6', + 'android_cronet_gn_release_bot_minimal_symbols_armv6', 'Android Cronet Builder': - 'android_cronet_gyp_release_bot_minimal_symbols', - 'Android Cronet Builder (dbg)': 'android_cronet_gyp_debug_static_bot', + 'android_cronet_gn_release_bot_minimal_symbols', + 'Android Cronet Builder (dbg)': 'android_cronet_gn_debug_static_bot', 'Android Cronet Data Reduction Proxy Builder': - 'android_cronet_data_reduction_proxy_gyp_release_bot_minimal_symbols', + 'android_cronet_data_reduction_proxy_gn_release_bot_minimal_symbols', 'Android Cronet MIPS Builder': - 'android_cronet_gyp_release_bot_minimal_symbols_mipsel', + 'android_cronet_gn_release_bot_minimal_symbols_mipsel', 'Android Cronet x86 Builder': - 'android_cronet_gyp_release_bot_minimal_symbols_x86', + 'android_cronet_gn_release_bot_minimal_symbols_x86', 'Android Cronet x86 Builder (dbg)': - 'android_cronet_gyp_debug_static_bot_x86', + 'android_cronet_gn_debug_static_bot_x86', 'Android GN Builder (dbg)': 'android_gn_debug_bot_minimal_symbols', 'Android MIPS Builder (dbg)': 'android_gn_debug_static_bot_mipsel', @@ -112,7 +111,7 @@ 'Chromium Win PGO Builder': 'gyp_official_winpgo', 'Chromium Win x64 Clobber': 'tbd', 'Chromium Win x64 PGO Builder': 'gyp_official_winpgo_x64', - 'Chromium Windows Analyze': 'gyp_windows_analyze', + 'Chromium Windows Analyze': 'gn_windows_analyze', 'Chromium Windows Buildrunner': 'tbd', 'Chromium Windows Instant Extended': 'tbd', 'ChromiumOS Linux Tests': 'tbd', @@ -154,13 +153,10 @@ 'CrWinAsan(dll) tester': 'tbd', 'CrWinAsanCov': 'tbd', 'CrWinAsanCov tester': 'tbd', - 'CrWinClang': 'tbd', 'CrWinClang tester': 'tbd', - 'CrWinClang(dbg)': 'tbd', 'CrWinClang(dbg) tester': 'tbd', 'CrWinClang(shared)': 'tbd', 'CrWinClang(shared) tester': 'tbd', - 'CrWinClang64': 'tbd', 'CrWinClang64 tester': 'tbd', 'CrWinClang64(dbg) tester': 'tbd', 'CrWinClang64(dll)': 'tbd', @@ -201,6 +197,12 @@ 'Chromium_iOS_Device': 'ios_gyp', 'Chromium_iOS_Device_(ninja)': 'ios_gyp', 'Chromium_iOS_Simulator_(dbg)': 'ios_gyp', + 'CrWinClang': + 'swarming_gyp_clang_official_release_bot_minimal_symbols_x86', + 'CrWinClang(dbg)': + 'swarming_gyp_clang_debug_bot_minimal_symbols_x86', + 'CrWinClang64': + 'swarming_gyp_clang_official_release_bot_minimal_symbols_x64', 'CrWinClang64(dbg)': 'win_clang_debug_bot', 'Libfuzzer Upload Linux ASan': 'gn_release_libfuzzer_asan', 'Libfuzzer Upload Linux MSan': 'gn_release_libfuzzer_msan', @@ -219,32 +221,30 @@ 'Android Debug (Nexus 9)': 'tbd', 'GPU Mac Builder': 'tbd', 'GPU Mac Builder (dbg)': 'tbd', - 'GPU Win Builder': 'tbd', - 'GPU Win Builder (dbg)': 'tbd', 'Mac 10.10 Debug (Intel)': 'tbd', 'Mac 10.10 Release (Intel)': 'tbd', 'Mac 10.10 Retina Debug (AMD)': 'tbd', 'Mac 10.10 Retina Release (AMD)': 'tbd', 'Mac Retina Debug': 'tbd', 'Mac Retina Release': 'tbd', - 'Win7 Debug (NVIDIA)': 'tbd', - 'Win7 Release (ATI)': 'tbd', - 'Win7 Release (NVIDIA)': 'tbd', 'GPU Linux Builder (dbg)': 'swarming_gpu_tests_gn_debug_bot', 'GPU Linux Builder': 'swarming_gpu_tests_gn_release_bot', + 'GPU Win Builder': + 'swarming_gpu_tests_gyp_release_bot_minimal_symbols_x86', + 'GPU Win Builder (dbg)': + 'swarming_gpu_tests_gyp_debug_bot_minimal_symbols_x86', 'Linux Debug (NVIDIA)': 'none', 'Linux Release (NVIDIA)': 'none', + 'Win7 Debug (NVIDIA)': 'none', + 'Win7 Release (ATI)': 'none', + 'Win7 Release (NVIDIA)': 'none', }, 'chromium.gpu.fyi': { 'GPU Mac Builder': 'tbd', 'GPU Mac Builder (dbg)': 'tbd', - 'GPU Win Builder': 'tbd', - 'GPU Win Builder (dbg)': 'tbd', 'GPU Win Clang Builder (dbg)': 'tbd', - 'GPU Win x64 Builder': 'tbd', - 'GPU Win x64 Builder (dbg)': 'tbd', 'Linux Audio': 'tbd', 'Linux Release (NVIDIA GeForce 730)': 'tbd', 'Mac 10.10 Debug (ATI)': 'tbd', @@ -269,7 +269,14 @@ 'GPU Linux Builder (dbg)': 'swarming_gpu_fyi_tests_gn_debug_bot', 'GPU Linux Builder': 'swarming_gpu_fyi_tests_gn_release_bot', - 'Linux Debug (NVIDIA)': 'none', + 'GPU Win Builder': + 'swarming_gpu_tests_deqp_gles_gyp_release_bot_minimal_symbols_x86', + 'GPU Win Builder (dbg)': + 'swarming_gpu_tests_deqp_gles_gyp_debug_bot_minimal_symbols_x86', + 'GPU Win x64 Builder': + 'swarming_gpu_tests_deqp_gles_gyp_release_bot_minimal_symbols_x64', + 'GPU Win x64 Builder (dbg)': + 'swarming_gpu_tests_deqp_gles_gyp_debug_bot_minimal_symbols_x64', 'Linux Debug (NVIDIA)': 'none', 'Linux Release (ATI)': 'none', 'Linux Release (Intel Graphics Stack)': 'none', @@ -475,6 +482,10 @@ 'Linux Builder': 'swarming_gn_release_bot', 'Linux Builder-Trybot': 'swarming_gn_release_bot', 'Linux Tests': 'swarming_gn_release_bot', + 'Win Builder': + 'swarming_gpu_tests_gyp_release_bot_minimal_symbols_x86', + 'Win Builder-Trybot': + 'swarming_gpu_tests_gyp_release_trybot_minimal_symbols_x86', }, 'client.v8.fyi': { @@ -548,21 +559,18 @@ }, 'chromium.win': { - 'Win 7 Tests x64 (1)': 'tbd', - 'Win Builder': 'tbd', - 'Win Builder (dbg)': 'tbd', - 'Win x64 Builder': 'tbd', - 'Win x64 Builder (dbg)': 'tbd', - 'Win7 (32) Tests': 'tbd', - 'Win7 Tests (1)': 'tbd', - 'Win7 Tests (dbg)(1)': 'tbd', - - # Test-only builder. - 'Win10 Tests x64': 'none', - # Windows bots take too long to link w/ full symbols and time out. + 'Win Builder': 'swarming_gyp_release_bot_minimal_symbols_x86', + 'Win Builder (dbg)': 'swarming_gyp_debug_bot_minimal_symbols_x86', + 'Win x64 Builder': 'swarming_gyp_release_bot_minimal_symbols_x64', + 'Win x64 Builder (dbg)': 'swarming_gyp_debug_bot_minimal_symbols_x64', 'Win x64 GN (dbg)': 'gn_debug_bot_minimal_symbols', 'Win x64 GN': 'gn_release_bot_minimal_symbols', + 'Win 7 Tests x64 (1)': 'none', + 'Win10 Tests x64': 'none', + 'Win7 (32) Tests': 'none', + 'Win7 Tests (1)': 'none', + 'Win7 Tests (dbg)(1)': 'none', 'Win8 Aura': 'gn_release_bot_minimal_symbols_x86', 'Win8 GN (dbg)': 'gn_debug_bot_minimal_symbols_x86', }, @@ -641,13 +649,12 @@ 'tryserver.chromium.android': { 'android_amp': 'tbd', 'android_archive_rel_ng': 'tbd', - 'android_blink_rel': 'tbd', 'android_chromium_variable': 'tbd', 'android_coverage': 'tbd', - 'android_deterministic': 'tbd', 'cast_shell_android': 'tbd', 'android_arm64_dbg_recipe': 'swarming_android_gyp_debug_trybot_arm64', + 'android_blink_rel': 'swarming_android_gyp_release_trybot', 'android_chromium_gn_compile_dbg': 'android_gn_debug_trybot', 'android_chromium_gn_compile_rel': 'android_gn_release_trybot', 'android_chromium_gn_rel': 'android_gn_release_trybot', @@ -659,7 +666,7 @@ 'android_compile_x86_dbg': 'android_gn_debug_trybot_x86', # TODO(crbug/597596): Switch this back to debug_trybot when cronet's # shared library loading is fixed. - 'android_cronet_tester': 'android_cronet_gyp_debug_static_bot', + 'android_cronet_tester': 'android_cronet_gn_debug_static_bot', 'linux_android_dbg_ng': 'swarming_android_gyp_debug_trybot', 'linux_android_rel_ng': 'swarming_android_gyp_release_trybot', }, @@ -667,13 +674,17 @@ 'tryserver.chromium.angle': { 'mac_angle_dbg_ng': 'tbd', 'mac_angle_rel_ng': 'tbd', - 'win_angle_dbg_ng': 'tbd', - 'win_angle_rel_ng': 'tbd', - 'win_angle_x64_dbg_ng': 'tbd', - 'win_angle_x64_rel_ng': 'tbd', 'linux_angle_dbg_ng': 'swarming_gpu_fyi_tests_gn_debug_trybot', 'linux_angle_rel_ng': 'swarming_gpu_fyi_tests_gn_release_trybot', + 'win_angle_dbg_ng': + 'swarming_gpu_tests_deqp_gles_gyp_debug_bot_minimal_symbols_x86', + 'win_angle_rel_ng': + 'swarming_gpu_tests_deqp_gles_gyp_release_trybot_minimal_symbols_x86', + 'win_angle_x64_dbg_ng': + 'swarming_gpu_tests_deqp_gles_gyp_debug_bot_minimal_symbols_x64', + 'win_angle_x64_rel_ng': + 'swarming_gpu_tests_deqp_gles_gyp_release_trybot_minimal_symbols_x64', }, 'tryserver.chromium.linux': { @@ -694,8 +705,6 @@ 'linux_chromium_chromeos_ozone_rel_ng': 'tbd', 'linux_chromium_chromeos_variable': 'tbd', 'linux_chromium_variable': 'tbd', - 'linux_nacl_sdk': 'tbd', - 'linux_nacl_sdk_build': 'tbd', 'cast_shell_linux': 'cast_gn_release_trybot', 'linux_arm': 'swarming_gyp_release_trybot_arm', @@ -721,9 +730,10 @@ 'linux_chromium_practice_rel_ng': 'gyp_release_trybot', 'linux_chromium_rel_ng': 'swarming_gpu_tests_gn_release_trybot', 'linux_chromium_tsan_rel_ng': 'swarming_tsan_gyp_release_trybot', - 'linux_deterministic': 'swarming_deterministic_gyp_release_bot', 'linux_ecs_ozone': 'embedded_gyp_debug_bot', 'linux_full_bisect_builder': 'swarming_gyp_release_bot', + 'linux_nacl_sdk': 'nacl_annotator', + 'linux_nacl_sdk_build': 'nacl_annotator', 'linux_optional_gpu_tests_rel': 'swarming_gpu_fyi_tests_gn_release_trybot', 'linux_site_isolation': 'gn_release_trybot', @@ -740,9 +750,6 @@ 'mac_chromium_dbg_ng': 'tbd', 'mac_chromium_rel_ng': 'tbd', 'mac_chromium_variable': 'tbd', - 'mac_deterministic': 'tbd', - 'mac_nacl_sdk': 'tbd', - 'mac_nacl_sdk_build': 'tbd', 'mac_optional_gpu_tests_rel': 'tbd', 'ios_dbg_simulator': 'ios_gyp', @@ -755,6 +762,8 @@ 'mac_chromium_gn_dbg': 'gn_debug_static_bot', 'mac_chromium_gn_rel': 'gn_release_trybot', 'mac_chromium_gn_upload': 'gn_release_bot', + 'mac_nacl_sdk': 'nacl_annotator', + 'mac_nacl_sdk_build': 'nacl_annotator', }, 'tryserver.chromium.perf': { @@ -801,34 +810,48 @@ }, 'tryserver.chromium.win': { - 'win_archive': 'tbd', - 'win_chromium_compile_dbg_ng': 'tbd', - 'win_chromium_compile_dbg_ng_exp': 'tbd', - 'win_chromium_compile_rel_ng': 'tbd', - 'win_chromium_dbg_ng': 'tbd', - 'win_chromium_rel_ng': 'tbd', - 'win_chromium_rel_ng_exp': 'tbd', - 'win_chromium_syzyasan_rel': 'tbd', + # The *_variable bots are used by FindIt. We need to talk to + # the FindIt team to figure out how their recipes interact w/ MB. 'win_chromium_variable': 'tbd', - 'win_chromium_x64_rel_ng_exp': 'tbd', - 'win_clang_dbg': 'tbd', - 'win_clang_rel': 'tbd', - 'win_clang_x64_rel': 'tbd', - 'win_deterministic': 'tbd', - 'win_nacl_sdk': 'tbd', - 'win_nacl_sdk_build': 'tbd', - 'win_optional_gpu_tests_rel': 'tbd', + 'win_chromium_variable_archive': 'tbd', + 'win_chromium_variable_chrome': 'tbd', + 'win_chromium_variable_gn': 'tbd', + 'win_chromium_variable_webkit_builder': 'tbd', + 'win_chromium_variable_webkit_layout': 'tbd', + 'win_chromium_variable_webkit_win7_builder': 'tbd', + 'win_chromium_variable_webkit_win7_builder_x64': 'tbd', + 'win10_chromium_x64_rel_ng': + 'swarming_gyp_release_trybot_minimal_symbols_x64', 'win8_chromium_gn_dbg': 'gn_debug_bot_minimal_symbols_x86', 'win8_chromium_gn_upload': 'gn_release_bot_minimal_symbols_x86', 'win8_chromium_ng': 'gn_release_trybot_x86', + 'win_archive': 'noswarming_gyp_release_trybot_minimal_symbols_x86', 'win_chromium_clang_upload': 'gn_release_bot', + 'win_chromium_compile_dbg_ng': + 'swarming_gyp_debug_bot_minimal_symbols_x86', + 'win_chromium_compile_rel_ng': + 'swarming_gpu_tests_gyp_release_trybot_minimal_symbols_x86', 'win_chromium_gn_x64_dbg': 'gn_debug_bot_minimal_symbols', 'win_chromium_gn_x64_rel': 'gn_release_trybot', - 'win_chromium_x64_rel_ng': 'gn_release_trybot', - 'win10_chromium_x64_rel_ng': 'gn_release_trybot', + 'win_chromium_dbg_ng': 'swarming_gyp_debug_bot_minimal_symbols_x86', + 'win_chromium_rel_ng': + 'swarming_gpu_tests_gyp_release_trybot_minimal_symbols_x86', + 'win_chromium_syzyasan_rel': + 'swarming_gyp_syzyasan_release_trybot_minimal_symbols_x86', + 'win_chromium_x64_rel_ng': + 'swarming_gyp_release_trybot_minimal_symbols_x64', 'win_clang': 'win_clang_debug_bot', + 'win_clang_dbg': 'swarming_gyp_clang_debug_bot_minimal_symbols_x86', + 'win_clang_rel': + 'swarming_gyp_clang_official_release_trybot_minimal_symbols_x86', 'win_clang_x64_dbg': 'win_clang_debug_bot', + 'win_clang_x64_rel': + 'swarming_gyp_clang_official_release_trybot_minimal_symbols_x64', + 'win_nacl_sdk': 'nacl_annotator', + 'win_nacl_sdk_build': 'nacl_annotator', + 'win_optional_gpu_tests_rel': + 'swarming_gpu_tests_deqp_gles_gyp_release_trybot_minimal_symbols_x86', 'win_pgo': 'gyp_official_winpgo', }, @@ -863,41 +886,41 @@ 'android', 'clang', 'asan', 'findbugs', 'gyp', 'debug_trybot', ], - 'android_cronet_data_reduction_proxy_gyp_release_bot_minimal_symbols': [ - 'android', 'cronet', 'data_reduction_proxy', 'gyp', + 'android_cronet_data_reduction_proxy_gn_release_bot_minimal_symbols': [ + 'android', 'cronet', 'data_reduction_proxy', 'gn', 'release_bot_minimal_symbols', 'arm' ], - 'android_cronet_gyp_debug_static_bot': [ - 'android', 'cronet', 'gyp', 'debug_static_bot', 'arm' + 'android_cronet_gn_debug_static_bot': [ + 'android', 'cronet', 'gn', 'debug_static_bot', 'arm' ], - 'android_cronet_gyp_debug_static_bot_arm64': [ - 'android', 'cronet', 'gyp', 'debug_static_bot', 'arm64' + 'android_cronet_gn_debug_static_bot_arm64': [ + 'android', 'cronet', 'gn', 'debug_static_bot', 'arm64' ], - 'android_cronet_gyp_debug_static_bot_x86': [ - 'android', 'cronet', 'gyp', 'debug_static_bot', 'x86' + 'android_cronet_gn_debug_static_bot_x86': [ + 'android', 'cronet', 'gn', 'debug_static_bot', 'x86' ], - 'android_cronet_gyp_release_bot_minimal_symbols': [ - 'android', 'cronet', 'gyp', 'release_bot_minimal_symbols', 'arm' + 'android_cronet_gn_release_bot_minimal_symbols': [ + 'android', 'cronet', 'gn', 'release_bot_minimal_symbols', 'arm' ], - 'android_cronet_gyp_release_bot_minimal_symbols_arm64': [ - 'android', 'cronet', 'gyp', 'release_bot_minimal_symbols', 'arm64' + 'android_cronet_gn_release_bot_minimal_symbols_arm64': [ + 'android', 'cronet', 'gn', 'release_bot_minimal_symbols', 'arm64' ], - 'android_cronet_gyp_release_bot_minimal_symbols_armv6': [ - 'android', 'cronet', 'gyp', 'release_bot_minimal_symbols', 'armv6' + 'android_cronet_gn_release_bot_minimal_symbols_armv6': [ + 'android', 'cronet', 'gn', 'release_bot_minimal_symbols', 'armv6' ], - 'android_cronet_gyp_release_bot_minimal_symbols_mipsel': [ - 'android', 'cronet', 'gyp', 'release_bot_minimal_symbols', 'mipsel' + 'android_cronet_gn_release_bot_minimal_symbols_mipsel': [ + 'android', 'cronet', 'gn', 'release_bot_minimal_symbols', 'mipsel' ], - 'android_cronet_gyp_release_bot_minimal_symbols_x86': [ - 'android', 'cronet', 'gyp', 'release_bot_minimal_symbols', 'x86' + 'android_cronet_gn_release_bot_minimal_symbols_x86': [ + 'android', 'cronet', 'gn', 'release_bot_minimal_symbols', 'x86' ], 'android_gn_debug_bot': [ @@ -1133,7 +1156,7 @@ 'disable_nacl', ], 'gn_release_libfuzzer_ubsan': [ - 'gn', 'release', 'libfuzzer', 'ubsan_security', 'proprietary_codecs', + 'gn', 'release', 'libfuzzer', 'ubsan_security', 'proprietary_codecs', 'pdf_xfa', 'disable_nacl', ], @@ -1144,6 +1167,11 @@ 'gn', 'release', 'drmemory', 'drfuzz', 'proprietary_codecs', ], + 'gn_windows_analyze': [ + 'gn', 'no_symbols', 'disable_precompiled_headers', + 'shared', 'x86', 'win_analyze', + ], + 'gyp_valgrind_release_bot': [ 'gyp', 'valgrind', 'release_bot', ], @@ -1152,11 +1180,6 @@ 'gyp', 'chromeos', 'valgrind', 'release_bot', ], - 'gyp_windows_analyze': [ - 'gyp', 'no_symbols', 'disable_precompiled_headers', - 'shared', 'x86', 'win_analyze', - ], - 'gyp_drmemory_shared_release_x86': [ 'gyp', 'drmemory', 'shared', 'release', 'x86', ], @@ -1174,6 +1197,10 @@ 'ios_gyp': ['gyp', 'error'], + # This is used to indicate that the bot runs the nacl annotator-based + # configs and switching them is out of scope for MB. + 'nacl_annotator': [ 'error' ], + # This is used for tracking purposes; any bot that uses this config # should never actually run MB. 'none': [ @@ -1184,16 +1211,16 @@ 'noswarming', 'gn', 'release_bot', ], - 'noswarming_gyp_release_bot': [ - 'noswarming', 'gyp', 'release_bot', - ], - 'noswarming_gyp_release_bot_mac_strip': [ 'noswarming', 'gyp', 'release_bot', 'mac_strip', ], - 'noswarming_gyp_release_bot_x86': [ - 'noswarming', 'gyp', 'release_bot', 'x86', + 'noswarming_gyp_release_bot_minimal_symbols_x86': [ + 'noswarming', 'gyp', 'release_bot', 'minimal_symbols', 'x86', + ], + + 'noswarming_gyp_release_trybot_minimal_symbols_x86': [ + 'noswarming', 'gyp', 'release_trybot', 'minimal_symbols', 'x86', ], 'swarming_android_gn_release_bot_minimal_symbols': [ @@ -1240,10 +1267,6 @@ 'swarming', 'chromeos', 'msan', 'gyp', 'release_trybot', ], - 'swarming_deterministic_gyp_release_bot': [ - 'swarming', 'deterministic', 'gyp', 'release_bot', - ], - 'swarming_gpu_fyi_tests_gn_debug_bot': [ 'swarming', 'gpu_tests', 'internal_gles2_conform_tests', 'gn', 'debug_bot', 'angle_deqp_tests', @@ -1264,6 +1287,42 @@ 'release_bot', 'angle_deqp_tests', ], + 'swarming_gpu_tests_deqp_gles_gyp_debug_bot_minimal_symbols_x64': [ + 'swarming', 'gpu_tests', 'angle_deqp_tests', + 'internal_gles2_conform_tests', 'gyp', 'debug_bot', + 'minimal_symbols', 'x64', + ], + + 'swarming_gpu_tests_deqp_gles_gyp_debug_bot_minimal_symbols_x86': [ + 'swarming', 'gpu_tests', 'angle_deqp_tests', + 'internal_gles2_conform_tests', 'gyp', 'debug_bot', + 'minimal_symbols', 'x86', + ], + + 'swarming_gpu_tests_deqp_gles_gyp_release_trybot_minimal_symbols_x64': [ + 'swarming', 'gpu_tests', 'angle_deqp_tests', + 'internal_gles2_conform_tests', 'gyp', 'release_trybot', + 'minimal_symbols', 'x64', + ], + + 'swarming_gpu_tests_deqp_gles_gyp_release_trybot_minimal_symbols_x86': [ + 'swarming', 'gpu_tests', 'angle_deqp_tests', + 'internal_gles2_conform_tests', 'gyp', 'release_trybot', + 'minimal_symbols', 'x86', + ], + + 'swarming_gpu_tests_deqp_gles_gyp_release_bot_minimal_symbols_x64': [ + 'swarming', 'gpu_tests', 'angle_deqp_tests', + 'internal_gles2_conform_tests', 'gyp', 'release_bot', + 'minimal_symbols', 'x64', + ], + + 'swarming_gpu_tests_deqp_gles_gyp_release_bot_minimal_symbols_x86': [ + 'swarming', 'gpu_tests', 'angle_deqp_tests', + 'internal_gles2_conform_tests', 'gyp', 'release_bot', + 'minimal_symbols', 'x86', + ], + 'swarming_gpu_tests_gn_debug_bot': [ 'swarming', 'gpu_tests', 'gn', 'debug_bot', ], @@ -1276,6 +1335,19 @@ 'swarming', 'gpu_tests', 'gn', 'release_trybot', ], + 'swarming_gpu_tests_gyp_debug_bot_minimal_symbols_x86': [ + 'swarming', 'gpu_tests', 'gyp', 'debug_bot', 'minimal_symbols', 'x86', + ], + + 'swarming_gpu_tests_gyp_release_bot_minimal_symbols_x86': [ + 'swarming', 'gpu_tests', 'gyp', 'release_bot', 'minimal_symbols', 'x86', + ], + + 'swarming_gpu_tests_gyp_release_trybot_minimal_symbols_x86': [ + 'swarming', 'gpu_tests', 'gyp', 'release_trybot', 'minimal_symbols', + 'x86', + ], + 'swarming_gn_debug_bot': [ 'swarming', 'gn', 'debug_bot', ], @@ -1329,6 +1401,30 @@ 'swarming', 'gyp', 'asan', 'lsan', 'release_bot', 'x64', ], + 'swarming_gyp_clang_debug_bot_minimal_symbols_x86': [ + 'swarming', 'gyp', 'clang', 'debug_bot', 'minimal_symbols', 'x86', + ], + + 'swarming_gyp_clang_official_release_bot_minimal_symbols_x64': [ + 'swarming', 'gyp', 'clang', 'official', 'release_bot', + 'minimal_symbols', 'x64', + ], + + 'swarming_gyp_clang_official_release_bot_minimal_symbols_x86': [ + 'swarming', 'gyp', 'clang', 'official', 'release_bot', + 'minimal_symbols', 'x86', + ], + + 'swarming_gyp_clang_official_release_trybot_minimal_symbols_x64': [ + 'swarming', 'gyp', 'clang', 'official', 'release_trybot', + 'minimal_symbols', 'x64', + ], + + 'swarming_gyp_clang_official_release_trybot_minimal_symbols_x86': [ + 'swarming', 'gyp', 'clang', 'official', 'release_trybot', + 'minimal_symbols', 'x86', + ], + 'swarming_gyp_debug_bot_minimal_symbols_x64': [ 'swarming', 'gyp', 'debug_bot_minimal_symbols', 'x64', ], @@ -1419,6 +1515,11 @@ 'swarming', 'gyp', 'release_trybot', 'minimal_symbols', 'x86', ], + 'swarming_gyp_syzyasan_release_trybot_minimal_symbols_x86': [ + 'swarming', 'gyp', 'syzyasan', 'release_trybot', 'minimal_symbols', + 'x86', + ], + 'swarming_tsan_gyp_release_trybot': [ 'swarming', 'disable_nacl', 'tsan', 'gyp', 'release_trybot', ], @@ -1472,6 +1573,7 @@ }, 'angle_deqp_tests': { + 'gyp_defines': 'build_angle_deqp_tests=1', 'gn_args': 'build_angle_deqp_tests=true', }, @@ -1556,7 +1658,7 @@ }, 'data_reduction_proxy': { - 'gn_args': 'enable_data_reduction_proxy_support=true', + 'gn_args': 'cronet_enable_data_reduction_proxy_support=true', 'gyp_defines': 'enable_data_reduction_proxy_support=1', }, @@ -1585,12 +1687,6 @@ 'mixins': ['debug_bot_minimal_symbols'], }, - # TODO(zforman): This doesn't do anything now, find out if it can - # be removed, and remove it. - 'deterministic': { - 'gn_args': 'error', - }, - 'disable_nacl': { 'gn_args': 'enable_nacl=false', 'gyp_defines': 'disable_nacl=1',
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index 28e3d39f..7622ec8 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -9799,6 +9799,14 @@ <description>Please enter the description of this user action.</description> </action> +<action name="Options_DefaultBackgroundSyncSettingChanged"> + <owner>nsatragno@chromium.org</owner> + <owner>peter@chromium.org</owner> + <description> + Triggers when the default content setting for Background Sync is changed. + </description> +</action> + <action name="Options_DefaultCookieSettingChanged"> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <description>Please enter the description of this user action.</description> @@ -11758,9 +11766,15 @@ <description>Please enter the description of this user action.</description> </action> +<action name="ReloadBypassingCache"> + <owner>toyoshim@chromium.org</owner> + <description>The user triggers Shift-reload operation.</description> +</action> + <action name="ReloadIgnoringCache"> - <owner>Please list the metric's owners. Add more owner tags as needed.</owner> - <description>Please enter the description of this user action.</description> + <owner>toyoshim@chromium.org</owner> + <description>The user triggers Shift-reload operation.</description> + <obsolete>This is replaced with ReloadBypassingCache.</obsolete> </action> <action name="RemoveFormat">
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index dd24d015..d1430d5 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -207,6 +207,40 @@ </summary> </histogram> +<histogram name="Accessibility.Mac.DifferentiateWithoutColor" + enum="BooleanEnabled"> + <owner>ellyjones@chromium.org</owner> + <summary> + Whether the "differentiate without color" Mac system setting is + enabled. This is checked once, 45 seconds after startup. + </summary> +</histogram> + +<histogram name="Accessibility.Mac.FullKeyboardAccessEnabled" + enum="BooleanEnabled"> + <owner>ellyjones@chromium.org</owner> + <summary> + Whether the "full keyboard access" Mac system setting is enabled. + This is checked once, 45 seconds after startup. + </summary> +</histogram> + +<histogram name="Accessibility.Mac.IncreaseContrast" enum="BooleanEnabled"> + <owner>ellyjones@chromium.org</owner> + <summary> + Whether the "increase contrast" Mac system setting is enabled. + This is checked once, 45 seconds after startup. + </summary> +</histogram> + +<histogram name="Accessibility.Mac.ReduceTransparency" enum="BooleanEnabled"> + <owner>ellyjones@chromium.org</owner> + <summary> + Whether the "reduce transparency" Mac system setting is enabled. + This is checked once, 45 seconds after startup. + </summary> +</histogram> + <histogram name="Accessibility.ManuallyEnabled" enum="BooleanEnabled"> <owner>dmazzoni@chromium.org</owner> <owner>kenjibaheux@google.com</owner> @@ -3282,6 +3316,13 @@ </summary> </histogram> +<histogram name="Blink.Compositing.UpdateTime" units="microseconds"> + <owner>paint-dev@chromium.org</owner> + <summary> + Time spent updating compositing in the Blink document lifecyce. + </summary> +</histogram> + <histogram name="Blink.DecodedImage.Orientation" enum="DecodedImageOrientation"> <owner>rob.buis@samsung.org</owner> <summary>Image orientation inferred during decode.</summary> @@ -3337,6 +3378,18 @@ </summary> </histogram> +<histogram name="Blink.Paint.UpdateTime" units="microseconds"> + <owner>paint-dev@chromium.org</owner> + <summary>Time spent updating paint in the Blink document lifecycle.</summary> +</histogram> + +<histogram name="Blink.PaintInvalidation.UpdateTime" units="microseconds"> + <owner>paint-dev@chromium.org</owner> + <summary> + Time spent updating paint invalidation in the Blink document lifecycle. + </summary> +</histogram> + <histogram name="Blink.RestoredCachedStyleSheet" enum="RestoredCachedStyleSheet"> <obsolete> @@ -3364,6 +3417,13 @@ </summary> </histogram> +<histogram name="Blink.StyleAndLayout.UpdateTime" units="microseconds"> + <owner>layout-dev@chromium.org</owner> + <summary> + Time spent updating style and layout in the Blink document lifecycle. + </summary> +</histogram> + <histogram name="Blink.XHR.setRequestHeader.HeaderValueCategoryInRFC7230" enum="XMLHttpRequestHeaderValueCategoryInRFC7230"> <owner>hiroshige@chromium.org</owner> @@ -41847,6 +41907,15 @@ </summary> </histogram> +<histogram name="RenderViewContextMenu.OpenLinkAsUserShownProfilesState" + enum="OpenLinkAsUserProfilesState"> + <owner>jochen@chromium.org</owner> + <summary> + Whether or not other profiles are active when the "Open Link as + User" context menu is shown. Logged when the context menu is created. + </summary> +</histogram> + <histogram name="RenderViewContextMenu.Shown" enum="RenderViewContextMenuItem"> <owner>vitalybuka@chromium.org</owner> <summary>Count of renderer view context menu items shown.</summary> @@ -53954,6 +54023,19 @@ </summary> </histogram> +<histogram name="Translate.CLD2.LanguageAccuracy" units="%"> + <owner>rkaplow@google.com</owner> + <summary> + Accuracy of the language detected by CLD2. Only recorded if the detection + returned a "known" result. + </summary> +</histogram> + +<histogram name="Translate.CLD2.LanguageDetected" enum="CLD2LanguageCode"> + <owner>rkaplow@google.com</owner> + <summary>Language of page detected by CLD2.</summary> +</histogram> + <histogram name="Translate.ContentLanguage" enum="TranslateLanguage"> <owner>kenjibaheux@google.com</owner> <summary> @@ -61991,6 +62073,626 @@ <int value="2" label="Fixed Address Load Not Attempted"/> </enum> +<enum name="CLD2LanguageCode" type="int"> + <summary> + See Language in third_party/cld_2/src/internal/generated_language.h. + </summary> + <int value="0" label="ENGLISH"/> + <int value="1" label="DANISH"/> + <int value="2" label="DUTCH"/> + <int value="3" label="FINNISH"/> + <int value="4" label="FRENCH"/> + <int value="5" label="GERMAN"/> + <int value="6" label="HEBREW"/> + <int value="7" label="ITALIAN"/> + <int value="8" label="JAPANESE"/> + <int value="9" label="KOREAN"/> + <int value="10" label="NORWEGIAN"/> + <int value="11" label="POLISH"/> + <int value="12" label="PORTUGUESE"/> + <int value="13" label="RUSSIAN"/> + <int value="14" label="SPANISH"/> + <int value="15" label="SWEDISH"/> + <int value="16" label="CHINESE"/> + <int value="17" label="CZECH"/> + <int value="18" label="GREEK"/> + <int value="19" label="ICELANDIC"/> + <int value="20" label="LATVIAN"/> + <int value="21" label="LITHUANIAN"/> + <int value="22" label="ROMANIAN"/> + <int value="23" label="HUNGARIAN"/> + <int value="24" label="ESTONIAN"/> + <int value="25" label="TG_UNKNOWN_LANGUAGE"/> + <int value="26" label="UNKNOWN_LANGUAGE"/> + <int value="27" label="BULGARIAN"/> + <int value="28" label="CROATIAN"/> + <int value="29" label="SERBIAN"/> + <int value="30" label="IRISH"/> + <int value="31" label="GALICIAN"/> + <int value="32" label="TAGALOG"/> + <int value="33" label="TURKISH"/> + <int value="34" label="UKRAINIAN"/> + <int value="35" label="HINDI"/> + <int value="36" label="MACEDONIAN"/> + <int value="37" label="BENGALI"/> + <int value="38" label="INDONESIAN"/> + <int value="39" label="LATIN"/> + <int value="40" label="MALAY"/> + <int value="41" label="MALAYALAM"/> + <int value="42" label="WELSH"/> + <int value="43" label="NEPALI"/> + <int value="44" label="TELUGU"/> + <int value="45" label="ALBANIAN"/> + <int value="46" label="TAMIL"/> + <int value="47" label="BELARUSIAN"/> + <int value="48" label="JAVANESE"/> + <int value="49" label="OCCITAN"/> + <int value="50" label="URDU"/> + <int value="51" label="BIHARI"/> + <int value="52" label="GUJARATI"/> + <int value="53" label="THAI"/> + <int value="54" label="ARABIC"/> + <int value="55" label="CATALAN"/> + <int value="56" label="ESPERANTO"/> + <int value="57" label="BASQUE"/> + <int value="58" label="INTERLINGUA"/> + <int value="59" label="KANNADA"/> + <int value="60" label="PUNJABI"/> + <int value="61" label="SCOTS_GAELIC"/> + <int value="62" label="SWAHILI"/> + <int value="63" label="SLOVENIAN"/> + <int value="64" label="MARATHI"/> + <int value="65" label="MALTESE"/> + <int value="66" label="VIETNAMESE"/> + <int value="67" label="FRISIAN"/> + <int value="68" label="SLOVAK"/> + <int value="69" label="CHINESE_T"/> + <int value="70" label="FAROESE"/> + <int value="71" label="SUNDANESE"/> + <int value="72" label="UZBEK"/> + <int value="73" label="AMHARIC"/> + <int value="74" label="AZERBAIJANI"/> + <int value="75" label="GEORGIAN"/> + <int value="76" label="TIGRINYA"/> + <int value="77" label="PERSIAN"/> + <int value="78" label="BOSNIAN"/> + <int value="79" label="SINHALESE"/> + <int value="80" label="NORWEGIAN_N"/> + <int value="81" label="X_81"/> + <int value="82" label="X_82"/> + <int value="83" label="XHOSA"/> + <int value="84" label="ZULU"/> + <int value="85" label="GUARANI"/> + <int value="86" label="SESOTHO"/> + <int value="87" label="TURKMEN"/> + <int value="88" label="KYRGYZ"/> + <int value="89" label="BRETON"/> + <int value="90" label="TWI"/> + <int value="91" label="YIDDISH"/> + <int value="92" label="X_92"/> + <int value="93" label="SOMALI"/> + <int value="94" label="UIGHUR"/> + <int value="95" label="KURDISH"/> + <int value="96" label="MONGOLIAN"/> + <int value="97" label="ARMENIAN"/> + <int value="98" label="LAOTHIAN"/> + <int value="99" label="SINDHI"/> + <int value="100" label="RHAETO_ROMANCE"/> + <int value="101" label="AFRIKAANS"/> + <int value="102" label="LUXEMBOURGISH"/> + <int value="103" label="BURMESE"/> + <int value="104" label="KHMER"/> + <int value="105" label="TIBETAN"/> + <int value="106" label="DHIVEHI"/> + <int value="107" label="CHEROKEE"/> + <int value="108" label="SYRIAC"/> + <int value="109" label="LIMBU"/> + <int value="110" label="ORIYA"/> + <int value="111" label="ASSAMESE"/> + <int value="112" label="CORSICAN"/> + <int value="113" label="INTERLINGUE"/> + <int value="114" label="KAZAKH"/> + <int value="115" label="LINGALA"/> + <int value="116" label="X_116"/> + <int value="117" label="PASHTO"/> + <int value="118" label="QUECHUA"/> + <int value="119" label="SHONA"/> + <int value="120" label="TAJIK"/> + <int value="121" label="TATAR"/> + <int value="122" label="TONGA"/> + <int value="123" label="YORUBA"/> + <int value="124" label="X_124"/> + <int value="125" label="X_125"/> + <int value="126" label="X_126"/> + <int value="127" label="X_127"/> + <int value="128" label="MAORI"/> + <int value="129" label="WOLOF"/> + <int value="130" label="ABKHAZIAN"/> + <int value="131" label="AFAR"/> + <int value="132" label="AYMARA"/> + <int value="133" label="BASHKIR"/> + <int value="134" label="BISLAMA"/> + <int value="135" label="DZONGKHA"/> + <int value="136" label="FIJIAN"/> + <int value="137" label="GREENLANDIC"/> + <int value="138" label="HAUSA"/> + <int value="139" label="HAITIAN_CREOLE"/> + <int value="140" label="INUPIAK"/> + <int value="141" label="INUKTITUT"/> + <int value="142" label="KASHMIRI"/> + <int value="143" label="KINYARWANDA"/> + <int value="144" label="MALAGASY"/> + <int value="145" label="NAURU"/> + <int value="146" label="OROMO"/> + <int value="147" label="RUNDI"/> + <int value="148" label="SAMOAN"/> + <int value="149" label="SANGO"/> + <int value="150" label="SANSKRIT"/> + <int value="151" label="SISWANT"/> + <int value="152" label="TSONGA"/> + <int value="153" label="TSWANA"/> + <int value="154" label="VOLAPUK"/> + <int value="155" label="ZHUANG"/> + <int value="156" label="KHASI"/> + <int value="157" label="SCOTS"/> + <int value="158" label="GANDA"/> + <int value="159" label="MANX"/> + <int value="160" label="MONTENEGRIN"/> + <int value="161" label="AKAN"/> + <int value="162" label="IGBO"/> + <int value="163" label="MAURITIAN_CREOLE"/> + <int value="164" label="HAWAIIAN"/> + <int value="165" label="CEBUANO"/> + <int value="166" label="EWE"/> + <int value="167" label="GA"/> + <int value="168" label="HMONG"/> + <int value="169" label="KRIO"/> + <int value="170" label="LOZI"/> + <int value="171" label="LUBA_LULUA"/> + <int value="172" label="LUO_KENYA_AND_TANZANIA"/> + <int value="173" label="NEWARI"/> + <int value="174" label="NYANJA"/> + <int value="175" label="OSSETIAN"/> + <int value="176" label="PAMPANGA"/> + <int value="177" label="PEDI"/> + <int value="178" label="RAJASTHANI"/> + <int value="179" label="SESELWA"/> + <int value="180" label="TUMBUKA"/> + <int value="181" label="VENDA"/> + <int value="182" label="WARAY_PHILIPPINES"/> + <int value="183" label="X_183"/> + <int value="184" label="X_184"/> + <int value="185" label="X_185"/> + <int value="186" label="X_186"/> + <int value="187" label="X_187"/> + <int value="188" label="X_188"/> + <int value="189" label="X_189"/> + <int value="190" label="X_190"/> + <int value="191" label="X_191"/> + <int value="192" label="X_192"/> + <int value="193" label="X_193"/> + <int value="194" label="X_194"/> + <int value="195" label="X_195"/> + <int value="196" label="X_196"/> + <int value="197" label="X_197"/> + <int value="198" label="X_198"/> + <int value="199" label="X_199"/> + <int value="200" label="X_200"/> + <int value="201" label="X_201"/> + <int value="202" label="X_202"/> + <int value="203" label="X_203"/> + <int value="204" label="X_204"/> + <int value="205" label="X_205"/> + <int value="206" label="X_206"/> + <int value="207" label="X_207"/> + <int value="208" label="X_208"/> + <int value="209" label="X_209"/> + <int value="210" label="X_210"/> + <int value="211" label="X_211"/> + <int value="212" label="X_212"/> + <int value="213" label="X_213"/> + <int value="214" label="X_214"/> + <int value="215" label="X_215"/> + <int value="216" label="X_216"/> + <int value="217" label="X_217"/> + <int value="218" label="X_218"/> + <int value="219" label="X_219"/> + <int value="220" label="X_220"/> + <int value="221" label="X_221"/> + <int value="222" label="X_222"/> + <int value="223" label="X_223"/> + <int value="224" label="X_224"/> + <int value="225" label="X_225"/> + <int value="226" label="X_226"/> + <int value="227" label="X_227"/> + <int value="228" label="X_228"/> + <int value="229" label="X_229"/> + <int value="230" label="X_230"/> + <int value="231" label="X_231"/> + <int value="232" label="X_232"/> + <int value="233" label="X_233"/> + <int value="234" label="X_234"/> + <int value="235" label="X_235"/> + <int value="236" label="X_236"/> + <int value="237" label="X_237"/> + <int value="238" label="X_238"/> + <int value="239" label="X_239"/> + <int value="240" label="X_240"/> + <int value="241" label="X_241"/> + <int value="242" label="X_242"/> + <int value="243" label="X_243"/> + <int value="244" label="X_244"/> + <int value="245" label="X_245"/> + <int value="246" label="X_246"/> + <int value="247" label="X_247"/> + <int value="248" label="X_248"/> + <int value="249" label="X_249"/> + <int value="250" label="X_250"/> + <int value="251" label="X_251"/> + <int value="252" label="X_252"/> + <int value="253" label="X_253"/> + <int value="254" label="X_254"/> + <int value="255" label="X_255"/> + <int value="256" label="X_256"/> + <int value="257" label="X_257"/> + <int value="258" label="X_258"/> + <int value="259" label="X_259"/> + <int value="260" label="X_260"/> + <int value="261" label="X_261"/> + <int value="262" label="X_262"/> + <int value="263" label="X_263"/> + <int value="264" label="X_264"/> + <int value="265" label="X_265"/> + <int value="266" label="X_266"/> + <int value="267" label="X_267"/> + <int value="268" label="X_268"/> + <int value="269" label="X_269"/> + <int value="270" label="X_270"/> + <int value="271" label="X_271"/> + <int value="272" label="X_272"/> + <int value="273" label="X_273"/> + <int value="274" label="X_274"/> + <int value="275" label="X_275"/> + <int value="276" label="X_276"/> + <int value="277" label="X_277"/> + <int value="278" label="X_278"/> + <int value="279" label="X_279"/> + <int value="280" label="X_280"/> + <int value="281" label="X_281"/> + <int value="282" label="X_282"/> + <int value="283" label="X_283"/> + <int value="284" label="X_284"/> + <int value="285" label="X_285"/> + <int value="286" label="X_286"/> + <int value="287" label="X_287"/> + <int value="288" label="X_288"/> + <int value="289" label="X_289"/> + <int value="290" label="X_290"/> + <int value="291" label="X_291"/> + <int value="292" label="X_292"/> + <int value="293" label="X_293"/> + <int value="294" label="X_294"/> + <int value="295" label="X_295"/> + <int value="296" label="X_296"/> + <int value="297" label="X_297"/> + <int value="298" label="X_298"/> + <int value="299" label="X_299"/> + <int value="300" label="X_300"/> + <int value="301" label="X_301"/> + <int value="302" label="X_302"/> + <int value="303" label="X_303"/> + <int value="304" label="X_304"/> + <int value="305" label="X_305"/> + <int value="306" label="X_306"/> + <int value="307" label="X_307"/> + <int value="308" label="X_308"/> + <int value="309" label="X_309"/> + <int value="310" label="X_310"/> + <int value="311" label="X_311"/> + <int value="312" label="X_312"/> + <int value="313" label="X_313"/> + <int value="314" label="X_314"/> + <int value="315" label="X_315"/> + <int value="316" label="X_316"/> + <int value="317" label="X_317"/> + <int value="318" label="X_318"/> + <int value="319" label="X_319"/> + <int value="320" label="X_320"/> + <int value="321" label="X_321"/> + <int value="322" label="X_322"/> + <int value="323" label="X_323"/> + <int value="324" label="X_324"/> + <int value="325" label="X_325"/> + <int value="326" label="X_326"/> + <int value="327" label="X_327"/> + <int value="328" label="X_328"/> + <int value="329" label="X_329"/> + <int value="330" label="X_330"/> + <int value="331" label="X_331"/> + <int value="332" label="X_332"/> + <int value="333" label="X_333"/> + <int value="334" label="X_334"/> + <int value="335" label="X_335"/> + <int value="336" label="X_336"/> + <int value="337" label="X_337"/> + <int value="338" label="X_338"/> + <int value="339" label="X_339"/> + <int value="340" label="X_340"/> + <int value="341" label="X_341"/> + <int value="342" label="X_342"/> + <int value="343" label="X_343"/> + <int value="344" label="X_344"/> + <int value="345" label="X_345"/> + <int value="346" label="X_346"/> + <int value="347" label="X_347"/> + <int value="348" label="X_348"/> + <int value="349" label="X_349"/> + <int value="350" label="X_350"/> + <int value="351" label="X_351"/> + <int value="352" label="X_352"/> + <int value="353" label="X_353"/> + <int value="354" label="X_354"/> + <int value="355" label="X_355"/> + <int value="356" label="X_356"/> + <int value="357" label="X_357"/> + <int value="358" label="X_358"/> + <int value="359" label="X_359"/> + <int value="360" label="X_360"/> + <int value="361" label="X_361"/> + <int value="362" label="X_362"/> + <int value="363" label="X_363"/> + <int value="364" label="X_364"/> + <int value="365" label="X_365"/> + <int value="366" label="X_366"/> + <int value="367" label="X_367"/> + <int value="368" label="X_368"/> + <int value="369" label="X_369"/> + <int value="370" label="X_370"/> + <int value="371" label="X_371"/> + <int value="372" label="X_372"/> + <int value="373" label="X_373"/> + <int value="374" label="X_374"/> + <int value="375" label="X_375"/> + <int value="376" label="X_376"/> + <int value="377" label="X_377"/> + <int value="378" label="X_378"/> + <int value="379" label="X_379"/> + <int value="380" label="X_380"/> + <int value="381" label="X_381"/> + <int value="382" label="X_382"/> + <int value="383" label="X_383"/> + <int value="384" label="X_384"/> + <int value="385" label="X_385"/> + <int value="386" label="X_386"/> + <int value="387" label="X_387"/> + <int value="388" label="X_388"/> + <int value="389" label="X_389"/> + <int value="390" label="X_390"/> + <int value="391" label="X_391"/> + <int value="392" label="X_392"/> + <int value="393" label="X_393"/> + <int value="394" label="X_394"/> + <int value="395" label="X_395"/> + <int value="396" label="X_396"/> + <int value="397" label="X_397"/> + <int value="398" label="X_398"/> + <int value="399" label="X_399"/> + <int value="400" label="X_400"/> + <int value="401" label="X_401"/> + <int value="402" label="X_402"/> + <int value="403" label="X_403"/> + <int value="404" label="X_404"/> + <int value="405" label="X_405"/> + <int value="406" label="X_406"/> + <int value="407" label="X_407"/> + <int value="408" label="X_408"/> + <int value="409" label="X_409"/> + <int value="410" label="X_410"/> + <int value="411" label="X_411"/> + <int value="412" label="X_412"/> + <int value="413" label="X_413"/> + <int value="414" label="X_414"/> + <int value="415" label="X_415"/> + <int value="416" label="X_416"/> + <int value="417" label="X_417"/> + <int value="418" label="X_418"/> + <int value="419" label="X_419"/> + <int value="420" label="X_420"/> + <int value="421" label="X_421"/> + <int value="422" label="X_422"/> + <int value="423" label="X_423"/> + <int value="424" label="X_424"/> + <int value="425" label="X_425"/> + <int value="426" label="X_426"/> + <int value="427" label="X_427"/> + <int value="428" label="X_428"/> + <int value="429" label="X_429"/> + <int value="430" label="X_430"/> + <int value="431" label="X_431"/> + <int value="432" label="X_432"/> + <int value="433" label="X_433"/> + <int value="434" label="X_434"/> + <int value="435" label="X_435"/> + <int value="436" label="X_436"/> + <int value="437" label="X_437"/> + <int value="438" label="X_438"/> + <int value="439" label="X_439"/> + <int value="440" label="X_440"/> + <int value="441" label="X_441"/> + <int value="442" label="X_442"/> + <int value="443" label="X_443"/> + <int value="444" label="X_444"/> + <int value="445" label="X_445"/> + <int value="446" label="X_446"/> + <int value="447" label="X_447"/> + <int value="448" label="X_448"/> + <int value="449" label="X_449"/> + <int value="450" label="X_450"/> + <int value="451" label="X_451"/> + <int value="452" label="X_452"/> + <int value="453" label="X_453"/> + <int value="454" label="X_454"/> + <int value="455" label="X_455"/> + <int value="456" label="X_456"/> + <int value="457" label="X_457"/> + <int value="458" label="X_458"/> + <int value="459" label="X_459"/> + <int value="460" label="X_460"/> + <int value="461" label="X_461"/> + <int value="462" label="X_462"/> + <int value="463" label="X_463"/> + <int value="464" label="X_464"/> + <int value="465" label="X_465"/> + <int value="466" label="X_466"/> + <int value="467" label="X_467"/> + <int value="468" label="X_468"/> + <int value="469" label="X_469"/> + <int value="470" label="X_470"/> + <int value="471" label="X_471"/> + <int value="472" label="X_472"/> + <int value="473" label="X_473"/> + <int value="474" label="X_474"/> + <int value="475" label="X_475"/> + <int value="476" label="X_476"/> + <int value="477" label="X_477"/> + <int value="478" label="X_478"/> + <int value="479" label="X_479"/> + <int value="480" label="X_480"/> + <int value="481" label="X_481"/> + <int value="482" label="X_482"/> + <int value="483" label="X_483"/> + <int value="484" label="X_484"/> + <int value="485" label="X_485"/> + <int value="486" label="X_486"/> + <int value="487" label="X_487"/> + <int value="488" label="X_488"/> + <int value="489" label="X_489"/> + <int value="490" label="X_490"/> + <int value="491" label="X_491"/> + <int value="492" label="X_492"/> + <int value="493" label="X_493"/> + <int value="494" label="X_494"/> + <int value="495" label="X_495"/> + <int value="496" label="X_496"/> + <int value="497" label="X_497"/> + <int value="498" label="X_498"/> + <int value="499" label="X_499"/> + <int value="500" label="X_500"/> + <int value="501" label="X_501"/> + <int value="502" label="X_502"/> + <int value="503" label="X_503"/> + <int value="504" label="X_504"/> + <int value="505" label="X_505"/> + <int value="506" label="NDEBELE"/> + <int value="507" label="X_BORK_BORK_BORK"/> + <int value="508" label="X_PIG_LATIN"/> + <int value="509" label="X_HACKER"/> + <int value="510" label="X_KLINGON"/> + <int value="511" label="X_ELMER_FUDD"/> + <int value="512" label="X_Common"/> + <int value="513" label="X_Latin"/> + <int value="514" label="X_Greek"/> + <int value="515" label="X_Cyrillic"/> + <int value="516" label="X_Armenian"/> + <int value="517" label="X_Hebrew"/> + <int value="518" label="X_Arabic"/> + <int value="519" label="X_Syriac"/> + <int value="520" label="X_Thaana"/> + <int value="521" label="X_Devanagari"/> + <int value="522" label="X_Bengali"/> + <int value="523" label="X_Gurmukhi"/> + <int value="524" label="X_Gujarati"/> + <int value="525" label="X_Oriya"/> + <int value="526" label="X_Tamil"/> + <int value="527" label="X_Telugu"/> + <int value="528" label="X_Kannada"/> + <int value="529" label="X_Malayalam"/> + <int value="530" label="X_Sinhala"/> + <int value="531" label="X_Thai"/> + <int value="532" label="X_Lao"/> + <int value="533" label="X_Tibetan"/> + <int value="534" label="X_Myanmar"/> + <int value="535" label="X_Georgian"/> + <int value="536" label="X_Hangul"/> + <int value="537" label="X_Ethiopic"/> + <int value="538" label="X_Cherokee"/> + <int value="539" label="X_Canadian_Aboriginal"/> + <int value="540" label="X_Ogham"/> + <int value="541" label="X_Runic"/> + <int value="542" label="X_Khmer"/> + <int value="543" label="X_Mongolian"/> + <int value="544" label="X_Hiragana"/> + <int value="545" label="X_Katakana"/> + <int value="546" label="X_Bopomofo"/> + <int value="547" label="X_Han"/> + <int value="548" label="X_Yi"/> + <int value="549" label="X_Old_Italic"/> + <int value="550" label="X_Gothic"/> + <int value="551" label="X_Deseret"/> + <int value="552" label="X_Inherited"/> + <int value="553" label="X_Tagalog"/> + <int value="554" label="X_Hanunoo"/> + <int value="555" label="X_Buhid"/> + <int value="556" label="X_Tagbanwa"/> + <int value="557" label="X_Limbu"/> + <int value="558" label="X_Tai_Le"/> + <int value="559" label="X_Linear_B"/> + <int value="560" label="X_Ugaritic"/> + <int value="561" label="X_Shavian"/> + <int value="562" label="X_Osmanya"/> + <int value="563" label="X_Cypriot"/> + <int value="564" label="X_Braille"/> + <int value="565" label="X_Buginese"/> + <int value="566" label="X_Coptic"/> + <int value="567" label="X_New_Tai_Lue"/> + <int value="568" label="X_Glagolitic"/> + <int value="569" label="X_Tifinagh"/> + <int value="570" label="X_Syloti_Nagri"/> + <int value="571" label="X_Old_Persian"/> + <int value="572" label="X_Kharoshthi"/> + <int value="573" label="X_Balinese"/> + <int value="574" label="X_Cuneiform"/> + <int value="575" label="X_Phoenician"/> + <int value="576" label="X_Phags_Pa"/> + <int value="577" label="X_Nko"/> + <int value="578" label="X_Sundanese"/> + <int value="579" label="X_Lepcha"/> + <int value="580" label="X_Ol_Chiki"/> + <int value="581" label="X_Vai"/> + <int value="582" label="X_Saurashtra"/> + <int value="583" label="X_Kayah_Li"/> + <int value="584" label="X_Rejang"/> + <int value="585" label="X_Lycian"/> + <int value="586" label="X_Carian"/> + <int value="587" label="X_Lydian"/> + <int value="588" label="X_Cham"/> + <int value="589" label="X_Tai_Tham"/> + <int value="590" label="X_Tai_Viet"/> + <int value="591" label="X_Avestan"/> + <int value="592" label="X_Egyptian_Hieroglyphs"/> + <int value="593" label="X_Samaritan"/> + <int value="594" label="X_Lisu"/> + <int value="595" label="X_Bamum"/> + <int value="596" label="X_Javanese"/> + <int value="597" label="X_Meetei_Mayek"/> + <int value="598" label="X_Imperial_Aramaic"/> + <int value="599" label="X_Old_South_Arabian"/> + <int value="600" label="X_Inscriptional_Parthian"/> + <int value="601" label="X_Inscriptional_Pahlavi"/> + <int value="602" label="X_Old_Turkic"/> + <int value="603" label="X_Kaithi"/> + <int value="604" label="X_Batak"/> + <int value="605" label="X_Brahmi"/> + <int value="606" label="X_Mandaic"/> + <int value="607" label="X_Chakma"/> + <int value="608" label="X_Meroitic_Cursive"/> + <int value="609" label="X_Meroitic_Hieroglyphs"/> + <int value="610" label="X_Miao"/> + <int value="611" label="X_Sharada"/> + <int value="612" label="X_Sora_Sompeng"/> + <int value="613" label="X_Takri"/> +</enum> + <enum name="ClientAppId" type="int"> <int value="0" label="Other"/> <int value="1" label="Gmail"/> @@ -73538,6 +74240,7 @@ <int value="-1020450980" label="gesture-deletion"/> <int value="-1016202433" label="disable-add-to-shelf"/> <int value="-996673716" label="enable-web-app-frame"/> + <int value="-979313250" label="enable-google-branded-context-menu"/> <int value="-979057409" label="enable-seccomp-filter-sandbox"/> <int value="-979034258" label="disable-ntp-other-sessions-menu"/> <int value="-978700508" label="disable-simplified-fullscreen-ui"/> @@ -73750,6 +74453,7 @@ <int value="730024226" label="enable-out-of-process-pdf"/> <int value="732703958" label="enable-gesture-tap-highlight"/> <int value="752194066" label="enable-app-window-cycling"/> + <int value="752939691" label="disable-tab-for-desktop-share"/> <int value="773919225" label="disable-office-editing-component-extension"/> <int value="779086132" label="enable-data-reduction-proxy-alt"/> <int value="782167080" label="enable-new-qp-input-view"/> @@ -73919,6 +74623,7 @@ <int value="1861251313" label="enable-message-center-always-scroll-up-upon-notification-removal"/> <int value="1862207743" label="enable-android-spellchecker"/> + <int value="1865068568" label="disable-audio-support-for-desktop-share"/> <int value="1865799183" label="javascript-harmony"/> <int value="1881036528" label="disable-multilingual-spellchecker"/> <int value="1881174782" label="disable-brotli"/> @@ -76817,6 +77522,11 @@ <int value="2" label="Inactive, single-profile."/> </enum> +<enum name="OpenLinkAsUserProfilesState" type="int"> + <int value="0" label="No other active profiles."/> + <int value="1" label="Active other profiles."/> +</enum> + <enum name="OSAgnosticErrno" type="int"> <summary>Errno values with the same meanings on Mac/Win/Linux.</summary> <int value="0" label="0">No error</int>
diff --git a/tools/perf/benchmarks/v8.py b/tools/perf/benchmarks/v8.py index 804a2ea..21469a2 100644 --- a/tools/perf/benchmarks/v8.py +++ b/tools/perf/benchmarks/v8.py
@@ -21,6 +21,18 @@ from telemetry.web_perf.metrics import memory_timeline +def EnableIgnition(options): + existing_js_flags = [] + for extra_arg in options.extra_browser_args: + if extra_arg.startswith('--js-flags='): + existing_js_flags.extend(shlex.split(extra_arg[len('--js-flags='):])) + options.AppendExtraBrowserArgs([ + # This overrides any existing --js-flags, hence we have to include the + # previous flags as well. + '--js-flags=--ignition %s' % (' '.join(existing_js_flags)) + ]) + + @benchmark.Disabled('win') # crbug.com/416502 class V8Top25(perf_benchmark.PerfBenchmark): """Measures V8 GC metrics on the while scrolling down the top 25 web pages. @@ -153,15 +165,7 @@ page_set = page_sets.TodoMVCPageSet def SetExtraBrowserOptions(self, options): - existing_js_flags = [] - for extra_arg in options.extra_browser_args: - if extra_arg.startswith('--js-flags='): - existing_js_flags.extend(shlex.split(extra_arg[len('--js-flags='):])) - options.AppendExtraBrowserArgs([ - # This overrides any existing --js-flags, hence we have to include the - # previous flags as well. - '--js-flags=--ignition %s' % (' '.join(existing_js_flags)) - ]) + EnableIgnition(options) def CreateTimelineBasedMeasurementOptions(self): category_filter = tracing_category_filter.CreateMinimalOverheadFilter() @@ -182,6 +186,23 @@ # Disabled on reference builds because they don't support the new # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. +@benchmark.Disabled('reference') # crbug.com/579546 +class V8InfiniteScrollIgnition(_InfiniteScrollBenchmark): + """Measures V8 GC metrics using Ignition.""" + + page_set = page_sets.InfiniteScrollPageSet + + def SetExtraBrowserOptions(self, options): + _InfiniteScrollBenchmark.SetExtraBrowserOptions(self,options) + EnableIgnition(options) + + @classmethod + def Name(cls): + return 'v8.infinite_scroll-ignition' + + +# Disabled on reference builds because they don't support the new +# Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. @benchmark.Disabled('reference') class V8InfiniteScroll(_InfiniteScrollBenchmark): """Measures V8 GC metrics and memory usage while scrolling the top web pages.
diff --git a/ui/accessibility/extensions/alt/hide-images.css b/ui/accessibility/extensions/alt/hide-images.css index a9d30e3..840d7f23 100644 --- a/ui/accessibility/extensions/alt/hide-images.css +++ b/ui/accessibility/extensions/alt/hide-images.css
@@ -29,19 +29,19 @@ @-webkit-keyframes slideDown { from { - -webkit-transform: translateY(-150%); + transform: translateY(-150%); } to { - -webkit-transform: translateY(0px); + transform: translateY(0px); } } @-webkit-keyframes slideUp { from { - -webkit-transform: translateY(0%); + transform: translateY(0%); } to { - -webkit-transform: translateY(-150%); + transform: translateY(-150%); } } @@ -52,7 +52,7 @@ -webkit-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -webkit-animation-direction: forwards; - -webkit-transform: translateY(0%); + transform: translateY(0%); } body:not([show-alt]) .show-alt-infobar { @@ -62,7 +62,7 @@ -webkit-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -webkit-animation-direction: forwards; - -webkit-transform: translateY(-150%); + transform: translateY(-150%); } .show-alt-infobar {
diff --git a/ui/accessibility/extensions/colorenhancer/res/setup.css b/ui/accessibility/extensions/colorenhancer/res/setup.css index 747b42b..fbb1470 100644 --- a/ui/accessibility/extensions/colorenhancer/res/setup.css +++ b/ui/accessibility/extensions/colorenhancer/res/setup.css
@@ -68,7 +68,7 @@ } .swatch span { - -webkit-transform: translate(-5px, -22px); + transform: translate(-5px, -22px); font: 60pt sans; display: flex; height: 40px;
diff --git a/ui/arc/DEPS b/ui/arc/DEPS index ea22bc1..b692d81 100644 --- a/ui/arc/DEPS +++ b/ui/arc/DEPS
@@ -1,4 +1,5 @@ include_rules = [ + "+ash", "+components/arc", "+mojo", ]
diff --git a/ui/arc/notification/arc_notification_manager.cc b/ui/arc/notification/arc_notification_manager.cc index 6718929..7786932 100644 --- a/ui/arc/notification/arc_notification_manager.cc +++ b/ui/arc/notification/arc_notification_manager.cc
@@ -4,6 +4,8 @@ #include "ui/arc/notification/arc_notification_manager.h" +#include "ash/shell.h" +#include "ash/system/toast/toast_manager.h" #include "base/stl_util.h" #include "ui/arc/notification/arc_notification_item.h" @@ -174,4 +176,12 @@ notifications_instance->SendNotificationEventToAndroid(key, command); } +void ArcNotificationManager::OnToastPosted(ArcToastDataPtr data) { + ash::Shell::GetInstance()->toast_manager()->Show(data->text, data->duration); +} + +void ArcNotificationManager::OnToastCancelled(ArcToastDataPtr data) { + // TODO(yoshiki): Implement cancel. +} + } // namespace arc
diff --git a/ui/arc/notification/arc_notification_manager.h b/ui/arc/notification/arc_notification_manager.h index 27091167..7dfba341 100644 --- a/ui/arc/notification/arc_notification_manager.h +++ b/ui/arc/notification/arc_notification_manager.h
@@ -39,6 +39,8 @@ // NotificationsHost implementation: void OnNotificationPosted(ArcNotificationDataPtr data) override; void OnNotificationRemoved(const mojo::String& key) override; + void OnToastPosted(ArcToastDataPtr data) override; + void OnToastCancelled(ArcToastDataPtr data) override; // Methods called from ArcNotificationItem: void SendNotificationRemovedFromChrome(const std::string& key);
diff --git a/ui/base/clipboard/clipboard_mac.mm b/ui/base/clipboard/clipboard_mac.mm index eb4fc21..08a6041 100644 --- a/ui/base/clipboard/clipboard_mac.mm +++ b/ui/base/clipboard/clipboard_mac.mm
@@ -20,6 +20,7 @@ #include "skia/ext/skia_utils_mac.h" #import "third_party/mozilla/NSPasteboard+Utils.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/clipboard/clipboard_util_mac.h" #include "ui/base/clipboard/custom_data_helper.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/size.h" @@ -29,9 +30,6 @@ namespace { -// Would be nice if this were in UTCoreTypes.h, but it isn't -NSString* const kUTTypeURLName = @"public.url-name"; - // Tells us if WebKit was the last to write to the pasteboard. There's no // actual data associated with this type. NSString* const kWebSmartPastePboardType = @"NeXT smart paste pasteboard type"; @@ -354,12 +352,12 @@ NSPasteboard* pb = GetPasteboard(); if (title) { - NSString* contents = [pb stringForType:kUTTypeURLName]; + NSString* contents = ClipboardUtil::GetTitleFromPasteboardURL(pb); *title = base::SysNSStringToUTF16(contents); } if (url) { - NSString* url_string = [[NSURL URLFromPasteboard:pb] absoluteString]; + NSString* url_string = ClipboardUtil::GetURLFromPasteboardURL(pb); if (!url_string) url->clear(); else @@ -425,18 +423,21 @@ std::string url_str(url_data, url_len); NSString* url = base::SysUTF8ToNSString(url_str); - // TODO(playmobil): In the Windows version of this function, an HTML - // representation of the bookmark is also added to the clipboard, to support - // drag and drop of web shortcuts. I don't think we need to do this on the - // Mac, but we should double check later on. - NSURL* nsurl = [NSURL URLWithString:url]; - + base::scoped_nsobject<NSPasteboardItem> item( + ClipboardUtil::PasteboardItemFromUrl(url, title)); NSPasteboard* pb = GetPasteboard(); - // passing UTIs into the pasteboard methods is valid >= 10.5 - [pb addTypes:[NSArray arrayWithObjects:NSURLPboardType, kUTTypeURLName, nil] - owner:nil]; - [nsurl writeToPasteboard:pb]; - [pb setString:title forType:kUTTypeURLName]; + + NSSet* oldTypes = [NSSet setWithArray:[pb types]]; + NSMutableSet* newTypes = [NSMutableSet setWithArray:[item types]]; + [newTypes minusSet:oldTypes]; + + [pb addTypes:[newTypes allObjects] owner:nil]; + for (NSString* type in newTypes) { + // Technically, the object associated with |type| might be an NSString or a + // property list. It doesn't matter though, since the type gets pulled from + // and shoved into an NSDictionary. + [pb setData:[item dataForType:type] forType:type]; + } } void ClipboardMac::WriteBitmap(const SkBitmap& bitmap) {
diff --git a/ui/base/clipboard/clipboard_util_mac.h b/ui/base/clipboard/clipboard_util_mac.h index 79a2a691..5d62cfa 100644 --- a/ui/base/clipboard/clipboard_util_mac.h +++ b/ui/base/clipboard/clipboard_util_mac.h
@@ -8,10 +8,24 @@ #import <AppKit/AppKit.h> #include "base/mac/scoped_nsobject.h" +#include "base/memory/ref_counted.h" #include "ui/base/ui_base_export.h" namespace ui { +class UI_BASE_EXPORT UniquePasteboard + : public base::RefCounted<UniquePasteboard> { + public: + UniquePasteboard(); + + NSPasteboard* get() { return pasteboard_; } + + private: + friend class base::RefCounted<UniquePasteboard>; + ~UniquePasteboard(); + base::scoped_nsobject<NSPasteboard> pasteboard_; +}; + class UI_BASE_EXPORT ClipboardUtil { public: // Returns an NSPasteboardItem that represents the given |url|. @@ -20,6 +34,16 @@ static base::scoped_nsobject<NSPasteboardItem> PasteboardItemFromUrl( NSString* url, NSString* title); + + // Returns an NSPasteboardItem that represents the given string. + // |string| must not be nil. + static base::scoped_nsobject<NSPasteboardItem> PasteboardItemFromString( + NSString* string); + + // Returns the title or url associated with a NSPasteboard which contains an + // url NSPasteboardItem. + static NSString* GetTitleFromPasteboardURL(NSPasteboard* pboard); + static NSString* GetURLFromPasteboardURL(NSPasteboard* pboard); }; }
diff --git a/ui/base/clipboard/clipboard_util_mac.mm b/ui/base/clipboard/clipboard_util_mac.mm index 0d3f8f87..cff59788 100644 --- a/ui/base/clipboard/clipboard_util_mac.mm +++ b/ui/base/clipboard/clipboard_util_mac.mm
@@ -26,6 +26,13 @@ namespace ui { +UniquePasteboard::UniquePasteboard() + : pasteboard_([[NSPasteboard pasteboardWithUniqueName] retain]) {} + +UniquePasteboard::~UniquePasteboard() { + [pasteboard_ releaseGlobally]; +} + // static base::scoped_nsobject<NSPasteboardItem> ClipboardUtil::PasteboardItemFromUrl( NSString* urlString, @@ -70,4 +77,24 @@ return item; } +// static +base::scoped_nsobject<NSPasteboardItem> ClipboardUtil::PasteboardItemFromString( + NSString* string) { + base::scoped_nsobject<NSPasteboardItem> item([[NSPasteboardItem alloc] init]); + [item setString:string forType:UTIFromPboardType(NSStringPboardType)]; + return item; +} + +//static +NSString* ClipboardUtil::GetTitleFromPasteboardURL(NSPasteboard* pboard) { + return + [pboard stringForType:UTIFromPboardType(kCorePasteboardFlavorType_urln)]; +} + +//static +NSString* ClipboardUtil::GetURLFromPasteboardURL(NSPasteboard* pboard) { + return + [pboard stringForType:UTIFromPboardType(kCorePasteboardFlavorType_url)]; +} + } // namespace ui
diff --git a/ui/base/clipboard/clipboard_util_mac_unittest.mm b/ui/base/clipboard/clipboard_util_mac_unittest.mm index d3d3370..28728c2 100644 --- a/ui/base/clipboard/clipboard_util_mac_unittest.mm +++ b/ui/base/clipboard/clipboard_util_mac_unittest.mm
@@ -5,6 +5,7 @@ #import "ui/base/clipboard/clipboard_util_mac.h" #include "base/mac/scoped_nsobject.h" +#include "base/memory/ref_counted.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest_mac.h" #include "testing/platform_test.h" @@ -25,19 +26,19 @@ base::scoped_nsobject<NSPasteboardItem> item( ui::ClipboardUtil::PasteboardItemFromUrl(urlString, nil)); - NSPasteboard* pasteboard = [NSPasteboard pasteboardWithUniqueName]; - [pasteboard writeObjects:@[ item ]]; + scoped_refptr<ui::UniquePasteboard> pasteboard = new ui::UniquePasteboard; + [pasteboard->get() writeObjects:@[ item ]]; NSArray* urls = nil; NSArray* titles = nil; - [pasteboard getURLs:&urls andTitles:&titles convertingFilenames:NO]; + [pasteboard->get() getURLs:&urls andTitles:&titles convertingFilenames:NO]; ASSERT_EQ(1u, [urls count]); EXPECT_NSEQ(urlString, [urls objectAtIndex:0]); ASSERT_EQ(1u, [titles count]); EXPECT_NSEQ(urlString, [titles objectAtIndex:0]); - NSURL* url = [NSURL URLFromPasteboard:pasteboard]; + NSURL* url = [NSURL URLFromPasteboard:pasteboard->get()]; EXPECT_NSEQ([url absoluteString], urlString); } @@ -47,19 +48,19 @@ base::scoped_nsobject<NSPasteboardItem> item( ui::ClipboardUtil::PasteboardItemFromUrl(urlString, title)); - NSPasteboard* pasteboard = [NSPasteboard pasteboardWithUniqueName]; - [pasteboard writeObjects:@[ item ]]; + scoped_refptr<ui::UniquePasteboard> pasteboard = new ui::UniquePasteboard; + [pasteboard->get() writeObjects:@[ item ]]; NSArray* urls = nil; NSArray* titles = nil; - [pasteboard getURLs:&urls andTitles:&titles convertingFilenames:NO]; + [pasteboard->get() getURLs:&urls andTitles:&titles convertingFilenames:NO]; ASSERT_EQ(1u, [urls count]); EXPECT_NSEQ(urlString, [urls objectAtIndex:0]); ASSERT_EQ(1u, [titles count]); EXPECT_NSEQ(title, [titles objectAtIndex:0]); - NSURL* url = [NSURL URLFromPasteboard:pasteboard]; + NSURL* url = [NSURL URLFromPasteboard:pasteboard->get()]; EXPECT_NSEQ([url absoluteString], urlString); } @@ -70,20 +71,29 @@ base::scoped_nsobject<NSPasteboardItem> item( ui::ClipboardUtil::PasteboardItemFromUrl(urlString, nil)); - NSPasteboard* pasteboard = [NSPasteboard pasteboardWithUniqueName]; - [pasteboard writeObjects:@[ item ]]; + scoped_refptr<ui::UniquePasteboard> pasteboard = new ui::UniquePasteboard; + [pasteboard->get() writeObjects:@[ item ]]; NSArray* urls = nil; NSArray* titles = nil; - [pasteboard getURLs:&urls andTitles:&titles convertingFilenames:NO]; + [pasteboard->get() getURLs:&urls andTitles:&titles convertingFilenames:NO]; ASSERT_EQ(1u, [urls count]); EXPECT_NSEQ(urlString, [urls objectAtIndex:0]); ASSERT_EQ(1u, [titles count]); EXPECT_NSEQ(urlString, [titles objectAtIndex:0]); - NSURL* urlFromPasteboard = [NSURL URLFromPasteboard:pasteboard]; + NSURL* urlFromPasteboard = [NSURL URLFromPasteboard:pasteboard->get()]; EXPECT_NSEQ(urlFromPasteboard, url); } +TEST_F(ClipboardUtilMacTest, CheckForLeak) { + for (int i = 0; i < 10000; ++i) { + @autoreleasepool { + scoped_refptr<ui::UniquePasteboard> pboard = new ui::UniquePasteboard; + EXPECT_TRUE(pboard->get()); + } + } +} + } // namespace
diff --git a/ui/base/dragdrop/os_exchange_data_provider_mac.h b/ui/base/dragdrop/os_exchange_data_provider_mac.h index c619ab9..3786029 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_mac.h +++ b/ui/base/dragdrop/os_exchange_data_provider_mac.h
@@ -5,20 +5,21 @@ #ifndef UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_MAC_H_ #define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_MAC_H_ -#import "base/mac/scoped_nsobject.h" #include "base/macros.h" +#include "base/memory/ref_counted.h" +#import "ui/base/clipboard/clipboard_util_mac.h" #include "ui/base/dragdrop/os_exchange_data.h" @class NSPasteboard; namespace ui { +class UniquePasteboard; // OSExchangeData::Provider implementation for Mac. class UI_BASE_EXPORT OSExchangeDataProviderMac : public OSExchangeData::Provider { public: OSExchangeDataProviderMac(); - explicit OSExchangeDataProviderMac(NSPasteboard* pasteboard); ~OSExchangeDataProviderMac() override; // Overridden from OSExchangeData::Provider: @@ -45,7 +46,8 @@ bool HasCustomFormat(const Clipboard::FormatType& format) const override; private: - base::scoped_nsobject<NSPasteboard> pasteboard_; + explicit OSExchangeDataProviderMac(scoped_refptr<ui::UniquePasteboard>); + scoped_refptr<ui::UniquePasteboard> pasteboard_; DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderMac); };
diff --git a/ui/base/dragdrop/os_exchange_data_provider_mac.mm b/ui/base/dragdrop/os_exchange_data_provider_mac.mm index 72d647f..030d0d08 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_mac.mm +++ b/ui/base/dragdrop/os_exchange_data_provider_mac.mm
@@ -11,17 +11,17 @@ #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #import "third_party/mozilla/NSPasteboard+Utils.h" +#import "ui/base/clipboard/clipboard_util_mac.h" #include "url/gurl.h" namespace ui { OSExchangeDataProviderMac::OSExchangeDataProviderMac() - : pasteboard_([[NSPasteboard pasteboardWithUniqueName] retain]) { -} + : pasteboard_(new ui::UniquePasteboard) {} -OSExchangeDataProviderMac::OSExchangeDataProviderMac(NSPasteboard* pasteboard) - : pasteboard_([pasteboard retain]) { -} +OSExchangeDataProviderMac::OSExchangeDataProviderMac( + scoped_refptr<ui::UniquePasteboard> pb) + : pasteboard_(pb) {} OSExchangeDataProviderMac::~OSExchangeDataProviderMac() { } @@ -40,21 +40,21 @@ } void OSExchangeDataProviderMac::SetString(const base::string16& string) { - [pasteboard_ writeObjects:@[ base::SysUTF16ToNSString(string) ]]; + [pasteboard_->get() writeObjects:@[ base::SysUTF16ToNSString(string) ]]; } void OSExchangeDataProviderMac::SetURL(const GURL& url, const base::string16& title) { NSURL* ns_url = [NSURL URLWithString:base::SysUTF8ToNSString(url.spec())]; - [pasteboard_ writeObjects:@[ ns_url ]]; + [pasteboard_->get() writeObjects:@[ ns_url ]]; - [pasteboard_ setString:base::SysUTF16ToNSString(title) - forType:kCorePasteboardFlavorType_urln]; + [pasteboard_->get() setString:base::SysUTF16ToNSString(title) + forType:kCorePasteboardFlavorType_urln]; } void OSExchangeDataProviderMac::SetFilename(const base::FilePath& path) { - [pasteboard_ setPropertyList:@[ base::SysUTF8ToNSString(path.value()) ] - forType:NSFilenamesPboardType]; + [pasteboard_->get() setPropertyList:@[ base::SysUTF8ToNSString(path.value()) ] + forType:NSFilenamesPboardType]; } void OSExchangeDataProviderMac::SetFilenames( @@ -66,13 +66,14 @@ const Clipboard::FormatType& format, const base::Pickle& data) { NSData* ns_data = [NSData dataWithBytes:data.data() length:data.size()]; - [pasteboard_ setData:ns_data forType:format.ToNSString()]; + [pasteboard_->get() setData:ns_data forType:format.ToNSString()]; } bool OSExchangeDataProviderMac::GetString(base::string16* data) const { DCHECK(data); - NSArray* items = [pasteboard_ readObjectsForClasses:@[ [NSString class] ] - options:@{ }]; + NSArray* items = + [pasteboard_->get() readObjectsForClasses:@[ [NSString class] ] + options:@{}]; // There was no NSString, check for an NSURL. if ([items count] == 0) { @@ -95,8 +96,8 @@ base::string16* title) const { DCHECK(url); DCHECK(title); - NSArray* items = [pasteboard_ readObjectsForClasses:@[ [NSURL class] ] - options:@{ }]; + NSArray* items = + [pasteboard_->get() readObjectsForClasses:@[ [NSURL class] ] options:@{}]; if ([items count] == 0) return false; @@ -105,7 +106,8 @@ if (policy == OSExchangeData::DO_NOT_CONVERT_FILENAMES) { // If the URL matches a filename, assume that it came from SetFilename(). // Don't return it if we are not supposed to convert filename to URL. - NSArray* paths = [pasteboard_ propertyListForType:NSFilenamesPboardType]; + NSArray* paths = + [pasteboard_->get() propertyListForType:NSFilenamesPboardType]; NSString* url_path = [[ns_url path] stringByStandardizingPath]; for (NSString* path in paths) { if ([[path stringByStandardizingPath] isEqualToString:url_path]) @@ -115,12 +117,13 @@ *url = GURL([[ns_url absoluteString] UTF8String]); *title = base::SysNSStringToUTF16( - [pasteboard_ stringForType:kCorePasteboardFlavorType_urln]); + [pasteboard_->get() stringForType:kCorePasteboardFlavorType_urln]); return true; } bool OSExchangeDataProviderMac::GetFilename(base::FilePath* path) const { - NSArray* paths = [pasteboard_ propertyListForType:NSFilenamesPboardType]; + NSArray* paths = + [pasteboard_->get() propertyListForType:NSFilenamesPboardType]; if ([paths count] == 0) return false; @@ -138,7 +141,7 @@ const Clipboard::FormatType& format, base::Pickle* data) const { DCHECK(data); - NSData* ns_data = [pasteboard_ dataForType:format.ToNSString()]; + NSData* ns_data = [pasteboard_->get() dataForType:format.ToNSString()]; if (!ns_data) return false; @@ -149,7 +152,7 @@ bool OSExchangeDataProviderMac::HasString() const { NSArray* classes = @[ [NSString class] ]; - return [pasteboard_ canReadObjectForClasses:classes options:nil]; + return [pasteboard_->get() canReadObjectForClasses:classes options:nil]; } bool OSExchangeDataProviderMac::HasURL( @@ -160,12 +163,12 @@ } bool OSExchangeDataProviderMac::HasFile() const { - return [[pasteboard_ types] containsObject:NSFilenamesPboardType]; + return [[pasteboard_->get() types] containsObject:NSFilenamesPboardType]; } bool OSExchangeDataProviderMac::HasCustomFormat( const Clipboard::FormatType& format) const { - return [[pasteboard_ types] containsObject:format.ToNSString()]; + return [[pasteboard_->get() types] containsObject:format.ToNSString()]; } ///////////////////////////////////////////////////////////////////////////////
diff --git a/ui/base/ime/win/imm32_manager.cc b/ui/base/ime/win/imm32_manager.cc index 853bf3f..9f03a2a8 100644 --- a/ui/base/ime/win/imm32_manager.cc +++ b/ui/base/ime/win/imm32_manager.cc
@@ -15,11 +15,6 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/base/ime/composition_text.h" -// "imm32.lib" is required by IMM32 APIs used in this file. -// NOTE(hbono): To comply with a comment from Darin, I have added -// this #pragma directive instead of adding "imm32.lib" to a project file. -#pragma comment(lib, "imm32.lib") - // Following code requires wchar_t to be same as char16. It should always be // true on Windows. static_assert(sizeof(wchar_t) == sizeof(base::char16),
diff --git a/ui/compositor/test/draw_waiter_for_test.h b/ui/compositor/test/draw_waiter_for_test.h index 40e5342..7d271ff 100644 --- a/ui/compositor/test/draw_waiter_for_test.h +++ b/ui/compositor/test/draw_waiter_for_test.h
@@ -6,6 +6,7 @@ #define UI_COMPOSITOR_TEST_DRAW_WAITER_H_ #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/run_loop.h" #include "ui/compositor/compositor_observer.h"
diff --git a/ui/file_manager/file_manager/common/js/util.js b/ui/file_manager/file_manager/common/js/util.js index 0fa0624..9eb6f1c 100644 --- a/ui/file_manager/file_manager/common/js/util.js +++ b/ui/file_manager/file_manager/common/js/util.js
@@ -259,7 +259,7 @@ * contains scaleX, scaleY and rotate90 properties. */ util.applyTransform = function(element, transform) { - element.style.webkitTransform = + element.style.transform = transform ? 'scaleX(' + transform.scaleX + ') ' + 'scaleY(' + transform.scaleY + ') ' + 'rotate(' + transform.rotate90 * 90 + 'deg)' :
diff --git a/ui/file_manager/file_manager/foreground/css/common.css b/ui/file_manager/file_manager/foreground/css/common.css index 42d67c44..07b43bb2 100644 --- a/ui/file_manager/file_manager/foreground/css/common.css +++ b/ui/file_manager/file_manager/foreground/css/common.css
@@ -229,16 +229,16 @@ @-webkit-keyframes pulse { 0% { - -webkit-transform: scale(1); + transform: scale(1); } 40% { - -webkit-transform: scale(1.02); + transform: scale(1.02); } 60% { - -webkit-transform: scale(1.02); + transform: scale(1.02); } 100% { - -webkit-transform: scale(1); + transform: scale(1); } }
diff --git a/ui/file_manager/file_manager/foreground/css/file_manager.css b/ui/file_manager/file_manager/foreground/css/file_manager.css index 666e9cc..e9e0a5c 100644 --- a/ui/file_manager/file_manager/foreground/css/file_manager.css +++ b/ui/file_manager/file_manager/foreground/css/file_manager.css
@@ -654,7 +654,7 @@ } #cloud-import-details.hidden { - -webkit-transform: translateY(-10px); + transform: translateY(-10px); opacity: 0; } @@ -1126,7 +1126,7 @@ } html[dir='rtl'] .breadcrumbs .separator { - -webkit-transform: scaleX(-1); + transform: scaleX(-1); } .filelist-panel {
diff --git a/ui/file_manager/file_manager/foreground/css/tree.css b/ui/file_manager/file_manager/foreground/css/tree.css index a319a94e..517d7d1 100644 --- a/ui/file_manager/file_manager/foreground/css/tree.css +++ b/ui/file_manager/file_manager/foreground/css/tree.css
@@ -18,7 +18,7 @@ } .tree-row > .expand-icon { - -webkit-transform: rotate(-90deg); + transform: rotate(-90deg); -webkit-transition: all 150ms; background-image: -webkit-image-set( url(../images/files/ui/expand_more.png) 1x, @@ -37,11 +37,11 @@ } html[dir=rtl] .tree-row > .expand-icon { - -webkit-transform: rotate(90deg); + transform: rotate(90deg); } .tree-item[expanded] > .tree-row > .expand-icon { - -webkit-transform: rotate(0); + transform: rotate(0); } .tree-row > .expand-icon {
diff --git a/ui/file_manager/gallery/css/gallery.css b/ui/file_manager/gallery/css/gallery.css index 5ccdbecf..4e97f5d 100644 --- a/ui/file_manager/gallery/css/gallery.css +++ b/ui/file_manager/gallery/css/gallery.css
@@ -44,7 +44,7 @@ } .bubble .pointer.bottom { - -webkit-transform: rotate(180deg); + transform: rotate(180deg); bottom: -11px; }
diff --git a/ui/file_manager/video_player/css/media_controls.css b/ui/file_manager/video_player/css/media_controls.css index fd1acfd6..f2bd382 100644 --- a/ui/file_manager/video_player/css/media_controls.css +++ b/ui/file_manager/video_player/css/media_controls.css
@@ -240,26 +240,26 @@ opacity: 1; } to { - -webkit-transform: scale(3); + transform: scale(3); opacity: 0; } } @-webkit-keyframes text-banner-blowup { from { - -webkit-transform: scale(0.5); + transform: scale(0.5); opacity: 0; } 20% { - -webkit-transform: scale(1); + transform: scale(1); opacity: 0.75; } 80% { - -webkit-transform: scale(1); + transform: scale(1); opacity: 0.75; } to { - -webkit-transform: scale(3); + transform: scale(3); opacity: 0; } }
diff --git a/ui/gfx/canvas_paint_mac.h b/ui/gfx/canvas_paint_mac.h index b8d9974..1623b4ba 100644 --- a/ui/gfx/canvas_paint_mac.h +++ b/ui/gfx/canvas_paint_mac.h
@@ -43,7 +43,6 @@ private: void Init(bool opaque); - CGContext* context_; NSRect rectangle_; // See description above setter. bool composite_alpha_;
diff --git a/ui/gfx/canvas_paint_mac.mm b/ui/gfx/canvas_paint_mac.mm index d5178a0..29fdfe5 100644 --- a/ui/gfx/canvas_paint_mac.mm +++ b/ui/gfx/canvas_paint_mac.mm
@@ -8,25 +8,25 @@ namespace gfx { CanvasSkiaPaint::CanvasSkiaPaint(NSRect dirtyRect) - : context_(NULL), - rectangle_(dirtyRect), + : rectangle_(dirtyRect), composite_alpha_(false) { Init(true); } CanvasSkiaPaint::CanvasSkiaPaint(NSRect dirtyRect, bool opaque) - : context_(NULL), - rectangle_(dirtyRect), + : rectangle_(dirtyRect), composite_alpha_(false) { Init(opaque); } CanvasSkiaPaint::~CanvasSkiaPaint() { if (!is_empty()) { - sk_canvas()->restoreToCount(1); + SkCanvas* canvas = sk_canvas(); + canvas->restoreToCount(1); // Blit the dirty rect to the current context. - CGImageRef image = CGBitmapContextCreateImage(context_); + CGImageRef image = + CGBitmapContextCreateImage(skia::GetBitmapContext(*canvas)); CGRect dest_rect = NSRectToCGRect(rectangle_); CGContextRef destination_context = @@ -67,8 +67,6 @@ // surface. canvas->translate(-SkDoubleToScalar(NSMinX(rectangle_)), -SkDoubleToScalar(NSMinY(rectangle_))); - - context_ = skia::GetBitmapContext(*canvas); } } // namespace skia
diff --git a/ui/gl/gl_implementation.cc b/ui/gl/gl_implementation.cc index 40aedde7..af06cbe 100644 --- a/ui/gl/gl_implementation.cc +++ b/ui/gl/gl_implementation.cc
@@ -53,7 +53,7 @@ } } -} +} // namespace base::ThreadLocalPointer<GLApi>* g_current_gl_context_tls = NULL; OSMESAApi* g_current_osmesa_context;
diff --git a/ui/gl/gl_surface_egl.h b/ui/gl/gl_surface_egl.h index 6d72e9a4..97f2b15 100644 --- a/ui/gl/gl_surface_egl.h +++ b/ui/gl/gl_surface_egl.h
@@ -14,6 +14,7 @@ #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "build/build_config.h" #include "ui/gfx/geometry/size.h"
diff --git a/ui/gl/gpu_switching_manager.h b/ui/gl/gpu_switching_manager.h index 7849d4a..92e865a 100644 --- a/ui/gl/gpu_switching_manager.h +++ b/ui/gl/gpu_switching_manager.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/observer_list.h" #include "build/build_config.h"
diff --git a/ui/login/account_picker/user_pod_row.css b/ui/login/account_picker/user_pod_row.css index 412179398..88f117b 100644 --- a/ui/login/account_picker/user_pod_row.css +++ b/ui/login/account_picker/user_pod_row.css
@@ -502,7 +502,7 @@ } .action-box-area.menu-moved-up { - -webkit-transform: rotate(180deg); + transform: rotate(180deg); } html[dir=rtl] .action-box-area.active ~ .action-box-menu {
diff --git a/ui/login/screen_container.css b/ui/login/screen_container.css index 2017e70d1..57742eaf 100644 --- a/ui/login/screen_container.css +++ b/ui/login/screen_container.css
@@ -88,11 +88,11 @@ /* Only play this animation when 'down' class is removed. */ .oobe-display #inner-container:not(.down) { - -webkit-transition: -webkit-transform 200ms ease-in-out; + -webkit-transition: transform 200ms ease-in-out; } .oobe-display #inner-container.down { - -webkit-transform: translateY(50px) rotateX(-2.5deg); + transform: translateY(50px) rotateX(-2.5deg); } #step-logo {
diff --git a/ui/native_theme/native_theme_dark_aura.cc b/ui/native_theme/native_theme_dark_aura.cc index 0d51e477..b00d32f 100644 --- a/ui/native_theme/native_theme_dark_aura.cc +++ b/ui/native_theme/native_theme_dark_aura.cc
@@ -67,6 +67,8 @@ return kResultsTableDimmedText; // Intentional pass-throughs to NativeThemeAura. + case kColorId_ButtonEnabledColor: + case kColorId_TextOnCallToActionColor: case kColorId_ResultsTableHoveredBackground: case kColorId_ResultsTableSelectedBackground: case kColorId_ResultsTableNormalUrl: @@ -75,9 +77,70 @@ return NativeThemeAura::GetSystemColor(color_id); // Any other color is not defined and shouldn't be used in a dark theme. - default: + case kColorId_WindowBackground: + case kColorId_DialogBackground: + case kColorId_BubbleBackground: + case kColorId_FocusedBorderColor: + case kColorId_UnfocusedBorderColor: + case kColorId_ButtonBackgroundColor: + case kColorId_ButtonDisabledColor: + case kColorId_ButtonHighlightColor: + case kColorId_ButtonHoverColor: + case kColorId_ButtonHoverBackgroundColor: + case kColorId_BlueButtonEnabledColor: + case kColorId_BlueButtonDisabledColor: + case kColorId_BlueButtonPressedColor: + case kColorId_BlueButtonHoverColor: + case kColorId_BlueButtonShadowColor: + case kColorId_EnabledMenuItemForegroundColor: + case kColorId_DisabledMenuItemForegroundColor: + case kColorId_DisabledEmphasizedMenuItemForegroundColor: + case kColorId_SelectedMenuItemForegroundColor: + case kColorId_FocusedMenuItemBackgroundColor: + case kColorId_HoverMenuItemBackgroundColor: + case kColorId_MenuSeparatorColor: + case kColorId_MenuBackgroundColor: + case kColorId_MenuBorderColor: + case kColorId_EnabledMenuButtonBorderColor: + case kColorId_FocusedMenuButtonBorderColor: + case kColorId_HoverMenuButtonBorderColor: + case kColorId_LabelEnabledColor: + case kColorId_LabelDisabledColor: + case kColorId_LabelBackgroundColor: + case kColorId_LinkDisabled: + case kColorId_TextfieldReadOnlyColor: + case kColorId_TextfieldReadOnlyBackground: + case kColorId_TooltipBackground: + case kColorId_TooltipText: + case kColorId_TreeBackground: + case kColorId_TreeText: + case kColorId_TreeSelectedText: + case kColorId_TreeSelectedTextUnfocused: + case kColorId_TreeSelectionBackgroundFocused: + case kColorId_TreeSelectionBackgroundUnfocused: + case kColorId_TreeArrow: + case kColorId_TableBackground: + case kColorId_TableText: + case kColorId_TableSelectedText: + case kColorId_TableSelectedTextUnfocused: + case kColorId_TableSelectionBackgroundFocused: + case kColorId_TableSelectionBackgroundUnfocused: + case kColorId_TableGroupingIndicatorColor: + case kColorId_ResultsTablePositiveText: + case kColorId_ResultsTablePositiveHoveredText: + case kColorId_ResultsTablePositiveSelectedText: + case kColorId_ResultsTableNegativeText: + case kColorId_ResultsTableNegativeHoveredText: + case kColorId_ResultsTableNegativeSelectedText: + case kColorId_ThrobberSpinningColor: + case kColorId_ThrobberWaitingColor: + case kColorId_ThrobberLightColor: + case kColorId_NumColors: return gfx::kPlaceholderColor; } + + NOTREACHED(); + return gfx::kPlaceholderColor; } NativeThemeDarkAura::NativeThemeDarkAura() {}
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn index 6d694da..ff508fa 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn
@@ -85,6 +85,7 @@ "dwmapi.lib", "imm32.lib", "oleacc.lib", + "wtsapi32.lib", ] ldflags = [ "/DELAYLOAD:user32.dll" ] deps += [ @@ -231,6 +232,7 @@ "//ui/gl:test_support", "//ui/native_theme", "//ui/resources", + "//ui/resources:ui_test_pak", "//ui/strings", "//url", ]
diff --git a/ui/views/animation/bounds_animator.h b/ui/views/animation/bounds_animator.h index 68dad46..2840c3d 100644 --- a/ui/views/animation/bounds_animator.h +++ b/ui/views/animation/bounds_animator.h
@@ -10,6 +10,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "ui/gfx/animation/animation_container_observer.h" #include "ui/gfx/animation/animation_delegate.h"
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc index 282ca89..3f8411b 100644 --- a/ui/views/bubble/bubble_frame_view.cc +++ b/ui/views/bubble/bubble_frame_view.cc
@@ -35,9 +35,6 @@ namespace { -// The horizontal padding between the title and the icon. -const int kTitleHorizontalPadding = 5; - // Background color of the footnote view. const SkColor kFootnoteBackgroundColor = SkColorSetRGB(245, 245, 245); @@ -159,7 +156,9 @@ // Allow dialogs to show the system menu and be dragged. if (GetWidget()->widget_delegate()->AsDialogDelegate() && !GetWidget()->widget_delegate()->AsBubbleDialogDelegate()) { - gfx::Rect sys_rect(0, 0, title_->x(), title_->y()); + gfx::Rect bounds(GetContentsBounds()); + bounds.Inset(title_margins_); + gfx::Rect sys_rect(0, 0, bounds.x(), bounds.y()); sys_rect.set_origin(gfx::Point(GetMirroredXForRect(sys_rect), 0)); if (sys_rect.Contains(point)) return HTSYSMENU; @@ -302,30 +301,24 @@ close_position += gfx::Vector2d(-close_->width() - 7, 6); close_->SetPosition(close_position); - gfx::Size title_icon_size(title_icon_->GetPreferredSize()); - gfx::Size title_label_size(title_->GetPreferredSize()); + gfx::Size title_icon_pref_size(title_icon_->GetPreferredSize()); int padding = 0; - if (title_icon_size.width() > 0 && title_label_size.width() > 0) - padding = kTitleHorizontalPadding; - const int title_height = std::max(title_icon_size.height(), - title_label_size.height()); - const int title_icon_width = std::max(0, close_->x() - bounds.x()); - title_icon_size.SetToMin(gfx::Size(title_icon_width, title_height)); - gfx::Rect title_icon_bounds( - bounds.x(), bounds.y(), title_icon_size.width(), title_height); - title_icon_->SetBoundsRect(title_icon_bounds); + if (title_->visible() && !title_->text().empty()) { + if (title_icon_pref_size.width() > 0) + padding = title_margins_.left(); - const int title_label_x = title_icon_->bounds().right() + padding; - const int title_label_width = std::max(0, close_->x() - title_label_x); - title_label_size.SetToMin(gfx::Size(title_label_width, - title_label_size.height())); - gfx::Rect title_label_bounds( - title_label_x, bounds.y(), title_label_size.width(), title_height); - title_->SetBoundsRect(title_label_bounds); + const int title_label_x = + bounds.x() + title_icon_pref_size.width() + padding; + title_->SizeToFit(std::max(1, close_->x() - title_label_x)); + title_->SetPosition(gfx::Point(title_label_x, bounds.y())); + } - bounds.set_width( - title_icon_size.width() + title_label_size.width() + padding); + const int title_height = + std::max(title_icon_pref_size.height(), title_->height()); + title_icon_->SetBounds(bounds.x(), bounds.y(), title_icon_pref_size.width(), + title_height); + bounds.set_width(title_->bounds().right() - bounds.x()); bounds.set_height(title_height); if (footnote_container_) { @@ -508,7 +501,7 @@ gfx::Size title_icon_size = title_icon_->GetPreferredSize(); gfx::Size title_label_size = title_->GetPreferredSize(); if (title_icon_size.width() > 0 && title_label_size.width() > 0) - title_bar_width += kTitleHorizontalPadding; + title_bar_width += title_margins_.left(); title_bar_width += title_icon_size.width(); if (close_->visible()) title_bar_width += close_->width() + 1;
diff --git a/ui/views/controls/button/label_button_border.cc b/ui/views/controls/button/label_button_border.cc index f90b8fa..e8347bb9 100644 --- a/ui/views/controls/button/label_button_border.cc +++ b/ui/views/controls/button/label_button_border.cc
@@ -146,9 +146,7 @@ SkPaint paint; double scale = animation->GetCurrentValue(); - skia::RefPtr<SkXfermode> sk_arith_xfer = - skia::AdoptRef(SkArithmeticMode::Create(0.0f, scale, 1.0 - scale, 0.0)); - paint.setXfermode(sk_arith_xfer.get()); + paint.setXfermode(SkArithmeticMode::Make(0.0f, scale, 1.0 - scale, 0.0)); canvas->sk_canvas()->saveLayer(&sk_rect, &paint); state = native_theme_delegate->GetForegroundThemeState(&extra); PaintHelper(this, canvas, state, rect, extra);
diff --git a/ui/views/mus/native_widget_mus.cc b/ui/views/mus/native_widget_mus.cc index 48eb6d0..c501c6e 100644 --- a/ui/views/mus/native_widget_mus.cc +++ b/ui/views/mus/native_widget_mus.cc
@@ -770,10 +770,6 @@ // NOTIMPLEMENTED(); } -void NativeWidgetMus::SetUseDragFrame(bool use_drag_frame) { - // NOTIMPLEMENTED(); -} - void NativeWidgetMus::FlashFrame(bool flash_frame) { // NOTIMPLEMENTED(); }
diff --git a/ui/views/mus/native_widget_mus.h b/ui/views/mus/native_widget_mus.h index a0e667b..3419c064 100644 --- a/ui/views/mus/native_widget_mus.h +++ b/ui/views/mus/native_widget_mus.h
@@ -143,7 +143,6 @@ void SetFullscreen(bool fullscreen) override; bool IsFullscreen() const override; void SetOpacity(unsigned char opacity) override; - void SetUseDragFrame(bool use_drag_frame) override; void FlashFrame(bool flash_frame) override; void RunShellDrag(View* view, const ui::OSExchangeData& data,
diff --git a/ui/views/views.gyp b/ui/views/views.gyp index 236ae59..43f4ac3 100644 --- a/ui/views/views.gyp +++ b/ui/views/views.gyp
@@ -738,6 +738,7 @@ 'libraries': [ '-limm32.lib', '-loleacc.lib', + '-lwtsapi32.lib', ], 'msvs_settings': { 'VCLinkerTool': {
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc index 0ff2fbbb..f69b839d 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -820,9 +820,6 @@ desktop_window_tree_host_->SetOpacity(opacity); } -void DesktopNativeWidgetAura::SetUseDragFrame(bool use_drag_frame) { -} - void DesktopNativeWidgetAura::FlashFrame(bool flash_frame) { if (content_window_) desktop_window_tree_host_->FlashFrame(flash_frame);
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h index f33fa728..47f51492 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
@@ -148,7 +148,6 @@ void SetFullscreen(bool fullscreen) override; bool IsFullscreen() const override; void SetOpacity(unsigned char opacity) override; - void SetUseDragFrame(bool use_drag_frame) override; void FlashFrame(bool flash_frame) override; void RunShellDrag(View* view, const ui::OSExchangeData& data,
diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.h b/ui/views/widget/desktop_aura/desktop_screen_x11.h index c49d4da..463c5fd 100644 --- a/ui/views/widget/desktop_aura/desktop_screen_x11.h +++ b/ui/views/widget/desktop_aura/desktop_screen_x11.h
@@ -8,6 +8,7 @@ #include <stdint.h> #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/timer/timer.h" #include "ui/events/platform/platform_event_dispatcher.h" #include "ui/gfx/display_change_notifier.h"
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index afcf4a9..4f24e5c 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc
@@ -598,10 +598,6 @@ window_->layer()->SetOpacity(opacity / 255.0); } -void NativeWidgetAura::SetUseDragFrame(bool use_drag_frame) { - NOTIMPLEMENTED(); -} - void NativeWidgetAura::FlashFrame(bool flash) { if (window_) window_->SetProperty(aura::client::kDrawAttentionKey, flash);
diff --git a/ui/views/widget/native_widget_aura.h b/ui/views/widget/native_widget_aura.h index 56cc8261..9e27cca 100644 --- a/ui/views/widget/native_widget_aura.h +++ b/ui/views/widget/native_widget_aura.h
@@ -108,7 +108,6 @@ void SetFullscreen(bool fullscreen) override; bool IsFullscreen() const override; void SetOpacity(unsigned char opacity) override; - void SetUseDragFrame(bool use_drag_frame) override; void FlashFrame(bool flash_frame) override; void RunShellDrag(View* view, const ui::OSExchangeData& data,
diff --git a/ui/views/widget/native_widget_mac.h b/ui/views/widget/native_widget_mac.h index f2f7918..1b7deb2c 100644 --- a/ui/views/widget/native_widget_mac.h +++ b/ui/views/widget/native_widget_mac.h
@@ -107,7 +107,6 @@ void SetFullscreen(bool fullscreen) override; bool IsFullscreen() const override; void SetOpacity(unsigned char opacity) override; - void SetUseDragFrame(bool use_drag_frame) override; void FlashFrame(bool flash_frame) override; void RunShellDrag(View* view, const ui::OSExchangeData& data,
diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm index 2414aed..126623ff 100644 --- a/ui/views/widget/native_widget_mac.mm +++ b/ui/views/widget/native_widget_mac.mm
@@ -493,10 +493,6 @@ [GetNativeWindow() setAlphaValue:opacity / 255.0]; } -void NativeWidgetMac::SetUseDragFrame(bool use_drag_frame) { - NOTIMPLEMENTED(); -} - void NativeWidgetMac::FlashFrame(bool flash_frame) { NOTIMPLEMENTED(); }
diff --git a/ui/views/widget/native_widget_private.h b/ui/views/widget/native_widget_private.h index 6e52bf6..777eaa2 100644 --- a/ui/views/widget/native_widget_private.h +++ b/ui/views/widget/native_widget_private.h
@@ -194,7 +194,6 @@ virtual void SetFullscreen(bool fullscreen) = 0; virtual bool IsFullscreen() const = 0; virtual void SetOpacity(unsigned char opacity) = 0; - virtual void SetUseDragFrame(bool use_drag_frame) = 0; virtual void FlashFrame(bool flash) = 0; virtual void RunShellDrag(View* view, const ui::OSExchangeData& data,
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc index 7aa8458..ffafd0d 100644 --- a/ui/views/widget/widget.cc +++ b/ui/views/widget/widget.cc
@@ -695,10 +695,6 @@ native_widget_->SetOpacity(opacity); } -void Widget::SetUseDragFrame(bool use_drag_frame) { - native_widget_->SetUseDragFrame(use_drag_frame); -} - void Widget::FlashFrame(bool flash) { native_widget_->FlashFrame(flash); }
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h index bbc89db..0ceaf82 100644 --- a/ui/views/widget/widget.h +++ b/ui/views/widget/widget.h
@@ -523,10 +523,6 @@ // underlying windowing system. void SetOpacity(unsigned char opacity); - // Sets whether or not the window should show its frame as a "transient drag - // frame" - slightly transparent and without the standard window controls. - void SetUseDragFrame(bool use_drag_frame); - // Flashes the frame of the window to draw attention to it. Currently only // implemented on Windows for non-Aura. void FlashFrame(bool flash);
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc index 67c2a6c..b571f5e 100644 --- a/ui/views/widget/widget_unittest.cc +++ b/ui/views/widget/widget_unittest.cc
@@ -632,7 +632,6 @@ widget->IsMaximized(); widget->IsFullscreen(); widget->SetOpacity(0); - widget->SetUseDragFrame(true); widget->FlashFrame(true); widget->IsVisible(); widget->GetThemeProvider();
diff --git a/ui/views/win/windows_session_change_observer.cc b/ui/views/win/windows_session_change_observer.cc index a96c566..6d230d6 100644 --- a/ui/views/win/windows_session_change_observer.cc +++ b/ui/views/win/windows_session_change_observer.cc
@@ -5,7 +5,6 @@ #include "ui/views/win/windows_session_change_observer.h" #include <wtsapi32.h> -#pragma comment(lib, "wtsapi32.lib") #include "base/bind.h" #include "base/bind_helpers.h"
diff --git a/ui/views/window/dialog_delegate_unittest.cc b/ui/views/window/dialog_delegate_unittest.cc index 54099e60..86e957dd 100644 --- a/ui/views/window/dialog_delegate_unittest.cc +++ b/ui/views/window/dialog_delegate_unittest.cc
@@ -202,7 +202,8 @@ for (size_t i = 0; i < arraysize(cases); ++i) { gfx::Point point(cases[i].point, cases[i].point); EXPECT_EQ(cases[i].hit, frame->NonClientHitTest(point)) - << " with border: " << border << ", at point " << cases[i].point; + << " case " << i << " with border: " << border << ", at point " + << cases[i].point; } }
diff --git a/ui/webui/resources/css/bubble.css b/ui/webui/resources/css/bubble.css index b0092e5e..52e0d10 100644 --- a/ui/webui/resources/css/bubble.css +++ b/ui/webui/resources/css/bubble.css
@@ -68,7 +68,7 @@ } .bubble-arrow { - -webkit-transform: rotate(45deg); + transform: rotate(45deg); box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.15); height: 15px; position: absolute;
diff --git a/ui/webui/resources/css/dialogs.css b/ui/webui/resources/css/dialogs.css index 9c16aca55..fde32aab 100644 --- a/ui/webui/resources/css/dialogs.css +++ b/ui/webui/resources/css/dialogs.css
@@ -38,16 +38,16 @@ @-webkit-keyframes pulse { 0% { - -webkit-transform: scale(1); + transform: scale(1); } 40% { - -webkit-transform: scale(1.02); + transform: scale(1.02); } 60% { - -webkit-transform: scale(1.02); + transform: scale(1.02); } 100% { - -webkit-transform: scale(1); + transform: scale(1); } } @@ -59,13 +59,13 @@ } .shown > .cr-dialog-frame { - -webkit-transform: perspective(500px) scale(1) + transform: perspective(500px) scale(1) translateY(0) rotateX(0); opacity: 1; } .cr-dialog-frame { - -webkit-transform: perspective(500px) scale(0.99) + transform: perspective(500px) scale(0.99) translateY(-20px) rotateX(5deg); -webkit-transition: all 180ms; -webkit-transition-duration: 250ms;
diff --git a/ui/webui/resources/css/overlay.css b/ui/webui/resources/css/overlay.css index 361fb82..3b3340d 100644 --- a/ui/webui/resources/css/overlay.css +++ b/ui/webui/resources/css/overlay.css
@@ -25,14 +25,14 @@ .overlay.transparent .page { /* TODO(flackr): Add perspective(500px) rotateX(5deg) when accelerated * compositing is enabled on chrome:// pages. See http://crbug.com/116800. */ - -webkit-transform: scale(0.99) translateY(-20px); + transform: scale(0.99) translateY(-20px); } /* The foreground dialog. */ .overlay .page { -webkit-border-radius: 3px; -webkit-box-orient: vertical; - -webkit-transition: 200ms -webkit-transform; + -webkit-transition: 200ms transform; background: white; box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0,0,0,0.15); color: #333; @@ -52,16 +52,16 @@ /* keyframes used to pulse the overlay */ @-webkit-keyframes pulse { 0% { - -webkit-transform: scale(1); + transform: scale(1); } 40% { - -webkit-transform: scale(1.02); + transform: scale(1.02); } 60% { - -webkit-transform: scale(1.02); + transform: scale(1.02); } 100% { - -webkit-transform: scale(1); + transform: scale(1); } }
diff --git a/ui/webui/resources/css/trash.css b/ui/webui/resources/css/trash.css index fb06e9aa..dfe66dc0 100644 --- a/ui/webui/resources/css/trash.css +++ b/ui/webui/resources/css/trash.css
@@ -29,7 +29,7 @@ .trash > .lid { -webkit-transform-origin: -7% 100%; - -webkit-transition: -webkit-transform 150ms; + -webkit-transition: transform 150ms; height: 6px; width: 14px; } @@ -39,12 +39,12 @@ } .trash:-webkit-any(:focus, :hover, .open) > .lid { - -webkit-transform: rotate(-45deg); - -webkit-transition: -webkit-transform 250ms; + transform: rotate(-45deg); + -webkit-transition: transform 250ms; } html[dir='rtl'] .trash:-webkit-any(:focus, :hover, .open) > .lid { - -webkit-transform: rotate(45deg); + transform: rotate(45deg); } .trash > .can {
diff --git a/ui/webui/resources/css/tree.css b/ui/webui/resources/css/tree.css index a47735a..a86baba5 100644 --- a/ui/webui/resources/css/tree.css +++ b/ui/webui/resources/css/tree.css
@@ -22,7 +22,7 @@ } .expand-icon { - -webkit-transform: rotate(-90deg); + transform: rotate(-90deg); -webkit-transition: all 150ms; background: url(../images/tree_triangle.svg) no-repeat center center; background-size: 8px 5px; @@ -36,11 +36,11 @@ } html[dir=rtl] .expand-icon { - -webkit-transform: rotate(90deg); + transform: rotate(90deg); } .tree-item[expanded] > .tree-row > .expand-icon { - -webkit-transform: rotate(0); + transform: rotate(0); background-image: url(../images/tree_triangle.svg); opacity: .5; }
diff --git a/ui/webui/resources/images/throbber_medium.svg b/ui/webui/resources/images/throbber_medium.svg index 2a7aaca7..c6f51b2 100644 --- a/ui/webui/resources/images/throbber_medium.svg +++ b/ui/webui/resources/images/throbber_medium.svg
@@ -42,8 +42,8 @@ /* Rotating the whole thing */ @-webkit-keyframes rotate { - from {-webkit-transform: rotate(0deg);} - to {-webkit-transform: rotate(360deg);} + from {transform: rotate(0deg);} + to {transform: rotate(360deg);} } .qp-circular-loader { -webkit-animation-name: rotate; @@ -68,10 +68,10 @@ } @-webkit-keyframes rot { from { - -webkit-transform: rotate(0deg); + transform: rotate(0deg); } to { - -webkit-transform: rotate(-360deg); + transform: rotate(-360deg); } } @-webkit-keyframes colors {
diff --git a/ui/webui/resources/images/throbber_small.svg b/ui/webui/resources/images/throbber_small.svg index 0cf4db1..6f31d49 100644 --- a/ui/webui/resources/images/throbber_small.svg +++ b/ui/webui/resources/images/throbber_small.svg
@@ -43,8 +43,8 @@ /* Rotating the whole thing */ @-webkit-keyframes rotate { - from {-webkit-transform: rotate(0deg);} - to {-webkit-transform: rotate(360deg);} + from {transform: rotate(0deg);} + to {transform: rotate(360deg);} } .qp-circular-loader { -webkit-animation-name: rotate; @@ -69,10 +69,10 @@ } @-webkit-keyframes rot { from { - -webkit-transform: rotate(0deg); + transform: rotate(0deg); } to { - -webkit-transform: rotate(-360deg); + transform: rotate(-360deg); } } @-webkit-keyframes colors {
diff --git a/ui/webui/resources/js/cr/ui/card_slider.js b/ui/webui/resources/js/cr/ui/card_slider.js index e0d0e202..f1919912 100644 --- a/ui/webui/resources/js/cr/ui/card_slider.js +++ b/ui/webui/resources/js/cr/ui/card_slider.js
@@ -328,7 +328,7 @@ }, /** - * Handles the ends of -webkit-transitions on -webkit-transform (animated + * Handles the ends of -webkit-transitions on transform (animated * card switches). * @param {Event} e The webkitTransitionEnd event. * @private @@ -459,7 +459,7 @@ }, /** - * This re-syncs the -webkit-transform that's used to position the frame in + * This re-syncs the transform that's used to position the frame in * the likely event it needs to be updated by a card being inserted or * removed in the flow. */ @@ -566,7 +566,7 @@ // enough to change cards. var transition = ''; if (opt_animate) { - transition = '-webkit-transform ' + CardSlider.TRANSITION_TIME_ + + transition = 'transform ' + CardSlider.TRANSITION_TIME_ + 'ms ease-in-out'; } this.container_.style.WebkitTransition = transition; @@ -581,12 +581,12 @@ * @private */ translateTo_: function(x) { - // We use a webkitTransform to slide because this is GPU accelerated on + // We use a transform to slide because this is GPU accelerated on // Chrome and iOS. Once Chrome does GPU acceleration on the position // fixed-layout elements we could simply set the element's position to // fixed and modify 'left' instead. this.deltaX_ = x - this.currentLeft_; - this.container_.style.WebkitTransform = 'translate3d(' + x + 'px, 0, 0)'; + this.container_.style.transform = 'translate3d(' + x + 'px, 0, 0)'; }, /* Touch ******************************************************************/