OLD | NEW |
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> |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 command_line.GetSwitchValueASCII(switches::kV8CacheOptions); | 466 command_line.GetSwitchValueASCII(switches::kV8CacheOptions); |
467 if (v8_cache_options == "parse") { | 467 if (v8_cache_options == "parse") { |
468 prefs.v8_cache_options = V8_CACHE_OPTIONS_PARSE; | 468 prefs.v8_cache_options = V8_CACHE_OPTIONS_PARSE; |
469 } else if (v8_cache_options == "code") { | 469 } else if (v8_cache_options == "code") { |
470 prefs.v8_cache_options = V8_CACHE_OPTIONS_CODE; | 470 prefs.v8_cache_options = V8_CACHE_OPTIONS_CODE; |
471 } else { | 471 } else { |
472 prefs.v8_cache_options = V8_CACHE_OPTIONS_OFF; | 472 prefs.v8_cache_options = V8_CACHE_OPTIONS_OFF; |
473 } | 473 } |
474 } | 474 } |
475 | 475 |
| 476 std::string streaming_experiment_group = |
| 477 base::FieldTrialList::FindFullName("V8ScriptStreaming"); |
476 prefs.v8_script_streaming_enabled = | 478 prefs.v8_script_streaming_enabled = |
477 command_line.HasSwitch(switches::kEnableV8ScriptStreaming) || | 479 command_line.HasSwitch(switches::kEnableV8ScriptStreaming); |
478 base::FieldTrialList::FindFullName("V8ScriptStreaming") == "Enabled"; | 480 if (streaming_experiment_group == "Enabled") { |
| 481 prefs.v8_script_streaming_enabled = true; |
| 482 prefs.v8_script_streaming_mode = V8_SCRIPT_STREAMING_MODE_ALL; |
| 483 } else if (streaming_experiment_group == "OnlyAsyncAndDefer") { |
| 484 prefs.v8_script_streaming_enabled = true; |
| 485 prefs.v8_script_streaming_mode = |
| 486 V8_SCRIPT_STREAMING_MODE_ONLY_ASYNC_AND_DEFER; |
| 487 } else if (streaming_experiment_group == "AllPlusBlockParserBlocking") { |
| 488 prefs.v8_script_streaming_enabled = true; |
| 489 prefs.v8_script_streaming_mode = |
| 490 V8_SCRIPT_STREAMING_MODE_ALL_PLUS_BLOCK_PARSER_BLOCKING; |
| 491 } |
479 | 492 |
480 GetContentClient()->browser()->OverrideWebkitPrefs(this, url, &prefs); | 493 GetContentClient()->browser()->OverrideWebkitPrefs(this, url, &prefs); |
481 return prefs; | 494 return prefs; |
482 } | 495 } |
483 | 496 |
484 void RenderViewHostImpl::SuppressDialogsUntilSwapOut() { | 497 void RenderViewHostImpl::SuppressDialogsUntilSwapOut() { |
485 Send(new ViewMsg_SuppressDialogsUntilSwapOut(GetRoutingID())); | 498 Send(new ViewMsg_SuppressDialogsUntilSwapOut(GetRoutingID())); |
486 } | 499 } |
487 | 500 |
488 void RenderViewHostImpl::ClosePage() { | 501 void RenderViewHostImpl::ClosePage() { |
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1439 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1427 | 1440 |
1428 frame_tree->ResetForMainFrameSwap(); | 1441 frame_tree->ResetForMainFrameSwap(); |
1429 } | 1442 } |
1430 | 1443 |
1431 void RenderViewHostImpl::SelectWordAroundCaret() { | 1444 void RenderViewHostImpl::SelectWordAroundCaret() { |
1432 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1445 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1433 } | 1446 } |
1434 | 1447 |
1435 } // namespace content | 1448 } // namespace content |
OLD | NEW |