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

Side by Side Diff: content/renderer/renderer_main_platform_delegate_linux.cc

Issue 14630005: This patch is to enable the vtune profiling tool support in chrome. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 7 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/renderer/renderer_main_platform_delegate.h" 5 #include "content/renderer/renderer_main_platform_delegate.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "content/common/sandbox_linux.h" 13 #include "content/common/sandbox_linux.h"
14 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
15 #include "content/public/common/sandbox_init.h" 15 #include "content/public/common/sandbox_init.h"
16 16
17 #ifdef ENABLE_VTUNE_JIT_INTERFACE
18 #include "v8/src/third_party/vtune/v8-vtune.h"
jamesr 2013/05/07 02:33:38 is this not where the InitializeVtuneForV8() symbo
19 #endif
20
17 namespace content { 21 namespace content {
18 22
19 RendererMainPlatformDelegate::RendererMainPlatformDelegate( 23 RendererMainPlatformDelegate::RendererMainPlatformDelegate(
20 const MainFunctionParams& parameters) 24 const MainFunctionParams& parameters)
21 : parameters_(parameters) { 25 : parameters_(parameters) {
22 } 26 }
23 27
24 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { 28 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() {
25 } 29 }
26 30
27 void RendererMainPlatformDelegate::PlatformInitialize() { 31 void RendererMainPlatformDelegate::PlatformInitialize() {
32 #ifdef ENABLE_VTUNE_JIT_INTERFACE
33 const CommandLine& command_line = parameters_.command_line;
34 // If --enable-vtune-support.
Avi (use Gerrit) 2013/05/07 03:04:04 pointless comment
35 if (command_line.HasSwitch(switches::kEnableVtune)) {
Avi (use Gerrit) 2013/05/07 03:04:04 no {} if there is only one line
36 vTune::InitilizeVtuneForV8();
Avi (use Gerrit) 2013/05/07 03:04:04 That's the real function name? Yes, it is (https:/
37 }
38 #endif
28 } 39 }
29 40
30 void RendererMainPlatformDelegate::PlatformUninitialize() { 41 void RendererMainPlatformDelegate::PlatformUninitialize() {
31 } 42 }
32 43
33 bool RendererMainPlatformDelegate::InitSandboxTests(bool no_sandbox) { 44 bool RendererMainPlatformDelegate::InitSandboxTests(bool no_sandbox) {
34 // The sandbox is started in the zygote process: zygote_main_linux.cc 45 // The sandbox is started in the zygote process: zygote_main_linux.cc
35 // http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox 46 // http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox
36 return true; 47 return true;
37 } 48 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 errno = 0; 87 errno = 0;
77 // This should normally return EBADF since the first argument is bogus, 88 // This should normally return EBADF since the first argument is bogus,
78 // but we know that under the seccomp-bpf sandbox, this should return EPERM. 89 // but we know that under the seccomp-bpf sandbox, this should return EPERM.
79 CHECK_EQ(fchmod(-1, 07777), -1); 90 CHECK_EQ(fchmod(-1, 07777), -1);
80 CHECK_EQ(errno, EPERM); 91 CHECK_EQ(errno, EPERM);
81 } 92 }
82 #endif // __x86_64__ 93 #endif // __x86_64__
83 } 94 }
84 95
85 } // namespace content 96 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698