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

Side by Side Diff: chrome/renderer/sandbox_status_extension_android.cc

Issue 2858073002: Use constexpr TaskTraits constructor in chrome. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « chrome/browser/win/jumplist.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "chrome/renderer/sandbox_status_extension_android.h" 5 #include "chrome/renderer/sandbox_status_extension_android.h"
6 6
7 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 v8::Local<v8::Function> callback; 98 v8::Local<v8::Function> callback;
99 if (!args->GetNext(&callback)) { 99 if (!args->GetNext(&callback)) {
100 args->ThrowError(); 100 args->ThrowError();
101 return; 101 return;
102 } 102 }
103 103
104 auto global_callback = 104 auto global_callback =
105 base::MakeUnique<v8::Global<v8::Function>>(args->isolate(), callback); 105 base::MakeUnique<v8::Global<v8::Function>>(args->isolate(), callback);
106 106
107 base::PostTaskWithTraitsAndReplyWithResult( 107 base::PostTaskWithTraitsAndReplyWithResult(
108 FROM_HERE, base::TaskTraits().MayBlock(), 108 FROM_HERE, {base::MayBlock()},
109 base::Bind(&SandboxStatusExtension::ReadSandboxStatus, this), 109 base::Bind(&SandboxStatusExtension::ReadSandboxStatus, this),
110 base::Bind(&SandboxStatusExtension::RunCallback, this, 110 base::Bind(&SandboxStatusExtension::RunCallback, this,
111 base::Passed(&global_callback))); 111 base::Passed(&global_callback)));
112 } 112 }
113 113
114 std::unique_ptr<base::Value> SandboxStatusExtension::ReadSandboxStatus() { 114 std::unique_ptr<base::Value> SandboxStatusExtension::ReadSandboxStatus() {
115 std::string secontext; 115 std::string secontext;
116 base::FilePath path(FILE_PATH_LITERAL("/proc/self/attr/current")); 116 base::FilePath path(FILE_PATH_LITERAL("/proc/self/attr/current"));
117 base::ReadFileToString(path, &secontext); 117 base::ReadFileToString(path, &secontext);
118 118
(...skipping 29 matching lines...) Expand all
148 v8::Local<v8::Function> callback_local = 148 v8::Local<v8::Function> callback_local =
149 v8::Local<v8::Function>::New(isolate, *callback); 149 v8::Local<v8::Function>::New(isolate, *callback);
150 150
151 std::unique_ptr<content::V8ValueConverter> converter( 151 std::unique_ptr<content::V8ValueConverter> converter(
152 content::V8ValueConverter::create()); 152 content::V8ValueConverter::create());
153 153
154 v8::Local<v8::Value> argv[] = {converter->ToV8Value(status.get(), context)}; 154 v8::Local<v8::Value> argv[] = {converter->ToV8Value(status.get(), context)};
155 render_frame()->GetWebFrame()->CallFunctionEvenIfScriptDisabled( 155 render_frame()->GetWebFrame()->CallFunctionEvenIfScriptDisabled(
156 callback_local, v8::Object::New(isolate), 1, argv); 156 callback_local, v8::Object::New(isolate), 1, argv);
157 } 157 }
OLDNEW
« no previous file with comments | « chrome/browser/win/jumplist.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698