Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 547373002: Add a command line option and a Finch experiment for script streaming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/debug/trace_event.h" 14 #include "base/debug/trace_event.h"
15 #include "base/i18n/rtl.h" 15 #include "base/i18n/rtl.h"
16 #include "base/json/json_reader.h" 16 #include "base/json/json_reader.h"
17 #include "base/message_loop/message_loop.h" 17 #include "base/message_loop/message_loop.h"
18 #include "base/metrics/field_trial.h"
18 #include "base/metrics/histogram.h" 19 #include "base/metrics/histogram.h"
19 #include "base/stl_util.h" 20 #include "base/stl_util.h"
20 #include "base/strings/string_util.h" 21 #include "base/strings/string_util.h"
21 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
22 #include "base/sys_info.h" 23 #include "base/sys_info.h"
23 #include "base/time/time.h" 24 #include "base/time/time.h"
24 #include "base/values.h" 25 #include "base/values.h"
25 #include "cc/base/switches.h" 26 #include "cc/base/switches.h"
26 #include "content/browser/child_process_security_policy_impl.h" 27 #include "content/browser/child_process_security_policy_impl.h"
27 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 28 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 command_line.GetSwitchValueASCII(switches::kV8CacheOptions); 470 command_line.GetSwitchValueASCII(switches::kV8CacheOptions);
470 if (v8_cache_options == "parse") { 471 if (v8_cache_options == "parse") {
471 prefs.v8_cache_options = V8_CACHE_OPTIONS_PARSE; 472 prefs.v8_cache_options = V8_CACHE_OPTIONS_PARSE;
472 } else if (v8_cache_options == "code") { 473 } else if (v8_cache_options == "code") {
473 prefs.v8_cache_options = V8_CACHE_OPTIONS_CODE; 474 prefs.v8_cache_options = V8_CACHE_OPTIONS_CODE;
474 } else { 475 } else {
475 prefs.v8_cache_options = V8_CACHE_OPTIONS_OFF; 476 prefs.v8_cache_options = V8_CACHE_OPTIONS_OFF;
476 } 477 }
477 } 478 }
478 479
480 prefs.v8_script_streaming_enabled =
481 command_line.HasSwitch(switches::kEnableV8ScriptStreaming) ||
482 base::FieldTrialList::FindFullName("V8ScriptStreaming") == "Enabled";
483
479 GetContentClient()->browser()->OverrideWebkitPrefs(this, url, &prefs); 484 GetContentClient()->browser()->OverrideWebkitPrefs(this, url, &prefs);
480 return prefs; 485 return prefs;
481 } 486 }
482 487
483 void RenderViewHostImpl::Navigate(const FrameMsg_Navigate_Params& params) { 488 void RenderViewHostImpl::Navigate(const FrameMsg_Navigate_Params& params) {
484 TRACE_EVENT0("renderer_host,navigation", "RenderViewHostImpl::Navigate"); 489 TRACE_EVENT0("renderer_host,navigation", "RenderViewHostImpl::Navigate");
485 delegate_->GetFrameTree()->GetMainFrame()->Navigate(params); 490 delegate_->GetFrameTree()->GetMainFrame()->Navigate(params);
486 } 491 }
487 492
488 void RenderViewHostImpl::NavigateToURL(const GURL& url) { 493 void RenderViewHostImpl::NavigateToURL(const GURL& url) {
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 FrameTree* frame_tree = delegate_->GetFrameTree(); 1516 FrameTree* frame_tree = delegate_->GetFrameTree();
1512 1517
1513 frame_tree->ResetForMainFrameSwap(); 1518 frame_tree->ResetForMainFrameSwap();
1514 } 1519 }
1515 1520
1516 void RenderViewHostImpl::SelectWordAroundCaret() { 1521 void RenderViewHostImpl::SelectWordAroundCaret() {
1517 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1522 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1518 } 1523 }
1519 1524
1520 } // namespace content 1525 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_field_trials.cc ('k') | content/public/common/common_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698