%endif
Name: crosswalk
-Version: 7.36.151.0
+Version: 7.36.152.0
Release: 0
Summary: Crosswalk is an app runtime based on Chromium
License: (BSD-3-Clause and LGPL-2.1+)
Send(new ViewMsg_TimezoneChange());
}
+ScreenOrientationDispatcherHost* RenderProcessHostImpl
+ ::GetScreenOrientationDispatcherHost() {
+ return screen_orientation_dispatcher_host_;
+}
+
void RenderProcessHostImpl::AddRoute(
int32 routing_id,
IPC::Listener* listener) {
OVERRIDE;
virtual void NotifyTimezoneChange() OVERRIDE;
+ virtual ScreenOrientationDispatcherHost* GetScreenOrientationDispatcherHost()
+ OVERRIDE;
+
// IPC::Sender via RenderProcessHost.
virtual bool Send(IPC::Message* msg) OVERRIDE;
class BrowserMessageFilter;
class RenderProcessHostObserver;
class RenderWidgetHost;
+class ScreenOrientationDispatcherHost;
class StoragePartition;
struct GlobalRequestID;
// have changed.
virtual void NotifyTimezoneChange() = 0;
+ // Returns message filter and dispatcher for screen orientation.
+ virtual ScreenOrientationDispatcherHost* GetScreenOrientationDispatcherHost()
+ = 0;
+
// Static management functions -----------------------------------------------
// Flag to run the renderer in process. This is primarily
RenderProcessHostImpl::FilterURL(this, empty_allowed, url);
}
+ScreenOrientationDispatcherHost* MockRenderProcessHost
+ ::GetScreenOrientationDispatcherHost() {
+ return NULL;
+}
+
#if defined(ENABLE_WEBRTC)
void MockRenderProcessHost::EnableAecDump(const base::FilePath& file) {
}
OVERRIDE;
virtual void NotifyTimezoneChange() OVERRIDE;
+ virtual ScreenOrientationDispatcherHost* GetScreenOrientationDispatcherHost()
+ OVERRIDE;
+
// IPC::Sender via RenderProcessHost.
virtual bool Send(IPC::Message* msg) OVERRIDE;
typedef uint32_t SnapshotObjectId;
+typedef struct {
+ /** The 1-based number of the source line where the function originates. */
+ unsigned int line;
+
+ /** The count of samples associated with the source line. */
+ unsigned int ticks;
+} LineTick;
+
/**
* CpuProfileNode represents a node in a call graph.
*/
*/
int GetColumnNumber() const;
+ /**
+ * Returns the number of the function's source lines that collect the samples.
+ */
+ unsigned int GetHitLineCount() const;
+
+ /** Returns the set of source lines that collect the samples.
+ * The caller allocates buffer and responsible for releasing it.
+ * True if all available entries are copied, otherwise false.
+ */
+ bool GetLineTicks(LineTick* entries, unsigned int number) const;
+
/** Returns bailout reason for the function
* if the optimization was disabled for it.
*/
}
+unsigned int CpuProfileNode::GetHitLineCount() const {
+ const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
+ return node->GetHitLineCount();
+}
+
+
+bool CpuProfileNode::GetLineTicks(LineTick* entries,
+ unsigned int number) const {
+ const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
+ return node->GetLineTicks(entries, number);
+}
+
+
const char* CpuProfileNode::GetBailoutReason() const {
const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
return node->entry()->bailout_reason();
CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
rec->start = code->address();
+ // Get line info from the relocation information.
+ ASSERT(Script::cast(shared->script()));
+ JITLineInfoTable line_table;
+ if (line > 0) {
+ for (RelocIterator it(code); !it.done(); it.next()) {
+ RelocInfo::Mode mode = it.rinfo()->rmode();
+ if (RelocInfo::IsPosition(mode)) {
+ int pc_offset = static_cast<int>(it.rinfo()->pc() - code->address());
+ int position = static_cast<int>(it.rinfo()->data());
+ int lineno =
+ Script::cast(shared->script())->GetLineNumber(position) + 1;
+ if (position >= 0 && lineno > 0) {
+ line_table.SetPosition(pc_offset, lineno);
+ }
+ }
+ }
+ }
rec->entry = profiles_->NewCodeEntry(
tag,
profiles_->GetFunctionName(shared->DebugName()),
CodeEntry::kEmptyNamePrefix,
profiles_->GetName(source),
line,
- column);
+ column,
+ line_table.entries()->length() ? &line_table : NULL);
if (info) {
rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges());
}
- ASSERT(Script::cast(shared->script()));
Script* script = Script::cast(shared->script());
rec->entry->set_script_id(script->id()->value());
rec->size = code->ExecutableSize();
void FullCodeGenerator::SetSourcePosition(int pos) {
if (pos != RelocInfo::kNoPosition) {
masm_->positions_recorder()->RecordPosition(pos);
+ masm_->positions_recorder()->WriteRecordedPositions();
}
}
class PerfJitLogger;
class Sampler;
+// Mapping from the offset within generated code to source line number.
+class JITLineInfoTable : public Malloced {
+ public:
+ JITLineInfoTable() : pc_offset_infos_(20) {}
+
+ void SetPosition(unsigned int pc_offset, unsigned int src_line) {
+ AddPcOffsetInfo(PcOffsetInfo(pc_offset, src_line));
+ }
+
+ int GetSourceLineNumber(unsigned int pc_offset) const {
+ int length = pc_offset_infos_.length();
+ if (0 == length) return 0;
+
+ int low = 0;
+ int high = length - 1;
+
+ if (pc_offset > pc_offset_infos_[high].pc_offset_) {
+ return 0; // out of range
+ }
+
+ while (low < high) {
+ int mid = (low + high) / 2;
+ const JITLineInfoTable::PcOffsetInfo& elem = pc_offset_infos_[mid];
+ if (elem.pc_offset_ > pc_offset) {
+ high = mid;
+ continue;
+ }
+ if (elem.pc_offset_ < pc_offset) {
+ low = mid + 1;
+ continue;
+ }
+ return elem.line_; // found the element
+ }
+
+ int line = pc_offset_infos_[high].line_;
+ return line;
+ }
+
+ struct PcOffsetInfo {
+ PcOffsetInfo(unsigned int pc_offset, unsigned int src_line)
+ : pc_offset_(pc_offset), line_(src_line) { }
+
+ unsigned int pc_offset_;
+ unsigned int line_;
+ };
+
+ List<PcOffsetInfo>* entries() { return &pc_offset_infos_; }
+ const List<PcOffsetInfo>* entries() const { return &pc_offset_infos_; }
+
+ JITLineInfoTable& operator=(const JITLineInfoTable& other) {
+ if (this != &other) {
+ const List<PcOffsetInfo>* entries = other.entries();
+ if (entries) {
+ pc_offset_infos_.Clear();
+ pc_offset_infos_.AddAll(*entries);
+ }
+ }
+ return *this;
+ }
+
+ private:
+ void AddPcOffsetInfo(const PcOffsetInfo& pc_offset_info) {
+ pc_offset_infos_.Add(pc_offset_info);
+ }
+
+ // The data reported by code generator.
+ List<PcOffsetInfo> pc_offset_infos_;
+};
+
+
class Logger {
public:
#define DECLARE_ENUM(enum_item, ignore) enum_item,
const char* name_prefix,
const char* resource_name,
int line_number,
- int column_number)
+ int column_number,
+ JITLineInfoTable* line_info)
: tag_(tag),
builtin_id_(Builtins::builtin_count),
name_prefix_(name_prefix),
shared_id_(0),
script_id_(v8::UnboundScript::kNoScriptId),
no_frame_ranges_(NULL),
- bailout_reason_(kEmptyBailoutReason) { }
+ bailout_reason_(kEmptyBailoutReason) {
+ if (NULL != line_info) {
+ line_info_ = *line_info;
+ }
+}
bool CodeEntry::is_js_function_tag(Logger::LogEventsAndTags tag) {
}
+static bool LineTickMatch(void* a, void* b) {
+ return a == b;
+}
+
+
ProfileNode::ProfileNode(ProfileTree* tree, CodeEntry* entry)
: tree_(tree),
entry_(entry),
self_ticks_(0),
children_(CodeEntriesMatch),
- id_(tree->next_node_id()) { }
+ id_(tree->next_node_id()),
+ line_ticks_(LineTickMatch) { }
} } // namespace v8::internal
}
+void ProfileNode::IncrementLineTicks(int src_line) {
+ if (src_line == v8::CpuProfileNode::kNoLineNumberInfo) return;
+ // Increment a hit counter of a certain source line.
+ // Add a new source line if not found.
+ HashMap::Entry* e =
+ line_ticks_.Lookup(reinterpret_cast<void*>(src_line), src_line, true);
+ if (NULL != e) {
+ e->value = static_cast<char*>(e->value) + 1;
+ }
+}
+
+
+bool ProfileNode::GetLineTicks(LineTick* entries,
+ unsigned int number) const {
+ if (NULL == entries || number == 0) {
+ return false;
+ }
+
+ unsigned lineNumber = line_ticks_.occupancy();
+ if (lineNumber == 0) return false;
+ if (number < lineNumber) return false;
+
+ LineTick* entry = entries;
+
+ for (HashMap::Entry* p = line_ticks_.Start();
+ p != NULL;
+ p = line_ticks_.Next(p), entry++) {
+ entry->line = reinterpret_cast<intptr_t>(p->key);
+ entry->ticks = reinterpret_cast<intptr_t>(p->value);
+ }
+
+ return true;
+}
+
+
void ProfileNode::Print(int indent) {
OS::Print("%5u %*c %s%s %d #%d %s",
self_ticks_,
}
-ProfileNode* ProfileTree::AddPathFromEnd(const Vector<CodeEntry*>& path) {
+ProfileNode* ProfileTree::AddPathFromEnd(const Vector<CodeEntry*>& path,
+ int src_line) {
ProfileNode* node = root_;
for (CodeEntry** entry = path.start() + path.length() - 1;
entry != path.start() - 1;
}
}
node->IncrementSelfTicks();
+ if (src_line != v8::CpuProfileNode::kNoLineNumberInfo) {
+ node->IncrementLineTicks(src_line);
+ }
return node;
}
-void ProfileTree::AddPathFromStart(const Vector<CodeEntry*>& path) {
+void ProfileTree::AddPathFromStart(const Vector<CodeEntry*>& path,
+ int src_line) {
ProfileNode* node = root_;
for (CodeEntry** entry = path.start();
entry != path.start() + path.length();
}
}
node->IncrementSelfTicks();
+ if (src_line != v8::CpuProfileNode::kNoLineNumberInfo) {
+ node->IncrementLineTicks(src_line);
+ }
}
}
-void CpuProfile::AddPath(TimeTicks timestamp, const Vector<CodeEntry*>& path) {
- ProfileNode* top_frame_node = top_down_.AddPathFromEnd(path);
+void CpuProfile::AddPath(TimeTicks timestamp, const Vector<CodeEntry*>& path,
+ int src_line) {
+ ProfileNode* top_frame_node = top_down_.AddPathFromEnd(path, src_line);
if (record_samples_) {
timestamps_.Add(timestamp);
samples_.Add(top_frame_node);
void CpuProfilesCollection::AddPathToCurrentProfiles(
- TimeTicks timestamp, const Vector<CodeEntry*>& path) {
+ TimeTicks timestamp, const Vector<CodeEntry*>& path, int src_line) {
// As starting / stopping profiles is rare relatively to this
// method, we don't bother minimizing the duration of lock holding,
// e.g. copying contents of the list to a local vector.
current_profiles_semaphore_.Wait();
for (int i = 0; i < current_profiles_.length(); ++i) {
- current_profiles_[i]->AddPath(timestamp, path);
+ current_profiles_[i]->AddPath(timestamp, path, src_line);
}
current_profiles_semaphore_.Signal();
}
const char* name_prefix,
const char* resource_name,
int line_number,
- int column_number) {
+ int column_number,
+ JITLineInfoTable* line_info) {
CodeEntry* code_entry = new CodeEntry(tag,
name,
name_prefix,
resource_name,
line_number,
- column_number);
+ column_number,
+ line_info);
code_entries_.Add(code_entry);
return code_entry;
}
}
+static int GetSourceLine(unsigned int pc_offset, CodeEntry* entry) {
+ int src_line = v8::CpuProfileNode::kNoLineNumberInfo;
+ const JITLineInfoTable& table = entry->line_info();
+ if (!table.entries()->length()) return src_line;
+ src_line = table.GetSourceLineNumber(pc_offset);
+ return src_line;
+}
+
+
void ProfileGenerator::RecordTickSample(const TickSample& sample) {
// Allocate space for stack frames + pc + function + vm-state.
ScopedVector<CodeEntry*> entries(sample.frames_count + 3);
// entries vector with NULL values.
CodeEntry** entry = entries.start();
memset(entry, 0, entries.length() * sizeof(*entry));
+ int src_line = v8::CpuProfileNode::kNoLineNumberInfo;
if (sample.pc != NULL) {
if (sample.has_external_callback && sample.state == EXTERNAL &&
sample.top_frame_type == StackFrame::EXIT) {
// ebp contains return address of the current function and skips caller's
// frame. Check for this case and just skip such samples.
if (pc_entry) {
+ Code* code = Code::cast(HeapObject::FromAddress(start));
List<OffsetRange>* ranges = pc_entry->no_frame_ranges();
+ src_line = GetSourceLine(sample.pc - code->instruction_start(),
+ pc_entry);
if (ranges) {
- Code* code = Code::cast(HeapObject::FromAddress(start));
int pc_offset = static_cast<int>(
sample.pc - code->instruction_start());
for (int i = 0; i < ranges->length(); i++) {
}
}
+ bool unresolved_src = (src_line == v8::CpuProfileNode::kNoLineNumberInfo) ?
+ true : false;
+
for (const Address* stack_pos = sample.stack,
*stack_end = stack_pos + sample.frames_count;
stack_pos != stack_end;
++stack_pos) {
- *entry++ = code_map_.FindEntry(*stack_pos);
+ Address start = NULL;
+ *entry = code_map_.FindEntry(*stack_pos, &start);
+ if (unresolved_src && NULL != *entry) {
+ Code* code = Code::cast(HeapObject::FromAddress(start));
+ src_line = GetSourceLine(*stack_pos - code->instruction_start(),
+ *entry);
+ if (src_line == v8::CpuProfileNode::kNoLineNumberInfo) {
+ src_line = (*entry)->line_number();
+ }
+ unresolved_src = false;
+ }
+ entry++;
}
}
}
}
- profiles_->AddPathToCurrentProfiles(sample.timestamp, entries);
+ profiles_->AddPathToCurrentProfiles(sample.timestamp, entries, src_line);
}
const char* name_prefix = CodeEntry::kEmptyNamePrefix,
const char* resource_name = CodeEntry::kEmptyResourceName,
int line_number = v8::CpuProfileNode::kNoLineNumberInfo,
- int column_number = v8::CpuProfileNode::kNoColumnNumberInfo);
+ int column_number = v8::CpuProfileNode::kNoColumnNumberInfo,
+ JITLineInfoTable* line_info = NULL);
~CodeEntry();
bool is_js_function() const { return is_js_function_tag(tag_); }
const char* resource_name() const { return resource_name_; }
int line_number() const { return line_number_; }
int column_number() const { return column_number_; }
+ const JITLineInfoTable& line_info() const { return line_info_; }
void set_shared_id(int shared_id) { shared_id_ = shared_id; }
int script_id() const { return script_id_; }
void set_script_id(int script_id) { script_id_ = script_id; }
const char* resource_name_;
int line_number_;
int column_number_;
+ JITLineInfoTable line_info_;
int shared_id_;
int script_id_;
List<OffsetRange>* no_frame_ranges_;
ProfileNode* FindOrAddChild(CodeEntry* entry);
void IncrementSelfTicks() { ++self_ticks_; }
void IncreaseSelfTicks(unsigned amount) { self_ticks_ += amount; }
+ void IncrementLineTicks(int src_line);
CodeEntry* entry() const { return entry_; }
unsigned self_ticks() const { return self_ticks_; }
const List<ProfileNode*>* children() const { return &children_list_; }
unsigned id() const { return id_; }
+ unsigned int GetHitLineCount() const { return line_ticks_.occupancy(); }
+ bool GetLineTicks(LineTick* entries, unsigned int number) const;
void Print(int indent);
HashMap children_;
List<ProfileNode*> children_list_;
unsigned id_;
+ HashMap line_ticks_;
DISALLOW_COPY_AND_ASSIGN(ProfileNode);
};
ProfileTree();
~ProfileTree();
- ProfileNode* AddPathFromEnd(const Vector<CodeEntry*>& path);
- void AddPathFromStart(const Vector<CodeEntry*>& path);
+ ProfileNode* AddPathFromEnd(const Vector<CodeEntry*>& path,
+ int src_line = v8::CpuProfileNode::kNoLineNumberInfo);
+ void AddPathFromStart(const Vector<CodeEntry*>& path,
+ int src_line = v8::CpuProfileNode::kNoLineNumberInfo);
ProfileNode* root() const { return root_; }
unsigned next_node_id() { return next_node_id_++; }
CpuProfile(const char* title, bool record_samples);
// Add pc -> ... -> main() call path to the profile.
- void AddPath(TimeTicks timestamp, const Vector<CodeEntry*>& path);
+ void AddPath(TimeTicks timestamp, const Vector<CodeEntry*>& path,
+ int src_line);
void CalculateTotalTicksAndSamplingRate();
const char* title() const { return title_; }
const char* name_prefix = CodeEntry::kEmptyNamePrefix,
const char* resource_name = CodeEntry::kEmptyResourceName,
int line_number = v8::CpuProfileNode::kNoLineNumberInfo,
- int column_number = v8::CpuProfileNode::kNoColumnNumberInfo);
+ int column_number = v8::CpuProfileNode::kNoColumnNumberInfo,
+ JITLineInfoTable* line_info = NULL);
// Called from profile generator thread.
void AddPathToCurrentProfiles(
- TimeTicks timestamp, const Vector<CodeEntry*>& path);
+ TimeTicks timestamp, const Vector<CodeEntry*>& path, int src_line);
// Limits the number of profiles that can be simultaneously collected.
static const int kMaxSimultaneousProfiles = 100;
}
+// Check that the profile tree for the script below will look like the
+// following:
+//
+// [Top down]:
+// 0 (root)0 #1
+// 15 start 20 #3 no reason
+// 3 foo 20 #4 TryCatchStatement
+// 121 bar 20 #5 TryCatchStatement
+// 223 loop 20 #6 no reason
+//
+// This tests checks distribution of the samples through the source lines.
+// The optimizing compiler is disabled for the hotest function to make
+// the test deterministic.
+
+static int GetHitLineSampleCount(const v8::CpuProfileNode* node) {
+ int sampleCount = 0;
+ unsigned int lineCount = node->GetHitLineCount();
+ if (lineCount) {
+ v8::LineTick* entries = new v8::LineTick[lineCount];
+ CHECK_EQ(true, node->GetLineTicks(entries, lineCount));
+ for (unsigned int i = 0; i < lineCount; i++) {
+ sampleCount += entries[i].ticks;
+ }
+ delete [] entries;
+ }
+ return sampleCount;
+}
+
+
+void CheckHitLine(unsigned int lineNo,
+ const v8::CpuProfileNode* node,
+ unsigned int sampleTotal,
+ unsigned int threshold) {
+ bool found = false;
+
+ unsigned int lineCount = node->GetHitLineCount();
+ CHECK_GT(lineCount, 0);
+
+ v8::LineTick* entries = new v8::LineTick[lineCount];
+ CHECK_EQ(true, node->GetLineTicks(entries, lineCount));
+
+ unsigned int i = 0;
+ for (i = 0; i < lineCount; i++) {
+ if (entries[i].line == lineNo) {
+ found = true;
+ break;
+ }
+ }
+
+ CHECK_EQ(true, found);
+ CHECK_GT(entries[i].ticks * 100 / sampleTotal, threshold);
+
+ delete[] entries;
+}
+
+
+static void CheckBranchWithTickLines(v8::Isolate* isolate,
+ const v8::CpuProfile* profile) {
+ const v8::CpuProfileNode* root = profile->GetTopDownRoot();
+
+ const v8::CpuProfileNode* startNode =
+ GetChild(isolate, root, "start");
+ CHECK_EQ(1, startNode->GetChildrenCount());
+ CHECK_EQ(startNode->GetHitCount(), GetHitLineSampleCount(startNode));
+
+ const v8::CpuProfileNode* fooNode =
+ GetChild(isolate, startNode, "foo");
+ CHECK_EQ(1, fooNode->GetChildrenCount());
+ CHECK_EQ(fooNode->GetHitCount(), GetHitLineSampleCount(fooNode));
+
+ const v8::CpuProfileNode* barNode =
+ GetChild(isolate, fooNode, "bar");
+ CHECK_EQ(1, barNode->GetChildrenCount());
+ CHECK_EQ(barNode->GetHitCount(), GetHitLineSampleCount(barNode));
+ // Check that line #14 collects at least 90% of the samples.
+ CheckHitLine(14, barNode, barNode->GetHitCount(), 90);
+
+ const v8::CpuProfileNode* loopNode =
+ GetChild(isolate, barNode, "loop");
+ CHECK_EQ(0, loopNode->GetChildrenCount());
+ CHECK_EQ(loopNode->GetHitCount(), GetHitLineSampleCount(loopNode));
+
+ // Check that line #8 collects at least 70% of the samples
+ CheckHitLine(8, loopNode, loopNode->GetHitCount(), 70);
+}
+
+
+static const char* cpu_profiler_test_source3 = "function loop(timeout) {\n"
+" with({}); // disable the optimizing compiler for this function"
+" this.mmm = 0;\n"
+" var start = Date.now();\n"
+" while (Date.now() - start < timeout) {\n"
+" var n = 100*1000;\n"
+" while(n > 1) {\n"
+" n--;\n"
+" this.mmm += n * n * n;\n"
+" }\n"
+" }\n"
+"}\n"
+"function bar() {\n"
+" try {\n"
+" loop(10);\n"
+" } catch(e) { }\n"
+"}\n"
+"function foo() {\n"
+" try {\n"
+" bar();\n"
+" } catch (e) { }\n"
+"}\n"
+"function start(timeout) {\n"
+" var start = Date.now();\n"
+" do {\n"
+" foo();\n"
+" var duration = Date.now() - start;\n"
+" } while (duration < timeout);\n"
+" return duration;\n"
+"}\n";
+
+
+TEST(TickLines) {
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(),
+ cpu_profiler_test_source3))->Run();
+ v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(
+ env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "start")));
+
+ int32_t profiling_interval_ms = 200;
+ v8::Handle<v8::Value> args[] = {
+ v8::Integer::New(env->GetIsolate(), profiling_interval_ms)
+ };
+
+ // The first run tests distribution of the samples through the source
+ // line information taken from "relocation info" created during code
+ // generation.
+ v8::CpuProfile* profile =
+ RunProfiler(env.local(), function, args, ARRAY_SIZE(args), 200);
+ function->Call(env->Global(), ARRAY_SIZE(args), args);
+ CheckBranchWithTickLines(env->GetIsolate(), profile);
+ profile->Delete();
+
+ // This is a case when the precompiled functions located on the heap
+ // are profiled. The second run tests that same source lines collect
+ // the expected number of samples.
+ profile = RunProfiler(env.local(), function, args, ARRAY_SIZE(args), 200);
+ function->Call(env->Global(), ARRAY_SIZE(args), args);
+ CheckBranchWithTickLines(env->GetIsolate(), profile);
+ profile->Delete();
+}
+
+
static const char* call_function_test_source = "function bar(iterations) {\n"
"}\n"
"function start(duration) {\n"
# Use 'Trunk' for trunk.
# If using trunk, will use '.DEPS.git' for gclient.
chromium_version = '36.0.1985.18'
-chromium_crosswalk_point = 'b2129f32fc231edc2eb401cf56a858dcb1477031'
+chromium_crosswalk_point = 'c282374abcd161a82bbcd5a51e02e33b1be0b1c4'
blink_crosswalk_point = '7425f4985931cbd48e669c205a707cf1ff4ff6c6'
-v8_crosswalk_point = 'c4640c389b044e377d905579c6b01da3354d0f59'
+v8_crosswalk_point = '535cd006e5174ff00fd7b745a581980b1d371a9f'
ozone_wayland_point = 'a5ca2e9203e6a0567751cc0400995982b703dde4'
deps_xwalk = {
MAJOR=7
MINOR=36
-BUILD=151
+BUILD=152
PATCH=0
--- /dev/null
+#!/usr/bin/env python
+
+# Copyright (c) 2014 Intel Corporation. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+class AppInfo:
+ def __init__(self):
+ self.app_root = ''
+ self.app_version = '1.0.0'
+ self.app_versionCode = ''
+ self.fullscreen_flag = ''
+ self.icon = ''
+ self.name = 'AppTemplate'
+ self.orientation = 'unspecified'
+ self.original_name = ''
+ self.package = 'org.xwalk.app.template'
+ self.remote_debugging = ''
import stat
import sys
+from app_info import AppInfo
from customize_launch_screen import CustomizeLaunchScreen
from handle_xml import AddElementAttribute
from handle_xml import AddElementAttributeAndText
compress_js_and_css.CompressCss(css_list)
-def Prepare(name, package, app_root, compressor):
+def Prepare(app_info, compressor):
+ name = app_info.name
+ package = app_info.package
+ app_root = app_info.app_root
if os.path.exists(name):
shutil.rmtree(name)
shutil.copytree('app_src', name)
theme_file.close()
-def CustomizeXML(package, app_versionCode, app_version, description, name,
- orientation, icon_dict, fullscreen, icon, app_manifest,
- permissions, app_root):
+def CustomizeXML(app_info, description, icon_dict, app_manifest, permissions):
+ app_version = app_info.app_version
+ app_versionCode = app_info.app_versionCode
+ name = app_info.name
+ orientation = app_info.orientation
+ package = app_info.package
+ original_name = app_info.original_name
manifest_path = os.path.join(name, 'AndroidManifest.xml')
if not os.path.isfile(manifest_path):
print ('Please make sure AndroidManifest.xml'
sys.exit(6)
CustomizeStringXML(name, description)
- CustomizeThemeXML(name, fullscreen, app_manifest)
+ CustomizeThemeXML(name, app_info.fullscreen_flag, app_manifest)
xmldoc = minidom.parse(manifest_path)
EditElementAttribute(xmldoc, 'manifest', 'package', package)
if app_versionCode:
EditElementAttribute(xmldoc, 'manifest', 'android:description',
"@string/description")
HandlePermissions(permissions, xmldoc)
- EditElementAttribute(xmldoc, 'application', 'android:label', name)
+ EditElementAttribute(xmldoc, 'application', 'android:label', original_name)
activity_name = package + '.' + name + 'Activity'
EditElementAttribute(xmldoc, 'activity', 'android:name', activity_name)
- EditElementAttribute(xmldoc, 'activity', 'android:label', name)
+ EditElementAttribute(xmldoc, 'activity', 'android:label', original_name)
if orientation:
EditElementAttribute(xmldoc, 'activity', 'android:screenOrientation',
orientation)
- icon_name = CustomizeIcon(name, app_root, icon, icon_dict)
+ icon_name = CustomizeIcon(name, app_info.app_root, app_info.icon, icon_dict)
if icon_name:
EditElementAttribute(xmldoc, 'application', 'android:icon',
'@drawable/%s' % icon_name)
shutil.move(temp_file_path, file_path)
-def CustomizeJava(name, package, app_url, app_local_path,
- enable_remote_debugging, display_as_fullscreen,
- keep_screen_on):
+def CustomizeJava(app_info, app_url, app_local_path, keep_screen_on):
+ name = app_info.name
+ package = app_info.package
root_path = os.path.join(name, 'src', package.replace('.', os.path.sep))
dest_activity = os.path.join(root_path, name + 'Activity.java')
ReplaceString(dest_activity, 'org.xwalk.app.template', package)
' is correct.')
sys.exit(8)
- if enable_remote_debugging:
+ if app_info.remote_debugging:
SetVariable(dest_activity,
'public void onCreate(Bundle savedInstanceState)',
'RemoteDebugging', 'true')
- if display_as_fullscreen:
+ if app_info.fullscreen_flag:
SetVariable(dest_activity,
'super.onCreate(savedInstanceState)',
'IsFullscreen', 'true')
shutil.copyfile(src_file, dest_file)
-def CustomizeExtensions(name, extensions):
+def CustomizeExtensions(app_info, extensions):
"""Copy the files from external extensions and merge them into APK.
The directory of one external extension should be like:
"""
if not extensions:
return
+ name = app_info.name
apk_path = name
apk_assets_path = os.path.join(apk_path, 'assets')
extensions_string = 'xwalk-extensions'
extension_json_file.close()
-def GenerateCommandLineFile(name, xwalk_command_line):
+def GenerateCommandLineFile(app_info, xwalk_command_line):
if xwalk_command_line == '':
return
- assets_path = os.path.join(name, 'assets')
+ assets_path = os.path.join(app_info.name, 'assets')
file_path = os.path.join(assets_path, 'xwalk-command-line')
command_line_file = open(file_path, 'w')
command_line_file.write('xwalk ' + xwalk_command_line)
return icon_name
-def CustomizeAll(app_versionCode, description, icon_dict, permissions, app_url,
- app_root, app_local_path, enable_remote_debugging,
- display_as_fullscreen, keep_screen_on, extensions,
- app_manifest, icon, package='org.xwalk.app.template',
- name='AppTemplate', app_version='1.0.0',
- orientation='unspecified', xwalk_command_line='',
- compressor=None):
+def CustomizeAll(app_info, description, icon_dict, permissions, app_url,
+ app_local_path, keep_screen_on, extensions, app_manifest,
+ xwalk_command_line='', compressor=None):
try:
- Prepare(name, package, app_root, compressor)
- CustomizeXML(package, app_versionCode, app_version, description, name,
- orientation, icon_dict, display_as_fullscreen, icon,
- app_manifest, permissions, app_root)
- CustomizeJava(name, package, app_url, app_local_path,
- enable_remote_debugging, display_as_fullscreen,
- keep_screen_on)
- CustomizeExtensions(name, extensions)
- GenerateCommandLineFile(name, xwalk_command_line)
+ Prepare(app_info, compressor)
+ CustomizeXML(app_info, description, icon_dict, app_manifest, permissions)
+ CustomizeJava(app_info, app_url, app_local_path, keep_screen_on)
+ CustomizeExtensions(app_info, extensions)
+ GenerateCommandLineFile(app_info, xwalk_command_line)
except SystemExit as ec:
print('Exiting with error code: %d' % ec.code)
sys.exit(ec.code)
72: 'icons/icon_72.png',
96: 'icons/icon_96.png',
48: 'icons/icon_48.png'}
- if options.name is None:
- options.name = 'Example'
+ app_info = AppInfo()
+ if options.name is not None:
+ app_info.name = options.name
if options.app_root is None:
- options.app_root = os.path.join('test_data', 'manifest')
- if options.package is None:
- options.package = 'org.xwalk.app.template'
- if options.orientation is None:
- options.orientation = 'unspecified'
- if options.app_version is None:
- options.app_version = '1.0.0'
- icon = os.path.join('test_data', 'manifest', 'icons', 'icon_96.png')
- CustomizeAll(options.app_versionCode, options.description, icon_dict,
- options.permissions, options.app_url, options.app_root,
- options.app_local_path, options.enable_remote_debugging,
- options.fullscreen, options.keep_screen_on,
- options.extensions, options.manifest,
- icon, options.package, options.name,
- options.app_version, options.orientation,
+ app_info.app_root = os.path.join('test_data', 'manifest')
+ else:
+ app_info.app_root = options.app_root
+ if options.package is not None:
+ app_info.package = options.package
+ if options.orientation is not None:
+ app_info.orientation = options.orientation
+ if options.app_version is not None:
+ app_info.app_version = options.app_version
+ if options.enable_remote_debugging is not None:
+ app_info.remote_debugging = options.enable_remote_debugging
+ if options.fullscreen is not None:
+ app_info.fullscreen_flag = options.fullscreen
+ app_info.icon = os.path.join('test_data', 'manifest', 'icons',
+ 'icon_96.png')
+ CustomizeAll(app_info, options.description, icon_dict,
+ options.permissions, options.app_url, options.app_local_path,
+ options.keep_screen_on, options.extensions, options.manifest,
options.xwalk_command_line, options.compressor)
except SystemExit as ec:
print('Exiting with error code: %d' % ec.code)
sys.path.append('scripts/gyp')
+from app_info import AppInfo
from customize import VerifyAppName, CustomizeAll, \
ParseParameterForCompressor, ReplaceSpaceWithUnderscore
from dex import AddExeExtensions
return version_str
-def ParseManifest(options):
+def ParseManifest(options, app_info):
parser = ManifestJsonParser(os.path.expanduser(options.manifest))
- app_name = parser.GetAppName()
+ original_name = app_info.original_name = parser.GetAppName()
+ app_name = None
if options.package:
VerifyAppName(options.package, 'packagename')
else:
- VerifyAppName(app_name)
- app_name = ReplaceSpaceWithUnderscore(app_name)
+ VerifyAppName(original_name)
+ app_name = ReplaceSpaceWithUnderscore(original_name)
options.package = 'org.xwalk.' + app_name.lower()
if options.name:
VerifyAppName(options.name)
+ app_info.original_name = options.name
options.name = ReplaceSpaceWithUnderscore(options.name)
else:
- VerifyAppName(app_name)
- options.name = ReplaceSpaceWithUnderscore(app_name)
+ VerifyAppName(original_name)
+ options.name = ReplaceSpaceWithUnderscore(original_name)
if not options.app_version:
options.app_version = parser.GetVersion()
if not options.app_versionCode and not options.app_versionCodeBase:
return '%s%s' % (abi, b.zfill(7))
-def Customize(options):
- package = 'org.xwalk.app.template'
+def Customize(options, app_info):
if options.package:
- package = options.package
- name = 'AppTemplate'
+ app_info.package = options.package
if options.name:
- name = options.name
- app_version = ''
+ app_info.name = options.name
if options.app_version:
- app_version = options.app_version
- app_versionCode = MakeVersionCode(options)
- app_root = ''
+ app_info.app_version = options.app_version
+ app_info.app_versionCode = MakeVersionCode(options)
if options.app_root:
- app_root = os.path.expanduser(options.app_root)
- remote_debugging = ''
+ app_info.app_root = os.path.expanduser(options.app_root)
if options.enable_remote_debugging:
- remote_debugging = '--enable-remote-debugging'
- fullscreen_flag = ''
+ app_info.remote_debugging = '--enable-remote-debugging'
if options.fullscreen:
- fullscreen_flag = '-f'
- orientation = 'unspecified'
+ app_info.fullscreen_flag = '-f'
if options.orientation:
- orientation = options.orientation
- icon = ''
+ app_info.orientation = options.orientation
if options.icon:
- icon = '%s' % os.path.expanduser(options.icon)
- CustomizeAll(app_versionCode, options.description, options.icon_dict,
- options.permissions, options.app_url, app_root,
- options.app_local_path, remote_debugging,
- fullscreen_flag, options.keep_screen_on, options.extensions,
- options.manifest, icon, package, name, app_version,
- orientation, options.xwalk_command_line, options.compressor)
+ app_info.icon = '%s' % os.path.expanduser(options.icon)
+ CustomizeAll(app_info, options.description, options.icon_dict,
+ options.permissions, options.app_url, options.app_local_path,
+ options.keep_screen_on, options.extensions, options.manifest,
+ options.xwalk_command_line, options.compressor)
def Execution(options, name):
'here:\nhttps://software.intel.com/en-us/html5/articles/submitting'
'-multiple-crosswalk-apk-to-google-play-store')
-def MakeApk(options):
- Customize(options)
+def MakeApk(options, app_info):
+ Customize(options, app_info)
name = options.name
packaged_archs = []
if options.mode == 'shared':
print('Using manifest.json distributed with the application.')
options.manifest = manifest_path
+ app_info = AppInfo()
if not options.manifest:
if options.package:
VerifyAppName(options.package, 'packagename')
'Please use "--package" option.')
if options.name:
VerifyAppName(options.name)
+ app_info.original_name = options.name
options.name = ReplaceSpaceWithUnderscore(options.name)
else:
parser.error('The APK name is required! Please use "--name" option.')
options.icon_dict = {}
else:
try:
- ParseManifest(options)
+ ParseManifest(options, app_info)
except SystemExit as ec:
return ec.code
os.makedirs(target_dir)
try:
- MakeApk(options)
+ MakeApk(options, app_info)
except SystemExit as ec:
CleanDir(options.name)
CleanDir('out')
import unittest
import warnings
+from customize import ReplaceSpaceWithUnderscore
+
def Clean(name, app_version):
if os.path.exists(name):
return proc.communicate()[0]
-def GetResultWithOption(mode, manifest=None, name=None, package=None):
+def GetResultWithOption(mode=None, manifest=None, name=None, package=None):
app_url = None
if manifest is not None:
manifest = '--manifest=' + manifest
name = '--name=' + name
if package is not None:
package = '--package=' + package
+
cmd = ['python', 'make_apk.py',
'--app-version=1.0.0',
'%s' % manifest,
'%s' % name,
'%s' % package,
'%s' % app_url,
- mode]
+ '%s' % mode]
return RunCommand(cmd)
Clean(name, version)
+ def VerifyResultForAppNameWithSpace(self, manifest=None, name=None,
+ package=None):
+ version = '1.0.0'
+ GetResultWithOption(manifest=manifest, name=name, package=package)
+ if name is None:
+ name = 'app name '
+ replaced_name = ReplaceSpaceWithUnderscore(name)
+ manifest = replaced_name + '/AndroidManifest.xml'
+ with open(manifest, 'r') as content_file:
+ content = content_file.read()
+ self.assertTrue(os.path.exists(manifest))
+ self.assertTrue(name in content)
+ Clean(replaced_name, version)
+
+
+ def testAppNameWithSpace(self):
+ name = 'app name'
+ package = 'org.xwalk.app_name'
+
+ self.VerifyResultForAppNameWithSpace(name=name, package=package)
+
+ name = 'app name '
+ self.VerifyResultForAppNameWithSpace(name=name, package=package)
+
+ directory = os.path.join('test_data', 'manifest', 'invalidchars')
+ manifest_path = os.path.join(directory, 'manifest_contain_space_name.json')
+ self.VerifyResultForAppNameWithSpace(manifest=manifest_path)
+
+
def SuiteWithModeOption():
# Gather all the tests for the specified mode option.
test_suite = unittest.TestSuite()
def SuiteWithEmptyModeOption():
# Gather all the tests for empty mode option.
test_suite = unittest.TestSuite()
+ test_suite.addTest(TestMakeApk('testAppNameWithSpace'))
test_suite.addTest(TestMakeApk('testCompressor'))
test_suite.addTest(TestMakeApk('testCustomizeFile'))
test_suite.addTest(TestMakeApk('testEmptyMode'))
Application(scoped_refptr<ApplicationData> data,
RuntimeContext* context,
Observer* observer);
-
+ virtual bool Launch(const LaunchParams& launch_params);
virtual void InitSecurityPolicy();
void AddSecurityPolicy(const GURL& url, bool subdomains);
virtual void RenderProcessHostDestroyed(
content::RenderProcessHost* host) OVERRIDE;
-
- bool Launch(const LaunchParams& launch_params);
-
// Try to extract the URL from different possible keys for entry points in the
// manifest, returns it and the entry point used.
GURL GetStartURL(const LaunchParams& params, LaunchEntryPoint* used);
const base::FilePath::CharType ApplicationStorageImpl::kDBFileName[] =
FILE_PATH_LITERAL("applications.db");
-const char kEventSeparator = ';';
const char kPermissionSeparator = '^';
// Switching the JSON format DB(version 0) to SQLite backend version 1,
return transaction.Commit();
}
-bool InitEventsTable(sql::Connection* db) {
- sql::Transaction transaction(db);
- transaction.Begin();
- if (!db->DoesTableExist(db_fields::kEventTableName)) {
- if (!db->Execute(db_fields::kCreateEventTableOp))
- return false;
- }
- return transaction.Commit();
-}
-
// Permissions are stored like "bluetooth^ALLOW;calendar^DENY;contacts^ALLOW"
std::string ToString(StoredPermissionMap permissions) {
std::string str;
return false;
}
- if (!InitEventsTable(sqlite_db.get())) {
- LOG(ERROR) << "Unable to open registered events table.";
- return false;
- }
-
if (!InitPermissionsTable(sqlite_db.get())) {
LOG(ERROR) << "Unable to open registered permissions table.";
return false;
}
sql::Statement smt(sqlite_db_->GetUniqueStatement(
- db_fields::kGetAllRowsFromAppEventTableOp));
+ db_fields::kGetAllRowsFromAppTableOp));
if (!smt.is_valid())
return false;
}
std::string path = smt.ColumnString(2);
double install_time = smt.ColumnDouble(3);
- std::vector<std::string> events;
- base::SplitString(smt.ColumnString(4), kEventSeparator, &events);
std::string error;
scoped_refptr<ApplicationData> application =
application->install_time_ = base::Time::FromDoubleT(install_time);
- if (!events.empty()) {
- application->events_ =
- std::set<std::string>(events.begin(), events.end());
- }
-
application->permission_map_ = ToPermissionMap(smt.ColumnString(5));
if (!Insert(application, applications)) {
return (SetApplicationValue(
application, install_time, db_fields::kSetApplicationWithBindOp) &&
- SetEvents(application->ID(), application->GetEvents()) &&
SetPermissions(application->ID(), application->permission_map_));
}
if (SetApplicationValue(
application, install_time, db_fields::kUpdateApplicationWithBindOp) &&
- UpdateEvents(application->ID(), application->GetEvents()) &&
UpdatePermissions(application->ID(), application->permission_map_)) {
application->is_dirty_ = false;
return true;
return transaction.Commit();
}
-bool ApplicationStorageImpl::SetEvents(const std::string& id,
- const std::set<std::string>& events) {
- if (!db_initialized_)
- return false;
- return SetEventsValue(id, events, db_fields::kInsertEventsWithBindOp);
-}
-
-bool ApplicationStorageImpl::UpdateEvents(
- const std::string &id, const std::set<std::string>& events) {
- if (!db_initialized_)
- return false;
-
- if (events.empty())
- return DeleteEvents(id);
-
- return SetEventsValue(id, events, db_fields::kUpdateEventsWithBindOp);
-}
-
-bool ApplicationStorageImpl::DeleteEvents(const std::string& id) {
- sql::Transaction transaction(sqlite_db_.get());
- if (!transaction.Begin())
- return false;
-
- sql::Statement smt(sqlite_db_->GetUniqueStatement(
- db_fields::kDeleteEventsWithBindOp));
- smt.BindString(0, id);
-
- if (!smt.Run()) {
- LOG(ERROR) << "An error occured when deleting event information from DB.";
- return false;
- }
-
- return transaction.Commit();
-}
-
-bool ApplicationStorageImpl::SetEventsValue(
- const std::string& id,
- const std::set<std::string>& events,
- const std::string& operation) {
- sql::Transaction transaction(sqlite_db_.get());
- std::string events_list(JoinString(
- std::vector<std::string>(events.begin(), events.end()), kEventSeparator));
-
- if (!transaction.Begin())
- return false;
-
- sql::Statement smt(sqlite_db_->GetUniqueStatement(
- operation.c_str()));
- smt.BindString(0, events_list);
- smt.BindString(1, id);
- if (!smt.Run()) {
- LOG(ERROR) << "An error occured when inserting event information into DB.";
- return false;
- }
-
- return transaction.Commit();
-}
-
bool ApplicationStorageImpl::SetPermissions(const std::string& id,
const StoredPermissionMap& permissions) {
if (!db_initialized_) {
bool SetApplicationValue(const ApplicationData* application,
const base::Time& install_time,
const std::string& operation);
- // Events helper functions
- bool SetEventsValue(const std::string& id,
- const std::set<std::string>& events,
- const std::string& operation);
- bool SetEvents(const std::string& id,
- const std::set<std::string>& events);
- bool UpdateEvents(const std::string& id,
- const std::set<std::string>& events);
- bool DeleteEvents(const std::string& id);
// Permissions helper functions
bool SetPermissionsValue(const std::string& id,
const StoredPermissionMap& permissions,
&error);
ASSERT_TRUE(error.empty());
ASSERT_TRUE(application);
- std::set<std::string> events;
- events.insert("test_events");
- application->SetEvents(events);
EXPECT_TRUE(app_storage_impl_->AddApplication(application.get(),
base::Time::FromDoubleT(0)));
ApplicationData::ApplicationDataMap applications;
ASSERT_TRUE(app_storage_impl_->GetInstalledApplications(applications));
EXPECT_EQ(applications.size(), 1);
EXPECT_TRUE(applications[application->ID()]);
- EXPECT_EQ(applications[application->ID()]
- ->GetEvents().count("test_events"), 1);
}
TEST_F(ApplicationStorageImplTest, DBDelete) {
#include "content/public/browser/web_contents.h"
#include "content/public/browser/render_process_host.h"
+#include "content/browser/screen_orientation/screen_orientation_dispatcher_host.h"
-#include "xwalk/runtime/browser/ui/native_app_window.h"
+#include "xwalk/runtime/browser/ui/native_app_window_tizen.h"
#include "xwalk/runtime/common/xwalk_common_messages.h"
#if defined(USE_OZONE)
}
void ApplicationTizen::Hide() {
- DCHECK(runtimes_.size());
+ DCHECK(!runtimes_.empty());
std::set<Runtime*>::iterator it = runtimes_.begin();
for (; it != runtimes_.end(); ++it) {
if ((*it)->window())
}
}
+bool ApplicationTizen::Launch(const LaunchParams& launch_params) {
+ if (Application::Launch(launch_params)) {
+ DCHECK(render_process_host_);
+ render_process_host_->GetScreenOrientationDispatcherHost()->
+ SetProviderForTests(this);
+ return true;
+ }
+ return false;
+}
+
void ApplicationTizen::InitSecurityPolicy() {
// On Tizen, CSP mode has higher priority, and WARP will be disabled
// if the application is under CSP mode.
}
#endif
+void ApplicationTizen::LockOrientation(
+ blink::WebScreenOrientationLockType lock) {
+ DCHECK(!runtimes_.empty());
+ // FIXME: Probably need better alignment with
+ // https://w3c.github.io/screen-orientation/#screen-orientation-lock-lifetime
+ std::set<Runtime*>::iterator it = runtimes_.begin();
+ for (; it != runtimes_.end(); ++it) {
+ NativeAppWindow* window = (*it)->window();
+ if (window && window->IsActive()) {
+ ToNativeAppWindowTizen(window)->LockOrientation(lock);
+ break;
+ }
+ }
+}
+
+void ApplicationTizen::UnlockOrientation() {
+ LockOrientation(blink::WebScreenOrientationLockDefault);
+}
+
} // namespace application
} // namespace xwalk
#define XWALK_APPLICATION_BROWSER_APPLICATION_TIZEN_H_
#include "base/event_types.h"
+#include "content/browser/screen_orientation/screen_orientation_provider.h"
#include "xwalk/application/browser/application.h"
#if defined(USE_OZONE)
#if defined(USE_OZONE)
public ui::PlatformEventObserver,
#endif
- public Application {
+ public Application, public content::ScreenOrientationProvider {
public:
virtual ~ApplicationTizen();
void Hide();
ApplicationTizen(scoped_refptr<ApplicationData> data,
RuntimeContext* context,
Application::Observer* observer);
-
+ virtual bool Launch(const LaunchParams& launch_params) OVERRIDE;
virtual void InitSecurityPolicy() OVERRIDE;
#if defined(USE_OZONE)
virtual void WillProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
virtual void DidProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
#endif
+
+ // content::ScreenOrientationProvider overrides:
+ virtual void LockOrientation(
+ blink::WebScreenOrientationLockType orientations) OVERRIDE;
+ virtual void UnlockOrientation() OVERRIDE;
};
inline ApplicationTizen* ToApplicationTizen(Application* app) {
return true;
}
-void ApplicationData::SetEvents(const std::set<std::string>& events) {
- events_ = events;
- is_dirty_ = true;
-}
-
-const std::set<std::string>& ApplicationData::GetEvents() const {
- return events_;
-}
-
StoredPermission ApplicationData::GetPermission(
const std::string& permission_name) const {
StoredPermissionMap::const_iterator iter =
return manifest_.get();
}
- // System events
- void SetEvents(const std::set<std::string>& events);
- const std::set<std::string>& GetEvents() const;
-
bool IsDirty() const { return is_dirty_; }
const base::Time& install_time() const { return install_time_; }
namespace application_storage_constants {
const char kAppTableName[] = "applications";
-const char kEventTableName[] = "registered_events";
const char kPermissionTableName[] = "stored_permissions";
const char kGarbageCollectionTableName[] = "garbage_collection";
"path TEXT NOT NULL,"
"install_time REAL)";
-const char kCreateEventTableOp[] =
- "CREATE TABLE registered_events ("
- "id TEXT NOT NULL,"
- "event_names TEXT NOT NULL,"
- "PRIMARY KEY (id),"
- "FOREIGN KEY (id) REFERENCES applications(id)"
- "ON DELETE CASCADE)";
-
const char kCreatePermissionTableOp[] =
"CREATE TABLE stored_permissions ("
"id TEXT NOT NULL,"
"CREATE TRIGGER IF NOT EXISTS del_garbage_app AFTER INSERT ON applications"
" BEGIN DELETE FROM garbage_collection WHERE app_id = NEW.id; END";
-const char kGetAllRowsFromAppEventTableOp[] =
+const char kGetAllRowsFromAppTableOp[] =
"SELECT A.id, A.manifest, A.path, A.install_time, "
- "B.event_names, C.permission_names "
- "FROM applications as A "
- "LEFT JOIN registered_events as B "
- "ON A.id = B.id "
+ "C.permission_names FROM applications as A "
"LEFT JOIN stored_permissions as C "
"ON A.id = C.id";
const char kDeleteApplicationWithBindOp[] =
"DELETE FROM applications WHERE id = ?";
-const char kInsertEventsWithBindOp[] =
- "INSERT INTO registered_events (event_names, id) "
- "VALUES(?,?)";
-
-const char kUpdateEventsWithBindOp[] =
- "UPDATE registered_events SET event_names = ? WHERE id = ?";
-
-const char kDeleteEventsWithBindOp[] =
- "DELETE FROM registered_events WHERE id = ?";
-
const char kInsertPermissionsWithBindOp[] =
"INSERT INTO stored_permissions (permission_names, id) "
"VALUES(?,?)";
namespace xwalk {
namespace application_storage_constants {
extern const char kAppTableName[];
- extern const char kEventTableName[];
extern const char kPermissionTableName[];
extern const char kGarbageCollectionTableName[];
extern const char kCreateAppTableOp[];
- extern const char kCreateEventTableOp[];
extern const char kCreatePermissionTableOp[];
extern const char kCreateGarbageCollectionTableOp[];
extern const char kCreateGarbageCollectionTriggersOp[];
- extern const char kGetAllRowsFromAppEventTableOp[];
+ extern const char kGetAllRowsFromAppTableOp[];
extern const char kSetApplicationWithBindOp[];
extern const char kUpdateApplicationWithBindOp[];
extern const char kDeleteApplicationWithBindOp[];
- extern const char kInsertEventsWithBindOp[];
- extern const char kUpdateEventsWithBindOp[];
- extern const char kDeleteEventsWithBindOp[];
extern const char kInsertPermissionsWithBindOp[];
extern const char kUpdatePermissionsWithBindOp[];
extern const char kDeletePermissionsWithBindOp[];
if (argc <= 2)
return usage(argv[0]);
- // When installing an application on Tizen, the libraries used require
- // some steps to be run as root (UID 0) and fail otherwise, so we force
- // this tool to assume the root UID.
- if (setuid(0)) {
- fprintf(stderr, "Make sure '%s' is set-user-ID-root\n", argv[0]);
- return 1;;
- }
-
PackageInstallerHelper helper(argv[2]);
if (!strcmp(argv[1], "--install")) {
if (argc != 5)
'type': 'static_library',
'dependencies': [
'../base/base.gyp:base',
+ '../content/content.gyp:content_browser',
'../crypto/crypto.gyp:crypto',
'../ipc/ipc.gyp:ipc',
'../sql/sql.gyp:sql',
}],
],
'include_dirs': [
+ '..',
'../..',
],
},
# Build and python tools.
(os.path.join(tools_src_dir, 'ant'),
os.path.join(target_dir, 'scripts/ant')),
+ (os.path.join(tools_src_dir, 'app_info.py'), target_dir),
(os.path.join(tools_src_dir, 'compress_js_and_css.py'), target_dir),
(os.path.join(tools_src_dir, 'customize.py'), target_dir),
(os.path.join(tools_src_dir, 'customize_launch_screen.py'), target_dir),
%endif
Name: crosswalk
-Version: 7.36.151.0
+Version: 7.36.152.0
Release: 0
Summary: Crosswalk is an app runtime based on Chromium
License: (BSD-3-Clause and LGPL-2.1+)
SensorProvider::GetInstance()->RemoveObserver(this);
}
+void NativeAppWindowTizen::LockOrientation(
+ blink::WebScreenOrientationLockType lock) {
+ orientation_lock_ = lock;
+ if (SensorProvider* sensor = SensorProvider::GetInstance())
+ OnScreenOrientationChanged(sensor->GetScreenOrientation());
+}
+
void NativeAppWindowTizen::ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) {
if (details.is_add && details.child == this) {
return orientation;
}
-void NativeAppWindowTizen::LockOrientation(
- blink::WebScreenOrientationLockType lock) {
- orientation_lock_ = lock;
- if (SensorProvider* sensor = SensorProvider::GetInstance())
- OnScreenOrientationChanged(sensor->GetScreenOrientation());
-}
-
-void NativeAppWindowTizen::UnlockOrientation() {
- LockOrientation(blink::WebScreenOrientationLockDefault);
-}
-
void NativeAppWindowTizen::OnScreenOrientationChanged(
blink::WebScreenOrientationType orientation) {
#ifndef XWALK_RUNTIME_BROWSER_UI_NATIVE_APP_WINDOW_TIZEN_H_
#define XWALK_RUNTIME_BROWSER_UI_NATIVE_APP_WINDOW_TIZEN_H_
+#include "content/browser/screen_orientation/screen_orientation_provider.h"
#include "xwalk/runtime/browser/ui/screen_orientation.h"
#include "xwalk/runtime/browser/ui/native_app_window_views.h"
#include "xwalk/tizen/mobile/sensor/sensor_provider.h"
#include "xwalk/tizen/mobile/ui/tizen_system_indicator_widget.h"
#include "xwalk/tizen/mobile/ui/widget_container_view.h"
#include "ui/aura/window_observer.h"
-#include "content/browser/screen_orientation/screen_orientation_provider.h"
namespace xwalk {
class NativeAppWindowTizen
: public aura::WindowObserver,
public NativeAppWindowViews,
- public SensorProvider::Observer,
- public content::ScreenOrientationProvider {
+ public SensorProvider::Observer {
public:
explicit NativeAppWindowTizen(const NativeAppWindow::CreateParams& params);
virtual ~NativeAppWindowTizen();
+ void LockOrientation(
+ blink::WebScreenOrientationLockType orientations);
+
private:
blink::WebScreenOrientationType FindNearestAllowedOrientation(
blink::WebScreenOrientationType orientation) const;
virtual void OnScreenOrientationChanged(
blink::WebScreenOrientationType orientation) OVERRIDE;
- // content::ScreenOrientationProvider overrides:
- virtual void LockOrientation(
- blink::WebScreenOrientationLockType orientations) OVERRIDE;
- virtual void UnlockOrientation() OVERRIDE;
-
// NativeAppWindowViews overrides:
virtual void Initialize() OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(NativeAppWindowTizen);
};
+inline NativeAppWindowTizen* ToNativeAppWindowTizen(NativeAppWindow* window) {
+ return static_cast<NativeAppWindowTizen*>(window);
+}
+
} // namespace xwalk
#endif // XWALK_RUNTIME_BROWSER_UI_NATIVE_APP_WINDOW_TIZEN_H_