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

Side by Side Diff: content/shell/renderer/shell_content_renderer_client.cc

Issue 1653263005: [Experimental Framework] Move the trial token public key out of content and into the embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, and update for recent token changes Created 4 years, 10 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/shell/renderer/shell_content_renderer_client.h" 5 #include "content/shell/renderer/shell_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "components/web_cache/renderer/web_cache_render_process_observer.h" 8 #include "components/web_cache/renderer/web_cache_render_process_observer.h"
9 #include "content/public/renderer/render_thread.h" 9 #include "content/public/renderer/render_thread.h"
10 #include "content/shell/renderer/shell_render_view_observer.h" 10 #include "content/shell/renderer/shell_render_view_observer.h"
11 #include "third_party/WebKit/public/web/WebView.h" 11 #include "third_party/WebKit/public/web/WebView.h"
12 #include "v8/include/v8.h" 12 #include "v8/include/v8.h"
13 13
14 #if defined(ENABLE_PLUGINS) 14 #if defined(ENABLE_PLUGINS)
15 #include "ppapi/shared_impl/ppapi_switches.h" 15 #include "ppapi/shared_impl/ppapi_switches.h"
16 #endif 16 #endif
17 17
18 namespace content { 18 namespace content {
19 19
20 ShellContentRendererClient::ShellContentRendererClient() { 20 namespace {
21 } 21
22 // This is the public key which the content shell will use to enable origin
23 // trial features.
24 // TODO(iclelland): Update this comment with the location of the public and
25 // private key files when the command-line tool CL lands
26 static const uint8_t kOriginTrialPublicKey[] = {
27 0x75, 0x10, 0xac, 0xf9, 0x3a, 0x1c, 0xb8, 0xa9, 0x28, 0x70, 0xd2,
28 0x9a, 0xd0, 0x0b, 0x59, 0xe1, 0xac, 0x2b, 0xb7, 0xd5, 0xca, 0x1f,
29 0x64, 0x90, 0x08, 0x8e, 0xa8, 0xe0, 0x56, 0x3a, 0x04, 0xd0,
30 };
31 } // namespace
32
33 ShellContentRendererClient::ShellContentRendererClient()
34 : origin_trial_public_key_(base::StringPiece(
35 reinterpret_cast<const char*>(kOriginTrialPublicKey),
36 arraysize(kOriginTrialPublicKey))) {}
22 37
23 ShellContentRendererClient::~ShellContentRendererClient() { 38 ShellContentRendererClient::~ShellContentRendererClient() {
24 } 39 }
25 40
26 void ShellContentRendererClient::RenderThreadStarted() { 41 void ShellContentRendererClient::RenderThreadStarted() {
27 RenderThread* thread = RenderThread::Get(); 42 RenderThread* thread = RenderThread::Get();
28 web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver()); 43 web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver());
29 thread->AddObserver(web_cache_observer_.get()); 44 thread->AddObserver(web_cache_observer_.get());
30 } 45 }
31 46
(...skipping 13 matching lines...) Expand all
45 60
46 bool ShellContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() { 61 bool ShellContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() {
47 #if defined(ENABLE_PLUGINS) 62 #if defined(ENABLE_PLUGINS)
48 return base::CommandLine::ForCurrentProcess()->HasSwitch( 63 return base::CommandLine::ForCurrentProcess()->HasSwitch(
49 switches::kEnablePepperTesting); 64 switches::kEnablePepperTesting);
50 #else 65 #else
51 return false; 66 return false;
52 #endif 67 #endif
53 } 68 }
54 69
70 base::StringPiece ShellContentRendererClient::GetOriginTrialPublicKey() {
71 return origin_trial_public_key_;
72 }
73
55 } // namespace content 74 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698