| Index: chrome/browser/chromeos/login/helper.cc
|
| diff --git a/chrome/browser/chromeos/login/helper.cc b/chrome/browser/chromeos/login/helper.cc
|
| index 1de84556e79e258d90235f3f1fc921f7ec985692..455efaac897f54a7a0de1704bb104680b40120ab 100644
|
| --- a/chrome/browser/chromeos/login/helper.cc
|
| +++ b/chrome/browser/chromeos/login/helper.cc
|
| @@ -21,6 +21,7 @@
|
| #include "chromeos/network/network_state_handler.h"
|
| #include "chromeos/network/network_util.h"
|
| #include "components/guest_view/browser/guest_view_manager.h"
|
| +#include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/storage_partition.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "extensions/browser/guest_view/web_view/web_view_guest.h"
|
| @@ -84,6 +85,24 @@ content::StoragePartition* GetPartition(content::WebContents* embedder,
|
| : nullptr;
|
| }
|
|
|
| +base::ScopedFD GetDataReadPipe(const std::string& data) {
|
| + DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
|
| + int pipe_fds[2];
|
| + if (!base::CreateLocalNonBlockingPipe(pipe_fds)) {
|
| + DLOG(ERROR) << "Failed to create pipe";
|
| + return base::ScopedFD();
|
| + }
|
| + base::ScopedFD pipe_read_end(pipe_fds[0]);
|
| + base::ScopedFD pipe_write_end(pipe_fds[1]);
|
| +
|
| + if (!base::WriteFileDescriptor(pipe_write_end.get(), data.c_str(),
|
| + data.size())) {
|
| + DLOG(ERROR) << "Failed to write to pipe";
|
| + return base::ScopedFD();
|
| + }
|
| + return pipe_read_end;
|
| +}
|
| +
|
| } // namespace
|
|
|
| gfx::Rect CalculateScreenBounds(const gfx::Size& size) {
|
| @@ -243,6 +262,13 @@ net::URLRequestContextGetter* GetSigninContext() {
|
| return signin_partition->GetURLRequestContext();
|
| }
|
|
|
| +void GetPipeReadEnd(const std::string& data,
|
| + const OnPipeReadyCallback& callback) {
|
| + base::PostTaskAndReplyWithResult(
|
| + content::BrowserThread::GetBlockingPool(), FROM_HERE,
|
| + base::Bind(&GetDataReadPipe, data), callback);
|
| +}
|
| +
|
| } // namespace login
|
|
|
| } // namespace chromeos
|
|
|