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

Side by Side Diff: services/icu_data/icu_data_impl.cc

Issue 854433002: Update the sha1hash of the ICU data table (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « services/icu_data/embed_icu_data.py ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/application/application_runner_chromium.h" 5 #include "mojo/application/application_runner_chromium.h"
6 #include "mojo/common/weak_binding_set.h" 6 #include "mojo/common/weak_binding_set.h"
7 #include "mojo/public/c/system/main.h" 7 #include "mojo/public/c/system/main.h"
8 #include "mojo/public/cpp/application/application_connection.h" 8 #include "mojo/public/cpp/application/application_connection.h"
9 #include "mojo/public/cpp/application/application_delegate.h" 9 #include "mojo/public/cpp/application/application_delegate.h"
10 #include "mojo/public/cpp/application/interface_factory.h" 10 #include "mojo/public/cpp/application/interface_factory.h"
(...skipping 20 matching lines...) Expand all
31 // mojo::InterfaceFactory<mojo::ICUData> implementation. 31 // mojo::InterfaceFactory<mojo::ICUData> implementation.
32 void Create(mojo::ApplicationConnection* connection, 32 void Create(mojo::ApplicationConnection* connection,
33 mojo::InterfaceRequest<ICUData> request) override { 33 mojo::InterfaceRequest<ICUData> request) override {
34 bindings_.AddBinding(this, request.Pass()); 34 bindings_.AddBinding(this, request.Pass());
35 } 35 }
36 36
37 void Map(const mojo::String& sha1hash, 37 void Map(const mojo::String& sha1hash,
38 const mojo::Callback<void(mojo::ScopedSharedBufferHandle)>& callback) 38 const mojo::Callback<void(mojo::ScopedSharedBufferHandle)>& callback)
39 override { 39 override {
40 if (std::string(sha1hash) != std::string(kICUDataTableHash)) { 40 if (std::string(sha1hash) != std::string(kICUDataTableHash)) {
41 LOG(INFO) << "Failed to match sha1sum. Expected " << kICUDataTableHash;
eseidel 2015/01/13 20:22:43 LOG(FATAL)?
41 callback.Run(mojo::ScopedSharedBufferHandle()); 42 callback.Run(mojo::ScopedSharedBufferHandle());
42 return; 43 return;
43 } 44 }
44 EnsureBuffer(); 45 EnsureBuffer();
45 mojo::ScopedSharedBufferHandle handle; 46 mojo::ScopedSharedBufferHandle handle;
46 // FIXME: We should create a read-only duplicate of the handle. 47 // FIXME: We should create a read-only duplicate of the handle.
47 mojo::DuplicateBuffer(buffer_->handle.get(), nullptr, &handle); 48 mojo::DuplicateBuffer(buffer_->handle.get(), nullptr, &handle);
48 callback.Run(handle.Pass()); 49 callback.Run(handle.Pass());
49 } 50 }
50 51
(...skipping 13 matching lines...) Expand all
64 65
65 scoped_ptr<mojo::SharedBuffer> buffer_; 66 scoped_ptr<mojo::SharedBuffer> buffer_;
66 mojo::WeakBindingSet<ICUData> bindings_; 67 mojo::WeakBindingSet<ICUData> bindings_;
67 }; 68 };
68 } 69 }
69 70
70 MojoResult MojoMain(MojoHandle shell_handle) { 71 MojoResult MojoMain(MojoHandle shell_handle) {
71 mojo::ApplicationRunnerChromium runner(new icu_data::ICUDataImpl); 72 mojo::ApplicationRunnerChromium runner(new icu_data::ICUDataImpl);
72 return runner.Run(shell_handle); 73 return runner.Run(shell_handle);
73 } 74 }
OLDNEW
« no previous file with comments | « services/icu_data/embed_icu_data.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698